Skip to content

docs(#88): clarify the operation/JSX model and what "RSC runtime" does not provide - #89

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
cursor/issue-88-operation-jsx-model-docs-7902
Aug 31, 2026
Merged

docs(#88): clarify the operation/JSX model and what "RSC runtime" does not provide#89
ScriptedAlchemy merged 3 commits into
mainfrom
cursor/issue-88-operation-jsx-model-docs-7902

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Refs #88 — deliberately not a closing keyword. The issue also asks whether the
rsc-runtime name itself should change; that half is untouched here (see "Out of
scope"), so #88 stays open for it.

What this does

Makes the central framework-mode abstraction — the operation — explicit, and states plainly that @agent-bundle/rsc-runtime is not a React Server Components renderer.

docs/framework-mode.md (primary framework-mode docs)

  • New "One operation, end to end" section: shows the full defineOperation for the status operation already referenced by the defineRscApplication snippet, with the render JSX visible inline instead of implied. The example groups fields by role (shared core vs CLI projection vs MCP projection) and walks the pipeline: inputSchema.parseexecuteresultSchema.parse, then CLI JSON output (JSON.stringify + cli.exitCode) vs MCP JSX lowering (renderlowerMcpResultCallToolResult).
  • New "Why .tsx, and what 'RSC runtime' is not" section: states an operation is a host-neutral use-case definition (not a CLI command), that no RSC renderer or Flight transport is involved, introduces the "MCP result DSL" terminology, and closes with a five-point recap answering the issue's acceptance questions verbatim.

packages/rsc-runtime (published docs surface)

  • README now says up front: not an RSC renderer/runtime, no Flight transport; it is a synchronous React-element protocol DSL (lowerMcpResult/lowerHookResult walk the element tree, calling function components, and lower it into plain protocol results). The Applications section spells out shared core vs projections and that only MCP consumes render.
  • The npm description field no longer claims "React Server Component primitives" (it now says "React-element result primitives (an MCP result DSL)…"). The package name and the react-server-components keyword are untouched — renaming/repositioning is gated on Pick the npm package name #78/Pick the npm package name (real publishing is gated on this) #81.

examples/audiobook-curator

  • README gains an "Operation model" section that shows the actual CuratorResult JSX from src/result.tsx and says which projection consumes it.
  • src/result.tsx gets a header comment naming it as the one place runtime JSX lives; src/application.ts's header notes there is deliberately no JSX there. Comment-only source changes — no behavior change, per the issue's "readable over a huge refactor" guidance.

Changeset

One patch changeset for @agent-bundle/rsc-runtime is included because its published docs surface changes: the README ships in the npm package (files: ["dist", "README.md"]) and the package.json description is npm-visible metadata. The changes to docs/* and examples/* alone would not need one; no runtime code or export surface changes anywhere.

Out of scope (per the issue)

No changes toward #73/#74/#75 (PRs #84/#85/#83), no package rename (#78/#81), no build-pipeline changes (#80).

Verification

  • pnpm lint — 0 errors, 0 warnings (661 files).
  • pnpm build && pnpm typecheck — clean.
  • pnpm --filter @agent-bundle-example/audiobook-curator test — no failures.
  • Doc example accuracy checked against the source: Mcp.Text requires exactly one string child, so the new snippet uses a single template-literal child rather than interpolated JSX children (which lowerMcpResult would reject).

Review follow-up

Two claims were narrowed after checking them against packages/rsc-runtime/src
(Codex flagged the same two independently):

  • render is unconditionally required. RscOperationInput.render is not
    optional, so a CLI-only operation still has to declare one — verified by
    compiling a render-less defineOperation (TS2741: Property 'render' is missing). The docs had grouped render with the optional MCP projection.
  • lowerHookResult does not call caller-authored components. Unlike
    lowerMcpResult, lower-hook.ts resolves only the functions in the exported
    Hook object; a Hook.Result tree returned from your own component throws
    Expected exactly one agent-hook-result root (verified at runtime). The
    README's "does the same for hook results" now says so.

The cli.parse(argv) wording was also corrected: runRscCli passes the
arguments after the command name, and cli.exitCode is returned to the entry
rather than set on process by the runtime.

Pinned, per house style

docs/framework-mode.md and both READMEs were previously unpinned, while
examples/rsc-agent-runtime/tests/docs-contract.test.ts is the repo's
precedent for locking doc claims down. New
packages/rsc-runtime/tests/docs-contract.test.ts builds the documented
status operation and pins the three behavioural claims the new prose makes:

  • the CLI projection writes exactly {"status":"ready"}\n — one line of JSON —
    and never invokes render (asserted with a render counter);
  • the MCP projection lowers the same validated result to the documented
    CallToolResult;
  • a multi-child Mcp.Text is rejected with mcp-text requires one text child,
    which is why the snippet uses a template literal.

pnpm exec rslint on the new test: 0 errors, 0 warnings.

Open in Web Open in Cursor 

… provide (#88)

- docs/framework-mode.md: document one operation end to end with the JSX
  shown inline; state that an operation is a host-neutral use-case
  definition, that only the MCP projection consumes render, and that no
  React Server Components renderer or Flight transport is involved;
  introduce 'MCP result DSL' terminology and answer the issue's five
  reader questions explicitly.
- packages/rsc-runtime: README states the not-RSC/no-Flight facts up
  front and spells out the shared-core vs projection split; the npm
  description no longer claims 'React Server Component primitives'.
  Patch changeset included since the published README/description change.
- examples/audiobook-curator: README gains an 'Operation model' section
  showing the actual CuratorResult JSX; result.tsx and application.ts
  headers name where the runtime JSX lives and which projection uses it.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fb638eb

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

This PR includes changesets to release 1 package
Name Type
@agent-bundle/rsc-runtime Patch

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

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review August 31, 2026 19:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T19:56:29.488945Z b45f382 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b45f382afe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rsc-runtime/README.md Outdated
Comment thread packages/rsc-runtime/README.md Outdated
`render` is a required field of `RscOperationInput`, so a CLI-only
operation must still declare one; the docs read as if `render` belonged to
the optional MCP projection. `lowerHookResult` also resolves only `Hook`
elements — unlike `lowerMcpResult` it does not call caller-authored
function components — so "does the same for hook results" overclaimed.

Adds `packages/rsc-runtime/tests/docs-contract.test.ts` pinning the
documented `status` operation: the CLI projection writes exactly one line
of JSON and never invokes `render`, the MCP projection lowers the same
validated result, and a multi-child `Mcp.Text` is rejected.
@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

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

commit: 1780257

@ScriptedAlchemy
ScriptedAlchemy merged commit 766e824 into main Aug 31, 2026
8 of 9 checks passed
ScriptedAlchemy added a commit that referenced this pull request Aug 31, 2026
The published manifest contradicted itself: #89 rewrote the description to
say the package is a React-element result DSL and explicitly not an RSC
renderer, while the keywords array kept claiming react-server-components.
Keeps the honest keywords (agent-bundle, mcp); the package name is out of
scope here.
@ScriptedAlchemy
ScriptedAlchemy deleted the cursor/issue-88-operation-jsx-model-docs-7902 branch September 3, 2026 05:24
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