feat(contract): add Driver Contract v2 and refresh all dependencies#43
Draft
Yevanchen wants to merge 2 commits into
Draft
feat(contract): add Driver Contract v2 and refresh all dependencies#43Yevanchen wants to merge 2 commits into
Yevanchen wants to merge 2 commits into
Conversation
Bump TypeScript to 7.0.2, @types/node to 26, vite-plus to 0.2.4, @anthropic-ai/sdk to 0.111.0, Claude Agent SDK to 0.3.207, MCP client to 2.0.0-beta.3, and @orpc/client to 1.14.7. Drop two type assertions that the stricter no-unnecessary-type-assertion lint now rejects.
…coalescing Design and implement the v2 agent-session contract per docs/contract.md, synthesized from the Codex app-server thread/turn/item protocol and Agent Client Protocol v2: one item lifecycle (started/delta/updated/completed with authoritative snapshots), MCP-aligned content blocks, an option-based permission and user-input interaction plane, multimodal turn commands, an emitter-assigned per-session seq, and contract-level adjacent coalescing plus a reference buffer for high-frequency delta transport. Ships as the new agent-driver/contract subpath with zod schemas as the single source of truth and a granularity conformance suite; the 2026-05-26 runtime-event generation stays wired until kernel, backends, and host migrate.
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.
Summary
Two-part change, delivered as a draft while the kernel/backends/host migration is planned:
1. Dependency refresh (all deps to latest)
Migration fallout was minimal: two type assertions dropped for the stricter
no-unnecessary-type-assertionlint.bun@1.3.14remains the latest stable. Full CI flow (frozen-lockfile install → lint → tc → test → build → artifact) verified on a clean standalone checkout.2. Driver Contract v2 (
agent-driver/contract, spec indocs/contract.md)A clean, deliberately incompatible redesign of the agent-session event/data contract, synthesized from the latest Codex app-server protocol (thread/turn/item model) and ACP v2 (
protocolVersion: 2), cross-checked against Claude Agent SDK, AG-UI, Vercel AI SDK streams, and A2A. The old2026-05-26runtime-event generation stays wired until the kernel, the three backends, and the host migrate onto v2 via protocol adapters (follow-ups).Highlights over the old contract:
x_*extension rule replace 107 declared / ~20 emitted untyped kinds; zod v4 schemas are the single source of truth (previously hand-rolled validators duplicated driver/host).item.started/delta/updated/completedwith authoritative completed snapshots (Codex semantics), coveringmessage,reasoning(indexed summary/raw parts),plan,command,file_change,tool_call, and extension items. Ends the parallelmessage.*-family vsitem.*split and thetool.call.updatedfield-sniffing mega-event."[image: …]"string flattening; multimodalturn.start/turn.steerinput.input.requested/resolvedfor Codexrequest_user_input/ MCP elicitation.seq, delta-onlybest_effortclassification, normative adjacent-coalescing rules (coalesceSessionEvents) and a reference buffer (createSessionEventBuffer) so any boundary can batch/merge high-frequency deltas safely.tests/contract-granularity.test.ts).Testing
bun run lint/bun run tc/bun test tests(256 pass) /bun run build— all green, including on a cleangit archivecheckout withbun install --frozen-lockfile(the CI flow).Follow-ups (out of scope here)
mosoorepopkgs/runtime-events) migration off the parallel schema copy.src/runtime-events/src/runtime-commandonce both edges are on v2.