Commit 722fa4f
committed
feat!(types): resolve PolicyInfo / MCPPolicyInfo naming collision (v6.0.0)
The TS SDK had two unrelated types using overlapping names that
predated the OpenAPI spec write-up:
- `PolicyInfo` (proxy.ts): proxy-mode shape returned by /api/request
- `MCPPolicyInfo` (connector.ts): MCP shape returned by /mcp/* — this
is what the OpenAPI spec actually calls `PolicyInfo`.
The wire-shape contract gate flagged this as drift on the spec
PolicyInfo schema, since the SDK's PolicyInfo did not match the spec
shape and there was no way for the gate to know the SDK uses
MCPPolicyInfo for the spec's PolicyInfo.
This PR swaps the names to align with the OpenAPI spec:
v5.x → v6.0.0
PolicyInfo → ProxyPolicyInfo (proxy-mode shape)
MCPPolicyInfo → PolicyInfo (MCP shape; matches OpenAPI)
Both old names are kept as `type` aliases for one major-version
migration window:
type MCPPolicyInfo = PolicyInfo (in connector.ts)
type PolicyInfoLegacyProxyShape = ProxyPolicyInfo (in proxy.ts)
Removed in v7.0.0.
Code that uses the proxy-mode shape via `response.policyInfo` on
ExecuteQueryResponse continues to compile — the property type
changed from `PolicyInfo` to `ProxyPolicyInfo`, but the field shape
is identical.
Code that explicitly imports `PolicyInfo` from the public API will
see the new MCP shape (which is what the spec said it should be).
Migration:
- s/MCPPolicyInfo/PolicyInfo/ in MCP-handling code, OR keep the
MCPPolicyInfo alias for now.
- s/PolicyInfo/ProxyPolicyInfo/ in proxy-mode code, OR temporarily
use PolicyInfoLegacyProxyShape.
CHANGELOG marks this as BREAKING under [Unreleased]; the v6.0.0
header will land at release time.
Tests: 859 pass. Lint clean.1 parent d2274b7 commit 722fa4f
4 files changed
Lines changed: 71 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
10 | 31 | | |
11 | 32 | | |
12 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
124 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | | - | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | | - | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
73 | 92 | | |
74 | 93 | | |
75 | 94 | | |
| |||
116 | 135 | | |
117 | 136 | | |
118 | 137 | | |
119 | | - | |
120 | | - | |
| 138 | + | |
| 139 | + | |
121 | 140 | | |
122 | 141 | | |
123 | 142 | | |
| |||
0 commit comments