build: gate releases on attw + declaration-import check; manifest hygiene for agent-bundle, rsc-markdown-stream, create-agent-bundle (#566 §2) - #568
Merged
Conversation
…iene for agent-bundle, rsc-markdown-stream, create-agent-bundle - lint:release runs attw --profile esm-only on all three packed tarballs and scripts/check-declaration-imports.mjs, which fails when a shipped .d.ts a consumer can reach imports a devDependency or an undeclared package (internal declarations warn; --strict escalates) - expose ./package.json in exports on all three packages (create-agent-bundle gains an explicit exports map) - agent-bundle: peer @agent-bundle/runtime >=0.0.0 <1 instead of *, drop the duplicate @modelcontextprotocol/server devDependency and the dead !dist/workbench/**/*.map files entry - rsc-markdown-stream: declaration/value-export parity test for the hand-written index.d.ts - keep per-file dts (API Extractor bundling measured and rejected)
🦋 Changeset detectedLatest commit: fabb05f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
commit: |
…ation check; tolerate string exports in public-api test
…nd null blockers; create-agent-bundle exports map is a minor bump
…ets skip Node-invalid entries; docs and changeset wording
… case-folded; reject #, #/ and trailing-slash imports
ScriptedAlchemy
enabled auto-merge (squash)
September 5, 2026 01:18
ScriptedAlchemy
added a commit
that referenced
this pull request
Sep 5, 2026
…e in lint:release #568 added the gate for the other three publishable packages; the runtime tarball this PR reshapes now goes through the same attw --profile esm-only and scripts/check-declaration-imports.mjs run (0 errors, 0 warnings).
This was referenced Sep 5, 2026
build(rsc-runtime): one module graph, drop @modelcontextprotocol/sdk 1.x, expose ./package.json
#571
Merged
ScriptedAlchemy
added a commit
that referenced
this pull request
Sep 5, 2026
…1.x, expose ./package.json (#571) * build(rsc-runtime): one module graph, drop @modelcontextprotocol/sdk 1.x, expose ./package.json `@agent-bundle/runtime` imported `CallToolResult` from `@modelcontextprotocol/sdk` 1.x for two type positions, which kept the whole 1.x SDK (express 5, hono, jose, cors, ajv, ...) in every consumer's install. Take the type from `@modelcontextprotocol/server` 2.x (already a dependency) and publish the exact result shape the lowerers emit as `McpCallToolResult` / `McpContentBlock`, whose `_meta` and `structuredContent` are finite JSON objects, so the value stays assignable to both SDK lines' `CallToolResult`. Build every public entry in one Rslib lib instead of six bundle-mode libs stitched with literal-request `output.externals`. Shared modules land in common chunks once, so each error class is defined once in the dist and `instanceof` holds across subpaths. The old externals missed `src/state/sqlite.ts`'s direct `./contract.js` import, so today's tarball carries a second `AgentStateError` (and three `AgentContractError` / `AgentRequestError`): a sqlite store's `read({ revision: -1 })` rejection was not `instanceof` the class `./state` exports. Entry graphs stay disjoint where they must: `node:sqlite` loads only through `./state/sqlite`, the root and `./plugin` carry no kernel code. Tests: `state-packaging` now walks the dist import graph per entry, asserts one definition per error class, and runs a child-process probe that imports every entry, checks `process.moduleLoadList` for `node:sqlite`, and compares errors thrown by the sqlite and mount entries against `./state`'s class. A new packed test installs the release tarball and repeats the probe through the `exports` map. Both fail against the previous build. Manifest: `./package.json` export; `@rspack/core` peer marked optional (no runtime entry imports it; it is `react-server-dom-rspack`'s build-plugin peer). `react`/`react-dom` stay exact and required: the Flight wire format is pinned to the React build and `react-server-dom-rspack` loads both at import time. * changeset: @agent-bundle/runtime hygiene (#571) * fix(rsc-runtime): keep attachMcpStructuredContent generic; harden packaging graph tests attachMcpStructuredContent is generic over its input so a CallToolResult typed by either MCP SDK line round-trips instead of being narrowed to McpCallToolResult. The dist-graph tests count class definitions by occurrence, check sqlite confinement by entry reachability, exclude the kernel error classes by definition file, assert every dist file is reached by some entry, run the same static checks against the installed tarball, and strip NODE_OPTIONS from probe children. docs/preview-packages notes the @rspack/core peer is optional. * docs(rsc-runtime): document McpCallToolResult; pin 1.x CallToolResult compatibility in the example's tests The website MCP page (en/zh) and the package README name the lowered result type and its assignability to both MCP SDK lines. The rsc-agent-runtime example's lowering test annotates a lowered result and the attachMcpStructuredContent round-trip as the 1.x SDK's CallToolResult, so the example's typecheck fails if either narrows again. * build: run attw and the declaration-import check on the packed runtime in lint:release #568 added the gate for the other three publishable packages; the runtime tarball this PR reshapes now goes through the same attw --profile esm-only and scripts/check-declaration-imports.mjs run (0 errors, 0 warnings).
This was referenced Sep 5, 2026
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.
Wave 1 (S1 + S2) of the composite-plugin plan for #555 — the DECISION + SPEC and the implementation plan comment. Two commits; decisions D1, D5, D7 taken as final.
Commit 1 — S1: remove
pluginfrom the public target modelconfig/normalize.tsno longer synthesizes thepluginlowering target;adapters/registry.tsno longer registerspluginAdapter;adapters/plugin.tsis deleted along with everything only it used (theUniversalhook-wrapper codec,intersectCapabilityStates/unionCapabilityStates/mergeCapabilityEvidence/capabilityBooleanView, thelowersConfigExtensionsadapter hook andRegistry#lowersConfigExtension).targets: ['plugin']and--target pluginare rejected as an unknown target (AB4100);create-agent-bundle --targetaccepts onlyclaude|codex|cursor|portable.portable) for real hosts are unchanged.Commit 2 — S2: plan the selected projections into one composite root
build/build.tsstages one root atartifactRoot; only the selected hosts' planners run. Newbuild/compose.tsmerges byte-identical entries once, fails same-path/different-bytes withAB4103(projections compared in host-name order, paths in path order), and refuses host-scoped components another selected host would discover conventionally withAB4105(D5).adapters/composite-layout.tsowns the composite identity (claude+codex), sorted projections, hook-wrapper naming, and the folder-discovery shadow rule..codex-plugin/hooks.json,.codex-plugin/mcp.json,.cursor-plugin/hooks.json,.cursor-plugin/mcp.json); when another selected host claims their conventional path they emit an empty shield document so folder discovery cannot leak the other host's file. Claude keepshooks/hooks.json+.mcp.json; portable keepsplugin.json+mcp.json.hooks/<name>.<host>.mjsper host; a single-host hook keepshooks/<name>.mjs. Native hooks are preserved for every selected host (the old composite path stripped them). Event-route wrappers bake the composite identity asartifactTarget(the MCP endpoint) and the invoking host astarget.inspect --bundlerreportsdistPath.rootas<output>.INSTALL.md/install.mjsare composed once over the selection.agent-bundle.manifest.jsonrecords the selected projections and provenance only;agent-bundle.hooks.jsonindexes the selected hosts.validate-artifact*.ts), and the pack inventory are computed over the selected projections at the root.AB4102reports root-relative paths keyed per target.install/doctorresolveBundleRoot(manifest directly under--from, no<from>/<host>lookup), dev epoch store, artifact/skill/script/hook-playground/MCP-session services, Workbench artifact inspector (one tree, root., per selected host), eval harnesses (Claude/Codex plugin dir = root),rstest/browser.ts, examples (host-test,rsc-agent-runtime), and the tests.Composite root layout (
examples/host-test,targets: ['claude','codex','cursor','portable'])Pinned by
tests/build-compose.test.ts— "emits one root whose top-level entries are exactly the selected projections and shared surfaces (acceptance 1)" asserts the exhaustive sorted top-level listing (and of each dotfolder,hooks/,scripts/,skills/,commands/), and the Codex-only / portable-only / Cursor-only cases assert theirs.Deleted files
packages/agent-bundle/src/adapters/plugin.tspackages/agent-bundle/tests/plugin-bundle.test.tspackages/agent-bundle/src/build/target-stages.ts→ renamedbuild/compile-stages.ts(per-target staging removed; only the shared compile stages remain)Acceptance tests (
packages/agent-bundle/tests/build-compose.test.tsunless noted)tests/cli.test.ts—--target pluginfails withAB4100;tests/config-validate.test.ts—targets: ['plugin']fails withAB4100AB4103AB4105Diagnostics
AB4100— reworded:pluginis an unknown target.AB4103(new, build error) — same path, different bytes across selected projections; deterministic ordering.AB4105(new, build error) — host-scoped component leaks into a conventionally discovered directory of another selected host.Decisions beyond D1/D5/D7
.codex-plugin/hooks.json|mcp.jsonand.cursor-plugin/hooks.json|mcp.jsonare fixed paths regardless of the selection, so document paths are constants (codexArtifactPaths,cursorArtifactPaths); only hook-wrapper naming is selection-aware.hooks/hooks.json/mcp.jsonpath is claimed by another selected host emits an empty document at its side path and points its manifest at it, so the host's folder-discovery fallback cannot load the other host's file.inspectlist targets sorted by name (acceptance 5);selectedTargetNamesdedupes and sorts.AB4102keyed per target. Duplicate-output detection keys on<target>\0<generatedPath>internally and reports the root-relative path.lowersConfigExtensionsremoved from the adapter model (only the composite adapter used it).AB4104/ acceptance 9 not implemented (not in the brief):portable+codex/portable+cursorrely onAB4103for byte conflicts and otherwise merge (S9).Handed to S3/S4/S5
install/install.ts,install/doctor.ts: minimal change (manifest must sit directly under--from; the<from>/<host>fallback and its two tests are deleted).AB7001rewording per the plan (D2),uninstall, dev services' relocation-awareness beyond "root = epoch", and eval harness Codex home layout stay with S3.dev/artifacts/projection-digest.tshashes the whole root per selected host (one digest per host, identical bytes) — S3 may specialize.build/pack-inventory.tsonly follows the root-relative layout; npm package root = plugin root untouched.install/surface.tsis composed once per selection (INSTALL.mdfor any built-in host,install.mjsfor cursor|portable); per-host source-type rendering (AB4106) and distribution forms stay with S5.AGENTS.mdafter S1; the reserved-name entry inconfig/normalize.tsand therootDocumentsdoc comment inadapters/types.tsare left for S7.Remaining
pluginliterals (all non-target uses)The audit (
rg -n "'plugin'|\"plugin\"|/plugin\b" packages/agent-bundle/src packages/create-agent-bundle examples) finds no reference to the removed target: no target list,target === 'plugin', capability table, help text, or type union names it. Every remaining hit is one of:plugin.json/.claude-plugin/.codex-plugin/.cursor-pluginmanifest paths and schema$ids (adapters/{claude,codex,cursor,portable}.ts,build/pack-inventory.ts,install/{install,doctor,cursor-hooks-registration,cursor-marketplace,receipt}.ts,host-contracts/*-plugin-validation.ts,test/installed.ts,schemas/**,examples/rsc-agent-runtime/tests/**);claude plugin …,codex plugin …,--plugin-dir(install/*.ts,eval/codex-plugins.ts,host-contracts/host-contract.ts,host-contracts/native-codex-contract.ts,build/artifact-diagnostics.ts,examples/*/scripts/*.mjs);"plugin"capability section inadapters/capabilities/*.json(manifest features, not a target);config.plugin/plugin-identity.ts,@rsbuild/plugin-react, and prose.Four backtick-prose mentions of the old target (
config/validate.ts,create-agent-bundle/src/{options,scaffold}.ts,create-agent-bundle/tests/options.test.ts) were rewritten.Docs
docs/diagnostics.md(new "The composite plugin root" section:AB4100,AB4103,AB4105),docs/framework-mode.md,docs/entry-conventions.md, READMEs, and the website (en + zh) pages describing targets, output layout, install, hooks, and the CLI/config reference.Self-review
SELF_REVIEW_PLACEHOLDER