Skip to content

feat(build): package the canonical npm root - #639

Closed
ScriptedAlchemy wants to merge 16 commits into
feat/592-authoritative-manifestfrom
feat/555-npm-root
Closed

feat(build): package the canonical npm root#639
ScriptedAlchemy wants to merge 16 commits into
feat/592-authoritative-manifestfrom
feat/555-npm-root

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • stage the validated composite artifact itself as the npm package root instead of recompiling generated routed CLI bins
  • point the generated package bin at the manifest-declared artifact executable, remove the obsolete package-relative installer launcher, and make artifact bins directly executable
  • prove the packed package's declared executable is byte-identical and command-identical (dashboard, web) to the artifact bin after installation in a clean consumer
  • update package inventory diagnostics and English/Chinese distribution documentation

Closes the W2/S4 npm-root step of #555. This PR is stacked on #604 until manifest v2 lands.

Verification

  • pnpm build && pnpm typecheck && pnpm lint && pnpm test:unit
  • pnpm exec rstest --config rstest.packed.config.ts packages/agent-bundle/tests/packed-web-command.test.ts
  • pnpm docs:site:build

Deslop

Deslop: GPT-5.6 Sol, 3 edits (removed a stray blank line, replaced a non-null assertion with explicit narrowing, and flattened package provenance selection).

Self-review

Pending the required Claude Fable review after #604 lands and this branch is rebased onto main.

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 15e9366

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
agent-bundle Minor
@agent-bundle/runtime Minor
create-agent-bundle Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 5, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@639
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@639
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@639
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@639

commit: 6eb54e1

ScriptedAlchemy and others added 13 commits September 5, 2026 18:16
… root (#640)

* feat(runtime): separate the framework state root from the plugin code root

Artifact-hosted shells (stdio MCP entry, Flight worker, artifact CLI bin and
render worker, standalone hook wrappers) resolve their state root under
~/.agent-bundle/state/<plugin>-<digest> (or $XDG_STATE_HOME/agent-bundle/...)
instead of <plugin root>/state, so a read-only install launches and two
installs never share state. AGENT_BUNDLE_PLUGIN_ROOT keeps naming the code
root; AGENT_BUNDLE_STATE_ROOT overrides the state root.

Closes #637

* chore: name #640 in the changeset

* fix(state-root): anchor script workers on the artifact, pin dev sessions to <epoch>/state, ignore relative XDG_STATE_HOME

Self-review findings: rendered script workers kept the cwd fallback; dev and
Workbench MCP sessions would have derived one user-data root per build epoch;
a relative XDG_STATE_HOME would have anchored state on the shell's cwd.
uninstall --purge-data / doctor coverage of the derived root is #641.

* docs: scope --purge-data to legacy state, fix zh plugin.value.root, XDG absolute-path wording
# Conflicts:
#	docs/entry-conventions.md
#	website/docs/en/guide/authoring/mcp.mdx
#	website/docs/en/guide/authoring/package-entries.mdx
#	website/docs/en/reference/cli.mdx
#	website/docs/zh/guide/authoring/mcp.mdx
#	website/docs/zh/guide/authoring/package-entries.mdx
#	website/docs/zh/reference/cli.mdx
* fix(build): isolate re-bundled runtime entries

* chore: add runtime boundary changeset

* fix(test): restore release dist after packed fixture

* test: preserve ad hoc packed runs

* test: isolate runtime rebundle tarball

* test: scope rebundle fixture to stdio proof

* test: retain release stdio process proof
# Conflicts:
#	packages/agent-bundle/rslib.config.ts
)

* build: compile evidence record module and AB6039

* Persist the compile evidence record beside emitted files (AB6039)

* Share the evidence-to-IR lowering between Rslib surfaces and MCP App views

* Account for the compile evidence record in root listings and the epoch tamper test

* Re-judge recorded externals with the build's policy; keep the record out of the generic JSON check

* Judge recorded externals per compilation boundary: views keep none, node bundles load only node bundles
* fix: manage derived state across lifecycle

* fix: preserve state roots through keep data

* fix: align web data root derivation

* fix: keep lifecycle helpers runtime-free
# Conflicts:
#	packages/agent-bundle/src/build/build.ts
#	packages/agent-bundle/src/build/emit.ts
#	packages/agent-bundle/src/build/package-build.ts
#	packages/agent-bundle/src/build/validate-artifact.ts
#	packages/agent-bundle/src/install/doctor.ts
#	packages/agent-bundle/tests/artifact-validator.test.ts
#	packages/agent-bundle/tests/build-compose.test.ts
#	packages/agent-bundle/tests/packed-readonly-state-root.test.ts
#	website/docs/en/guide/concepts/architecture.mdx
#	website/docs/en/reference/cli.mdx
#	website/docs/en/reference/targets-artifacts.mdx
#	website/docs/zh/guide/concepts/architecture.mdx
#	website/docs/zh/reference/cli.mdx
#	website/docs/zh/reference/targets-artifacts.mdx
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