@code-yeongyu/senpi 2026.9.21-2 → 2026.9.22-2

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 (379) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/bundle/chunks/{anthropic-messages-C3ZY2ANT.js → anthropic-messages-2P7APOOQ.js} +1 -1
  3. package/dist/bundle/chunks/{app-server-command-HSX5RFAP.js → app-server-command-PRNA6QQU.js} +1 -1
  4. package/dist/bundle/chunks/{azure-openai-responses-7TAGS2VU.js → azure-openai-responses-3AH7MJWF.js} +1 -1
  5. package/dist/bundle/chunks/{bun-extension-importer-UO7V2MZ7.js → bun-extension-importer-H4IJCWWQ.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-OSDJ2SYO.js → chunk-5XC2FNJ5.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-D5CL7PPD.js → chunk-64JQFFHH.js} +2 -2
  8. package/dist/bundle/chunks/{chunk-Z3KQB2R3.js → chunk-6OD4TT33.js} +95 -39
  9. package/dist/bundle/chunks/{chunk-NEEAKXDT.js → chunk-7EH64T6E.js} +2 -2
  10. package/dist/bundle/chunks/{chunk-MIVOQT3Q.js → chunk-ARJJU3MS.js} +1 -1
  11. package/dist/bundle/chunks/chunk-BOZ37BOT.js +14 -0
  12. package/dist/bundle/chunks/{chunk-POMPEGWQ.js → chunk-F3DXL5MX.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-GLKVDRNP.js → chunk-GXUYWMN2.js} +1 -1
  14. package/dist/bundle/chunks/chunk-HH3KJDWA.js +2 -0
  15. package/dist/bundle/chunks/{chunk-B7W62BM7.js → chunk-IPRJIKLL.js} +1 -1
  16. package/dist/bundle/chunks/chunk-JEFYJDHP.js +8 -0
  17. package/dist/bundle/chunks/{chunk-T6XA2IZR.js → chunk-JR4X6ECO.js} +1 -1
  18. package/dist/bundle/chunks/{chunk-I425CMTO.js → chunk-JZ6YQU3A.js} +4 -4
  19. package/dist/bundle/chunks/{chunk-KNM6SRPE.js → chunk-K3HEWWSS.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-M2XAY6I7.js → chunk-M2HSO7MH.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-UYVPLEOL.js → chunk-NK2RNX25.js} +1 -1
  22. package/dist/bundle/chunks/chunk-NMB4C6ZZ.js +2 -0
  23. package/dist/bundle/chunks/{chunk-VEO3ABZR.js → chunk-OLJ7LQJY.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-GVI2HP7N.js → chunk-OPNVT7BU.js} +1 -1
  25. package/dist/bundle/chunks/{chunk-XHMOFY4T.js → chunk-R6LVC7SP.js} +4 -4
  26. package/dist/bundle/chunks/{chunk-3SLCHXZO.js → chunk-UCPWK6TZ.js} +2 -2
  27. package/dist/bundle/chunks/{chunk-B2IM56LB.js → chunk-VYIJQQ5I.js} +1 -1
  28. package/dist/bundle/chunks/{chunk-47GF6XYZ.js → chunk-YT2ZSZOY.js} +1 -1
  29. package/dist/bundle/chunks/{cli-main-GQTEEZ2V.js → cli-main-AFJNXUSL.js} +1 -1
  30. package/dist/bundle/chunks/github-copilot.js +1 -1
  31. package/dist/bundle/chunks/{google-generative-ai-JWIH75VF.js → google-generative-ai-Y2IYMUVC.js} +1 -1
  32. package/dist/bundle/chunks/{google-vertex-IRGAY5XR.js → google-vertex-TKBBMPHV.js} +1 -1
  33. package/dist/bundle/chunks/{host-command-KOEKIHIZ.js → host-command-OVA6GEWC.js} +1 -1
  34. package/dist/bundle/chunks/host-lifecycle-IDQPLYEA.js +3 -0
  35. package/dist/bundle/chunks/host-lifecycle.js +10 -6
  36. package/dist/bundle/chunks/{interactive-host-runtime-2KTFEW7O.js → interactive-host-runtime-F5L4USLR.js} +1 -1
  37. package/dist/bundle/chunks/{interactive-mode-I3ILWXQB.js → interactive-mode-UFBSCOP7.js} +1 -1
  38. package/dist/bundle/chunks/kimi-coding.js +2 -2
  39. package/dist/bundle/chunks/{list-tips-2KX65NWZ.js → list-tips-2QG7ASHS.js} +1 -1
  40. package/dist/bundle/chunks/{mistral-conversations-VOBYATVJ.js → mistral-conversations-ZYDVFRYF.js} +1 -1
  41. package/dist/bundle/chunks/multi-session-host-EUTEGVLS.js +21 -0
  42. package/dist/bundle/chunks/openai-codex-responses-MEIUNROM.js +10 -0
  43. package/dist/bundle/chunks/{openai-completions-YK6QTYOH.js → openai-completions-4V76L5ZJ.js} +1 -1
  44. package/dist/bundle/chunks/openai-responses-YR7WRBG3.js +2 -0
  45. package/dist/bundle/chunks/{package-manager-cli-HOL6CAI6.js → package-manager-cli-JPUWMUEJ.js} +1 -1
  46. package/dist/bundle/chunks/rotation-stream-S56Y7WMM.js +2 -0
  47. package/dist/bundle/chunks/{rpc-mode-L3DSGTVM.js → rpc-mode-JDVHUBZY.js} +1 -1
  48. package/dist/bundle/chunks/{session-picker-L3FYEQBL.js → session-picker-PFPJVVIC.js} +1 -1
  49. package/dist/bundle/chunks/session-worker.js +225 -164
  50. package/dist/bundle/cli.js +1 -1
  51. package/dist/bundle/index.js +1 -1
  52. package/dist/bundle/rpc-entry.js +1 -1
  53. package/dist/core/agent-session.d.ts +6 -4
  54. package/dist/core/agent-session.d.ts.map +1 -1
  55. package/dist/core/agent-session.js +9 -7
  56. package/dist/core/agent-session.js.map +1 -1
  57. package/dist/core/credential-pool/classify.d.ts.map +1 -1
  58. package/dist/core/credential-pool/classify.js +12 -0
  59. package/dist/core/credential-pool/classify.js.map +1 -1
  60. package/dist/core/credential-pool/failover.d.ts +37 -5
  61. package/dist/core/credential-pool/failover.d.ts.map +1 -1
  62. package/dist/core/credential-pool/failover.js +60 -24
  63. package/dist/core/credential-pool/failover.js.map +1 -1
  64. package/dist/core/credential-pool/rotation-events.d.ts +5 -0
  65. package/dist/core/credential-pool/rotation-events.d.ts.map +1 -0
  66. package/dist/core/credential-pool/rotation-events.js +25 -0
  67. package/dist/core/credential-pool/rotation-events.js.map +1 -0
  68. package/dist/core/credential-pool/rotation-stream.d.ts +4 -3
  69. package/dist/core/credential-pool/rotation-stream.d.ts.map +1 -1
  70. package/dist/core/credential-pool/rotation-stream.js +8 -11
  71. package/dist/core/credential-pool/rotation-stream.js.map +1 -1
  72. package/dist/core/extensions/builtin/ask-user/schema.d.ts +2 -25
  73. package/dist/core/extensions/builtin/ask-user/schema.d.ts.map +1 -1
  74. package/dist/core/extensions/builtin/ask-user/schema.js.map +1 -1
  75. package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.d.ts +7 -0
  76. package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.d.ts.map +1 -0
  77. package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.js +7 -0
  78. package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.js.map +1 -0
  79. package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts.map +1 -1
  80. package/dist/core/extensions/builtin/claude-sdk-oauth/index.js +3 -2
  81. package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +1 -1
  82. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +22 -1
  83. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -1
  84. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +2 -0
  85. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -1
  86. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +4 -0
  87. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -1
  88. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -1
  89. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +18 -1
  90. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -1
  91. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts.map +1 -1
  92. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js +18 -0
  93. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js.map +1 -1
  94. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +2 -7
  95. package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
  96. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +2 -8
  97. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
  98. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +1 -1
  99. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
  100. package/dist/core/extensions/builtin/mcp/expose/naming.d.ts +0 -1
  101. package/dist/core/extensions/builtin/mcp/expose/naming.d.ts.map +1 -1
  102. package/dist/core/extensions/builtin/mcp/expose/naming.js +0 -3
  103. package/dist/core/extensions/builtin/mcp/expose/naming.js.map +1 -1
  104. package/dist/core/extensions/builtin/mcp/expose/register.d.ts +1 -2
  105. package/dist/core/extensions/builtin/mcp/expose/register.d.ts.map +1 -1
  106. package/dist/core/extensions/builtin/mcp/expose/register.js +0 -21
  107. package/dist/core/extensions/builtin/mcp/expose/register.js.map +1 -1
  108. package/dist/core/extensions/builtin/mcp/expose/schema-compat.d.ts +2 -2
  109. package/dist/core/extensions/builtin/mcp/expose/schema-compat.d.ts.map +1 -1
  110. package/dist/core/extensions/builtin/mcp/expose/schema-compat.js +2 -2
  111. package/dist/core/extensions/builtin/mcp/expose/schema-compat.js.map +1 -1
  112. package/dist/core/extensions/builtin/prompt-preset/file-operations.js +1 -1
  113. package/dist/core/extensions/builtin/prompt-preset/file-operations.js.map +1 -1
  114. package/dist/core/extensions/builtin/prompt-preset/grok-4.7.d.ts +3 -0
  115. package/dist/core/extensions/builtin/prompt-preset/grok-4.7.d.ts.map +1 -0
  116. package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js +105 -0
  117. package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js.map +1 -0
  118. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  119. package/dist/core/extensions/builtin/prompt-preset/presets.js +14 -0
  120. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  121. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
  122. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  123. package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
  124. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  125. package/dist/core/extensions/bun-extension-importer.d.ts +1 -0
  126. package/dist/core/extensions/bun-extension-importer.d.ts.map +1 -1
  127. package/dist/core/extensions/bun-extension-importer.js +4 -0
  128. package/dist/core/extensions/bun-extension-importer.js.map +1 -1
  129. package/dist/core/extensions/extension-module-cache.d.ts +48 -0
  130. package/dist/core/extensions/extension-module-cache.d.ts.map +1 -0
  131. package/dist/core/extensions/extension-module-cache.js +111 -0
  132. package/dist/core/extensions/extension-module-cache.js.map +1 -0
  133. package/dist/core/extensions/loader.d.ts +1 -1
  134. package/dist/core/extensions/loader.d.ts.map +1 -1
  135. package/dist/core/extensions/loader.js +14 -56
  136. package/dist/core/extensions/loader.js.map +1 -1
  137. package/dist/core/http-dispatcher.d.ts +29 -0
  138. package/dist/core/http-dispatcher.d.ts.map +1 -1
  139. package/dist/core/http-dispatcher.js +30 -3
  140. package/dist/core/http-dispatcher.js.map +1 -1
  141. package/dist/core/model-resolver.js +1 -1
  142. package/dist/core/model-resolver.js.map +1 -1
  143. package/dist/core/retry-fallback/billing.d.ts.map +1 -1
  144. package/dist/core/retry-fallback/billing.js +20 -1
  145. package/dist/core/retry-fallback/billing.js.map +1 -1
  146. package/dist/core/session-manager.d.ts +3 -1
  147. package/dist/core/session-manager.d.ts.map +1 -1
  148. package/dist/core/session-manager.js +12 -6
  149. package/dist/core/session-manager.js.map +1 -1
  150. package/dist/modes/interactive/components/assistant-render-descriptors.d.ts.map +1 -1
  151. package/dist/modes/interactive/components/assistant-render-descriptors.js +8 -7
  152. package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
  153. package/dist/modes/print-mode.d.ts.map +1 -1
  154. package/dist/modes/print-mode.js +7 -5
  155. package/dist/modes/print-mode.js.map +1 -1
  156. package/dist/modes/rpc/custom-capability.d.ts +7 -0
  157. package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
  158. package/dist/modes/rpc/custom-capability.js +7 -0
  159. package/dist/modes/rpc/custom-capability.js.map +1 -1
  160. package/dist/modes/rpc/handoff-activity.d.ts +4 -0
  161. package/dist/modes/rpc/handoff-activity.d.ts.map +1 -0
  162. package/dist/modes/rpc/handoff-activity.js +6 -0
  163. package/dist/modes/rpc/handoff-activity.js.map +1 -0
  164. package/dist/modes/rpc/host-child-exit.d.ts +19 -0
  165. package/dist/modes/rpc/host-child-exit.d.ts.map +1 -0
  166. package/dist/modes/rpc/host-child-exit.js +35 -0
  167. package/dist/modes/rpc/host-child-exit.js.map +1 -0
  168. package/dist/modes/rpc/host-crash-record.d.ts +24 -0
  169. package/dist/modes/rpc/host-crash-record.d.ts.map +1 -0
  170. package/dist/modes/rpc/host-crash-record.js +75 -0
  171. package/dist/modes/rpc/host-crash-record.js.map +1 -0
  172. package/dist/modes/rpc/host-crash-record.test.d.ts +2 -0
  173. package/dist/modes/rpc/host-crash-record.test.d.ts.map +1 -0
  174. package/dist/modes/rpc/host-crash-record.test.js +91 -0
  175. package/dist/modes/rpc/host-crash-record.test.js.map +1 -0
  176. package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
  177. package/dist/modes/rpc/host-ensure.js +60 -17
  178. package/dist/modes/rpc/host-ensure.js.map +1 -1
  179. package/dist/modes/rpc/host-lifecycle.d.ts +4 -10
  180. package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
  181. package/dist/modes/rpc/host-lifecycle.js +83 -51
  182. package/dist/modes/rpc/host-lifecycle.js.map +1 -1
  183. package/dist/modes/rpc/host-supersession.d.ts +13 -2
  184. package/dist/modes/rpc/host-supersession.d.ts.map +1 -1
  185. package/dist/modes/rpc/host-supersession.js +40 -7
  186. package/dist/modes/rpc/host-supersession.js.map +1 -1
  187. package/dist/modes/rpc/multi-session-host.d.ts +1 -0
  188. package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
  189. package/dist/modes/rpc/multi-session-host.js +40 -7
  190. package/dist/modes/rpc/multi-session-host.js.map +1 -1
  191. package/dist/modes/rpc/observer-link.d.ts +48 -0
  192. package/dist/modes/rpc/observer-link.d.ts.map +1 -0
  193. package/dist/modes/rpc/observer-link.js +56 -0
  194. package/dist/modes/rpc/observer-link.js.map +1 -0
  195. package/dist/modes/rpc/rpc-mode.d.ts +12 -2
  196. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  197. package/dist/modes/rpc/rpc-mode.js +12 -2
  198. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  199. package/dist/modes/rpc/rpc-types.d.ts +36 -1
  200. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  201. package/dist/modes/rpc/rpc-types.js +8 -0
  202. package/dist/modes/rpc/rpc-types.js.map +1 -1
  203. package/dist/modes/rpc/session-command-router.d.ts +10 -4
  204. package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
  205. package/dist/modes/rpc/session-command-router.js +95 -19
  206. package/dist/modes/rpc/session-command-router.js.map +1 -1
  207. package/dist/modes/rpc/session-event-writer.d.ts +5 -3
  208. package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
  209. package/dist/modes/rpc/session-event-writer.js +21 -2
  210. package/dist/modes/rpc/session-event-writer.js.map +1 -1
  211. package/dist/modes/rpc/session-registry.d.ts +6 -1
  212. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  213. package/dist/modes/rpc/session-registry.js +34 -3
  214. package/dist/modes/rpc/session-registry.js.map +1 -1
  215. package/dist/modes/rpc/session-worker-client.d.ts +1 -0
  216. package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
  217. package/dist/modes/rpc/session-worker-client.js +3 -0
  218. package/dist/modes/rpc/session-worker-client.js.map +1 -1
  219. package/dist/modes/rpc/session-worker-protocol.d.ts +3 -1
  220. package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
  221. package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
  222. package/dist/modes/rpc/session-worker.js +7 -1
  223. package/dist/modes/rpc/session-worker.js.map +1 -1
  224. package/dist/modes/rpc/socket-ownership.d.ts +16 -0
  225. package/dist/modes/rpc/socket-ownership.d.ts.map +1 -1
  226. package/dist/modes/rpc/socket-ownership.js +28 -4
  227. package/dist/modes/rpc/socket-ownership.js.map +1 -1
  228. package/dist/modes/rpc/worker-session-registry.d.ts +12 -5
  229. package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
  230. package/dist/modes/rpc/worker-session-registry.js +10 -2
  231. package/dist/modes/rpc/worker-session-registry.js.map +1 -1
  232. package/docs/providers.md +9 -1
  233. package/docs/rpc.md +72 -10
  234. package/docs/settings.md +1 -1
  235. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +29 -0
  236. package/node_modules/@code-yeongyu/senpi-codemode/README.md +51 -13
  237. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  238. package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/agent-bridge.ts +53 -9
  239. package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/reserved-dispatch.ts +1 -0
  240. package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +18 -0
  241. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status.ts +9 -4
  242. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +6 -0
  243. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/AGENTS.md +2 -2
  244. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/jl/prelude.jl +10 -0
  245. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/context-manager.ts +18 -6
  246. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/kernel-contract.ts +2 -6
  247. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/prelude.ts +1 -1
  248. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/run-queue.ts +17 -7
  249. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +6 -1
  250. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel-contract.ts +2 -5
  251. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel.ts +37 -5
  252. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +11 -2
  253. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/rb/prelude.rb +6 -0
  254. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-contract.ts +2 -5
  255. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-kernel.ts +14 -4
  256. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-queue.ts +18 -5
  257. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt-template.ts +3 -2
  258. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +4 -1
  259. package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/idle-timeout.ts +9 -2
  260. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/AGENTS.md +2 -0
  261. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +19 -2
  262. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +11 -3
  263. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-contract.ts +6 -1
  264. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +72 -20
  265. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +28 -4
  266. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-state.ts +5 -4
  267. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-status.ts +5 -2
  268. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-eval-result.ts +76 -25
  269. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-execution-event.ts +4 -0
  270. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-kernel-reset-refused-error.ts +12 -0
  271. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-request.ts +2 -1
  272. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +3 -1
  273. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +58 -37
  274. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/managed-cell.ts +15 -8
  275. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +32 -8
  276. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/run-eval-cell.ts +89 -25
  277. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/terminal-snapshot-store.ts +4 -0
  278. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +51 -10
  279. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +2 -1
  280. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  281. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -13
  282. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  283. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +1 -0
  284. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  285. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +1 -0
  286. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  287. package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.d.ts +5 -0
  288. package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.d.ts.map +1 -0
  289. package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.js +20 -0
  290. package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.js.map +1 -0
  291. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  292. package/node_modules/@earendil-works/pi-ai/README.md +1 -1
  293. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +14 -56
  294. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  295. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  296. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +18 -27
  297. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  298. package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.d.ts +40 -0
  299. package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.d.ts.map +1 -0
  300. package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.js +102 -0
  301. package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.js.map +1 -0
  302. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts +4 -3
  303. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts.map +1 -1
  304. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +28 -14
  305. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js.map +1 -1
  306. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.d.ts +44 -0
  307. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.d.ts.map +1 -0
  308. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.js +120 -0
  309. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.js.map +1 -0
  310. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.d.ts +2 -2
  311. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.d.ts.map +1 -1
  312. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.js +2 -2
  313. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.js.map +1 -1
  314. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +3 -0
  315. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -1
  316. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +21 -15
  317. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -1
  318. package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +1 -0
  319. package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
  320. package/node_modules/@earendil-works/pi-ai/dist/compat.js +1 -0
  321. package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
  322. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -0
  323. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  324. package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -0
  325. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  326. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.d.ts +8 -0
  327. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.d.ts.map +1 -0
  328. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.js +26 -0
  329. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.js.map +1 -0
  330. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  331. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  332. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
  333. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  334. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  335. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  336. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  337. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  338. package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -1
  339. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  340. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
  341. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
  342. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
  343. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
  344. package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
  345. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.d.ts +9 -0
  346. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.d.ts.map +1 -0
  347. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.js +43 -0
  348. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.js.map +1 -0
  349. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.d.ts.map +1 -1
  350. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +3 -2
  351. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js.map +1 -1
  352. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.d.ts +19 -0
  353. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.d.ts.map +1 -0
  354. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.js +63 -0
  355. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.js.map +1 -0
  356. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.d.ts.map +1 -1
  357. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js +5 -1
  358. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js.map +1 -1
  359. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +17 -0
  360. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  361. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +22 -1
  362. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  363. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  364. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  365. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  366. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  367. package/node_modules/@earendil-works/pi-tui/dist/tui.js +12 -2
  368. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  369. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  370. package/package.json +7 -7
  371. package/dist/bundle/chunks/chunk-5J5R5AMP.js +0 -8
  372. package/dist/bundle/chunks/chunk-I3F6VZZF.js +0 -2
  373. package/dist/bundle/chunks/chunk-IDTLJYJ5.js +0 -10
  374. package/dist/bundle/chunks/chunk-U6Z6OBX4.js +0 -2
  375. package/dist/bundle/chunks/host-lifecycle-DGZJTBDJ.js +0 -3
  376. package/dist/bundle/chunks/multi-session-host-S5FWCIWE.js +0 -20
  377. package/dist/bundle/chunks/openai-codex-responses-L2PO2D6F.js +0 -10
  378. package/dist/bundle/chunks/openai-responses-YDUBVF4S.js +0 -2
  379. package/dist/bundle/chunks/rotation-stream-Y4YU6HV4.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../src/auth/pool/slots.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAqB3C,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAE7D,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACd,yBAAyB,IAAI,qEAAqE,CAClG,CAAC;IACH,CAAC;AACF,CAAC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AAE,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAyB,EAAE,SAAqB;IAC9E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvE,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,SAAS,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IAC7E,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACnH,MAAM,OAAO,GAAG;QACf,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;KAC1B,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM;QACtB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpF,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACpB,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import type { Credential } from \"../types.ts\";\n\nexport type { Credential };\n\nexport const DEFAULT_SLOT_NAME = \"default\";\n\nexport type CredentialSlotSource = \"login\" | \"import\" | \"env\";\n\nexport type CredentialSlot = {\n\t/** Immutable operational identity. */\n\tname: string;\n\t/** Optional presentation metadata; never used for credential selection. */\n\tdisplayName?: string;\n\tsource?: CredentialSlotSource;\n\tkey?: string;\n\taccess?: string;\n\trefresh?: string;\n\texpires?: number;\n};\n\nexport type PooledCredential = Credential & {\n\taccounts?: CredentialSlot[];\n\tpinned?: string;\n};\n\nconst SLOT_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;\n\nexport function assertValidSlotName(name: string): void {\n\tif (!SLOT_NAME_PATTERN.test(name)) {\n\t\tthrow new Error(\n\t\t\t`Invalid account name '${name}': use letters, digits, '-' or '_', starting with a letter or digit`,\n\t\t);\n\t}\n}\n\nconst UNSAFE_DISPLAY_CHARACTERS = /[\\p{Cc}\\p{Cf}\\p{Zl}\\p{Zp}]/u;\n\n/**\n * Labels are bounded in terminal columns, not UTF-16 code units: 80 code units\n * of CJK render ~170 columns, which no footer segment can hold, while 41 emoji\n * render 82 columns yet count 82 code units. The bound is what the footer's\n * parenthesised provider segment can carry alongside a provider id.\n */\nexport const DISPLAY_NAME_MAX_COLUMNS = 32;\n\n/** Code points that advance a cell without painting anything a user can see. */\nconst BLANK_DISPLAY_CHARACTER = /^[\\s\\p{M}\\u115f\\u1160\\u17b4\\u17b5\\u2800\\u3164\\uffa0]$/u;\n/** Invisible code points that are not whitespace, so trimming never removes them. */\nconst INVISIBLE_DISPLAY_CHARACTER = /^[\\p{M}\\u115f\\u1160\\u17b4\\u17b5\\u2800\\u3164\\uffa0]$/u;\nconst WIDE_DISPLAY_CHARACTER =\n\t/^(?:[\\u1100-\\u115f\\u2329\\u232a\\u2e80-\\u303e\\u3041-\\u33ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\ua000-\\ua4cf\\ua960-\\ua97f\\uac00-\\ud7a3\\uf900-\\ufaff\\ufe10-\\ufe19\\ufe30-\\ufe6f\\uff00-\\uff60\\uffe0-\\uffe6]|[\\u{1f300}-\\u{1faff}]|[\\u{20000}-\\u{3fffd}])$/u;\n\n/**\n * Latin lookalikes for the Cyrillic letters a homoglyph label would use. Folded\n * only for the uniqueness comparison; the stored label keeps the user's script.\n */\nconst CYRILLIC_LOOKALIKES: Record<string, string> = {\n\t\"\\u0430\": \"a\",\n\t\"\\u0432\": \"b\",\n\t\"\\u0435\": \"e\",\n\t\"\\u043a\": \"k\",\n\t\"\\u043c\": \"m\",\n\t\"\\u043d\": \"h\",\n\t\"\\u043e\": \"o\",\n\t\"\\u0440\": \"p\",\n\t\"\\u0441\": \"c\",\n\t\"\\u0442\": \"t\",\n\t\"\\u0443\": \"y\",\n\t\"\\u0445\": \"x\",\n\t\"\\u0455\": \"s\",\n\t\"\\u0456\": \"i\",\n\t\"\\u0458\": \"j\",\n};\n\nconst displayNameGraphemes = new Intl.Segmenter(undefined, { granularity: \"grapheme\" });\n\n/** Terminal columns a label occupies, measured per grapheme cluster. */\nexport function displayNameColumns(value: string): number {\n\tlet columns = 0;\n\tfor (const { segment } of displayNameGraphemes.segment(value)) {\n\t\tconst codePoint = segment.codePointAt(0);\n\t\tif (codePoint === undefined) continue;\n\t\tconst base = String.fromCodePoint(codePoint);\n\t\tif (INVISIBLE_DISPLAY_CHARACTER.test(base)) continue;\n\t\tcolumns += WIDE_DISPLAY_CHARACTER.test(base) || segment.includes(\"\\ufe0f\") ? 2 : 1;\n\t}\n\treturn columns;\n}\n\n/** The stored form: NFC, trimmed, internal whitespace runs collapsed to one space. */\nfunction normalizeDisplayName(value: string): string {\n\treturn value.normalize(\"NFC\").trim().replace(/\\s+/gu, \" \");\n}\n\n/**\n * Comparison key for \"unique per provider\": compatibility-folded (fullwidth and\n * other compatibility forms), case-folded, invisible code points dropped, and\n * Cyrillic lookalikes mapped to Latin, so two labels that render identically\n * cannot both be stored.\n */\nfunction displayNameKey(value: string): string {\n\treturn [...normalizeDisplayName(value).normalize(\"NFKC\").toLowerCase()]\n\t\t.filter((character) => !INVISIBLE_DISPLAY_CHARACTER.test(character))\n\t\t.map((character) => CYRILLIC_LOOKALIKES[character] ?? character)\n\t\t.join(\"\");\n}\n\n/** Treat persisted metadata as untrusted presentation input. */\nexport function accountDisplayName(value: unknown): string | undefined {\n\tif (typeof value !== \"string\" || UNSAFE_DISPLAY_CHARACTERS.test(value)) return undefined;\n\tconst normalized = normalizeDisplayName(value);\n\tconst characters = [...normalized];\n\t// A leading combining mark glues the label onto whatever precedes it, and a\n\t// label made only of blank-rendering code points is indistinguishable from none.\n\tif (characters.length === 0 || /^\\p{M}$/u.test(characters[0])) return undefined;\n\tif (characters.every((character) => BLANK_DISPLAY_CHARACTER.test(character))) return undefined;\n\treturn displayNameColumns(normalized) <= DISPLAY_NAME_MAX_COLUMNS ? normalized : undefined;\n}\n\nexport function accountLabel(account: { name: string; displayName?: string }): string {\n\tconst displayName = accountDisplayName(account.displayName);\n\treturn displayName === undefined ? account.name : `${displayName} (${account.name})`;\n}\n\n/** Pure metadata update; callers serialize this against the latest stored credential. */\nexport function renameSlotDisplayName(\n\tcredential: PooledCredential,\n\tname: string,\n\tvalue: string | null,\n): PooledCredential {\n\tassertValidSlotName(name);\n\tconst accounts = Array.isArray(credential.accounts) ? credential.accounts : listSlots(credential);\n\tconst target = accounts.find((slot) => slot.name === name);\n\tif (!target) throw new Error(`Stored provider account not found: ${name}`);\n\tif (target.source === \"env\") throw new Error(`Environment provider account cannot be renamed: ${name}`);\n\tconst displayName = value === null ? undefined : accountDisplayName(value);\n\tif (value !== null && displayName === undefined) {\n\t\tthrow new Error(\n\t\t\t`Display name must be 1-${DISPLAY_NAME_MAX_COLUMNS} terminal columns of visible text without control or formatting characters.`,\n\t\t);\n\t}\n\tif (\n\t\tdisplayName !== undefined &&\n\t\taccounts.some(\n\t\t\t(slot) =>\n\t\t\t\tslot.name !== name &&\n\t\t\t\tdisplayNameKey(accountDisplayName(slot.displayName) ?? \"\") === displayNameKey(displayName),\n\t\t)\n\t) {\n\t\tthrow new Error(\"Display name is already used by another account for this provider.\");\n\t}\n\treturn {\n\t\t...credential,\n\t\taccounts: accounts.map((slot) => {\n\t\t\tif (slot.name !== name) return slot;\n\t\t\tconst { displayName: _displayName, ...unchanged } = slot;\n\t\t\treturn displayName === undefined ? unchanged : { ...unchanged, displayName };\n\t\t}),\n\t};\n}\n\nfunction storedSlots(credential: PooledCredential): CredentialSlot[] {\n\treturn Array.isArray(credential.accounts) ? credential.accounts : [];\n}\n\nfunction slotFromFlatCredential(credential: PooledCredential): CredentialSlot {\n\tif (credential.type === \"oauth\") {\n\t\treturn {\n\t\t\tname: DEFAULT_SLOT_NAME,\n\t\t\tsource: \"login\",\n\t\t\taccess: credential.access,\n\t\t\trefresh: credential.refresh,\n\t\t\texpires: credential.expires,\n\t\t};\n\t}\n\treturn { name: DEFAULT_SLOT_NAME, source: \"login\", key: credential.key };\n}\n\n/**\n * A flat credential written by a build predating pools is read as a one-slot pool\n * without writing anything back; the caller decides whether a write ever happens.\n */\nexport function listSlots(credential: PooledCredential | undefined): CredentialSlot[] {\n\tif (!credential) return [];\n\tconst slots = storedSlots(credential);\n\treturn slots.length > 0 ? [...slots] : [slotFromFlatCredential(credential)];\n}\n\nexport function findSlot(credential: PooledCredential | undefined, name: string): CredentialSlot | undefined {\n\treturn listSlots(credential).find((slot) => slot.name === name);\n}\n\n/**\n * Replaces or appends one slot while every sibling, the pin, and the flat\n * top-level credential survive untouched. The flat fields stay as written so a\n * build that ignores `accounts` still authenticates from them.\n */\nexport function upsertSlot(credential: PooledCredential | undefined, slot: CredentialSlot): PooledCredential {\n\tassertValidSlotName(slot.name);\n\tconst base: PooledCredential =\n\t\tcredential ??\n\t\t(slot.access !== undefined || slot.refresh !== undefined\n\t\t\t? { type: \"oauth\", access: slot.access ?? \"\", refresh: slot.refresh ?? \"\", expires: slot.expires ?? 0 }\n\t\t\t: { type: \"api_key\", key: slot.key });\n\tconst existing = listSlots(base);\n\tconst index = existing.findIndex((candidate) => candidate.name === slot.name);\n\tconst accounts =\n\t\tindex >= 0\n\t\t\t? existing.map((candidate) => (candidate.name === slot.name ? { ...candidate, ...slot } : candidate))\n\t\t\t: [...existing, slot];\n\treturn { ...base, accounts };\n}\n\n/** Whether the flat top-level fields are this slot's material rather than a sibling's. */\nfunction slotMirrorsFlat(credential: PooledCredential, slot: CredentialSlot): boolean {\n\tif (credential.type === \"oauth\") return slot.access === credential.access || slot.refresh === credential.refresh;\n\treturn slot.key === credential.key;\n}\n\n/** Rewrites the flat top-level projection to carry the given slot's material. */\nfunction projectFlatFields(credential: PooledCredential, slot: CredentialSlot): PooledCredential {\n\tif (credential.type === \"oauth\") {\n\t\tif (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined) return credential;\n\t\treturn { ...credential, access: slot.access, refresh: slot.refresh, expires: slot.expires };\n\t}\n\treturn { ...credential, key: slot.key };\n}\n\n/**\n * Removes one slot. The credential is dropped entirely once its last slot is gone,\n * and a pin naming the removed slot is cleared so selection never points at a slot\n * that no longer exists.\n *\n * When the removed slot was the one the flat top-level fields projected, those\n * fields are re-projected from the first survivor. Without that the pool keeps\n * authenticating with the deleted account's material: a credential with a single\n * remaining slot does not enter the rotation path, so ordinary requests resolve\n * the flat projection and would keep using exactly the account the user removed.\n * `accounts` is preserved either way, so the entry stays a pool.\n */\nexport function removeSlot(credential: PooledCredential | undefined, name: string): PooledCredential | undefined {\n\tif (!credential) return undefined;\n\tconst existing = listSlots(credential);\n\tconst removed = existing.find((slot) => slot.name === name);\n\tconst accounts = existing.filter((slot) => slot.name !== name);\n\tif (accounts.length === 0) return undefined;\n\tconst reprojected =\n\t\tremoved && slotMirrorsFlat(credential, removed) ? projectFlatFields(credential, accounts[0]) : credential;\n\tconst next: PooledCredential = { ...reprojected, accounts };\n\tif (next.pinned === name) delete next.pinned;\n\treturn next;\n}\n\nexport function pinSlot(credential: PooledCredential, name: string): PooledCredential {\n\tassertValidSlotName(name);\n\treturn { ...credential, pinned: name };\n}\n\n/**\n * Projects one named slot onto the flat credential shape for request-scoped\n * resolution; pool bookkeeping fields are stripped so provider handlers see a\n * plain credential and never write pool state back through the projection.\n */\nexport function projectSlot(credential: PooledCredential | undefined, name: string): Credential | undefined {\n\tif (!credential) return undefined;\n\tconst slot = findSlot(credential, name);\n\tif (!slot) return undefined;\n\tconst { accounts: _accounts, pinned: _pinned, ...flat } = credential;\n\tif (flat.type === \"oauth\") {\n\t\tif (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined) return undefined;\n\t\treturn { ...flat, access: slot.access, refresh: slot.refresh, expires: slot.expires };\n\t}\n\treturn { ...flat, key: slot.key };\n}\n\nfunction slotFromFlatCredentialNamed(credential: Credential, name: string): CredentialSlot {\n\tif (credential.type === \"oauth\") {\n\t\treturn {\n\t\t\tname,\n\t\t\tsource: \"login\",\n\t\t\taccess: credential.access,\n\t\t\trefresh: credential.refresh,\n\t\t\texpires: credential.expires,\n\t\t};\n\t}\n\treturn { name, source: \"login\", key: credential.key };\n}\n\nfunction nextLoginSlotName(credential: PooledCredential): string {\n\tconst taken = new Set(listSlots(credential).map((slot) => slot.name));\n\tfor (let index = 2; index < 1000; index++) {\n\t\tconst candidate = `login-${index}`;\n\t\tif (!taken.has(candidate)) return candidate;\n\t}\n\tthrow new Error(\"Credential pool is full\");\n}\n\nfunction providedSlots(credential: Credential): CredentialSlot[] | undefined {\n\tconst accounts = (credential as PooledCredential).accounts;\n\treturn Array.isArray(accounts) && accounts.length > 0 ? accounts : undefined;\n}\n\n/**\n * Unions a provider-owned pool onto the value read under the credential lock.\n * `current` wins for every name it already holds: the provider built its\n * object from a snapshot taken BEFORE the interactive browser round trip, so a\n * sibling account that rotated its refresh token or earned a rate-limit block\n * during that window must not be rewound to the snapshot. Only names that do\n * not exist yet are appended.\n */\nfunction mergeProvidedPool(\n\tcurrent: PooledCredential,\n\texisting: readonly CredentialSlot[],\n\tprovided: readonly CredentialSlot[],\n): PooledCredential {\n\tconst known = new Set(existing.map((slot) => slot.name));\n\tconst added = provided.filter((slot) => !known.has(slot.name));\n\treturn added.length === 0 ? current : { ...current, accounts: [...existing, ...added] };\n}\n\n/**\n * Appends an unnamed flat credential to a pool as a generated `login-N` slot.\n * An absent current entry keeps today's whole-write shape; a flat current entry\n * is promoted to a pool so the legacy credential stays reachable as `default`\n * instead of being overwritten by the second login.\n *\n * A login result that already carries its own populated `accounts` array is a\n * provider-owned pool, and a provider that already holds a POOL names the\n * account this login created itself. That pool is MERGED onto `current` rather\n * than written through: a pre-browser-flow snapshot must never overwrite what\n * concurrent writers stored meanwhile. A flat `current` keeps the whole-write\n * shape - the provider echoes the flat fields it read, so there is nothing to\n * preserve and the login must not be dropped on a name collision.\n *\n * `onAllocated` reports the account this login committed, so a caller can name\n * it in a receipt without re-reading storage.\n */\nexport function appendLoginSlot(\n\tcurrent: PooledCredential | undefined,\n\tflat: Credential,\n\tonAllocated?: (name: string, origin: \"generated\" | \"provider\") => void,\n): Credential {\n\tconst provided = providedSlots(flat);\n\tif (provided) {\n\t\t// Provider-owned envelopes identify an addition by immutable ID, never by\n\t\t// token equality or array position. Ambiguous envelopes have no receipt.\n\t\tconst previous = new Set(\n\t\t\t(current && Array.isArray(current.accounts) ? current.accounts : listSlots(current)).map((slot) => slot.name),\n\t\t);\n\t\tconst added = provided.filter((slot) => !previous.has(slot.name));\n\t\tif (added.length === 1 && SLOT_NAME_PATTERN.test(added[0].name) && added[0].source !== \"env\") {\n\t\t\tonAllocated?.(added[0].name, \"provider\");\n\t\t}\n\t}\n\tif (!current) {\n\t\tif (!provided) onAllocated?.(DEFAULT_SLOT_NAME, \"generated\");\n\t\treturn flat;\n\t}\n\tconst storedAccounts = Array.isArray(current.accounts) ? current.accounts : undefined;\n\tif (provided) {\n\t\t// A pool merges onto the stored pool; a flat current keeps the whole-write\n\t\t// shape because the provider's accounts already carry this login.\n\t\treturn storedAccounts ? mergeProvidedPool(current, storedAccounts, provided) : flat;\n\t}\n\tconst name = nextLoginSlotName(current);\n\tconst next = upsertSlot(current, slotFromFlatCredentialNamed(flat, name));\n\tonAllocated?.(name, \"generated\");\n\treturn next;\n}\n\n/**\n * Material a provider writes into the flat credential when the real token lives\n * outside auth.json (an SDK subprocess or a vendor CLI owns it): the literal\n * `<providerId>-managed` in both OAuth fields. It is a marker, never a token.\n */\nexport function managedSentinelMaterial(providerId: string): string {\n\treturn `${providerId}-managed`;\n}\n\n/**\n * A POOL SLOT carrying that marker can never authenticate: `projectSlot` hands\n * it to the provider's `check`, which rejects it, and the request dies with\n * \"Provider is not configured\". Slots like that exist only because a shipped\n * build appended a provider-owned pool's flat sentinel as a generated `login-N`\n * slot.\n */\nexport function isManagedSentinelSlot(providerId: string, slot: CredentialSlot): boolean {\n\tconst sentinel = managedSentinelMaterial(providerId);\n\treturn slot.access === sentinel && slot.refresh === sentinel;\n}\n\n/**\n * Drops those poisoned slots from a stored credential, clearing a pin that\n * named one. Returns `undefined` when the credential holds none, so a caller\n * can tell a repair from a no-op and only rewrite storage when the bytes\n * actually change.\n */\nexport function repairManagedSentinelSlots(providerId: string, credential: Credential): PooledCredential | undefined {\n\tconst pooled = credential as PooledCredential;\n\tif (!Array.isArray(pooled.accounts)) return undefined;\n\tconst kept = pooled.accounts.filter((slot) => !isManagedSentinelSlot(providerId, slot));\n\tif (kept.length === pooled.accounts.length) return undefined;\n\tconst repaired: PooledCredential = { ...pooled, accounts: kept };\n\tif (repaired.pinned !== undefined && !kept.some((slot) => slot.name === repaired.pinned)) delete repaired.pinned;\n\treturn repaired;\n}\n\n/**\n * Merges a rotated OAuth credential back into the pool: the slot whose material\n * matches the pre-refresh flat fields is updated in place together with those\n * flat fields, while every sibling and the pin survive byte-identical. A flat\n * current entry keeps today's whole-write shape.\n */\n/**\n * Merges a rotated OAuth credential into the NAMED slot. The flat top-level\n * projection rotates only when it mirrored that slot's previous material, so\n * refreshing a secondary slot never disturbs what an older binary reads.\n */\nexport function mergeRefreshedSlot(current: PooledCredential, name: string, refreshed: Credential): Credential {\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return current;\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) return mergeRefreshed(current, refreshed);\n\tconst target = current.accounts.find((slot) => slot.name === name);\n\tif (!target) return current;\n\tconst rotated = { access: refreshed.access, refresh: refreshed.refresh, expires: refreshed.expires };\n\tconst accounts = current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot));\n\tconst mirrorsFlat = target.access === current.access || target.refresh === current.refresh;\n\treturn mirrorsFlat ? { ...current, ...rotated, accounts } : { ...current, accounts };\n}\n\nexport function mergeRefreshed(current: PooledCredential, refreshed: Credential): Credential {\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) {\n\t\treturn refreshed;\n\t}\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return refreshed;\n\tconst target = current.accounts.find((slot) => slot.access === current.access || slot.refresh === current.refresh);\n\tconst rotated = {\n\t\taccess: refreshed.access,\n\t\trefresh: refreshed.refresh,\n\t\texpires: refreshed.expires,\n\t};\n\tconst accounts = target\n\t\t? current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot))\n\t\t: current.accounts;\n\treturn { ...current, ...rotated, accounts };\n}\n"]}
1
+ {"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../src/auth/pool/slots.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAuB3C,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAE7D,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACd,yBAAyB,IAAI,qEAAqE,CAClG,CAAC;IACH,CAAC;AACF,CAAC;AAED,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C,gFAAgF;AAChF,MAAM,uBAAuB,GAAG,wDAAwD,CAAC;AACzF,qFAAqF;AACrF,MAAM,2BAA2B,GAAG,sDAAsD,CAAC;AAC3F,MAAM,sBAAsB,GAC3B,4O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C,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpF,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACpB,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import type { ProviderEnv } from \"../../types.ts\";\nimport type { Credential } from \"../types.ts\";\n\nexport type { Credential };\n\nexport const DEFAULT_SLOT_NAME = \"default\";\n\nexport type CredentialSlotSource = \"login\" | \"import\" | \"env\";\n\nexport type CredentialSlot = {\n\t/** Immutable operational identity. */\n\tname: string;\n\t/** Optional presentation metadata; never used for credential selection. */\n\tdisplayName?: string;\n\tsource?: CredentialSlotSource;\n\tkey?: string;\n\taccess?: string;\n\trefresh?: string;\n\texpires?: number;\n\t/** Provider-scoped values this account carries (a Kimi region, a Cloudflare account id). */\n\tenv?: ProviderEnv;\n};\n\nexport type PooledCredential = Credential & {\n\taccounts?: CredentialSlot[];\n\tpinned?: string;\n};\n\nconst SLOT_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;\n\nexport function assertValidSlotName(name: string): void {\n\tif (!SLOT_NAME_PATTERN.test(name)) {\n\t\tthrow new Error(\n\t\t\t`Invalid account name '${name}': use letters, digits, '-' or '_', starting with a letter or digit`,\n\t\t);\n\t}\n}\n\nconst UNSAFE_DISPLAY_CHARACTERS = /[\\p{Cc}\\p{Cf}\\p{Zl}\\p{Zp}]/u;\n\n/**\n * Labels are bounded in terminal columns, not UTF-16 code units: 80 code units\n * of CJK render ~170 columns, which no footer segment can hold, while 41 emoji\n * render 82 columns yet count 82 code units. The bound is what the footer's\n * parenthesised provider segment can carry alongside a provider id.\n */\nexport const DISPLAY_NAME_MAX_COLUMNS = 32;\n\n/** Code points that advance a cell without painting anything a user can see. */\nconst BLANK_DISPLAY_CHARACTER = /^[\\s\\p{M}\\u115f\\u1160\\u17b4\\u17b5\\u2800\\u3164\\uffa0]$/u;\n/** Invisible code points that are not whitespace, so trimming never removes them. */\nconst INVISIBLE_DISPLAY_CHARACTER = /^[\\p{M}\\u115f\\u1160\\u17b4\\u17b5\\u2800\\u3164\\uffa0]$/u;\nconst WIDE_DISPLAY_CHARACTER =\n\t/^(?:[\\u1100-\\u115f\\u2329\\u232a\\u2e80-\\u303e\\u3041-\\u33ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\ua000-\\ua4cf\\ua960-\\ua97f\\uac00-\\ud7a3\\uf900-\\ufaff\\ufe10-\\ufe19\\ufe30-\\ufe6f\\uff00-\\uff60\\uffe0-\\uffe6]|[\\u{1f300}-\\u{1faff}]|[\\u{20000}-\\u{3fffd}])$/u;\n\n/**\n * Latin lookalikes for the Cyrillic letters a homoglyph label would use. Folded\n * only for the uniqueness comparison; the stored label keeps the user's script.\n */\nconst CYRILLIC_LOOKALIKES: Record<string, string> = {\n\t\"\\u0430\": \"a\",\n\t\"\\u0432\": \"b\",\n\t\"\\u0435\": \"e\",\n\t\"\\u043a\": \"k\",\n\t\"\\u043c\": \"m\",\n\t\"\\u043d\": \"h\",\n\t\"\\u043e\": \"o\",\n\t\"\\u0440\": \"p\",\n\t\"\\u0441\": \"c\",\n\t\"\\u0442\": \"t\",\n\t\"\\u0443\": \"y\",\n\t\"\\u0445\": \"x\",\n\t\"\\u0455\": \"s\",\n\t\"\\u0456\": \"i\",\n\t\"\\u0458\": \"j\",\n};\n\nconst displayNameGraphemes = new Intl.Segmenter(undefined, { granularity: \"grapheme\" });\n\n/** Terminal columns a label occupies, measured per grapheme cluster. */\nexport function displayNameColumns(value: string): number {\n\tlet columns = 0;\n\tfor (const { segment } of displayNameGraphemes.segment(value)) {\n\t\tconst codePoint = segment.codePointAt(0);\n\t\tif (codePoint === undefined) continue;\n\t\tconst base = String.fromCodePoint(codePoint);\n\t\tif (INVISIBLE_DISPLAY_CHARACTER.test(base)) continue;\n\t\tcolumns += WIDE_DISPLAY_CHARACTER.test(base) || segment.includes(\"\\ufe0f\") ? 2 : 1;\n\t}\n\treturn columns;\n}\n\n/** The stored form: NFC, trimmed, internal whitespace runs collapsed to one space. */\nfunction normalizeDisplayName(value: string): string {\n\treturn value.normalize(\"NFC\").trim().replace(/\\s+/gu, \" \");\n}\n\n/**\n * Comparison key for \"unique per provider\": compatibility-folded (fullwidth and\n * other compatibility forms), case-folded, invisible code points dropped, and\n * Cyrillic lookalikes mapped to Latin, so two labels that render identically\n * cannot both be stored.\n */\nfunction displayNameKey(value: string): string {\n\treturn [...normalizeDisplayName(value).normalize(\"NFKC\").toLowerCase()]\n\t\t.filter((character) => !INVISIBLE_DISPLAY_CHARACTER.test(character))\n\t\t.map((character) => CYRILLIC_LOOKALIKES[character] ?? character)\n\t\t.join(\"\");\n}\n\n/** Treat persisted metadata as untrusted presentation input. */\nexport function accountDisplayName(value: unknown): string | undefined {\n\tif (typeof value !== \"string\" || UNSAFE_DISPLAY_CHARACTERS.test(value)) return undefined;\n\tconst normalized = normalizeDisplayName(value);\n\tconst characters = [...normalized];\n\t// A leading combining mark glues the label onto whatever precedes it, and a\n\t// label made only of blank-rendering code points is indistinguishable from none.\n\tif (characters.length === 0 || /^\\p{M}$/u.test(characters[0])) return undefined;\n\tif (characters.every((character) => BLANK_DISPLAY_CHARACTER.test(character))) return undefined;\n\treturn displayNameColumns(normalized) <= DISPLAY_NAME_MAX_COLUMNS ? normalized : undefined;\n}\n\nexport function accountLabel(account: { name: string; displayName?: string }): string {\n\tconst displayName = accountDisplayName(account.displayName);\n\treturn displayName === undefined ? account.name : `${displayName} (${account.name})`;\n}\n\n/** Pure metadata update; callers serialize this against the latest stored credential. */\nexport function renameSlotDisplayName(\n\tcredential: PooledCredential,\n\tname: string,\n\tvalue: string | null,\n): PooledCredential {\n\tassertValidSlotName(name);\n\tconst accounts = Array.isArray(credential.accounts) ? credential.accounts : listSlots(credential);\n\tconst target = accounts.find((slot) => slot.name === name);\n\tif (!target) throw new Error(`Stored provider account not found: ${name}`);\n\tif (target.source === \"env\") throw new Error(`Environment provider account cannot be renamed: ${name}`);\n\tconst displayName = value === null ? undefined : accountDisplayName(value);\n\tif (value !== null && displayName === undefined) {\n\t\tthrow new Error(\n\t\t\t`Display name must be 1-${DISPLAY_NAME_MAX_COLUMNS} terminal columns of visible text without control or formatting characters.`,\n\t\t);\n\t}\n\tif (\n\t\tdisplayName !== undefined &&\n\t\taccounts.some(\n\t\t\t(slot) =>\n\t\t\t\tslot.name !== name &&\n\t\t\t\tdisplayNameKey(accountDisplayName(slot.displayName) ?? \"\") === displayNameKey(displayName),\n\t\t)\n\t) {\n\t\tthrow new Error(\"Display name is already used by another account for this provider.\");\n\t}\n\treturn {\n\t\t...credential,\n\t\taccounts: accounts.map((slot) => {\n\t\t\tif (slot.name !== name) return slot;\n\t\t\tconst { displayName: _displayName, ...unchanged } = slot;\n\t\t\treturn displayName === undefined ? unchanged : { ...unchanged, displayName };\n\t\t}),\n\t};\n}\n\nfunction storedSlots(credential: PooledCredential): CredentialSlot[] {\n\treturn Array.isArray(credential.accounts) ? credential.accounts : [];\n}\n\nfunction credentialSlotEnv(credential: Credential): { env: ProviderEnv } | Record<string, never> {\n\tconst value = credential.env;\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return {};\n\tconst env: ProviderEnv = {};\n\tfor (const [name, entry] of Object.entries(value)) {\n\t\tif (typeof entry !== \"string\") return {};\n\t\tenv[name] = entry;\n\t}\n\treturn { env };\n}\n\nfunction slotFromFlatCredential(credential: PooledCredential): CredentialSlot {\n\treturn slotFromFlatCredentialNamed(credential, DEFAULT_SLOT_NAME);\n}\n\n/**\n * A flat credential written by a build predating pools is read as a one-slot pool\n * without writing anything back; the caller decides whether a write ever happens.\n */\nexport function listSlots(credential: PooledCredential | undefined): CredentialSlot[] {\n\tif (!credential) return [];\n\tconst slots = storedSlots(credential);\n\treturn slots.length > 0 ? [...slots] : [slotFromFlatCredential(credential)];\n}\n\nexport function findSlot(credential: PooledCredential | undefined, name: string): CredentialSlot | undefined {\n\treturn listSlots(credential).find((slot) => slot.name === name);\n}\n\n/**\n * Replaces or appends one slot while every sibling, the pin, and the flat\n * top-level credential survive untouched. The flat fields stay as written so a\n * build that ignores `accounts` still authenticates from them.\n */\nexport function upsertSlot(credential: PooledCredential | undefined, slot: CredentialSlot): PooledCredential {\n\tassertValidSlotName(slot.name);\n\tconst base: PooledCredential =\n\t\tcredential ??\n\t\t(slot.access !== undefined || slot.refresh !== undefined\n\t\t\t? { type: \"oauth\", access: slot.access ?? \"\", refresh: slot.refresh ?? \"\", expires: slot.expires ?? 0 }\n\t\t\t: { type: \"api_key\", key: slot.key });\n\tconst existing = listSlots(base);\n\tconst index = existing.findIndex((candidate) => candidate.name === slot.name);\n\tconst accounts =\n\t\tindex >= 0\n\t\t\t? existing.map((candidate) => (candidate.name === slot.name ? { ...candidate, ...slot } : candidate))\n\t\t\t: [...existing, slot];\n\treturn { ...base, accounts };\n}\n\n/** Whether the flat top-level fields are this slot's material rather than a sibling's. */\nfunction slotMirrorsFlat(credential: PooledCredential, slot: CredentialSlot): boolean {\n\tif (credential.type === \"oauth\") return slot.access === credential.access || slot.refresh === credential.refresh;\n\treturn slot.key === credential.key;\n}\n\n/** Rewrites the flat top-level projection to carry the given slot's material. */\nfunction projectFlatFields(credential: PooledCredential, slot: CredentialSlot): PooledCredential {\n\tconst env = slot.env === undefined ? {} : { env: slot.env };\n\tif (credential.type === \"oauth\") {\n\t\tif (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined) return credential;\n\t\treturn { ...credential, access: slot.access, refresh: slot.refresh, expires: slot.expires, ...env };\n\t}\n\treturn { ...credential, key: slot.key, ...env };\n}\n\n/**\n * Removes one slot. The credential is dropped entirely once its last slot is gone,\n * and a pin naming the removed slot is cleared so selection never points at a slot\n * that no longer exists.\n *\n * When the removed slot was the one the flat top-level fields projected, those\n * fields are re-projected from the first survivor. Without that the pool keeps\n * authenticating with the deleted account's material: a credential with a single\n * remaining slot does not enter the rotation path, so ordinary requests resolve\n * the flat projection and would keep using exactly the account the user removed.\n * `accounts` is preserved either way, so the entry stays a pool.\n */\nexport function removeSlot(credential: PooledCredential | undefined, name: string): PooledCredential | undefined {\n\tif (!credential) return undefined;\n\tconst existing = listSlots(credential);\n\tconst removed = existing.find((slot) => slot.name === name);\n\tconst accounts = existing.filter((slot) => slot.name !== name);\n\tif (accounts.length === 0) return undefined;\n\tconst reprojected =\n\t\tremoved && slotMirrorsFlat(credential, removed) ? projectFlatFields(credential, accounts[0]) : credential;\n\tconst next: PooledCredential = { ...reprojected, accounts };\n\tif (next.pinned === name) delete next.pinned;\n\treturn next;\n}\n\nexport function pinSlot(credential: PooledCredential, name: string): PooledCredential {\n\tassertValidSlotName(name);\n\treturn { ...credential, pinned: name };\n}\n\n/**\n * Projects one named slot onto the flat credential shape for request-scoped\n * resolution; pool bookkeeping fields are stripped so provider handlers see a\n * plain credential and never write pool state back through the projection.\n */\nexport function projectSlot(credential: PooledCredential | undefined, name: string): Credential | undefined {\n\tif (!credential) return undefined;\n\tconst slot = findSlot(credential, name);\n\tif (!slot) return undefined;\n\tconst { accounts: _accounts, pinned: _pinned, ...flat } = credential;\n\tconst env = slot.env === undefined ? {} : { env: slot.env };\n\tif (flat.type === \"oauth\") {\n\t\tif (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined) return undefined;\n\t\treturn { ...flat, access: slot.access, refresh: slot.refresh, expires: slot.expires, ...env };\n\t}\n\treturn { ...flat, key: slot.key, ...env };\n}\n\nfunction slotFromFlatCredentialNamed(credential: Credential, name: string): CredentialSlot {\n\tif (credential.type === \"oauth\") {\n\t\treturn {\n\t\t\tname,\n\t\t\tsource: \"login\",\n\t\t\taccess: credential.access,\n\t\t\trefresh: credential.refresh,\n\t\t\texpires: credential.expires,\n\t\t\t...credentialSlotEnv(credential),\n\t\t};\n\t}\n\treturn { name, source: \"login\", key: credential.key, ...credentialSlotEnv(credential) };\n}\n\nfunction nextLoginSlotName(credential: PooledCredential): string {\n\tconst taken = new Set(listSlots(credential).map((slot) => slot.name));\n\tfor (let index = 2; index < 1000; index++) {\n\t\tconst candidate = `login-${index}`;\n\t\tif (!taken.has(candidate)) return candidate;\n\t}\n\tthrow new Error(\"Credential pool is full\");\n}\n\nfunction providedSlots(credential: Credential): CredentialSlot[] | undefined {\n\tconst accounts = (credential as PooledCredential).accounts;\n\treturn Array.isArray(accounts) && accounts.length > 0 ? accounts : undefined;\n}\n\n/**\n * Unions a provider-owned pool onto the value read under the credential lock.\n * `current` wins for every name it already holds: the provider built its\n * object from a snapshot taken BEFORE the interactive browser round trip, so a\n * sibling account that rotated its refresh token or earned a rate-limit block\n * during that window must not be rewound to the snapshot. Only names that do\n * not exist yet are appended.\n */\nfunction mergeProvidedPool(\n\tcurrent: PooledCredential,\n\texisting: readonly CredentialSlot[],\n\tprovided: readonly CredentialSlot[],\n): PooledCredential {\n\tconst known = new Set(existing.map((slot) => slot.name));\n\tconst added = provided.filter((slot) => !known.has(slot.name));\n\treturn added.length === 0 ? current : { ...current, accounts: [...existing, ...added] };\n}\n\n/**\n * Appends an unnamed flat credential to a pool as a generated `login-N` slot.\n * An absent current entry keeps today's whole-write shape; a flat current entry\n * is promoted to a pool so the legacy credential stays reachable as `default`\n * instead of being overwritten by the second login.\n *\n * A login result that already carries its own populated `accounts` array is a\n * provider-owned pool, and a provider that already holds a POOL names the\n * account this login created itself. That pool is MERGED onto `current` rather\n * than written through: a pre-browser-flow snapshot must never overwrite what\n * concurrent writers stored meanwhile. A flat `current` keeps the whole-write\n * shape - the provider echoes the flat fields it read, so there is nothing to\n * preserve and the login must not be dropped on a name collision.\n *\n * `onAllocated` reports the account this login committed, so a caller can name\n * it in a receipt without re-reading storage.\n */\nexport function appendLoginSlot(\n\tcurrent: PooledCredential | undefined,\n\tflat: Credential,\n\tonAllocated?: (name: string, origin: \"generated\" | \"provider\") => void,\n): Credential {\n\tconst provided = providedSlots(flat);\n\tif (provided) {\n\t\t// Provider-owned envelopes identify an addition by immutable ID, never by\n\t\t// token equality or array position. Ambiguous envelopes have no receipt.\n\t\tconst previous = new Set(\n\t\t\t(current && Array.isArray(current.accounts) ? current.accounts : listSlots(current)).map((slot) => slot.name),\n\t\t);\n\t\tconst added = provided.filter((slot) => !previous.has(slot.name));\n\t\tif (added.length === 1 && SLOT_NAME_PATTERN.test(added[0].name) && added[0].source !== \"env\") {\n\t\t\tonAllocated?.(added[0].name, \"provider\");\n\t\t}\n\t}\n\tif (!current) {\n\t\tif (!provided) onAllocated?.(DEFAULT_SLOT_NAME, \"generated\");\n\t\treturn flat;\n\t}\n\tconst storedAccounts = Array.isArray(current.accounts) ? current.accounts : undefined;\n\tif (provided) {\n\t\t// A pool merges onto the stored pool; a flat current keeps the whole-write\n\t\t// shape because the provider's accounts already carry this login.\n\t\treturn storedAccounts ? mergeProvidedPool(current, storedAccounts, provided) : flat;\n\t}\n\tconst name = nextLoginSlotName(current);\n\tconst next = upsertSlot(current, slotFromFlatCredentialNamed(flat, name));\n\tonAllocated?.(name, \"generated\");\n\treturn next;\n}\n\n/**\n * Material a provider writes into the flat credential when the real token lives\n * outside auth.json (an SDK subprocess or a vendor CLI owns it): the literal\n * `<providerId>-managed` in both OAuth fields. It is a marker, never a token.\n */\nexport function managedSentinelMaterial(providerId: string): string {\n\treturn `${providerId}-managed`;\n}\n\n/**\n * A POOL SLOT carrying that marker can never authenticate: `projectSlot` hands\n * it to the provider's `check`, which rejects it, and the request dies with\n * \"Provider is not configured\". Slots like that exist only because a shipped\n * build appended a provider-owned pool's flat sentinel as a generated `login-N`\n * slot.\n */\nexport function isManagedSentinelSlot(providerId: string, slot: CredentialSlot): boolean {\n\tconst sentinel = managedSentinelMaterial(providerId);\n\treturn slot.access === sentinel && slot.refresh === sentinel;\n}\n\n/**\n * Drops those poisoned slots from a stored credential, clearing a pin that\n * named one. Returns `undefined` when the credential holds none, so a caller\n * can tell a repair from a no-op and only rewrite storage when the bytes\n * actually change.\n */\nexport function repairManagedSentinelSlots(providerId: string, credential: Credential): PooledCredential | undefined {\n\tconst pooled = credential as PooledCredential;\n\tif (!Array.isArray(pooled.accounts)) return undefined;\n\tconst kept = pooled.accounts.filter((slot) => !isManagedSentinelSlot(providerId, slot));\n\tif (kept.length === pooled.accounts.length) return undefined;\n\tconst repaired: PooledCredential = { ...pooled, accounts: kept };\n\tif (repaired.pinned !== undefined && !kept.some((slot) => slot.name === repaired.pinned)) delete repaired.pinned;\n\treturn repaired;\n}\n\n/**\n * Merges a rotated OAuth credential back into the pool: the slot whose material\n * matches the pre-refresh flat fields is updated in place together with those\n * flat fields, while every sibling and the pin survive byte-identical. A flat\n * current entry keeps today's whole-write shape.\n */\n/**\n * Merges a rotated OAuth credential into the NAMED slot. The flat top-level\n * projection rotates only when it mirrored that slot's previous material, so\n * refreshing a secondary slot never disturbs what an older binary reads.\n */\nexport function mergeRefreshedSlot(current: PooledCredential, name: string, refreshed: Credential): Credential {\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return current;\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) return mergeRefreshed(current, refreshed);\n\tconst target = current.accounts.find((slot) => slot.name === name);\n\tif (!target) return current;\n\tconst rotated = { access: refreshed.access, refresh: refreshed.refresh, expires: refreshed.expires };\n\tconst accounts = current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot));\n\tconst mirrorsFlat = target.access === current.access || target.refresh === current.refresh;\n\treturn mirrorsFlat ? { ...current, ...rotated, accounts } : { ...current, accounts };\n}\n\nexport function mergeRefreshed(current: PooledCredential, refreshed: Credential): Credential {\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) {\n\t\treturn refreshed;\n\t}\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return refreshed;\n\tconst target = current.accounts.find((slot) => slot.access === current.access || slot.refresh === current.refresh);\n\tconst rotated = {\n\t\taccess: refreshed.access,\n\t\trefresh: refreshed.refresh,\n\t\texpires: refreshed.expires,\n\t};\n\tconst accounts = target\n\t\t? current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot))\n\t\t: current.accounts;\n\treturn { ...current, ...rotated, accounts };\n}\n"]}
@@ -27,6 +27,7 @@ export * from "./images.ts";
27
27
  export * from "./images-api-registry.ts";
28
28
  export * from "./index.ts";
29
29
  export * from "./legacy-api-aliases.ts";
30
+ export * from "./legacy-provider-ids.ts";
30
31
  export * from "./providers/images/register-builtins.ts";
31
32
  export { getProtocol, getToolCallFormat, transformContext, wrapStreamWithToolCallMiddleware, } from "./tool-call-middleware/index.ts";
32
33
  import { getBuiltinModel, getBuiltinModels, getBuiltinProviders } from "./providers/all.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../src/compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,GAChC,MAAM,iCAAiC,CAAC;AAgBzC,OAAO,EAAiB,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE3G,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1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B"}
@@ -27,6 +27,7 @@ export * from "./images.js";
27
27
  export * from "./images-api-registry.js";
28
28
  export * from "./index.js";
29
29
  export * from "./legacy-api-aliases.js";
30
+ export * from "./legacy-provider-ids.js";
30
31
  export * from "./providers/images/register-builtins.js";
31
32
  export { getProtocol, getToolCallFormat, transformContext, wrapStreamWithToolCallMiddleware, } from "./tool-call-middleware/index.js";
32
33
  import { anthropicMessagesApi } from "./api/anthropic-messages.lazy.js";
@@ -1 +1 @@
1
- {"version":3,"file":"compat.js","sourceRoot":"","sources":["../src/compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,GAChC,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2B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AAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC/D,MAAM,WAAW,GAAG,YAAY,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;QACrE,OAAO,gCAAgC,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,eAAe,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAC1D,IAAI,eAAe,EAAE,CAAC;QACrB,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;YACrF,OAAO,YAAY,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,eAAe,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/C,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,KAAkB,EAClB,OAAgB,EAChB,OAA6B;IAE7B,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Temporary compatibility entrypoint preserving the old global pi-ai API\n * surface: api-dispatch `stream()`/`complete()` with env API key injection,\n * the api-registry, generated catalog reads (`getModel`/`getModels`/\n * `getProviders`), per-API lazy stream wrappers, and image generation.\n *\n * Existing apps switch imports from \"@earendil-works/pi-ai\" to\n * \"@earendil-works/pi-ai/compat\" unchanged; new code uses `createModels()`\n * and the provider factories. This module is deleted with the coding-agent\n * ModelManager migration.\n */\n\nexport * from \"./api/anthropic-messages.lazy.ts\";\nexport * from \"./api/azure-openai-responses.lazy.ts\";\nexport * from \"./api/bedrock-converse-stream.lazy.ts\";\nexport * from \"./api/cursor-agent.lazy.ts\";\nexport * from \"./api/devin-agent.lazy.ts\";\nexport * from \"./api/google-generative-ai.lazy.ts\";\nexport * from \"./api/google-vertex.lazy.ts\";\nexport * from \"./api/mistral-conversations.lazy.ts\";\nexport * from \"./api/openai-codex-responses.lazy.ts\";\nexport * from \"./api/openai-completions.lazy.ts\";\nexport * from \"./api/openai-responses.lazy.ts\";\nexport * from \"./api/pi-messages.lazy.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./image-models.ts\";\nexport * from \"./images.ts\";\nexport * from \"./images-api-registry.ts\";\nexport * from \"./index.ts\";\nexport * from \"./legacy-api-aliases.ts\";\nexport * from \"./providers/images/register-builtins.ts\";\nexport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\ttransformContext,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\n\nimport { anthropicMessagesApi } from \"./api/anthropic-messages.lazy.ts\";\nimport { azureOpenAIResponsesApi } from \"./api/azure-openai-responses.lazy.ts\";\nimport { bedrockConverseStreamApi } from \"./api/bedrock-converse-stream.lazy.ts\";\nimport { cursorAgentApi } from \"./api/cursor-agent.lazy.ts\";\nimport { devinAgentApi } from \"./api/devin-agent.lazy.ts\";\nimport { googleGenerativeAIApi } from \"./api/google-generative-ai.lazy.ts\";\nimport { googleVertexApi } from \"./api/google-vertex.lazy.ts\";\nimport { mistralConversationsApi } from \"./api/mistral-conversations.lazy.ts\";\nimport { openAICodexResponsesApi } from \"./api/openai-codex-responses.lazy.ts\";\nimport { openAICompletionsApi } from \"./api/openai-completions.lazy.ts\";\nimport { openAIResponsesApi } from \"./api/openai-responses.lazy.ts\";\nimport { piMessagesApi } from \"./api/pi-messages.lazy.ts\";\nimport { getEnvApiKey } from \"./env-api-keys.ts\";\nimport type { ModelsApiStreamOptions } from \"./models.ts\";\nimport { builtinModels, getBuiltinModel, getBuiltinModels, getBuiltinProviders } from \"./providers/all.ts\";\n\nexport type { BuiltinProvider } from \"./providers/all.ts\";\n\nimport { createFauxCore, type FauxProviderRegistration, type RegisterFauxProviderOptions } from \"./providers/faux.ts\";\nimport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\ttransformContext,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\nimport type {\n\tApi,\n\tApiStreamOptions,\n\tAssistantMessage,\n\tAssistantMessageEventStream,\n\tContext,\n\tModel,\n\tProviderStreamOptions,\n\tProviderStreams,\n\tSimpleStreamOptions,\n\tStreamOptions,\n} from \"./types.ts\";\n\n/** @deprecated Static catalog read. Use `getBuiltinModel` from \"@earendil-works/pi-ai/providers/all\" or `Models.getModel()`. */\nexport const getModel = getBuiltinModel;\n\n/** @deprecated Static catalog read. Use `getBuiltinModels` from \"@earendil-works/pi-ai/providers/all\" or `Models.getModels()`. */\nexport const getModels = getBuiltinModels;\n\n/** @deprecated Static catalog read. Use `getBuiltinProviders` from \"@earendil-works/pi-ai/providers/all\" or `Models.getProviders()`. */\nexport const getProviders = getBuiltinProviders;\n\nexport {\n\ttype ApiProvider,\n\ttype ApiProviderInternal,\n\ttype ApiStreamFunction,\n\ttype ApiStreamSimpleFunction,\n\tgetApiProvider,\n\tgetApiProviders,\n\tregisterApiProvider,\n\tunregisterApiProviders,\n} from \"./api-registry.ts\";\n\nimport {\n\tclearApiProviders,\n\tgetApiProvider,\n\tregisterApiProvider,\n\tregisterBuiltinApiProvider,\n\tunregisterApiProviders,\n} from \"./api-registry.ts\";\n\nexport function registerFauxProvider(options: RegisterFauxProviderOptions = {}): FauxProviderRegistration {\n\tconst core = createFauxCore(options);\n\tconst sourceId = `faux-provider-${Math.random().toString(36).slice(2, 10)}`;\n\tregisterApiProvider({ api: core.api, stream: core.stream, streamSimple: core.streamSimple }, sourceId);\n\treturn {\n\t\tapi: core.api,\n\t\tmodels: core.models,\n\t\tgetModel: core.getModel,\n\t\tstate: core.state,\n\t\tsetResponses: core.setResponses,\n\t\tappendResponses: core.appendResponses,\n\t\tgetPendingResponseCount: core.getPendingResponseCount,\n\t\tgetCallLog: core.getCallLog,\n\t\tunregister() {\n\t\t\tunregisterApiProviders(sourceId);\n\t\t},\n\t};\n}\n\nconst BUILTIN_APIS: [Api, ProviderStreams][] = [\n\t[\"anthropic-messages\", anthropicMessagesApi()],\n\t[\"openai-completions\", openAICompletionsApi()],\n\t[\"openai-responses\", openAIResponsesApi()],\n\t[\"openai-codex-responses\", openAICodexResponsesApi()],\n\t[\"cursor-agent\", cursorAgentApi()],\n\t[\"devin-agent\", devinAgentApi()],\n\t[\"azure-openai-responses\", azureOpenAIResponsesApi()],\n\t[\"google-generative-ai\", googleGenerativeAIApi()],\n\t[\"google-vertex\", googleVertexApi()],\n\t[\"mistral-conversations\", mistralConversationsApi()],\n\t[\"bedrock-converse-stream\", bedrockConverseStreamApi()],\n\t[\"pi-messages\", piMessagesApi()],\n];\n\nconst builtinApiProviderInstances = new Map<Api, ReturnType<typeof getApiProvider>>();\n\n/**\n * Registers the builtin API implementations into the api-registry without\n * clobbering existing entries: compat may load after a test or extension has\n * already registered an override for a builtin api id.\n */\nexport function registerBuiltInApiProviders(): void {\n\tfor (const [api, streams] of BUILTIN_APIS) {\n\t\tregisterBuiltinApiProvider({ api, stream: streams.stream, streamSimple: streams.streamSimple });\n\t\tif (!getApiProvider(api)) {\n\t\t\tregisterApiProvider({ api, stream: streams.stream, streamSimple: streams.streamSimple });\n\t\t}\n\t\tbuiltinApiProviderInstances.set(api, getApiProvider(api));\n\t}\n}\n\nexport function resetApiProviders(): void {\n\tclearApiProviders();\n\tbuiltinApiProviderInstances.clear();\n\tregisterBuiltInApiProviders();\n}\n\nregisterBuiltInApiProviders();\n\nconst compatModels = builtinModels();\nconst AMBIENT_AUTH_MARKER = \"<authenticated>\";\n\nfunction hasExplicitApiKey(apiKey: string | undefined): apiKey is string {\n\treturn typeof apiKey === \"string\" && apiKey.trim().length > 0;\n}\n\nfunction withEnvApiKey<TOptions extends StreamOptions>(\n\tmodel: Model<Api>,\n\toptions: TOptions | undefined,\n): TOptions | undefined {\n\tif (hasExplicitApiKey(options?.apiKey)) return options;\n\tconst apiKey = getEnvApiKey(model.provider, options?.env);\n\tif (!apiKey || apiKey === AMBIENT_AUTH_MARKER) return options;\n\treturn { ...options, apiKey } as TOptions;\n}\n\nfunction hasResolvedCloudflareAuth(options: StreamOptions | undefined): boolean {\n\treturn hasExplicitApiKey(options?.apiKey) || typeof options?.headers?.[\"cf-aig-authorization\"] === \"string\";\n}\n\nfunction getBuiltinProviderForModel(model: Model<Api>) {\n\tif (getApiProvider(model.api) !== builtinApiProviderInstances.get(model.api)) return undefined;\n\tconst provider = compatModels.getProvider(model.provider);\n\treturn provider?.getModels().some((candidate) => candidate.api === model.api) ? provider : undefined;\n}\n\nfunction resolveApiProvider(api: Api) {\n\tconst provider = getApiProvider(api);\n\tif (!provider) {\n\t\tthrow new Error(`No API provider registered for api: ${api}`);\n\t}\n\treturn provider;\n}\n\nexport function stream<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: ProviderStreamOptions,\n): AssistantMessageEventStream {\n\tconst format = getToolCallFormat(model);\n\tif (format && context.tools && context.tools.length > 0) {\n\t\tconst protocol = getProtocol(format);\n\t\tconst transformedContext = transformContext(context, protocol);\n\t\tconst innerStream = stream(model, transformedContext, options);\n\t\treturn wrapStreamWithToolCallMiddleware(innerStream, protocol, context.tools);\n\t}\n\n\tconst builtinProvider = getBuiltinProviderForModel(model);\n\tif (builtinProvider) {\n\t\tif (model.provider.startsWith(\"cloudflare-\") && !hasResolvedCloudflareAuth(options)) {\n\t\t\treturn compatModels.stream(model, context, options as ModelsApiStreamOptions<TApi> | undefined);\n\t\t}\n\t\treturn builtinProvider.stream(model, context, withEnvApiKey(model, options) as ApiStreamOptions<TApi>);\n\t}\n\tconst provider = resolveApiProvider(model.api);\n\treturn provider.stream(model, context, withEnvApiKey(model, options) as StreamOptions);\n}\n\nexport async function complete<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: ProviderStreamOptions,\n): Promise<AssistantMessage> {\n\tconst s = stream(model, context, options);\n\treturn s.result();\n}\n\nexport function streamSimple<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: SimpleStreamOptions,\n): AssistantMessageEventStream {\n\tconst format = getToolCallFormat(model);\n\tif (format && context.tools && context.tools.length > 0) {\n\t\tconst protocol = getProtocol(format);\n\t\tconst transformedContext = transformContext(context, protocol);\n\t\tconst innerStream = streamSimple(model, transformedContext, options);\n\t\treturn wrapStreamWithToolCallMiddleware(innerStream, protocol, context.tools);\n\t}\n\n\tconst builtinProvider = getBuiltinProviderForModel(model);\n\tif (builtinProvider) {\n\t\tif (model.provider.startsWith(\"cloudflare-\") && !hasResolvedCloudflareAuth(options)) {\n\t\t\treturn compatModels.streamSimple(model, context, options);\n\t\t}\n\t\treturn builtinProvider.streamSimple(model, context, withEnvApiKey(model, options));\n\t}\n\tconst provider = resolveApiProvider(model.api);\n\treturn provider.streamSimple(model, context, withEnvApiKey(model, options));\n}\n\nexport async function completeSimple<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: SimpleStreamOptions,\n): Promise<AssistantMessage> {\n\tconst s = streamSimple(model, context, options);\n\treturn s.result();\n}\n"]}
1
+ {"version":3,"file":"compat.js","sourceRoot":"","sources":["../src/compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kCAAkC,CAAC;AACjD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,CAAC,CAAC;IAC1D,IAAI,eAAe,EAAE,CAAC;QACrB,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;YACrF,OAAO,YAAY,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,eAAe,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/C,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,KAAkB,EAClB,OAAgB,EAChB,OAA6B;IAE7B,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Temporary compatibility entrypoint preserving the old global pi-ai API\n * surface: api-dispatch `stream()`/`complete()` with env API key injection,\n * the api-registry, generated catalog reads (`getModel`/`getModels`/\n * `getProviders`), per-API lazy stream wrappers, and image generation.\n *\n * Existing apps switch imports from \"@earendil-works/pi-ai\" to\n * \"@earendil-works/pi-ai/compat\" unchanged; new code uses `createModels()`\n * and the provider factories. This module is deleted with the coding-agent\n * ModelManager migration.\n */\n\nexport * from \"./api/anthropic-messages.lazy.ts\";\nexport * from \"./api/azure-openai-responses.lazy.ts\";\nexport * from \"./api/bedrock-converse-stream.lazy.ts\";\nexport * from \"./api/cursor-agent.lazy.ts\";\nexport * from \"./api/devin-agent.lazy.ts\";\nexport * from \"./api/google-generative-ai.lazy.ts\";\nexport * from \"./api/google-vertex.lazy.ts\";\nexport * from \"./api/mistral-conversations.lazy.ts\";\nexport * from \"./api/openai-codex-responses.lazy.ts\";\nexport * from \"./api/openai-completions.lazy.ts\";\nexport * from \"./api/openai-responses.lazy.ts\";\nexport * from \"./api/pi-messages.lazy.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./image-models.ts\";\nexport * from \"./images.ts\";\nexport * from \"./images-api-registry.ts\";\nexport * from \"./index.ts\";\nexport * from \"./legacy-api-aliases.ts\";\nexport * from \"./legacy-provider-ids.ts\";\nexport * from \"./providers/images/register-builtins.ts\";\nexport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\ttransformContext,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\n\nimport { anthropicMessagesApi } from \"./api/anthropic-messages.lazy.ts\";\nimport { azureOpenAIResponsesApi } from \"./api/azure-openai-responses.lazy.ts\";\nimport { bedrockConverseStreamApi } from \"./api/bedrock-converse-stream.lazy.ts\";\nimport { cursorAgentApi } from \"./api/cursor-agent.lazy.ts\";\nimport { devinAgentApi } from \"./api/devin-agent.lazy.ts\";\nimport { googleGenerativeAIApi } from \"./api/google-generative-ai.lazy.ts\";\nimport { googleVertexApi } from \"./api/google-vertex.lazy.ts\";\nimport { mistralConversationsApi } from \"./api/mistral-conversations.lazy.ts\";\nimport { openAICodexResponsesApi } from \"./api/openai-codex-responses.lazy.ts\";\nimport { openAICompletionsApi } from \"./api/openai-completions.lazy.ts\";\nimport { openAIResponsesApi } from \"./api/openai-responses.lazy.ts\";\nimport { piMessagesApi } from \"./api/pi-messages.lazy.ts\";\nimport { getEnvApiKey } from \"./env-api-keys.ts\";\nimport type { ModelsApiStreamOptions } from \"./models.ts\";\nimport { builtinModels, getBuiltinModel, getBuiltinModels, getBuiltinProviders } from \"./providers/all.ts\";\n\nexport type { BuiltinProvider } from \"./providers/all.ts\";\n\nimport { createFauxCore, type FauxProviderRegistration, type RegisterFauxProviderOptions } from \"./providers/faux.ts\";\nimport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\ttransformContext,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\nimport type {\n\tApi,\n\tApiStreamOptions,\n\tAssistantMessage,\n\tAssistantMessageEventStream,\n\tContext,\n\tModel,\n\tProviderStreamOptions,\n\tProviderStreams,\n\tSimpleStreamOptions,\n\tStreamOptions,\n} from \"./types.ts\";\n\n/** @deprecated Static catalog read. Use `getBuiltinModel` from \"@earendil-works/pi-ai/providers/all\" or `Models.getModel()`. */\nexport const getModel = getBuiltinModel;\n\n/** @deprecated Static catalog read. Use `getBuiltinModels` from \"@earendil-works/pi-ai/providers/all\" or `Models.getModels()`. */\nexport const getModels = getBuiltinModels;\n\n/** @deprecated Static catalog read. Use `getBuiltinProviders` from \"@earendil-works/pi-ai/providers/all\" or `Models.getProviders()`. */\nexport const getProviders = getBuiltinProviders;\n\nexport {\n\ttype ApiProvider,\n\ttype ApiProviderInternal,\n\ttype ApiStreamFunction,\n\ttype ApiStreamSimpleFunction,\n\tgetApiProvider,\n\tgetApiProviders,\n\tregisterApiProvider,\n\tunregisterApiProviders,\n} from \"./api-registry.ts\";\n\nimport {\n\tclearApiProviders,\n\tgetApiProvider,\n\tregisterApiProvider,\n\tregisterBuiltinApiProvider,\n\tunregisterApiProviders,\n} from \"./api-registry.ts\";\n\nexport function registerFauxProvider(options: RegisterFauxProviderOptions = {}): FauxProviderRegistration {\n\tconst core = createFauxCore(options);\n\tconst sourceId = `faux-provider-${Math.random().toString(36).slice(2, 10)}`;\n\tregisterApiProvider({ api: core.api, stream: core.stream, streamSimple: core.streamSimple }, sourceId);\n\treturn {\n\t\tapi: core.api,\n\t\tmodels: core.models,\n\t\tgetModel: core.getModel,\n\t\tstate: core.state,\n\t\tsetResponses: core.setResponses,\n\t\tappendResponses: core.appendResponses,\n\t\tgetPendingResponseCount: core.getPendingResponseCount,\n\t\tgetCallLog: core.getCallLog,\n\t\tunregister() {\n\t\t\tunregisterApiProviders(sourceId);\n\t\t},\n\t};\n}\n\nconst BUILTIN_APIS: [Api, ProviderStreams][] = [\n\t[\"anthropic-messages\", anthropicMessagesApi()],\n\t[\"openai-completions\", openAICompletionsApi()],\n\t[\"openai-responses\", openAIResponsesApi()],\n\t[\"openai-codex-responses\", openAICodexResponsesApi()],\n\t[\"cursor-agent\", cursorAgentApi()],\n\t[\"devin-agent\", devinAgentApi()],\n\t[\"azure-openai-responses\", azureOpenAIResponsesApi()],\n\t[\"google-generative-ai\", googleGenerativeAIApi()],\n\t[\"google-vertex\", googleVertexApi()],\n\t[\"mistral-conversations\", mistralConversationsApi()],\n\t[\"bedrock-converse-stream\", bedrockConverseStreamApi()],\n\t[\"pi-messages\", piMessagesApi()],\n];\n\nconst builtinApiProviderInstances = new Map<Api, ReturnType<typeof getApiProvider>>();\n\n/**\n * Registers the builtin API implementations into the api-registry without\n * clobbering existing entries: compat may load after a test or extension has\n * already registered an override for a builtin api id.\n */\nexport function registerBuiltInApiProviders(): void {\n\tfor (const [api, streams] of BUILTIN_APIS) {\n\t\tregisterBuiltinApiProvider({ api, stream: streams.stream, streamSimple: streams.streamSimple });\n\t\tif (!getApiProvider(api)) {\n\t\t\tregisterApiProvider({ api, stream: streams.stream, streamSimple: streams.streamSimple });\n\t\t}\n\t\tbuiltinApiProviderInstances.set(api, getApiProvider(api));\n\t}\n}\n\nexport function resetApiProviders(): void {\n\tclearApiProviders();\n\tbuiltinApiProviderInstances.clear();\n\tregisterBuiltInApiProviders();\n}\n\nregisterBuiltInApiProviders();\n\nconst compatModels = builtinModels();\nconst AMBIENT_AUTH_MARKER = \"<authenticated>\";\n\nfunction hasExplicitApiKey(apiKey: string | undefined): apiKey is string {\n\treturn typeof apiKey === \"string\" && apiKey.trim().length > 0;\n}\n\nfunction withEnvApiKey<TOptions extends StreamOptions>(\n\tmodel: Model<Api>,\n\toptions: TOptions | undefined,\n): TOptions | undefined {\n\tif (hasExplicitApiKey(options?.apiKey)) return options;\n\tconst apiKey = getEnvApiKey(model.provider, options?.env);\n\tif (!apiKey || apiKey === AMBIENT_AUTH_MARKER) return options;\n\treturn { ...options, apiKey } as TOptions;\n}\n\nfunction hasResolvedCloudflareAuth(options: StreamOptions | undefined): boolean {\n\treturn hasExplicitApiKey(options?.apiKey) || typeof options?.headers?.[\"cf-aig-authorization\"] === \"string\";\n}\n\nfunction getBuiltinProviderForModel(model: Model<Api>) {\n\tif (getApiProvider(model.api) !== builtinApiProviderInstances.get(model.api)) return undefined;\n\tconst provider = compatModels.getProvider(model.provider);\n\treturn provider?.getModels().some((candidate) => candidate.api === model.api) ? provider : undefined;\n}\n\nfunction resolveApiProvider(api: Api) {\n\tconst provider = getApiProvider(api);\n\tif (!provider) {\n\t\tthrow new Error(`No API provider registered for api: ${api}`);\n\t}\n\treturn provider;\n}\n\nexport function stream<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: ProviderStreamOptions,\n): AssistantMessageEventStream {\n\tconst format = getToolCallFormat(model);\n\tif (format && context.tools && context.tools.length > 0) {\n\t\tconst protocol = getProtocol(format);\n\t\tconst transformedContext = transformContext(context, protocol);\n\t\tconst innerStream = stream(model, transformedContext, options);\n\t\treturn wrapStreamWithToolCallMiddleware(innerStream, protocol, context.tools);\n\t}\n\n\tconst builtinProvider = getBuiltinProviderForModel(model);\n\tif (builtinProvider) {\n\t\tif (model.provider.startsWith(\"cloudflare-\") && !hasResolvedCloudflareAuth(options)) {\n\t\t\treturn compatModels.stream(model, context, options as ModelsApiStreamOptions<TApi> | undefined);\n\t\t}\n\t\treturn builtinProvider.stream(model, context, withEnvApiKey(model, options) as ApiStreamOptions<TApi>);\n\t}\n\tconst provider = resolveApiProvider(model.api);\n\treturn provider.stream(model, context, withEnvApiKey(model, options) as StreamOptions);\n}\n\nexport async function complete<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: ProviderStreamOptions,\n): Promise<AssistantMessage> {\n\tconst s = stream(model, context, options);\n\treturn s.result();\n}\n\nexport function streamSimple<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: SimpleStreamOptions,\n): AssistantMessageEventStream {\n\tconst format = getToolCallFormat(model);\n\tif (format && context.tools && context.tools.length > 0) {\n\t\tconst protocol = getProtocol(format);\n\t\tconst transformedContext = transformContext(context, protocol);\n\t\tconst innerStream = streamSimple(model, transformedContext, options);\n\t\treturn wrapStreamWithToolCallMiddleware(innerStream, protocol, context.tools);\n\t}\n\n\tconst builtinProvider = getBuiltinProviderForModel(model);\n\tif (builtinProvider) {\n\t\tif (model.provider.startsWith(\"cloudflare-\") && !hasResolvedCloudflareAuth(options)) {\n\t\t\treturn compatModels.streamSimple(model, context, options);\n\t\t}\n\t\treturn builtinProvider.streamSimple(model, context, withEnvApiKey(model, options));\n\t}\n\tconst provider = resolveApiProvider(model.api);\n\treturn provider.streamSimple(model, context, withEnvApiKey(model, options));\n}\n\nexport async function completeSimple<TApi extends Api>(\n\tmodel: Model<TApi>,\n\tcontext: Context,\n\toptions?: SimpleStreamOptions,\n): Promise<AssistantMessage> {\n\tconst s = streamSimple(model, context, options);\n\treturn s.result();\n}\n"]}
@@ -31,6 +31,7 @@ export { CURSOR_MODEL_CAPABILITIES, type CursorCapabilityEvidence, type CursorLe
31
31
  export { type CursorResolvedSelection, renderCursorCliModelString, resolveCursorSelectionDescriptor, } from "./cursor/selection-descriptor.ts";
32
32
  export * from "./env-api-keys.ts";
33
33
  export * from "./images-models.ts";
34
+ export * from "./legacy-provider-ids.ts";
34
35
  export * from "./models.ts";
35
36
  export * from "./models-store.ts";
36
37
  export * from "./providers/faux.ts";
@@ -50,6 +51,7 @@ export * from "./utils/json-parse.ts";
50
51
  export { extractOpenAiCodexAccountId } from "./utils/openai-codex-auth.ts";
51
52
  export * from "./utils/overflow.ts";
52
53
  export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, resolvePromptCacheTtlSeconds, } from "./utils/prompt-cache-ttl.ts";
54
+ export * from "./utils/provider-failure-description.ts";
53
55
  export * from "./utils/retry.ts";
54
56
  export * from "./utils/server-fallback-receipt.ts";
55
57
  export * from "./utils/stop-details.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAM/B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/G,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnF,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EACN,mCAAmC,EACnC,sCAAsC,GACtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,mBAAmB,IAAI,yBAAyB,EAChD,iBAAiB,IAAI,uBAAuB,EAC5C,OAAO,IAAI,aAAa,EACxB,QAAQ,IAAI,cAAc,EAC1B,UAAU,IAAI,gBAAgB,EAC9B,SAAS,IAAI,eAAe,GAC5B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACX,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,0BAA0B,EAC1B,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAClG,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,eAAe,CAAC;AAC9B,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E,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
@@ -17,6 +17,7 @@ export { CURSOR_MODEL_CAPABILITIES, getCursorBaseIdForVariant, getCursorCapabili
17
17
  export { renderCursorCliModelString, resolveCursorSelectionDescriptor, } from "./cursor/selection-descriptor.js";
18
18
  export * from "./env-api-keys.js";
19
19
  export * from "./images-models.js";
20
+ export * from "./legacy-provider-ids.js";
20
21
  export * from "./models.js";
21
22
  export * from "./models-store.js";
22
23
  export * from "./providers/faux.js";
@@ -36,6 +37,7 @@ export * from "./utils/json-parse.js";
36
37
  export { extractOpenAiCodexAccountId } from "./utils/openai-codex-auth.js";
37
38
  export * from "./utils/overflow.js";
38
39
  export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, resolvePromptCacheTtlSeconds, } from "./utils/prompt-cache-ttl.js";
40
+ export * from "./utils/provider-failure-description.js";
39
41
  export * from "./utils/retry.js";
40
42
  export * from "./utils/server-fallback-receipt.js";
41
43
  export * from "./utils/stop-details.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,EACN,mCAAmC,EACnC,sCAAsC,GACtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,mBAAmB,IAAI,yBAAyB,EAChD,iBAAiB,IAAI,uBAAuB,EAC5C,OAAO,IAAI,aAAa,EACxB,QAAQ,IAAI,cAAc,EAC1B,UAAU,IAAI,gBAAgB,EAC9B,SAAS,IAAI,eAAe,GAC5B,MAAM,+BAA+B,CAAC;AAcvC,cAAc,eAAe,CAAC;AAK9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAIN,eAAe,GACf,MAAM,4BA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AAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,cAAc,qBAAqB,CAAC;AACpC,OAAO,EACN,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,4BAA4B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@earendil-works/pi-ai/providers/*\", API implementations under\n// \"@earendil-works/pi-ai/api/*\", the old global API under\n// \"@earendil-works/pi-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport { sanitizeAnthropicToolPairs } from \"./api/anthropic-tool-pairs.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport {\n\tmeasureCursorHistorySerializedBytes,\n\tmeasureCursorModelInputSerializedBytes,\n} from \"./api/cursor-agent/measure.ts\";\nexport {\n\tcomposeShellCommand as composeCursorShellCommand,\n\tomitUndefinedArgs as omitUndefinedCursorArgs,\n\tpiLimit as cursorPiLimit,\n\tpiLsPath as cursorPiLsPath,\n\tpiReadArgs as cursorPiReadArgs,\n\tpiTimeout as cursorPiTimeout,\n} from \"./api/cursor-agent/pi-args.ts\";\nexport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorPiCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./api/cursor-agent/types.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleApiThinkingLevel, ResolvedGoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport { convertResponsesMessages } from \"./api/openai-responses-shared.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport {\n\ttype WarmPromptCacheOptions,\n\ttype WarmPromptCacheResult,\n\ttype WarmPromptCacheUsage,\n\twarmPromptCache,\n} from \"./api/warm-prompt-cache.ts\";\nexport { getApiProvider } from \"./api-registry.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/headers.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProviderId,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport {\n\tCONTEXT_PROVENANCE_FIELD,\n\ttype ContextProvenance,\n\tcontextProvenanceFingerprint,\n\tcopyContextProvenance,\n\tgetContextProvenance,\n} from \"./context-provenance.ts\";\nexport * from \"./cursor/catalog-grouping.ts\";\nexport {\n\tCURSOR_MODEL_CAPABILITIES,\n\ttype CursorCapabilityEvidence,\n\ttype CursorLevelEncoding,\n\ttype CursorLevelSpec,\n\ttype CursorModelCapability,\n\ttype CursorParameterId,\n\ttype CursorVariantAlias,\n\ttype CursorVariantParse,\n\tgetCursorBaseIdForVariant,\n\tgetCursorCapabilityForBase,\n\tgetCursorVariantAlias,\n} from \"./cursor/model-capabilities.ts\";\nexport {\n\ttype CursorResolvedSelection,\n\trenderCursorCliModelString,\n\tresolveCursorSelectionDescriptor,\n} from \"./cursor/selection-descriptor.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\thasKimiTextToolCallRecovery,\n\tshouldRecoverTextToolCalls,\n\ttransformContext,\n\twrapStreamWithModelRecovery,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\nexport { createXtmlRecoveryStreamParser } from \"./tool-call-middleware/protocols/kimi-xtml/recovery-stream.ts\";\nexport { wrapStreamWithInvokeRecovery } from \"./tool-call-middleware/recovery-stream-wrapper.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/assistant-message-frame.ts\";\nexport {\n\ttype CursorExecResolvedCarrier,\n\tcopyCursorExecResolved,\n\tisCursorExecResolved,\n\tkCursorExecResolved,\n} from \"./utils/block-symbols.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport { dropFailedAssistantTurns } from \"./utils/drop-failed-assistant-turns.ts\";\nexport * from \"./utils/empty-response-errors.ts\";\nexport { estimateContextTokens } from \"./utils/estimate.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport { extractOpenAiCodexAccountId } from \"./utils/openai-codex-auth.ts\";\nexport * from \"./utils/overflow.ts\";\nexport {\n\tisAnthropicApiBaseUrl,\n\tPROMPT_CACHE_TTL_LONG_SECONDS,\n\tPROMPT_CACHE_TTL_SHORT_SECONDS,\n\tresolvePromptCacheTtlSeconds,\n} from \"./utils/prompt-cache-ttl.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/server-fallback-receipt.ts\";\nexport * from \"./utils/stop-details.ts\";\nexport { contentText } from \"./utils/text.ts\";\nexport * from \"./utils/tool-pair-repair.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport { uuidv7 } from \"./utils/uuid.ts\";\nexport * from \"./utils/validation.ts\";\nexport * from \"./utils/visible-text.ts\";\nexport { getWireIdentity, setWireIdentity } from \"./wire-identity.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,EACN,mCAAmC,EACnC,sCAAsC,GACtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,mBAAmB,IAAI,yBAAyB,EAChD,iBAAiB,IAAI,uBAAuB,EAC5C,OAAO,IAAI,aAAa,EACxB,QAAQ,IAAI,cAAc,EAC1B,UAAU,IAAI,gBAAgB,EAC9B,SAAS,IAAI,eAAe,GAC5B,MAAM,+BAA+B,CAAC;AAcvC,cAAc,eAAe,CAAC;AAK9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAIN,eAAe,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAUhC,OAAO,EACN,wBAAwB,EAExB,4BAA4B,EAC5B,qBA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c,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@earendil-works/pi-ai/providers/*\", API implementations under\n// \"@earendil-works/pi-ai/api/*\", the old global API under\n// \"@earendil-works/pi-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport { sanitizeAnthropicToolPairs } from \"./api/anthropic-tool-pairs.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport {\n\tmeasureCursorHistorySerializedBytes,\n\tmeasureCursorModelInputSerializedBytes,\n} from \"./api/cursor-agent/measure.ts\";\nexport {\n\tcomposeShellCommand as composeCursorShellCommand,\n\tomitUndefinedArgs as omitUndefinedCursorArgs,\n\tpiLimit as cursorPiLimit,\n\tpiLsPath as cursorPiLsPath,\n\tpiReadArgs as cursorPiReadArgs,\n\tpiTimeout as cursorPiTimeout,\n} from \"./api/cursor-agent/pi-args.ts\";\nexport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorPiCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./api/cursor-agent/types.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleApiThinkingLevel, ResolvedGoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport { convertResponsesMessages } from \"./api/openai-responses-shared.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport {\n\ttype WarmPromptCacheOptions,\n\ttype WarmPromptCacheResult,\n\ttype WarmPromptCacheUsage,\n\twarmPromptCache,\n} from \"./api/warm-prompt-cache.ts\";\nexport { getApiProvider } from \"./api-registry.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/headers.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProviderId,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport {\n\tCONTEXT_PROVENANCE_FIELD,\n\ttype ContextProvenance,\n\tcontextProvenanceFingerprint,\n\tcopyContextProvenance,\n\tgetContextProvenance,\n} from \"./context-provenance.ts\";\nexport * from \"./cursor/catalog-grouping.ts\";\nexport {\n\tCURSOR_MODEL_CAPABILITIES,\n\ttype CursorCapabilityEvidence,\n\ttype CursorLevelEncoding,\n\ttype CursorLevelSpec,\n\ttype CursorModelCapability,\n\ttype CursorParameterId,\n\ttype CursorVariantAlias,\n\ttype CursorVariantParse,\n\tgetCursorBaseIdForVariant,\n\tgetCursorCapabilityForBase,\n\tgetCursorVariantAlias,\n} from \"./cursor/model-capabilities.ts\";\nexport {\n\ttype CursorResolvedSelection,\n\trenderCursorCliModelString,\n\tresolveCursorSelectionDescriptor,\n} from \"./cursor/selection-descriptor.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./legacy-provider-ids.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\thasKimiTextToolCallRecovery,\n\tshouldRecoverTextToolCalls,\n\ttransformContext,\n\twrapStreamWithModelRecovery,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\nexport { createXtmlRecoveryStreamParser } from \"./tool-call-middleware/protocols/kimi-xtml/recovery-stream.ts\";\nexport { wrapStreamWithInvokeRecovery } from \"./tool-call-middleware/recovery-stream-wrapper.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/assistant-message-frame.ts\";\nexport {\n\ttype CursorExecResolvedCarrier,\n\tcopyCursorExecResolved,\n\tisCursorExecResolved,\n\tkCursorExecResolved,\n} from \"./utils/block-symbols.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport { dropFailedAssistantTurns } from \"./utils/drop-failed-assistant-turns.ts\";\nexport * from \"./utils/empty-response-errors.ts\";\nexport { estimateContextTokens } from \"./utils/estimate.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport { extractOpenAiCodexAccountId } from \"./utils/openai-codex-auth.ts\";\nexport * from \"./utils/overflow.ts\";\nexport {\n\tisAnthropicApiBaseUrl,\n\tPROMPT_CACHE_TTL_LONG_SECONDS,\n\tPROMPT_CACHE_TTL_SHORT_SECONDS,\n\tresolvePromptCacheTtlSeconds,\n} from \"./utils/prompt-cache-ttl.ts\";\nexport * from \"./utils/provider-failure-description.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/server-fallback-receipt.ts\";\nexport * from \"./utils/stop-details.ts\";\nexport { contentText } from \"./utils/text.ts\";\nexport * from \"./utils/tool-pair-repair.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport { uuidv7 } from \"./utils/uuid.ts\";\nexport * from \"./utils/validation.ts\";\nexport * from \"./utils/visible-text.ts\";\nexport { getWireIdentity, setWireIdentity } from \"./wire-identity.ts\";\n"]}
@@ -0,0 +1,8 @@
1
+ export declare const LEGACY_PROVIDER_IDS: Readonly<{
2
+ readonly "openai-codex": "chatgpt-subscription";
3
+ readonly "claude-sdk-oauth": "anthropic-subscription";
4
+ }>;
5
+ export declare function normalizeProviderId(id: string): string;
6
+ export declare function normalizeModelRef(ref: string): string;
7
+ export declare function isLegacyProviderId(id: string): boolean;
8
+ //# sourceMappingURL=legacy-provider-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-provider-ids.d.ts","sourceRoot":"","sources":["../src/legacy-provider-ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;6BACf,sBAAsB;iCAClB,wBAAwB;EAClC,CAAC;AAIZ,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWrD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEtD"}
@@ -0,0 +1,26 @@
1
+ export const LEGACY_PROVIDER_IDS = Object.freeze({
2
+ "openai-codex": "chatgpt-subscription",
3
+ "claude-sdk-oauth": "anthropic-subscription",
4
+ });
5
+ export function normalizeProviderId(id) {
6
+ if (!Object.hasOwn(LEGACY_PROVIDER_IDS, id)) {
7
+ return id;
8
+ }
9
+ return LEGACY_PROVIDER_IDS[id];
10
+ }
11
+ export function normalizeModelRef(ref) {
12
+ const slash = ref.indexOf("/");
13
+ if (slash === -1) {
14
+ return normalizeProviderId(ref);
15
+ }
16
+ const provider = ref.slice(0, slash);
17
+ const normalized = normalizeProviderId(provider);
18
+ if (normalized === provider) {
19
+ return ref;
20
+ }
21
+ return `${normalized}/${ref.slice(slash + 1)}`;
22
+ }
23
+ export function isLegacyProviderId(id) {
24
+ return Object.hasOwn(LEGACY_PROVIDER_IDS, id);
25
+ }
26
+ //# sourceMappingURL=legacy-provider-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-provider-ids.js","sourceRoot":"","sources":["../src/legacy-provider-ids.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,cAAc,EAAE,sBAAsB;IACtC,kBAAkB,EAAE,wBAAwB;CACnC,CAAC,CAAC;AAIZ,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC7C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,CAAC,EAAE,CAAC;QAC7C,OAAO,EAAE,CAAC;IACX,CAAC;IACD,OAAO,mBAAmB,CAAC,EAAsB,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC5C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QAClB,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,UAAU,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAC5C,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["export const LEGACY_PROVIDER_IDS = Object.freeze({\n\t\"openai-codex\": \"chatgpt-subscription\",\n\t\"claude-sdk-oauth\": \"anthropic-subscription\",\n} as const);\n\ntype LegacyProviderId = keyof typeof LEGACY_PROVIDER_IDS;\n\nexport function normalizeProviderId(id: string): string {\n\tif (!Object.hasOwn(LEGACY_PROVIDER_IDS, id)) {\n\t\treturn id;\n\t}\n\treturn LEGACY_PROVIDER_IDS[id as LegacyProviderId];\n}\n\nexport function normalizeModelRef(ref: string): string {\n\tconst slash = ref.indexOf(\"/\");\n\tif (slash === -1) {\n\t\treturn normalizeProviderId(ref);\n\t}\n\tconst provider = ref.slice(0, slash);\n\tconst normalized = normalizeProviderId(provider);\n\tif (normalized === provider) {\n\t\treturn ref;\n\t}\n\treturn `${normalized}/${ref.slice(slash + 1)}`;\n}\n\nexport function isLegacyProviderId(id: string): boolean {\n\treturn Object.hasOwn(LEGACY_PROVIDER_IDS, id);\n}\n"]}
@@ -1 +1 @@
1
- {"schemaVersion":3,"generatedAt":"2026-09-21T10:39:33.382Z","structureHash":"7804dbf68d45e878145e435c433b763ba3d9ccc9b6cbb81440e787cd22a06b92","files":{"alibaba-token-plan.json":"3a9c1be76d47459371e9fa2feeffc31e7edbbfec65fa9cc41236988efc4cf6d9","amazon-bedrock.json":"d82a76308591b1777c351a22f1bd3e4f332a50464743dfc3610b250e265e531d","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"e9d883ee35d94dba963320b5496bd7dd368d226cbafcf134bfec66a0a24b3b7f","azure-openai-responses.json":"9d2137c68fbf7012872296a02a13a138f7d5246dc09f2ca79e34e6a875b11488","bai.json":"2b12b15bd43462e60711944dd7283db8676611d9d76c82c2a01f64913e16a67e","baseten.json":"d155c434294b5167244cffb6dea6793f9669e91e8ab65b564f9510d81b330e37","cerebras.json":"9eaa554e1b02f3665f8f63e6432d253bf81351af7c72001054dd8108aa528a52","cloudflare-ai-gateway.json":"b62b46dbb24c9a5cd0c10ba5adb58aedc2a1c0616459f36b51e07bb15416e584","cloudflare-workers-ai.json":"07ef63208ff7517fd1a80962f18143e21de399640423329490b157f459ccf995","deepseek.json":"b5f9693ec641e9a957dc5f7a22042b3bb928bac3d7268406619b6f18e21c4b83","fireworks.json":"6283651d25a8861e7d42fe2bdb1cb7dd80802811dfaf61e40c11cc813408c294","github-copilot.json":"2628f6583c2509e1f17412e6a8a8f12cf20750cc8cb82ab4273c63155cee4746","google-vertex.json":"e1631109172dc1f7d7977570420a5bb86258bdd1088427e244a2c51545c4f24d","google.json":"7619bf03edd2a7acb06a2274a14b13c3a61354288abe029a758401d4de36a8fd","groq.json":"e4728fd72e358cd8f25e9a518e9b49a521ef44523d3debe38a7db9e0663c4077","huggingface.json":"a488b6f175b382277ccf7d487f877ef0c698994576bb55d2410838bf9c8c7c41","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"be522597b22bceeb0bb9a0ba1781647649ffd19637d0c8e67b056d7b0ec33d52","moonshotai-cn.json":"c4e1801b5dfd61bebcaa33cbfc5ed0c69df14a3bee37da218a558668d817864e","moonshotai.json":"3dab637e7e2648792c786157f85f29026b93393f7098b77593c1180928d371c9","nvidia.json":"6493e09b5db8b8fe9c8fae5bc15dc287645f37f83a4ed3a1ad1181e5830b5ff7","openai-codex.json":"5b308f19ee369ba78113998361d8f8e6c160690b29947e6f07ccbc12b46289e6","openai.json":"203a1d6bf61178268edf3d3f0ad4a6408eded401c4472bda4ac0ec73142f38ce","opencode-go.json":"2650e9acbbb0a544bf9254825bee386b8bee6d2a84f9ec46c922592a0bfb47da","opencode.json":"9f32eaca64fb075e6f5a19f8a26d93676d309a58308a03e576f72251e7dbb27f","opengateway.json":"3c6a210a22965ded5f032e0a963649d809b889762205b8458cc367e5ba1e39a5","openrouter.json":"83720d90272b43e565d3582535cc2437efd98ba3bdf8af0c10f3fdd111bf760f","qwen-token-plan-cn.json":"4bf520ed38e5c3045680d2ec2816fa8a69079dbe97f7b929767a63172288da6b","qwen-token-plan-individual.json":"eb040e78595853e980011308b1bf9caacae6dc8a91abbac5ffebd402515dd2a6","qwen-token-plan.json":"a5c67213745329ec3ba79f712f31c1c32a781d7ffb8c04f9819f36c27672531f","together.json":"927c707d06f2236cdab13f14c870fb58bce0614ba7287bbcd57cc9fd66d191ed","venice.json":"647ef3c78a9c6215a9759dd54985af96adde4757cf32f129448fced334c25d16","vercel-ai-gateway.json":"2991c946e50ef3909ae4275f854fd89ee5d5d522f9a2de0644b851f84bc44c83","xai.json":"5947370c4a40ad85605f1a17ae09d4d6dd4f9ab120d14fabfb4c5a08a75e6f7e","xiaomi-token-plan-ams.json":"568b9992cf320536a65826e26a414afa5c0d17f083a01af4bd96658d9dd3e705","xiaomi-token-plan-cn.json":"c423857d0bbb0b126394eaf1ebb2a91bf2d1193cc5a4fe77843ff0f4536a0a80","xiaomi-token-plan-sgp.json":"008f1eb41037e93c5ae478f12815cd67bac1978f131ffefa602775bb60b63fea","xiaomi.json":"37acf451bb4364bdca2ecea6b7d962590d9974a87e80cfe34bb800be6a95c13b","zai-coding-cn.json":"69c572aa75104f16ccbddbaace60c267f4bcc74f86d34891ca43110d312fb1ad","zai.json":"15c8182a88e58bdc1b1c3eb0603c690475342c8a826ceddfe9af1b36b28345ee"}}
1
+ {"schemaVersion":3,"generatedAt":"2026-09-22T09:37:31.184Z","structureHash":"e885cac8a2f639b4f3ce9b22b3b89d6abe5238adcc21e59b889a7f70b9f1ecf7","files":{"alibaba-token-plan.json":"3a9c1be76d47459371e9fa2feeffc31e7edbbfec65fa9cc41236988efc4cf6d9","amazon-bedrock.json":"d82a76308591b1777c351a22f1bd3e4f332a50464743dfc3610b250e265e531d","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"e9d883ee35d94dba963320b5496bd7dd368d226cbafcf134bfec66a0a24b3b7f","azure-openai-responses.json":"9d2137c68fbf7012872296a02a13a138f7d5246dc09f2ca79e34e6a875b11488","bai.json":"2b12b15bd43462e60711944dd7283db8676611d9d76c82c2a01f64913e16a67e","baseten.json":"d155c434294b5167244cffb6dea6793f9669e91e8ab65b564f9510d81b330e37","cerebras.json":"9eaa554e1b02f3665f8f63e6432d253bf81351af7c72001054dd8108aa528a52","cloudflare-ai-gateway.json":"a2b9fa9b7bc78df3459a9c53282a9c2f715b7ce703ae0d09c59bec0a6841af49","cloudflare-workers-ai.json":"7fafe70c396bfeced683d348d743ca7ae109f03b8a6083a37a36d3698090a197","deepseek.json":"b5f9693ec641e9a957dc5f7a22042b3bb928bac3d7268406619b6f18e21c4b83","fireworks.json":"6283651d25a8861e7d42fe2bdb1cb7dd80802811dfaf61e40c11cc813408c294","github-copilot.json":"beee18c9dd4cda307140d9a54da4955a2ac1142c26d1fcbcd684181b83a7ba15","google-vertex.json":"e1631109172dc1f7d7977570420a5bb86258bdd1088427e244a2c51545c4f24d","google.json":"7619bf03edd2a7acb06a2274a14b13c3a61354288abe029a758401d4de36a8fd","groq.json":"e4728fd72e358cd8f25e9a518e9b49a521ef44523d3debe38a7db9e0663c4077","huggingface.json":"2f93082144a7b2a1cbf79148244ce7559e0428d6310c5eb0648bca89b15a8b4b","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"be522597b22bceeb0bb9a0ba1781647649ffd19637d0c8e67b056d7b0ec33d52","moonshotai-cn.json":"c4e1801b5dfd61bebcaa33cbfc5ed0c69df14a3bee37da218a558668d817864e","moonshotai.json":"3dab637e7e2648792c786157f85f29026b93393f7098b77593c1180928d371c9","nvidia.json":"6493e09b5db8b8fe9c8fae5bc15dc287645f37f83a4ed3a1ad1181e5830b5ff7","openai-codex.json":"5b308f19ee369ba78113998361d8f8e6c160690b29947e6f07ccbc12b46289e6","openai.json":"203a1d6bf61178268edf3d3f0ad4a6408eded401c4472bda4ac0ec73142f38ce","opencode-go.json":"64ea73012b153ef5d618663b6b542d527e43383e63b6b49f5961b310508c41cd","opencode.json":"c791718cc9f16789db88c7859b2fe94ce5e23a0aad72030422a23d7800ab2e0c","opengateway.json":"3c6a210a22965ded5f032e0a963649d809b889762205b8458cc367e5ba1e39a5","openrouter.json":"da9206877dc80b0c1678eb41cbb530a008a1d9612fc7fddc51dc3606802b08a1","qwen-token-plan-cn.json":"4bf520ed38e5c3045680d2ec2816fa8a69079dbe97f7b929767a63172288da6b","qwen-token-plan-individual.json":"eb040e78595853e980011308b1bf9caacae6dc8a91abbac5ffebd402515dd2a6","qwen-token-plan.json":"a5c67213745329ec3ba79f712f31c1c32a781d7ffb8c04f9819f36c27672531f","together.json":"927c707d06f2236cdab13f14c870fb58bce0614ba7287bbcd57cc9fd66d191ed","venice.json":"790725da45ac4b1977e21217f50ae97e2ef9b0381079aaf034935155bfab1129","vercel-ai-gateway.json":"8ad04c9c0834fbfd48bc33e4e653d33b25f76a43f601eb2be31d88c31bbdcca0","xai.json":"9b23faa5218e966a17108c05d2498a617ade1eae9b0d0684284c77d67949a3f1","xiaomi-token-plan-ams.json":"7df74a255259fc1d5be8e682c3ffb0908eaaf0af711f6433dedcf345ce3e8393","xiaomi-token-plan-cn.json":"7dc672723d5b37e5b92605752f74f46f44eba10be2b0cb959790260b9e0c2a4e","xiaomi-token-plan-sgp.json":"69b333b158be038459a511a673f4536a5b03d4931c3119339f1ac741bc03d502","xiaomi.json":"333299657f211ad9edac0f3d4298b7e5776626914c9c80e22305a87533f23966","zai-coding-cn.json":"69c572aa75104f16ccbddbaace60c267f4bcc74f86d34891ca43110d312fb1ad","zai.json":"15c8182a88e58bdc1b1c3eb0603c690475342c8a826ceddfe9af1b36b28345ee"}}