Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/clarify-rsc-runtime-not-rsc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": patch
"@agent-bundle/runtime": patch
---

Docs-only clarification of the operation/JSX model (#88). The published
Expand Down
2 changes: 1 addition & 1 deletion .changeset/deslop-wave1-delta.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'agent-bundle': patch
'@agent-bundle/rsc-runtime': patch
'@agent-bundle/runtime': patch
---

Deslop pass over the Wave 1 delta: `config/normalize.ts` reuses the shared `core/freeze.ts` `deepFreeze` instead of a local copy, the internal `configClaimedSources` helper is no longer exported, the dev-lock URL publication settles through one named cleanup, and the rsc-runtime CLI binding drops a redundant `Object.freeze` (the request store snapshots and freezes capabilities itself). No behavior changes.
2 changes: 1 addition & 1 deletion .changeset/framework-mode-rsc-runtime.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": minor
"@agent-bundle/runtime": minor
---

Framework mode (RFC #63), runtime side — **breaking removals**. The
Expand Down
2 changes: 1 addition & 1 deletion .changeset/fresh-runtimes-curate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": minor
"@agent-bundle/runtime": minor
"agent-bundle": patch
---

Expand Down
2 changes: 1 addition & 1 deletion .changeset/lower-mcp-undefined-wire-semantics.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": patch
"@agent-bundle/runtime": patch
---

`lowerMcpResult` now follows MCP SDK wire semantics for `undefined` inside
Expand Down
7 changes: 7 additions & 0 deletions .changeset/rename-rsc-runtime-package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@agent-bundle/runtime": minor
---

Rename the preview runtime package from `@agent-bundle/rsc-runtime` to
`@agent-bundle/runtime`. Update workspace consumers, documentation, paired
pkg.pr.new URL derivation, and preview publishing guidance for the new name.
2 changes: 1 addition & 1 deletion .changeset/request-store-agent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": minor
"@agent-bundle/runtime": minor
---

Add the versioned realm-singleton request store, `await agent()`, and
Expand Down
2 changes: 1 addition & 1 deletion .changeset/rsc-mcp-app-element.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": minor
"@agent-bundle/runtime": minor
---

`defineRscAgentBundle` element trees can declare MCP Apps first-class:
Expand Down
2 changes: 1 addition & 1 deletion .changeset/rsc-mcp-listing-title-meta.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": minor
"@agent-bundle/runtime": minor
---

`RscMcpDefinition` gains optional listing-level `title` and `_meta` slots;
Expand Down
2 changes: 1 addition & 1 deletion .changeset/rsc-runtime-drop-rsc-keyword.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@agent-bundle/rsc-runtime": patch
"@agent-bundle/runtime": patch
---

Published-metadata fix: the `react-server-components` keyword is removed from
Expand Down
2 changes: 1 addition & 1 deletion docs/entry-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ the framework lifecycle:

```ts
// src/mcp/curator.ts — the whole stdio entry a consumer writes
import { createRscMcpServer } from '@agent-bundle/rsc-runtime/plugin';
import { createRscMcpServer } from '@agent-bundle/runtime/plugin';
import { application } from '../application.js';

export default () => createRscMcpServer(application, 'curator');
Expand Down
13 changes: 6 additions & 7 deletions docs/framework-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ like this in full, including the JSX:

```tsx
// src/operations/status.tsx
import { defineOperation } from '@agent-bundle/rsc-runtime/plugin';
import { Mcp } from '@agent-bundle/rsc-runtime';
import { defineOperation } from '@agent-bundle/runtime/plugin';
import { Mcp } from '@agent-bundle/runtime';
import { z } from 'zod';

export const status = defineOperation({
Expand Down Expand Up @@ -122,12 +122,11 @@ validation cannot drift between surfaces. Only the last step differs:
lowering is strict — `Mcp.Text` takes exactly one string child, hence the
template literal above.

## Why `.tsx`, and what "RSC runtime" is not
## Why `.tsx`, and current renderer status

Despite the package name, `@agent-bundle/rsc-runtime` is **not a React
Server Components renderer or runtime, and no Flight transport is
involved**. Nothing streams a component tree to a client, hydrates, or
holds server component state. What the MCP projection uses is an **MCP
`@agent-bundle/runtime` does **not yet execute React Server Components or
Flight**. Its current compatibility lowerers do not stream a component tree,
hydrate, or hold server component state. What the MCP projection uses is an **MCP
result DSL**: `render` returns ordinary React elements, and
`lowerMcpResult` walks that tree synchronously — function components are
simply called — to produce the `CallToolResult` the MCP SDK sends. The
Expand Down
11 changes: 6 additions & 5 deletions docs/preview-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ placeholders, and npm publishing is deferred until the final name is chosen
(it will then use [npm package provenance](https://docs.npmjs.com/generating-provenance-statements);
the manifests and release workflow are already wired for it). Until then
pkg.pr.new is the release channel. Every CI package-preview run publishes real,
installable tarballs of both workspace packages to [pkg.pr.new](https://pkg.pr.new)
installable tarballs of all three publishable workspace packages to [pkg.pr.new](https://pkg.pr.new)
— a free continuous-release registry keyed by commit SHA and pull request.
These are the packages to install until a first npm release is cut.

Expand All @@ -15,7 +15,7 @@ Reference a pull request number to track its most recent build:

```sh
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@1
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@1
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@1
```

The `create-agent-bundle` scaffolder is published to the same channel and is
Expand All @@ -39,13 +39,13 @@ work), which is the right form for lockfiles and reproducible setups:

```sh
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@5685521
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@5685521
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@5685521
```

pnpm and yarn accept the same URLs (`pnpm add <url>`, `yarn add agent-bundle@<url>`).

Previews carry the version string `0.0.0-preview-<sha>`, and the publish
rewrites the `agent-bundle` peer range inside the `@agent-bundle/rsc-runtime`
rewrites the `agent-bundle` peer range inside the `@agent-bundle/runtime`
preview tarball to that exact preview version (`--peerDeps`). Installing both
packages from the same sha therefore works with stock npm — no
`--legacy-peer-deps` needed. Mixing two different shas fails with `ERESOLVE`
Expand All @@ -58,7 +58,8 @@ still requires `--legacy-peer-deps`.

`.github/workflows/package-preview.yml` runs
`pnpm preview:publish` (`pkg-pr-new publish --previewVersion --peerDeps
--no-compact --no-template './packages/agent-bundle' './packages/rsc-runtime'`)
--no-compact --no-template './packages/agent-bundle' './packages/rsc-runtime'
'./packages/create-agent-bundle'`)
after a full build, on every pull request and on every push to `main`. Runs for
`main` pushes use a per-commit concurrency group, so overlapping pushes
cannot cancel one another and every `main` commit has an installable
Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ outputs beneath `artifact/` (each host's plugin metadata, Skill, bundled CLI
script, and lifecycle-wrapped MCP server) plus the npm package build beneath
`dist/` (`dist/bin/audiobook-curator.js` for `package.json` `bin`,
`dist/index.js` and declarations for `exports`). The example uses only public
`agent-bundle` and `@agent-bundle/rsc-runtime` exports with `workspace:*`
`agent-bundle` and `@agent-bundle/runtime` exports with `workspace:*`
dependencies.

## Operation model
Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"validate": "agent-bundle validate"
},
"dependencies": {
"@agent-bundle/rsc-runtime": "workspace:*",
"@agent-bundle/runtime": "workspace:*",
"@modelcontextprotocol/server": "2.0.0",
"react": "19.2.8",
"zod": "4.4.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* runtime JSX is each operation's `render`, which delegates to
* `<CuratorResult>` in `./result.tsx` for the MCP projection.
*/
import { defineRscApplication } from '@agent-bundle/rsc-runtime/plugin';
import { defineRscApplication } from '@agent-bundle/runtime/plugin';

import {
audibleOperations,
Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runRscCli } from '@agent-bundle/rsc-runtime/plugin';
import { runRscCli } from '@agent-bundle/runtime/plugin';

import {
createAudiobookCuratorApplication,
Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/mcp/curator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRscMcpServer } from '@agent-bundle/rsc-runtime/plugin';
import { createRscMcpServer } from '@agent-bundle/runtime/plugin';

import { audiobookCuratorApplication } from '../application.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/operations/audible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* and `audible-cache`, backed by `../audible.ts`. Ranking is evidence only;
* `audible-select` records the required human edition choice.
*/
import { defineOperation, type RscOperationContext } from '@agent-bundle/rsc-runtime/plugin';
import { defineOperation, type RscOperationContext } from '@agent-bundle/runtime/plugin';
import React from 'react';
import { z } from 'zod';

Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/operations/discovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* `library-audit`, and `select`, backed by `../curator-core.ts` and
* `../library.ts`. All four retain evidence and never mutate media.
*/
import { defineOperation, type RscOperationContext } from '@agent-bundle/rsc-runtime/plugin';
import { defineOperation, type RscOperationContext } from '@agent-bundle/runtime/plugin';
import React from 'react';
import { z } from 'zod';

Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/operations/evidence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Acoustic and transcript identity-evidence operations: `acoustic-verify`,
* `acoustic-identify`, and `whisper-verify`, backed by `../evidence.ts`.
*/
import { defineOperation, type RscOperationContext } from '@agent-bundle/rsc-runtime/plugin';
import { defineOperation, type RscOperationContext } from '@agent-bundle/runtime/plugin';
import React from 'react';
import { z } from 'zod';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Plan-first derived-media repair operations: `apply-metadata` and
* `apply-chapters`, backed by `../media-mutation.ts`.
*/
import { defineOperation, type RscOperationContext } from '@agent-bundle/rsc-runtime/plugin';
import { defineOperation, type RscOperationContext } from '@agent-bundle/runtime/plugin';
import React from 'react';
import { z } from 'zod';

Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/operations/output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* `../integrity-audit.ts`. Conversion and preparation plan by default and
* mutate only a derived destination; the audit never mutates.
*/
import { defineOperation, type RscOperationContext } from '@agent-bundle/rsc-runtime/plugin';
import { defineOperation, type RscOperationContext } from '@agent-bundle/runtime/plugin';
import React from 'react';
import { z } from 'zod';

Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/src/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* transport is involved, and the CLI projection never calls it (it prints
* the validated receipt as JSON instead).
*/
import { Mcp } from '@agent-bundle/rsc-runtime';
import { Mcp } from '@agent-bundle/runtime';
import React from 'react';

import type { AudibleCacheReceipt, AudibleSearchReceipt, AudibleSelectionReceipt } from './audible.ts';
Expand Down
2 changes: 1 addition & 1 deletion examples/audiobook-curator/tests/application.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { lowerMcpResult } from '@agent-bundle/rsc-runtime';
import { lowerMcpResult } from '@agent-bundle/runtime';
import { describe, expect, it } from '@rstest/core';

import maybeFactoryConfig from '../agent-bundle.config.ts';
Expand Down
4 changes: 2 additions & 2 deletions examples/rsc-agent-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Native hooks are fresh requests: a process normalizes one host event, invokes th

```tsx
// A Hook JSX route reads request-scoped context.
import { Hook, agent } from '@agent-bundle/rsc-runtime';
import { Hook, agent } from '@agent-bundle/runtime';
import type { CanonicalPostToolUse, RuntimeSnapshot } from '../runtime/contracts.js';

export async function AfterFileEdit() {
Expand All @@ -34,7 +34,7 @@ export async function AfterFileEdit() {

```tsx
// An MCP JSX route describes protocol blocks, not browser HTML.
import { Mcp } from '@agent-bundle/rsc-runtime';
import { Mcp } from '@agent-bundle/runtime';

export function RenderTimeline({ snapshot }: { snapshot: { edits: unknown[]; stateVersion: number } }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"capture:widget": "node scripts/capture-widget.mjs"
},
"dependencies": {
"@agent-bundle/rsc-runtime": "workspace:*",
"@agent-bundle/runtime": "workspace:*",
"@modelcontextprotocol/ext-apps": "1.7.5",
"@modelcontextprotocol/sdk": "1.30.0",
"express": "5.2.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/src/dev/invocation-worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { requestFlightRenderWithFlight } from '../flight/request-render.js';
import { writeSync } from 'node:fs';
import { lowerHookResult, lowerMcpResult } from '@agent-bundle/rsc-runtime';
import { lowerHookResult, lowerMcpResult } from '@agent-bundle/runtime';
import type {
DevRuntimeInspectionRequest,
DevRuntimeInspectionResponse,
Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/src/hook/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { appendFile } from 'node:fs/promises';
import { resolve } from 'node:path';

import { requestFlightRender } from '../flight/request-render.js';
import { lowerHookResult } from '@agent-bundle/rsc-runtime';
import { lowerHookResult } from '@agent-bundle/runtime';
import { resolveImplicitRuntimeStateFile } from '../runtime/state-file.js';
import { normalizeClaudeHook, normalizeCodexHook } from './normalize.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/src/mcp/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createFileRuntimeKernel } from '../runtime/state-file.js';
import { lowerMcpResult } from '@agent-bundle/rsc-runtime';
import { lowerMcpResult } from '@agent-bundle/runtime';
import { requestFlightRender } from '../flight/request-render.js';
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/src/rsc/components.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { basename } from 'node:path';

import { Hook, Mcp, agent } from '@agent-bundle/rsc-runtime';
import { Hook, Mcp, agent } from '@agent-bundle/runtime';
import type { CanonicalPostToolUse, RuntimeSnapshot } from '../runtime/contracts.js';

const hookServices = async (): Promise<{ edit: CanonicalPostToolUse; snapshot: RuntimeSnapshot }> => {
Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/src/rsc/worker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { finished } from 'node:stream/promises';
import { resolve } from 'node:path';
import { writeSync } from 'node:fs';

import { available, runAgentRequest } from '@agent-bundle/rsc-runtime';
import { available, runAgentRequest } from '@agent-bundle/runtime';
import { renderToReadableStream } from 'react-server-dom-rspack/server.node';

import type { CanonicalPostToolUse, RenderRequest, RuntimeSnapshot } from '../runtime/contracts.js';
Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/tests/mcp-lowering.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from '@rstest/core';
import React from 'react';

import { Mcp, lowerMcpResult } from '@agent-bundle/rsc-runtime';
import { Mcp, lowerMcpResult } from '@agent-bundle/runtime';

test('lowers every supported MCP result block in authored order', () => {
const result = lowerMcpResult(
Expand Down
2 changes: 1 addition & 1 deletion examples/rsc-agent-runtime/tests/support/copy-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface CopiedExample {

/**
* Copies the example into a temporary workspace shaped like the repository.
* The example's direct dependencies (zod, @agent-bundle/rsc-runtime) live in
* The example's direct dependencies (zod, @agent-bundle/runtime) live in
* its own node_modules, not the workspace root's hoisted set, so the copy
* links both.
*/
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
},
"packageManager": "pnpm@11.23.0",
"scripts": {
"build": "pnpm --filter agent-bundle build && pnpm --filter @agent-bundle/rsc-runtime build && pnpm --filter create-agent-bundle build",
"lint:package": "publint packages/agent-bundle && publint packages/create-agent-bundle",
"build": "pnpm --filter agent-bundle build && pnpm --filter @agent-bundle/runtime build && pnpm --filter create-agent-bundle build",
"lint:package": "publint packages/agent-bundle && publint packages/rsc-runtime && publint packages/create-agent-bundle",
"test": "pnpm test:unit && pnpm test:integration",
"test:unit": "rstest --config rstest.unit.config.ts",
"test:integration": "pnpm build && pnpm test:integration:run",
Expand Down
8 changes: 6 additions & 2 deletions packages/create-agent-bundle/src/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import { UsageError } from './options.ts';

const previewPattern = /-preview-([0-9a-f]{7,40})$/u;

export const previewFrameworkSpec = (sha: string): string =>
`https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@${sha}`;
export type PreviewPackageName = 'agent-bundle' | '@agent-bundle/runtime' | 'create-agent-bundle';

export const previewPackageSpec = (packageName: PreviewPackageName, sha: string): string =>
`https://pkg.pr.new/ScriptedAlchemy/agent-bundle/${packageName}@${sha}`;

export const previewFrameworkSpec = (sha: string): string => previewPackageSpec('agent-bundle', sha);

/**
* Resolve the dependency spec the scaffolded project pins `agent-bundle` to.
Expand Down
9 changes: 8 additions & 1 deletion packages/create-agent-bundle/tests/framework.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { describe, expect, it } from '@rstest/core';

import { resolveFrameworkSpec } from '../src/framework.ts';
import { previewPackageSpec, resolveFrameworkSpec } from '../src/framework.ts';
import { UsageError } from '../src/options.ts';

describe('previewPackageSpec', () => {
it('derives the renamed runtime pkg.pr.new URL', () => {
expect(previewPackageSpec('@agent-bundle/runtime', 'da5df1d'))
.toBe('https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@da5df1d');
});
});

describe('resolveFrameworkSpec', () => {
it('derives the paired pkg.pr.new preview from the scaffolder preview version', () => {
expect(resolveFrameworkSpec('0.0.0-preview-da5df1d', undefined))
Expand Down
Loading
Loading