You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(spec)!: declare routes.mcp on ApiRoutesSchema, extend discovery gate to routes keys (#5679)
`/discovery` advertises `routes.mcp`, objectui reads it, and `ApiRoutesSchema`
never declared it — #4828's defect one level down, with the opposite
disposition: `endpoints` was retired for having no reader, `mcp` has two real
ones and is in fact the only `routes.*` key anything in objectui reads.
`ApiRoutesSchema` is a plain z.object, which strips unknown keys, so any
consumer parsing /discovery through the spec dropped `routes.mcp` silently.
- spec: declare `mcp: z.string().optional()` as MEASURED off both producers —
a path string, always the unscoped base (/mcp is mounted bare), optional
rather than nullable (the key is absent, never null, when MCP is off or
unserveable).
- rest: drop the two `as any` casts at the emit site. Type-only; the emitted
body is byte-identical. With the key undeclared, removing them produced two
TS2339; with it declared, tsc returns to its ratcheted baseline of 2.
- gates: the #4828 conformance tests now check `routes` keys as well as
top-level ones in all three producer packages, deriving the allowance from
ApiRoutesSchema. Extended one level, not recursed.
Corrects the issue's premise on one point: the runtime dispatcher's
getDiscoveryInfo() also emits `routes.mcp` (its routes literal always carries
the key, holding the path or undefined), so both producers were affected and
the new gate went red on both before the fix.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
* fix(client,spec): 补 client 路由约定表的 mcp 项,并在合并树上重生成 authorable-surface (#5679)
CI 上两条不同签名的红,都是合并 origin/main 之后才出现的:
1. `@objectstack/client` DTS build — TS2741: `getRoute()` 的约定回退表
`Record<ApiRouteType, string>` 按设计对 `keyof ApiRoutes` **全键必填**,
所以给 ApiRoutesSchema 新增一个已声明键就必须给出它的约定路径。这是我
消费半径漏掉的包。补 `mcp: '/api/v1/mcp'` —— 不是猜的,正是两个 discovery
生产者实测发出的值,所以回退值与被发现值一致而非互相打架;而且该表本就
是 unscoped 约定表(每行都是 /api/v1/...),恰好符合 /mcp 裸挂载的事实。
全仓复扫 `keyof ApiRoutes` / ApiRoutes 型字面量,确认没有第三处:其余站点
都是 `Partial<ApiRoutes>` 或只填两个必填键,不受影响。
2. `check:authorable-surface` — 合并带进了 #5721 的 `ui/ActionSession` 源,
但 authorable-surface.json 未在合并树上重生成。跑 gen:schema 重出,该文件
现同时含本单的 `api/ApiRoutes:mcp` 与 main 的 ActionSession 三键。
`authorable-surface.base.json` 的 baseRev 重锚照 #5358 再次剔除 —— 那是 main
前移导致的机械重锚,不属本单。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments