Run the Interactor compiler on Node and Deno - #326
Draft
cowboyd wants to merge 1 commit into
Draft
Conversation
Contributor
Package Changes Through 1c5f1c3There are 1 changes which include @interactors/core with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
cowboyd
force-pushed
the
codex/cli-dual-runtime
branch
2 times, most recently
from
September 8, 2026 21:52
d8ce557 to
7c9de3f
Compare
Contributor
|
🚀 Deploy Preview Ready!
|
cowboyd
force-pushed
the
codex/cli-dual-runtime
branch
from
September 8, 2026 22:03
7c9de3f to
beb995d
Compare
cowboyd
force-pushed
the
codex/cli-dual-runtime
branch
from
September 9, 2026 02:02
beb995d to
17e0991
Compare
cowboyd
force-pushed
the
codex/cli-dual-runtime
branch
from
September 9, 2026 03:24
17e0991 to
1c5f1c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The compiler must not require a Deno installation when distributed through npm. The same JavaScript CLI and compilation pipeline should work when either Node or Deno is the only installed runtime.
Approach
Publish the CLI as an ESM npm binary and use the Node-compatible process and filesystem APIs that both runtimes implement. Replace the
deno bundle,deno info, anddeno checksubprocesses with the esbuild and TypeScript JavaScript APIs. Runtime metadata produces the registry, while TypeScript declaration emit preserves exact filter, matcher, and action types in the standalone declaration artifact.Teach the npm build to emit the
interactorsexecutable and include TypeScript as a runtime dependency. Add CI coverage that builds the npm package, compiles the same entrypoint under Node and Deno, and compares all three output artifacts byte-for-byte.Alternate Designs
Shipping a Deno launcher would keep the existing subprocess pipeline but would fail on Node-only systems. Generating declarations from runtime metadata alone would be portable but would erase filter values and action arguments to
unknown. A separate declaration bundler was evaluated, but its second processing pass broke the package-qualified constructor identities consumed by the Playwright adapter; the TypeScript declaration emitter already produces the required single closed declaration surface.Possible Drawbacks or Risks
The CLI npm package now includes esbuild and TypeScript as runtime dependencies.
The CLI depends on the metadata-enabled core package introduced earlier in this stack, so that core version must be published before the CLI alpha.
TODOs and Open Questions
Publish the metadata-enabled core package before publishing the CLI alpha.
Learning
Deno implements the Node process, filesystem, module, path, and URL APIs needed by the CLI, allowing one implementation for both hosts. Compiler tooling was the only Deno-specific boundary and can run in process through JavaScript APIs.
DNT only emits modules reachable through static imports, so the browser agent source needs a static reference even though the compiler also addresses its emitted file when constructing the generated bundle.
Screenshots
Not applicable; this change affects command-line compilation.