Skip to content

Run the Interactor compiler on Node and Deno - #326

Draft
cowboyd wants to merge 1 commit into
codex/interactors-compilefrom
codex/cli-dual-runtime
Draft

Run the Interactor compiler on Node and Deno#326
cowboyd wants to merge 1 commit into
codex/interactors-compilefrom
codex/cli-dual-runtime

Conversation

@cowboyd

@cowboyd cowboyd commented Sep 8, 2026

Copy link
Copy Markdown
Member

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, and deno check subprocesses 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 interactors executable 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.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Package Changes Through 1c5f1c3

There are 1 changes which include @interactors/core with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@interactors/core 1.0.1 1.1.0
@interactors/keyboard 1.0.1 1.0.2
@interactors/html 1.0.1 1.0.2
@interactors/material-ui 5.0.0 5.0.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Deploy Preview Ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant