feat: framework request store and agent() (#95) - #113
Conversation
🦋 Changeset detectedLatest commit: 4c860b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4384210ad
ℹ️ 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".
d1658be to
f784024
Compare
commit: |
Add a versioned realm-singleton request store
(Symbol.for('@agent-bundle/rsc-runtime/request-store'),
AGENT_REQUEST_STORE_VERSION) with closed leases and
`const context = await agent()`. Identities are Observed<T> — unavailable
host/session/actor/workspace is a typed reason, never a fabricated string.
AgentInvocation carries an invocation-kind discriminator
(tool | event | cli | script | workbench). MCP and CLI entrypoints install
the same typed context; state/notices stay reserved undefined, providers
is present. A captured handle throws after the request completes.
The rsc-agent-runtime example drops its hand-rolled withRenderContext /
useEdit / useRuntimeSnapshot helper in favor of the framework store.
Refs #95
The example now uses the framework request store, so the generated topology tree no longer lists the deleted hand-rolled helper.
…tore Copy and freeze Observed identity values and capability arrays so a caller cannot mutate roots/allow on a live request handle.
Keep request validation failures within the public error contract and simplify the MCP operation narrowing while touching the reviewed paths.
request boundary copies/freezes host/actor/session/workspace/capability Observed values so callers cannot bypass \`available()\`
8463d02 to
4c860b5
Compare
|
Landing per owner authorization on scoped verification: @agent-bundle/rsc-runtime 34/34 plus typecheck, the RSC example pool 187 passed, and eval:spot green. Prior local gate requirements and hosted-check waiting are superseded; main CI and the end-of-Wave comprehensive pass are the safety net. |
Summary
Wave 1 Lane C context core for #95.
await agent()as the React-independent accessor.AgentInvocationcarrying the invocation-kind discriminator (tool|event|cli|script|workbench).state/notices/providersextension slots.Proof
examples/rsc-agent-runtimedeletes its hand-rolledwithRenderContext/useEdit/useRuntimeSnapshotinternals. The hook Flight worker installsrunAgentRequestfor every render, andAfterFileEditreadsawait agent(). Nested capability lists (roots,allow) are copied and frozen so a caller cannot mutate authority during a live request.Remaining sequenced work (not this PR)
useAgent()rides Build a real RSC Agent Document renderer with streaming semantics #96's React bridge.This PR does not implement durable state, the renderer
useAgent()React bridge, or the filesystem route compiler.Test plan
packages/rsc-runtimetests and typecheckFixes #95