@amalgm/chat 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/AGENTS.md +98 -0
  2. package/PURPOSE.md +143 -112
  3. package/README.md +87 -54
  4. package/dist/acp/index.d.ts +7 -0
  5. package/dist/acp/index.d.ts.map +1 -0
  6. package/dist/acp/index.js +7 -0
  7. package/dist/acp/index.js.map +1 -0
  8. package/dist/acp/projection.d.ts +30 -0
  9. package/dist/acp/projection.d.ts.map +1 -0
  10. package/dist/acp/projection.js +147 -0
  11. package/dist/acp/projection.js.map +1 -0
  12. package/dist/api/conversations.d.ts +66 -0
  13. package/dist/api/conversations.d.ts.map +1 -0
  14. package/dist/api/conversations.js +202 -0
  15. package/dist/api/conversations.js.map +1 -0
  16. package/dist/api/index.d.ts +3 -3
  17. package/dist/api/index.d.ts.map +1 -1
  18. package/dist/api/index.js +1 -2
  19. package/dist/api/index.js.map +1 -1
  20. package/dist/conversations/index.d.ts +3 -0
  21. package/dist/conversations/index.d.ts.map +1 -0
  22. package/dist/conversations/index.js +3 -0
  23. package/dist/conversations/index.js.map +1 -0
  24. package/dist/conversations/transcript.d.ts +13 -0
  25. package/dist/conversations/transcript.d.ts.map +1 -0
  26. package/dist/conversations/transcript.js +171 -0
  27. package/dist/conversations/transcript.js.map +1 -0
  28. package/dist/conversations/types.d.ts +147 -0
  29. package/dist/conversations/types.d.ts.map +1 -0
  30. package/dist/conversations/types.js +9 -0
  31. package/dist/conversations/types.js.map +1 -0
  32. package/dist/events/constructors.d.ts +9 -15
  33. package/dist/events/constructors.d.ts.map +1 -1
  34. package/dist/events/constructors.js +6 -12
  35. package/dist/events/constructors.js.map +1 -1
  36. package/dist/events/index.d.ts +2 -3
  37. package/dist/events/index.d.ts.map +1 -1
  38. package/dist/events/index.js +2 -3
  39. package/dist/events/index.js.map +1 -1
  40. package/dist/events/schema.d.ts +2 -5
  41. package/dist/events/schema.d.ts.map +1 -1
  42. package/dist/events/schema.js +2 -5
  43. package/dist/events/schema.js.map +1 -1
  44. package/dist/execution/contract.d.ts +51 -0
  45. package/dist/execution/contract.d.ts.map +1 -0
  46. package/dist/execution/contract.js +127 -0
  47. package/dist/execution/contract.js.map +1 -0
  48. package/dist/execution/index.d.ts +6 -0
  49. package/dist/execution/index.d.ts.map +1 -0
  50. package/dist/execution/index.js +4 -0
  51. package/dist/execution/index.js.map +1 -0
  52. package/dist/execution/revision.d.ts +5 -0
  53. package/dist/execution/revision.d.ts.map +1 -0
  54. package/dist/execution/revision.js +17 -0
  55. package/dist/execution/revision.js.map +1 -0
  56. package/dist/execution/store.d.ts +26 -0
  57. package/dist/execution/store.d.ts.map +1 -0
  58. package/dist/execution/store.js +38 -0
  59. package/dist/execution/store.js.map +1 -0
  60. package/dist/index.d.ts +8 -25
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +7 -25
  63. package/dist/index.js.map +1 -1
  64. package/dist/input/index.d.ts +3 -0
  65. package/dist/input/index.d.ts.map +1 -0
  66. package/dist/input/index.js +2 -0
  67. package/dist/input/index.js.map +1 -0
  68. package/dist/input/prompt.d.ts +17 -0
  69. package/dist/input/prompt.d.ts.map +1 -0
  70. package/dist/input/prompt.js +104 -0
  71. package/dist/input/prompt.js.map +1 -0
  72. package/dist/normalizers/claude.d.ts +6 -9
  73. package/dist/normalizers/claude.d.ts.map +1 -1
  74. package/dist/normalizers/claude.js +5 -8
  75. package/dist/normalizers/claude.js.map +1 -1
  76. package/dist/normalizers/codex.d.ts +5 -8
  77. package/dist/normalizers/codex.d.ts.map +1 -1
  78. package/dist/normalizers/codex.js +4 -7
  79. package/dist/normalizers/codex.js.map +1 -1
  80. package/dist/normalizers/cursor.d.ts +1 -2
  81. package/dist/normalizers/cursor.d.ts.map +1 -1
  82. package/dist/normalizers/cursor.js +2 -3
  83. package/dist/normalizers/cursor.js.map +1 -1
  84. package/dist/normalizers/index.d.ts +3 -5
  85. package/dist/normalizers/index.d.ts.map +1 -1
  86. package/dist/normalizers/index.js +3 -5
  87. package/dist/normalizers/index.js.map +1 -1
  88. package/dist/normalizers/opencode.d.ts +2 -4
  89. package/dist/normalizers/opencode.d.ts.map +1 -1
  90. package/dist/normalizers/opencode.js +2 -4
  91. package/dist/normalizers/opencode.js.map +1 -1
  92. package/dist/normalizers/pi.d.ts +3 -4
  93. package/dist/normalizers/pi.d.ts.map +1 -1
  94. package/dist/normalizers/pi.js +3 -4
  95. package/dist/normalizers/pi.js.map +1 -1
  96. package/dist/sessions/chat.d.ts +176 -0
  97. package/dist/sessions/chat.d.ts.map +1 -0
  98. package/dist/sessions/chat.js +701 -0
  99. package/dist/sessions/chat.js.map +1 -0
  100. package/dist/sessions/index.d.ts +3 -0
  101. package/dist/sessions/index.d.ts.map +1 -0
  102. package/dist/sessions/index.js +2 -0
  103. package/dist/sessions/index.js.map +1 -0
  104. package/dist/transcript/index.d.ts +1 -1
  105. package/dist/transcript/index.js +1 -1
  106. package/dist/transcript/message-reducer.d.ts +1 -1
  107. package/dist/transcript/message-reducer.js +1 -1
  108. package/dist/transcript/part-accumulator.d.ts +1 -1
  109. package/dist/transcript/part-accumulator.js +1 -1
  110. package/dist/transcript/tool-display.d.ts +1 -1
  111. package/dist/transcript/tool-display.js +1 -1
  112. package/dist/transcript/tool-shape.d.ts +1 -1
  113. package/dist/transcript/tool-shape.js +1 -1
  114. package/dist/usage/finalize.d.ts +7 -9
  115. package/dist/usage/finalize.d.ts.map +1 -1
  116. package/dist/usage/finalize.js +11 -13
  117. package/dist/usage/finalize.js.map +1 -1
  118. package/dist/usage/index.d.ts +2 -3
  119. package/dist/usage/index.d.ts.map +1 -1
  120. package/dist/usage/index.js +2 -3
  121. package/dist/usage/index.js.map +1 -1
  122. package/dist/usage/model-catalog.d.ts +2 -3
  123. package/dist/usage/model-catalog.d.ts.map +1 -1
  124. package/dist/usage/model-catalog.js +10 -3
  125. package/dist/usage/model-catalog.js.map +1 -1
  126. package/dist/usage/normalize.d.ts +5 -7
  127. package/dist/usage/normalize.d.ts.map +1 -1
  128. package/dist/usage/normalize.js +3 -5
  129. package/dist/usage/normalize.js.map +1 -1
  130. package/dist/usage/ports.d.ts +14 -24
  131. package/dist/usage/ports.d.ts.map +1 -1
  132. package/dist/usage/ports.js +9 -17
  133. package/dist/usage/ports.js.map +1 -1
  134. package/dist/usage/steps.d.ts +70 -0
  135. package/dist/usage/steps.d.ts.map +1 -0
  136. package/dist/usage/steps.js +152 -0
  137. package/dist/usage/steps.js.map +1 -0
  138. package/dist/usage/tokens.d.ts +4 -7
  139. package/dist/usage/tokens.d.ts.map +1 -1
  140. package/dist/usage/tokens.js +4 -7
  141. package/dist/usage/tokens.js.map +1 -1
  142. package/docs/contracts/acp-and-step-usage.md +51 -0
  143. package/docs/contracts/conversation-persistence.md +47 -0
  144. package/docs/contracts/input-and-execution.md +177 -0
  145. package/docs/contracts/platform-authorization.md +22 -0
  146. package/host/adapters/acp-capabilities.js +30 -0
  147. package/host/adapters/acp-client.js +156 -0
  148. package/host/adapters/acp.js +284 -0
  149. package/host/adapters/claude.js +235 -0
  150. package/host/adapters/codex.js +733 -0
  151. package/host/adapters/cursor.js +347 -0
  152. package/host/adapters/input-capabilities.js +89 -0
  153. package/host/adapters/opencode.js +486 -0
  154. package/host/adapters/pi.js +519 -0
  155. package/host/adapters/prompt.js +212 -0
  156. package/host/auth.js +257 -0
  157. package/host/credentials/store.js +209 -0
  158. package/host/http.d.ts +32 -0
  159. package/host/http.js +238 -0
  160. package/host/index.d.ts +84 -0
  161. package/host/index.js +59 -0
  162. package/host/lib/runtime-paths.js +44 -0
  163. package/host/model-resolution.js +313 -0
  164. package/host/native-contract.js +185 -0
  165. package/host/native-runtime.js +194 -0
  166. package/host/permissions.js +27 -0
  167. package/host/platform-egress.js +146 -0
  168. package/host/recorder.js +61 -0
  169. package/host/sqlite/index.d.ts +69 -0
  170. package/host/sqlite/index.js +704 -0
  171. package/host/tooling/mcp-bundle.js +214 -0
  172. package/host/tooling/mcp-relay.js +83 -0
  173. package/host/tooling/native-binaries.js +667 -0
  174. package/host/tooling/native-config.js +460 -0
  175. package/host/tooling/package-import.js +111 -0
  176. package/host/tooling/runtime-home.js +26 -0
  177. package/host/tooling/system-instructions.js +69 -0
  178. package/host/tooling/system-prompt.js +35 -0
  179. package/package.json +45 -26
  180. package/skills/chat/SKILL.md +97 -0
  181. package/skills/chat/agents/openai.yaml +4 -0
  182. package/skills/chat/references/contracts.md +131 -0
  183. package/dist/api/chat-payloads.d.ts +0 -10
  184. package/dist/api/chat-payloads.d.ts.map +0 -1
  185. package/dist/api/chat-payloads.js +0 -57
  186. package/dist/api/chat-payloads.js.map +0 -1
  187. package/dist/contract/chat-input.d.ts +0 -144
  188. package/dist/contract/chat-input.d.ts.map +0 -1
  189. package/dist/contract/chat-input.js +0 -261
  190. package/dist/contract/chat-input.js.map +0 -1
  191. package/dist/contract/create.d.ts +0 -191
  192. package/dist/contract/create.d.ts.map +0 -1
  193. package/dist/contract/create.js +0 -249
  194. package/dist/contract/create.js.map +0 -1
  195. package/dist/contract/freeze.d.ts +0 -85
  196. package/dist/contract/freeze.d.ts.map +0 -1
  197. package/dist/contract/freeze.js +0 -151
  198. package/dist/contract/freeze.js.map +0 -1
  199. package/dist/contract/harnesses.d.ts +0 -21
  200. package/dist/contract/harnesses.d.ts.map +0 -1
  201. package/dist/contract/harnesses.js +0 -39
  202. package/dist/contract/harnesses.js.map +0 -1
  203. package/dist/contract/index.d.ts +0 -17
  204. package/dist/contract/index.d.ts.map +0 -1
  205. package/dist/contract/index.js +0 -17
  206. package/dist/contract/index.js.map +0 -1
  207. package/dist/contract/input.d.ts +0 -45
  208. package/dist/contract/input.d.ts.map +0 -1
  209. package/dist/contract/input.js +0 -78
  210. package/dist/contract/input.js.map +0 -1
  211. package/dist/contract/models.d.ts +0 -57
  212. package/dist/contract/models.d.ts.map +0 -1
  213. package/dist/contract/models.js +0 -380
  214. package/dist/contract/models.js.map +0 -1
  215. package/dist/contract/payload-merge.d.ts +0 -76
  216. package/dist/contract/payload-merge.d.ts.map +0 -1
  217. package/dist/contract/payload-merge.js +0 -215
  218. package/dist/contract/payload-merge.js.map +0 -1
  219. package/dist/events/tool-display.d.ts +0 -22
  220. package/dist/events/tool-display.d.ts.map +0 -1
  221. package/dist/events/tool-display.js +0 -60
  222. package/dist/events/tool-display.js.map +0 -1
  223. package/dist/events/tool-shape.d.ts +0 -48
  224. package/dist/events/tool-shape.d.ts.map +0 -1
  225. package/dist/events/tool-shape.js +0 -225
  226. package/dist/events/tool-shape.js.map +0 -1
  227. package/dist/relay/index.d.ts +0 -65
  228. package/dist/relay/index.d.ts.map +0 -1
  229. package/dist/relay/index.js +0 -197
  230. package/dist/relay/index.js.map +0 -1
  231. package/dist/turns/index.d.ts +0 -11
  232. package/dist/turns/index.d.ts.map +0 -1
  233. package/dist/turns/index.js +0 -11
  234. package/dist/turns/index.js.map +0 -1
  235. package/dist/turns/queries.d.ts +0 -36
  236. package/dist/turns/queries.d.ts.map +0 -1
  237. package/dist/turns/queries.js +0 -37
  238. package/dist/turns/queries.js.map +0 -1
  239. package/dist/turns/replay.d.ts +0 -105
  240. package/dist/turns/replay.d.ts.map +0 -1
  241. package/dist/turns/replay.js +0 -163
  242. package/dist/turns/replay.js.map +0 -1
  243. package/dist/turns/status.d.ts +0 -49
  244. package/dist/turns/status.d.ts.map +0 -1
  245. package/dist/turns/status.js +0 -56
  246. package/dist/turns/status.js.map +0 -1
  247. package/dist/turns/turn-store.d.ts +0 -109
  248. package/dist/turns/turn-store.d.ts.map +0 -1
  249. package/dist/turns/turn-store.js +0 -169
  250. package/dist/turns/turn-store.js.map +0 -1
  251. package/dist/warm/client-cache.d.ts +0 -47
  252. package/dist/warm/client-cache.d.ts.map +0 -1
  253. package/dist/warm/client-cache.js +0 -48
  254. package/dist/warm/client-cache.js.map +0 -1
  255. package/dist/warm/envelope-cache.d.ts +0 -79
  256. package/dist/warm/envelope-cache.d.ts.map +0 -1
  257. package/dist/warm/envelope-cache.js +0 -85
  258. package/dist/warm/envelope-cache.js.map +0 -1
  259. package/dist/warm/index.d.ts +0 -18
  260. package/dist/warm/index.d.ts.map +0 -1
  261. package/dist/warm/index.js +0 -12
  262. package/dist/warm/index.js.map +0 -1
  263. package/dist/warm/payload.d.ts +0 -137
  264. package/dist/warm/payload.d.ts.map +0 -1
  265. package/dist/warm/payload.js +0 -112
  266. package/dist/warm/payload.js.map +0 -1
  267. package/dist/warm/revision.d.ts +0 -70
  268. package/dist/warm/revision.d.ts.map +0 -1
  269. package/dist/warm/revision.js +0 -63
  270. package/dist/warm/revision.js.map +0 -1
  271. package/dist/warm/store-policy.d.ts +0 -57
  272. package/dist/warm/store-policy.d.ts.map +0 -1
  273. package/dist/warm/store-policy.js +0 -89
  274. package/dist/warm/store-policy.js.map +0 -1
  275. package/dist/warm/store.d.ts +0 -42
  276. package/dist/warm/store.d.ts.map +0 -1
  277. package/dist/warm/store.js +0 -69
  278. package/dist/warm/store.js.map +0 -1
  279. package/dist/wire/frames.d.ts +0 -208
  280. package/dist/wire/frames.d.ts.map +0 -1
  281. package/dist/wire/frames.js +0 -245
  282. package/dist/wire/frames.js.map +0 -1
  283. package/dist/wire/index.d.ts +0 -7
  284. package/dist/wire/index.d.ts.map +0 -1
  285. package/dist/wire/index.js +0 -7
  286. package/dist/wire/index.js.map +0 -1
@@ -1,45 +0,0 @@
1
- /**
2
- * Turn input normalization — engine `chat-core/input.js`, ported byte-exact.
3
- *
4
- * Two effects are severed into injected ports:
5
- * - `env` on the normalized input (engine: `process.env`)
6
- * - the lazy `require('../amalgm-mcp/project-context/prompt')` in
7
- * `promptText`/`openCodeParts` becomes an optional injected provider.
8
- */
9
- export interface NormalizedInput {
10
- text: string;
11
- parts: unknown[];
12
- files: unknown[];
13
- systemPrompt: string;
14
- env: Record<string, string | undefined>;
15
- }
16
- export interface NormalizeInputPorts {
17
- /** Engine default: `process.env`. SDK default: `{}`. */
18
- env?: Record<string, string | undefined> | undefined;
19
- }
20
- /** Engine `normalizeInput(payload)` (`input.js:10-25`). */
21
- export declare function normalizeInput(payload: Record<string, any>, ports?: NormalizeInputPorts): NormalizedInput;
22
- export interface PromptTextPorts {
23
- /**
24
- * Engine: `amalgm-mcp/project-context/prompt.js projectContextTurnUpdateBlock`
25
- * — the per-turn project-context update block (empty in the common case).
26
- * Omitted ⇒ no context update, exactly like an engine host without the
27
- * module.
28
- */
29
- projectContextTurnUpdate?(contract: unknown): string | null | undefined;
30
- /**
31
- * Called with the first line of the provider's error message when it
32
- * throws. Engine default:
33
- * `console.warn('[chat-core] project context turn update failed:', message)`.
34
- */
35
- onProjectContextError?(message: string): void;
36
- }
37
- /** Engine `promptText(input, contract)` (`input.js:41-50`). */
38
- export declare function promptText(input: NormalizedInput, contract: unknown, ports?: PromptTextPorts): string;
39
- /** Engine `openCodeParts(input, contract)` (`input.js:52-62`). */
40
- export declare function openCodeParts(input: NormalizedInput, contract: unknown, ports?: PromptTextPorts): Array<{
41
- type: string;
42
- text?: string;
43
- path?: string;
44
- }>;
45
- //# sourceMappingURL=input.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/contract/input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACtD;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,GAAE,mBAAwB,GAAG,eAAe,CAe7G;AAED,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,wBAAwB,CAAC,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACxE;;;;OAIG;IACH,qBAAqB,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/C;AAiBD,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAE,eAAoB,GAAG,MAAM,CASzG;AAED,kEAAkE;AAClE,wBAAgB,aAAa,CAC3B,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,OAAO,EACjB,KAAK,GAAE,eAAoB,GAC1B,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAUvD"}
@@ -1,78 +0,0 @@
1
- /**
2
- * Turn input normalization — engine `chat-core/input.js`, ported byte-exact.
3
- *
4
- * Two effects are severed into injected ports:
5
- * - `env` on the normalized input (engine: `process.env`)
6
- * - the lazy `require('../amalgm-mcp/project-context/prompt')` in
7
- * `promptText`/`openCodeParts` becomes an optional injected provider.
8
- */
9
- function textFromPart(part) {
10
- if (!part || typeof part !== 'object')
11
- return '';
12
- if (part.type === 'text' && typeof part.text === 'string')
13
- return part.text;
14
- if (typeof part.content === 'string')
15
- return part.content;
16
- return '';
17
- }
18
- /** Engine `normalizeInput(payload)` (`input.js:10-25`). */
19
- export function normalizeInput(payload, ports = {}) {
20
- const chatInput = payload.chatInput && typeof payload.chatInput === 'object' ? payload.chatInput : null;
21
- const parts = Array.isArray(payload.userParts) && payload.userParts.length > 0
22
- ? payload.userParts
23
- : Array.isArray(chatInput?.parts) && chatInput.parts.length > 0
24
- ? chatInput.parts
25
- : [{ type: 'text', text: payload.prompt || '' }];
26
- const text = String(payload.prompt || parts.map(textFromPart).filter(Boolean).join('\n') || '').trim();
27
- return {
28
- text,
29
- parts,
30
- files: Array.isArray(chatInput?.files) ? chatInput.files : [],
31
- systemPrompt: payload.systemPrompt || chatInput?.agent?.systemPrompt || '',
32
- env: ports.env ?? {},
33
- };
34
- }
35
- // Resumed provider threads cannot change their system prompt without busting
36
- // the provider's prompt cache, so context freshness rides on the turn instead:
37
- // when the project context revision moved since this session last saw it, the
38
- // turn gets a compact update block prepended. Empty in the common case.
39
- function projectContextTurnUpdate(contract, ports) {
40
- if (!ports.projectContextTurnUpdate)
41
- return '';
42
- try {
43
- return ports.projectContextTurnUpdate(contract) || '';
44
- }
45
- catch (error) {
46
- const message = error instanceof Error ? error.message.split('\n')[0] : String(error);
47
- ports.onProjectContextError?.(message);
48
- return '';
49
- }
50
- }
51
- /** Engine `promptText(input, contract)` (`input.js:41-50`). */
52
- export function promptText(input, contract, ports = {}) {
53
- const chunks = [];
54
- const contextUpdate = projectContextTurnUpdate(contract, ports);
55
- if (contextUpdate)
56
- chunks.push(contextUpdate);
57
- if (input.files?.length) {
58
- chunks.push(`<files>\n${input.files.map((file) => JSON.stringify(file)).join('\n')}\n</files>`);
59
- }
60
- chunks.push(input.text || '');
61
- return chunks.filter(Boolean).join('\n\n');
62
- }
63
- /** Engine `openCodeParts(input, contract)` (`input.js:52-62`). */
64
- export function openCodeParts(input, contract, ports = {}) {
65
- const text = input.text || input.parts.map(textFromPart).filter(Boolean).join('\n');
66
- const out = [];
67
- const contextUpdate = projectContextTurnUpdate(contract, ports);
68
- if (contextUpdate)
69
- out.push({ type: 'text', text: contextUpdate });
70
- if (text)
71
- out.push({ type: 'text', text });
72
- for (const file of (input.files || [])) {
73
- if (file?.path)
74
- out.push({ type: 'file', path: file.path });
75
- }
76
- return out.length ? out : [{ type: 'text', text: '' }];
77
- }
78
- //# sourceMappingURL=input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"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AM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AACzD,CAAC"}
@@ -1,57 +0,0 @@
1
- /**
2
- * Model identity tables — engine `chat-core/contract.js:23-345`, ported
3
- * byte-exact. A model has four identities:
4
- *
5
- * - display id — what the UI sent (`payload.modelId`)
6
- * - canonical id — `canonicalModel()`: the billing identity
7
- * (`contract.modelId` / `usageModelId`)
8
- * - runtime-CLI id — `cliModelFor()`: what the harness CLI is launched with
9
- * (`contract.cliModel`)
10
- * - context profile — derived downstream from the canonical id
11
- *
12
- * The alias tables below are the frozen law: every row's spelling, order, and
13
- * precedence must match the engine exactly, because `runtimeKey` fingerprints
14
- * their outputs.
15
- */
16
- export declare const GATEWAY_PROVIDERS: readonly ["prime-intellect", "arcee-ai", "alibaba", "amazon", "anthropic", "bytedance", "cohere", "cursor", "deepseek", "google", "inception", "kwaipilot", "meituan", "meta", "minimax", "mistral", "moonshotai", "morph", "nvidia", "openai", "perplexity", "xiaomi", "xai", "zai"];
17
- export declare function gatewayModelId(raw: unknown): string;
18
- export declare const CURSOR_CLI_ALIASES: Readonly<Record<string, string>>;
19
- export declare const CURSOR_CANONICAL_MODEL_ALIASES: Readonly<Record<string, string>>;
20
- export declare function cursorCliAlias(cliModel: string): string;
21
- export declare function cursorAnthropicCliModel(model: string): string;
22
- export declare function cursorCliModelFor(raw: unknown): string;
23
- /**
24
- * Claude Code display-id -> canonical billing-id alias table
25
- * (`contract.js:171-240`). Keys are matched after `vercel/` strip +
26
- * lowercase.
27
- */
28
- export declare const CLAUDE_CODE_MODEL_ALIASES: Readonly<Record<string, string>>;
29
- /**
30
- * `canonicalModel(modelId, harness)` — engine `contract.js:164-258`.
31
- * Throw message ("modelId is required for <harness>") is byte-exact.
32
- */
33
- export declare function canonicalModel(modelId: unknown, harness: string): string;
34
- /**
35
- * Claude Code canonical/display -> CLI launch alias table
36
- * (`contract.js:264-284`). Looked up first by canonical id, then by the
37
- * lowercased raw input, else the raw input passes through.
38
- */
39
- export declare const CLAUDE_CODE_CLI_ALIASES: Readonly<Record<string, string>>;
40
- /**
41
- * OpenCode gateway providers (`contract.js:312-334`). NOTE: intentionally a
42
- * different list from `GATEWAY_PROVIDERS` — the engine's opencode branch omits
43
- * 'moonshotai', 'morph', and 'nvidia'. Byte-parity requires keeping both.
44
- */
45
- export declare const OPENCODE_GATEWAY_PROVIDERS: readonly ["prime-intellect", "arcee-ai", "alibaba", "amazon", "anthropic", "bytedance", "cohere", "cursor", "deepseek", "google", "inception", "kwaipilot", "meituan", "meta", "minimax", "mistral", "openai", "perplexity", "xiaomi", "xai", "zai"];
46
- export interface CliModelForArgs {
47
- harness: string;
48
- modelId?: unknown;
49
- cliModel?: unknown;
50
- reasoningEffort?: unknown;
51
- }
52
- /**
53
- * `cliModelFor({ harness, modelId, cliModel, reasoningEffort })` — engine
54
- * `contract.js:260-345`: the runtime-CLI identity for a model.
55
- */
56
- export declare function cliModelFor({ harness, modelId, cliModel, reasoningEffort }: CliModelForArgs): string;
57
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/contract/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,iBAAiB,uRAyBpB,CAAC;AAGX,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAQnD;AAED,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuB/D,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwB3E,CAAC;AAEF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA0B7D;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAgBtD;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqEtE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAyBxE;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAoBpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,sPAsB7B,CAAC;AAEX,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,eAAe,GAAG,MAAM,CAyCpG"}
@@ -1,380 +0,0 @@
1
- /**
2
- * Model identity tables — engine `chat-core/contract.js:23-345`, ported
3
- * byte-exact. A model has four identities:
4
- *
5
- * - display id — what the UI sent (`payload.modelId`)
6
- * - canonical id — `canonicalModel()`: the billing identity
7
- * (`contract.modelId` / `usageModelId`)
8
- * - runtime-CLI id — `cliModelFor()`: what the harness CLI is launched with
9
- * (`contract.cliModel`)
10
- * - context profile — derived downstream from the canonical id
11
- *
12
- * The alias tables below are the frozen law: every row's spelling, order, and
13
- * precedence must match the engine exactly, because `runtimeKey` fingerprints
14
- * their outputs.
15
- */
16
- // First-party providers on the Vercel AI Gateway (multi-word first so the
17
- // dash-separated legacy ids match longest-prefix).
18
- export const GATEWAY_PROVIDERS = [
19
- 'prime-intellect',
20
- 'arcee-ai',
21
- 'alibaba',
22
- 'amazon',
23
- 'anthropic',
24
- 'bytedance',
25
- 'cohere',
26
- 'cursor',
27
- 'deepseek',
28
- 'google',
29
- 'inception',
30
- 'kwaipilot',
31
- 'meituan',
32
- 'meta',
33
- 'minimax',
34
- 'mistral',
35
- 'moonshotai',
36
- 'morph',
37
- 'nvidia',
38
- 'openai',
39
- 'perplexity',
40
- 'xiaomi',
41
- 'xai',
42
- 'zai',
43
- ];
44
- // 'pi-anthropic-claude-sonnet-4.6' / 'vercel/anthropic/x' -> 'anthropic/claude-sonnet-4.6'
45
- export function gatewayModelId(raw) {
46
- const bare = String(raw || '').replace(/^pi-/, '').replace(/^vercel\//, '');
47
- if (bare.includes('/'))
48
- return bare;
49
- for (const provider of GATEWAY_PROVIDERS) {
50
- const prefix = `${provider}-`;
51
- if (bare.startsWith(prefix))
52
- return `${provider}/${bare.slice(prefix.length)}`;
53
- }
54
- return bare;
55
- }
56
- export const CURSOR_CLI_ALIASES = {
57
- 'composer-2': 'composer-2.5',
58
- 'composer-2-fast': 'composer-2.5-fast',
59
- 'claude-fable-5': 'claude-fable-5-high',
60
- 'claude-fable-5-thinking': 'claude-fable-5-thinking-high',
61
- 'claude-opus-4-8': 'claude-opus-4-8-high',
62
- 'claude-opus-4-8-thinking': 'claude-opus-4-8-thinking-high',
63
- 'claude-opus-4-7': 'claude-opus-4-7-xhigh',
64
- 'claude-opus-4-7-thinking': 'claude-opus-4-7-thinking-xhigh',
65
- 'claude-opus-4-6': 'claude-4.6-opus-high',
66
- 'claude-opus-4-6-thinking': 'claude-4.6-opus-high-thinking',
67
- 'claude-opus-4-5': 'claude-4.5-opus-high',
68
- 'claude-opus-4-5-thinking': 'claude-4.5-opus-high-thinking',
69
- 'claude-sonnet-5': 'claude-sonnet-5-high',
70
- 'claude-sonnet-5-thinking': 'claude-sonnet-5-thinking-high',
71
- 'claude-sonnet-4-6': 'claude-4.6-sonnet-medium',
72
- 'claude-sonnet-4-6-thinking': 'claude-4.6-sonnet-medium-thinking',
73
- 'gpt-5.5': 'gpt-5.5-medium',
74
- 'gpt-5.4': 'gpt-5.4-medium',
75
- 'gpt-5.4-mini': 'gpt-5.4-mini-medium',
76
- 'gpt-5.4-nano': 'gpt-5.4-nano-medium',
77
- 'grok-4.5': 'grok-4.5-xhigh',
78
- 'glm-5.2': 'glm-5.2-high',
79
- };
80
- export const CURSOR_CANONICAL_MODEL_ALIASES = {
81
- 'cursor/composer-2': 'cursor/composer-2.5',
82
- 'cursor/composer-2-fast': 'cursor/composer-2.5-fast',
83
- 'anthropic/claude-fable-5': 'anthropic/claude-fable-5-high',
84
- 'anthropic/claude-fable-5-thinking': 'anthropic/claude-fable-5-thinking-high',
85
- 'anthropic/claude-opus-4.8': 'anthropic/claude-opus-4.8-high',
86
- 'anthropic/claude-opus-4.8-thinking': 'anthropic/claude-opus-4.8-thinking-high',
87
- 'anthropic/claude-opus-4.7': 'anthropic/claude-opus-4.7-xhigh',
88
- 'anthropic/claude-opus-4.7-thinking': 'anthropic/claude-opus-4.7-thinking-xhigh',
89
- 'anthropic/claude-opus-4.6': 'anthropic/claude-opus-4.6-high',
90
- 'anthropic/claude-opus-4.6-thinking': 'anthropic/claude-opus-4.6-high-thinking',
91
- 'anthropic/claude-opus-4.5': 'anthropic/claude-opus-4.5-high',
92
- 'anthropic/claude-opus-4.5-thinking': 'anthropic/claude-opus-4.5-high-thinking',
93
- 'anthropic/claude-sonnet-5': 'anthropic/claude-sonnet-5-high',
94
- 'anthropic/claude-sonnet-5-thinking': 'anthropic/claude-sonnet-5-thinking-high',
95
- 'anthropic/claude-sonnet-4.6': 'anthropic/claude-sonnet-4.6-medium',
96
- 'anthropic/claude-sonnet-4.6-thinking': 'anthropic/claude-sonnet-4.6-medium-thinking',
97
- 'openai/gpt-5.5': 'openai/gpt-5.5-medium',
98
- 'openai/gpt-5.4': 'openai/gpt-5.4-medium',
99
- 'openai/gpt-5.4-mini': 'openai/gpt-5.4-mini-medium',
100
- 'openai/gpt-5.4-nano': 'openai/gpt-5.4-nano-medium',
101
- 'google/gemini-3.1-pro-preview': 'google/gemini-3.1-pro',
102
- 'xai/grok-4.5': 'xai/grok-4.5-xhigh',
103
- 'zai/glm-5.2': 'zai/glm-5.2-high',
104
- };
105
- export function cursorCliAlias(cliModel) {
106
- return CURSOR_CLI_ALIASES[cliModel] || cliModel;
107
- }
108
- export function cursorAnthropicCliModel(model) {
109
- const versioned = model.match(/^claude-(opus|sonnet)-(4(?:\.\d+)?)(?:-(.+))?$/);
110
- if (!versioned) {
111
- return model.replace(/-(\d+)\.(\d+)(?=$|-)/, '-$1-$2');
112
- }
113
- const [, family, version, rawSuffix] = versioned;
114
- const suffix = rawSuffix || '';
115
- if (family === 'sonnet' && version === '4.6') {
116
- if (!suffix)
117
- return 'claude-4.6-sonnet-medium';
118
- if (suffix === 'thinking')
119
- return 'claude-4.6-sonnet-medium-thinking';
120
- return `claude-4.6-sonnet-${suffix}`;
121
- }
122
- if (family === 'sonnet' && (version === '4.5' || version === '4')) {
123
- return `claude-${version}-sonnet${suffix ? `-${suffix}` : ''}`;
124
- }
125
- if (family === 'opus' && version === '4.6') {
126
- if (!suffix)
127
- return 'claude-4.6-opus-high';
128
- if (suffix === 'thinking')
129
- return 'claude-4.6-opus-high-thinking';
130
- return `claude-4.6-opus-${suffix}`;
131
- }
132
- if (family === 'opus' && version === '4.5') {
133
- if (!suffix)
134
- return 'claude-4.5-opus-high';
135
- if (suffix === 'thinking')
136
- return 'claude-4.5-opus-high-thinking';
137
- return `claude-4.5-opus-${suffix}`;
138
- }
139
- return model.replace(/-(\d+)\.(\d+)(?=$|-)/, '-$1-$2');
140
- }
141
- export function cursorCliModelFor(raw) {
142
- const clean = String(raw || '').trim().replace(/^vercel\//i, '').toLowerCase();
143
- const canonical = CURSOR_CANONICAL_MODEL_ALIASES[clean] || clean;
144
- if (canonical.startsWith('cursor/'))
145
- return cursorCliAlias(canonical.slice('cursor/'.length));
146
- if (canonical.startsWith('cursor-'))
147
- return cursorCliAlias(canonical.slice('cursor-'.length));
148
- if (canonical.startsWith('openai/'))
149
- return canonical.slice('openai/'.length);
150
- if (canonical.startsWith('google/'))
151
- return canonical.slice('google/'.length);
152
- if (canonical.startsWith('moonshotai/'))
153
- return canonical.slice('moonshotai/'.length);
154
- if (canonical.startsWith('zai/'))
155
- return canonical.slice('zai/'.length);
156
- if (canonical.startsWith('xai/')) {
157
- return canonical.slice('xai/'.length).replace(/^grok-4\.20/, 'grok-4-20');
158
- }
159
- if (canonical.startsWith('anthropic/')) {
160
- return cursorAnthropicCliModel(canonical.slice('anthropic/'.length));
161
- }
162
- return cursorCliAlias(canonical);
163
- }
164
- /**
165
- * Claude Code display-id -> canonical billing-id alias table
166
- * (`contract.js:171-240`). Keys are matched after `vercel/` strip +
167
- * lowercase.
168
- */
169
- export const CLAUDE_CODE_MODEL_ALIASES = {
170
- 'haiku': 'anthropic/claude-haiku-4.5',
171
- 'sonnet': 'anthropic/claude-sonnet-4.6',
172
- 'sonnet[1m]': 'anthropic/claude-sonnet-4.6',
173
- 'opus': 'anthropic/claude-opus-4.8',
174
- 'opus1m': 'anthropic/claude-opus-4.8-1m',
175
- 'opus[1m]': 'anthropic/claude-opus-4.8-1m',
176
- 'fable': 'anthropic/claude-fable-5',
177
- 'claude-code-haiku': 'anthropic/claude-haiku-4.5',
178
- 'claude-code-sonnet': 'anthropic/claude-sonnet-4.6',
179
- 'claude-code-sonnet-45': 'anthropic/claude-sonnet-4.6',
180
- 'claude-code-fable': 'anthropic/claude-fable-5',
181
- 'claude-code-fable-5': 'anthropic/claude-fable-5',
182
- 'claude-code-opus': 'anthropic/claude-opus-4.8',
183
- 'claude-code-opus-45': 'anthropic/claude-opus-4.8',
184
- 'claude-code-opus-46': 'anthropic/claude-opus-4.8',
185
- 'claude-code-opus-47': 'anthropic/claude-opus-4.8',
186
- 'claude-code-opus-48': 'anthropic/claude-opus-4.8',
187
- 'claude-code-opus-4.5': 'anthropic/claude-opus-4.8',
188
- 'claude-code-opus-4-5': 'anthropic/claude-opus-4.8',
189
- 'claude-code-opus-4.6': 'anthropic/claude-opus-4.8',
190
- 'claude-code-opus-4-6': 'anthropic/claude-opus-4.8',
191
- 'claude-code-opus-4.7': 'anthropic/claude-opus-4.8',
192
- 'claude-code-opus-4-7': 'anthropic/claude-opus-4.8',
193
- 'claude-code-opus-4.8': 'anthropic/claude-opus-4.8',
194
- 'claude-code-opus-4-8': 'anthropic/claude-opus-4.8',
195
- 'claude-code-opus1m': 'anthropic/claude-opus-4.8-1m',
196
- 'claude-code-opus-1m': 'anthropic/claude-opus-4.8-1m',
197
- 'claude-code-opus-4.8-1m': 'anthropic/claude-opus-4.8-1m',
198
- 'claude-code-opus-4-8-1m': 'anthropic/claude-opus-4.8-1m',
199
- 'claude-code-opus-4.7-1m': 'anthropic/claude-opus-4.8-1m',
200
- 'claude-code-opus-4-7-1m': 'anthropic/claude-opus-4.8-1m',
201
- 'claude-code-sonnet-4.5': 'anthropic/claude-sonnet-4.6',
202
- 'claude-code-sonnet-4-5': 'anthropic/claude-sonnet-4.6',
203
- 'claude-code-sonnet-4.6': 'anthropic/claude-sonnet-4.6',
204
- 'claude-code-sonnet-4-6': 'anthropic/claude-sonnet-4.6',
205
- 'claude-code-haiku-4.5': 'anthropic/claude-haiku-4.5',
206
- 'claude-code-haiku-4-5': 'anthropic/claude-haiku-4.5',
207
- 'claude-haiku-4-5': 'anthropic/claude-haiku-4.5',
208
- 'claude-fable-5': 'anthropic/claude-fable-5',
209
- 'claude-sonnet-4-5': 'anthropic/claude-sonnet-4.6',
210
- 'claude-sonnet-4-6': 'anthropic/claude-sonnet-4.6',
211
- 'claude-opus-4-5': 'anthropic/claude-opus-4.8',
212
- 'claude-opus-4-6': 'anthropic/claude-opus-4.8',
213
- 'claude-opus-4-7': 'anthropic/claude-opus-4.8',
214
- 'claude-opus-4-8': 'anthropic/claude-opus-4.8',
215
- 'claude-opus-4-8-1m': 'anthropic/claude-opus-4.8-1m',
216
- 'claude-opus-4.8-1m': 'anthropic/claude-opus-4.8-1m',
217
- 'claude-opus-4-7-1m': 'anthropic/claude-opus-4.8-1m',
218
- 'claude-opus-4.7-1m': 'anthropic/claude-opus-4.8-1m',
219
- 'anthropic/claude-haiku-4-5': 'anthropic/claude-haiku-4.5',
220
- 'anthropic/claude-haiku-4.5': 'anthropic/claude-haiku-4.5',
221
- 'anthropic/claude-fable-5': 'anthropic/claude-fable-5',
222
- 'anthropic/claude-sonnet-4-5': 'anthropic/claude-sonnet-4.6',
223
- 'anthropic/claude-sonnet-4-6': 'anthropic/claude-sonnet-4.6',
224
- 'anthropic/claude-sonnet-4.5': 'anthropic/claude-sonnet-4.6',
225
- 'anthropic/claude-sonnet-4.6': 'anthropic/claude-sonnet-4.6',
226
- 'anthropic/claude-opus-4-5': 'anthropic/claude-opus-4.8',
227
- 'anthropic/claude-opus-4-6': 'anthropic/claude-opus-4.8',
228
- 'anthropic/claude-opus-4-7': 'anthropic/claude-opus-4.8',
229
- 'anthropic/claude-opus-4-8': 'anthropic/claude-opus-4.8',
230
- 'anthropic/claude-opus-4-8-1m': 'anthropic/claude-opus-4.8-1m',
231
- 'anthropic/claude-opus-4-7-1m': 'anthropic/claude-opus-4.8-1m',
232
- 'anthropic/claude-opus-4.5': 'anthropic/claude-opus-4.8',
233
- 'anthropic/claude-opus-4.6': 'anthropic/claude-opus-4.8',
234
- 'anthropic/claude-opus-4.7': 'anthropic/claude-opus-4.8',
235
- 'anthropic/claude-opus-4.8': 'anthropic/claude-opus-4.8',
236
- 'anthropic/claude-opus-4.8-1m': 'anthropic/claude-opus-4.8-1m',
237
- 'anthropic/claude-opus-4.7-1m': 'anthropic/claude-opus-4.8-1m',
238
- };
239
- /**
240
- * `canonicalModel(modelId, harness)` — engine `contract.js:164-258`.
241
- * Throw message ("modelId is required for <harness>") is byte-exact.
242
- */
243
- export function canonicalModel(modelId, harness) {
244
- const raw = String(modelId || '').trim();
245
- if (!raw) {
246
- throw new Error(`modelId is required for ${harness}`);
247
- }
248
- if (harness === 'claude_code') {
249
- const cleaned = raw.replace(/^vercel\//i, '').toLowerCase();
250
- const aliased = CLAUDE_CODE_MODEL_ALIASES[cleaned];
251
- if (aliased)
252
- return aliased;
253
- if (cleaned.startsWith('anthropic/'))
254
- return cleaned.replace(/-(\d+)-(\d+)(?=$|-)/, '-$1.$2');
255
- if (cleaned.startsWith('claude-')) {
256
- return `anthropic/${cleaned.replace(/-(\d+)-(\d+)(?=$|-)/, '-$1.$2')}`;
257
- }
258
- return raw;
259
- }
260
- // Cursor is provider_auth-only and reports no usage, so the model id is a
261
- // display/runtime identity, not a billing identity; keep it as sent.
262
- if (harness === 'cursor')
263
- return raw;
264
- // Pi bills against the gateway model identity ('anthropic/claude-sonnet-4.6').
265
- if (harness === 'pi')
266
- return gatewayModelId(raw);
267
- if (raw.startsWith('opencode-openai-'))
268
- return `openai/${raw.slice('opencode-openai-'.length)}`;
269
- if (raw.startsWith('codex-openai-'))
270
- return `openai/${raw.slice('codex-openai-'.length)}`;
271
- if (raw.startsWith('claude-'))
272
- return `anthropic/${raw}`;
273
- if (/^gpt-|^o\d|^o-/i.test(raw))
274
- return `openai/${raw}`;
275
- return raw;
276
- }
277
- /**
278
- * Claude Code canonical/display -> CLI launch alias table
279
- * (`contract.js:264-284`). Looked up first by canonical id, then by the
280
- * lowercased raw input, else the raw input passes through.
281
- */
282
- export const CLAUDE_CODE_CLI_ALIASES = {
283
- 'anthropic/claude-haiku-4.5': 'haiku',
284
- 'anthropic/claude-sonnet-5': 'sonnet',
285
- 'anthropic/claude-sonnet-4.6': 'sonnet',
286
- 'anthropic/claude-opus-4.8': 'opus',
287
- 'anthropic/claude-opus-4.8-1m': 'opus[1m]',
288
- 'anthropic/claude-opus-4.7': 'opus',
289
- 'anthropic/claude-opus-4.7-1m': 'opus[1m]',
290
- 'anthropic/claude-fable-5': 'claude-fable-5',
291
- 'haiku': 'haiku',
292
- 'sonnet': 'sonnet',
293
- 'sonnet-5': 'sonnet',
294
- 'claude-sonnet-5': 'sonnet',
295
- 'opus': 'opus',
296
- 'opus1m': 'opus[1m]',
297
- 'opus[1m]': 'opus[1m]',
298
- 'fable': 'claude-fable-5',
299
- 'claude-code-fable': 'claude-fable-5',
300
- 'claude-code-fable-5': 'claude-fable-5',
301
- 'claude-fable-5': 'claude-fable-5',
302
- };
303
- /**
304
- * OpenCode gateway providers (`contract.js:312-334`). NOTE: intentionally a
305
- * different list from `GATEWAY_PROVIDERS` — the engine's opencode branch omits
306
- * 'moonshotai', 'morph', and 'nvidia'. Byte-parity requires keeping both.
307
- */
308
- export const OPENCODE_GATEWAY_PROVIDERS = [
309
- 'prime-intellect',
310
- 'arcee-ai',
311
- 'alibaba',
312
- 'amazon',
313
- 'anthropic',
314
- 'bytedance',
315
- 'cohere',
316
- 'cursor',
317
- 'deepseek',
318
- 'google',
319
- 'inception',
320
- 'kwaipilot',
321
- 'meituan',
322
- 'meta',
323
- 'minimax',
324
- 'mistral',
325
- 'openai',
326
- 'perplexity',
327
- 'xiaomi',
328
- 'xai',
329
- 'zai',
330
- ];
331
- /**
332
- * `cliModelFor({ harness, modelId, cliModel, reasoningEffort })` — engine
333
- * `contract.js:260-345`: the runtime-CLI identity for a model.
334
- */
335
- export function cliModelFor({ harness, modelId, cliModel, reasoningEffort }) {
336
- const clean = String(cliModel || modelId || '').trim();
337
- if (harness === 'claude_code') {
338
- const canonical = canonicalModel(clean, harness);
339
- return CLAUDE_CODE_CLI_ALIASES[canonical] || CLAUDE_CODE_CLI_ALIASES[clean.toLowerCase()] || clean;
340
- }
341
- if (harness === 'codex') {
342
- let base = clean.replace(/^openai\//, '');
343
- let effort = reasoningEffort;
344
- const slashEffort = base.match(/\/(low|medium|high|xhigh|max|ultra)$/i);
345
- if (slashEffort) {
346
- effort ||= slashEffort[1].toLowerCase();
347
- base = base.slice(0, -slashEffort[0].length);
348
- }
349
- const thinkingEffort = base.match(/-thinking-(low|medium|high|xhigh|max|ultra)$/i);
350
- if (!cliModel && thinkingEffort) {
351
- effort ||= thinkingEffort[1].toLowerCase();
352
- base = base.slice(0, -thinkingEffort[0].length);
353
- }
354
- return effort ? `${base}/${effort}` : base;
355
- }
356
- if (harness === 'cursor') {
357
- // The adapter matches this against cursor-agent's ACP availableModels.
358
- return cursorCliModelFor(clean);
359
- }
360
- if (harness === 'pi') {
361
- // Pi's vercel-ai-gateway provider takes bare '<provider>/<model>' ids.
362
- return gatewayModelId(clean);
363
- }
364
- if (harness === 'opencode') {
365
- const bare = clean.replace(/^opencode-/, '');
366
- if (bare.startsWith('vercel/'))
367
- return bare;
368
- const slashProvider = bare.split('/')[0];
369
- if (OPENCODE_GATEWAY_PROVIDERS.includes(slashProvider))
370
- return `vercel/${bare}`;
371
- for (const provider of OPENCODE_GATEWAY_PROVIDERS) {
372
- const prefix = `${provider}-`;
373
- if (bare.startsWith(prefix))
374
- return `vercel/${provider}/${bare.slice(prefix.length)}`;
375
- }
376
- return bare;
377
- }
378
- return clean;
379
- }
380
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/contract/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,0EAA0E;AAC1E,mDAAmD;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iBAAiB;IACjB,UAAU;IACV,SAAS;IACT,QAAQ;IACR,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,WAAW;IACX,WAAW;IACX,SAAS;IACT,MAAM;IACN,SAAS;IACT,SAAS;IACT,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,KAAK;IACL,KAAK;CACG,CAAC;AAEX,2FAA2F;AAC3F,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,OAAO,CA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