Skip to content

feat: add ./browser export — supported browser-safe generation boundary (0.3.2) - #55

Merged
ryandmonk merged 1 commit into
mainfrom
feat/browser-export
Aug 9, 2026
Merged

feat: add ./browser export — supported browser-safe generation boundary (0.3.2)#55
ryandmonk merged 1 commit into
mainfrom
feat/browser-export

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

Adds a ./browser subpath exporting exactly runPipeline + ScriptedAdapter, so in-browser/edge hosts (dspack-studio's hosted Composer) import a supported package boundary instead of deep-importing dist/run/orchestrator.js by path.

The package root re-exports the Node-only provider adapters (@anthropic-ai/sdk, undici) and eval/serve helpers (node:fs/path), so it can't bundle for the browser. ./browser exposes only what's needed to RUN the pipeline; the host brings its own adapter for real providers (provider-agnostic, ADR-9).

Verified: the transitive static-import graph from dist/browser.js reaches only node:crypto (the audit provenance hash, which the host shims) — no undici, no anthropic SDK, no node:fs/eval. 138 tests pass.

🤖 Generated with Claude Code

…dary (0.3.2)

The package index (`.`) re-exports the whole library, including the Node-only
provider adapters (@anthropic-ai/sdk, undici via Ollama) and eval/serve helpers
(node:fs/path), so it cannot be bundled for the browser. Consumers running the
pipeline in a browser/edge host (e.g. dspack-studio's hosted Composer) were left
deep-importing dist/run/orchestrator.js by path — a brittle dependency on the
build layout that bypasses the exports map.

`./browser` is the supported boundary: it exposes exactly what an in-browser host
needs to RUN the governed pipeline — runPipeline + the deterministic
ScriptedAdapter — and nothing else. The host brings its own adapter for real
providers (the pipeline is provider-agnostic, ADR-9). The reachable subgraph is
browser-safe except node:crypto in the audit report's provenance hash, which the
host aliases to a synchronous SHA-256 shim.

Verified: the transitive static-import graph from dist/browser.js reaches only
`node:crypto` (no undici, no @anthropic-ai/sdk, no node:fs/path, no eval/serve).
All 138 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 02:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a dedicated ./browser export surface so browser/edge consumers can import a supported, browser-safe entrypoint (instead of deep-importing internal dist/* files), while keeping the package root free to continue exporting Node-only utilities and provider adapters.

Changes:

  • Added src/browser.ts to re-export only runPipeline and the deterministic ScriptedAdapter (plus related types).
  • Exposed the new ./browser subpath in package.json exports and bumped the package version to 0.3.2.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/browser.ts New browser-safe entrypoint that re-exports the minimal runtime surface (pipeline runner + scripted adapter).
package.json Adds ./browser to the package export map and bumps version to 0.3.2.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ryandmonk
ryandmonk merged commit cbc9e1c into main Aug 9, 2026
3 checks passed
@ryandmonk
ryandmonk deleted the feat/browser-export branch August 9, 2026 03:04
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.

2 participants