feat: single-source cross-app wire contracts in @boocode/contracts (v2.7.13)

Move all hand-synced cross-app wire contracts into one built workspace
package, @boocode/contracts, consumed by server/web/coder/coder-web via
workspace:* + a per-subpath exports map. The ws-frames and provider-config
Zod schemas are schema-first (z.infer); MessageMetadata, ErrorReason,
AgentSessionConfig, the provider snapshot types, and WorktreeRiskReport are
each single-sourced. Deletes the byte-identical copies and their parity
tests, fixes a live AgentSessionConfig drift (coder dead copy removed,
unified to the web required/nullable shape), removes the dead pending_change
WS arms in the fallback SPA, and inverts the build order (contracts builds
first) across root build, Dockerfile, and the coder deploy docs. Reverses
the shared-package decision declined in v2.5.12.
This commit is contained in:
2026-06-02 21:00:00 +00:00
parent 1a210f5d23
commit 65ce126c80
55 changed files with 804 additions and 1108 deletions

25
pnpm-lock.yaml generated
View File

@@ -54,6 +54,9 @@ importers:
'@anthropic-ai/claude-agent-sdk':
specifier: ^0.3.159
version: 0.3.159(@anthropic-ai/sdk@0.100.1(zod@3.25.76))(@modelcontextprotocol/sdk@1.29.0(zod@3.25.76))(zod@3.25.76)
'@boocode/contracts':
specifier: workspace:*
version: link:../../packages/contracts
'@boocode/server':
specifier: workspace:*
version: link:../server
@@ -100,6 +103,9 @@ importers:
apps/coder/web:
dependencies:
'@boocode/contracts':
specifier: workspace:*
version: link:../../../packages/contracts
lucide-react:
specifier: ^1.16.0
version: 1.16.0(react@18.3.1)
@@ -146,6 +152,9 @@ importers:
'@ai-sdk/openai-compatible':
specifier: ^2.0.47
version: 2.0.47(zod@3.25.76)
'@boocode/contracts':
specifier: workspace:*
version: link:../../packages/contracts
'@fastify/static':
specifier: ^7.0.4
version: 7.0.4
@@ -192,6 +201,9 @@ importers:
apps/web:
dependencies:
'@boocode/contracts':
specifier: workspace:*
version: link:../../packages/contracts
'@fontsource-variable/inter':
specifier: ^5.2.8
version: 5.2.8
@@ -287,6 +299,19 @@ importers:
specifier: ^5.3.4
version: 5.4.21(@types/node@20.19.41)(lightningcss@1.32.0)
packages/contracts:
dependencies:
zod:
specifier: ^3.23.8
version: 3.25.76
devDependencies:
typescript:
specifier: ^5.5.0
version: 5.9.3
vitest:
specifier: ^3.2.4
version: 3.2.4(@types/debug@4.1.13)(@types/node@20.19.41)(lightningcss@1.32.0)(msw@2.14.6(@types/node@20.19.41)(typescript@5.9.3))
packages:
'@agentclientprotocol/sdk@0.22.1':