1.0.0-rc.4

AgJSON 1.0.0-rc.4: @openai/agents 0.21, and 0.12.7's clone fix on the release candidate

The fourth release candidate for 1.0.0. All six packages move to 1.0.0-rc.4 together. The spec doesn’t change: they still ship spec revision 1.0.0-rc.3 (AGJSON_VERSION).

Installing the release candidate

The release candidate is published under the rc tag. latest is on 0.12.8:

npm i @silverprotocol/core@rc

Install each framework package you use the same way, so every @silverprotocol/* package in your lockfile is on 1.0.0-rc.4. While a release candidate is the most recent publish, a package’s page on npmjs.com shows no README; each package still carries its README.

1.0.0-rc.4 includes 0.12.7’s change, which rc.3 didn’t: its @silverprotocol/core no longer calls the global structuredClone. It also carries everything 0.12.8 changes.

Who should upgrade

  • You run @silverprotocol/core on an engine without a global structuredClone. rc.3 fails there; rc.4 runs, as 0.12.7 does.
  • You run @openai/agents 0.21. rc.4 is the first release whose @silverprotocol/openai-agents accepts it: the peer range widens from <0.21 to <0.22. Read “Moving to @openai/agents 0.21” below first.
  • You run the Vercel AI SDK with a provider that cites sources (ai 7.0.138 or later). Its citations now land on the text block they cite.
  • You use an OpenAI-compatible provider through @openai/agents that reports usage detail counters beyond the ones the OpenAI client’s types define. Those counters are now carried, where rc.3 dropped them.
  • You read per-model usage from the Claude Agent SDK across a query with more than one result, as @anthropic-ai/claude-agent-sdk 0.3.310 reports it.
  • Anyone else gets the same output as from rc.3: of 446 replayed runs, only three differ, each by a member named below (see Wire version).

Moving to @openai/agents 0.21

These are changes in @openai/agents 0.21 itself. They reach a host that upgrades, whichever version of this package it runs:

  • A run paused and saved on 0.21 can’t be resumed on 0.20. 0.21 saves run state at schema version 1.23, and 0.20 rejects it on resume with a UserError: “Run state schema version 1.23 is not supported. Please use version 1.22.” A run saved on 0.20 resumes on 0.21. Upgrade every process that resumes saved runs before any process saves one on 0.21.
  • Usage token details can be nested. In the SDK’s own Usage object, inputTokensDetails and outputTokensDetails are now records whose values are numbers or further records, so narrow each value to a number before you do arithmetic with it. The AgJSON usage this package emits doesn’t change shape: it reads the response’s own usage, and a detail key it doesn’t map rides the usage-details event described below.
  • The Runloop sandbox provider is removed, with its public API. OpenAI’s migration guide lists the supported alternatives. This package never touches the sandbox.

@silverprotocol/core

These two changes shipped on the 0.12 line as 0.12.7 and are new to the release candidate.

  • The fold no longer calls the global structuredClone. Reducer.push(), result(), toPersistable(), toPersistableWithReport() and the JSON Patch applier now copy with core’s own deep copy. On a JavaScript engine that has no global structuredClone, every fold used to fail with “structuredClone is not defined”; it now runs. For every AgJSON value, the copy gives the same result as before, so no event, fold result or toPersistable() output changes.
  • A host-placed non-JSON object is now shared, not copied. If a host puts a Date, Map, Set, RegExp, Error, ArrayBuffer, typed array or boxed primitive inside an event it pushes, the fold no longer copies it. The fold, every result() and toPersistable() share that object with the host’s event, so a host that changes it after push() sees the change in the fold. Nothing throws that didn’t on rc.3. A function or symbol in the fold still throws where it did, now with an error named CloneError (a TypeError) where rc.3 threw a DOMException named DataCloneError. No AgJSON value holds any of these, and none arrives through ingestAgEvent() or from the framework packages.

The supported engines don’t change: the packages still declare node >=22.12.0.

OpenAI Agents SDK

  • The package accepts @openai/agents 0.21: its peer range widens to >=0.2.0 <0.22. 0.21 needed no mapping change of its own.
  • Usage detail counters the package doesn’t map are no longer dropped. The package maps cached_tokens, cache_write_tokens and reasoning_tokens from a response’s input and output token details, and dropped every other key. The OpenAI client’s types (openai 7.43.0) define no other key; an OpenAI-compatible provider can send flat counters or a nested breakdown, and 0.21 keeps them through a streamed run. They now ride one ext.openai.unparsed event per response, name: "usage-details", before the round’s terminal, holding the unmapped entries as received. Nothing is emitted when every key is mapped. A mapped key whose value isn’t a number (a provider’s null) now sets no usage counter, where rc.3 put that null in usage, and rides the same event.

Vercel AI SDK

  • A URL citation lands on the text block it cites. From ai 7.0.138, a text-end part can carry citations. A URL-source citation now maps to a citation of kind "url" on the text block’s text.end, with the provider’s cited text, else the block text between its offsets, as the OpenAI package maps OpenAI’s own URL citations. Any other entry, such as a document source, rides ext.vercel.citations with its text id.
  • A tool call’s input encoding is carried. From ai 7.0.142, tool-input-start can carry inputEncoding; it rides ext.vercel.input-encoding with the call id.
  • A provider-executed tool call keeps providerExecuted on its tool.start when the call arrives without streamed input, so a client knows not to execute it.
  • The package drops its one structuredClone call, as in 0.12.7. Its output is unchanged.

Claude Agent SDK

  • Per-result model usage rides the result. At @anthropic-ai/claude-agent-sdk 0.3.310, a result frame reports what each model spent since the query’s previous result. It now rides ext.anthropic.result-meta as modelUsageSinceLastResult, each model’s entry mapped like a usage.byModel entry with cumulative: false. usage.byModel still holds the running totals. A frame without it, or with an empty one, emits as before.

Google ADK

  • No code change. The package’s README now documents, at @google/adk 2.3.0, how an SSE prompt block closes, a failed Interactions call that arrives without its error code, and the Chrome built-in backend’s fixed reply.

Spec

Unchanged. The packages ship spec revision 1.0.0-rc.3, as rc.3 did, so no closed set, schema or fold rule changes.

Verified versions

Each framework package is verified end to end, tool calls included, against a live run at:

  • @anthropic-ai/claude-agent-sdk 0.3.310;
  • @openai/agents 0.21.0;
  • @google/adk 2.3.0, with @google/genai 2.30.0;
  • ai 7.0.146.

Wire version

1.0.0-rc.3, unchanged. Replaying every recorded stream and engine-built fixture through the 1.0.0-rc.3 and 1.0.0-rc.4 packages, 443 of 446 runs give byte-identical events. The 446 are 85 recorded streams, among them the Claude Agent SDK (33), OpenAI Agents SDK (16), Google ADK (25) and Vercel AI SDK (10) streams, and 361 runs of the engine-built Google ADK and OpenAI fixtures. The three that differ each add one member described above: two Claude streams gain modelUsageSinceLastResult on their result metadata, and one Vercel web-search stream gains citations on a text.end. No recorded stream or fixture carries, in a response’s usage, a detail key the package doesn’t map.

The 1.0.0-rc.4 packages are built from typescript-sdk commit 3e03011d, the commit npm’s provenance for all six 1.0.0-rc.4 packages attests.