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

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 (630) hide show
  1. package/CHANGELOG.md +37 -17
  2. package/dist/bundle/chunks/{anthropic-messages-2P7APOOQ.js → anthropic-messages-V4CUY3UU.js} +1 -1
  3. package/dist/bundle/chunks/{app-server-command-PRNA6QQU.js → app-server-command-P5WP2YVC.js} +2 -2
  4. package/dist/bundle/chunks/azure-openai-responses-SBCCU4KI.js +2 -0
  5. package/dist/bundle/chunks/chatgpt-subscription.js +75 -0
  6. package/dist/bundle/chunks/chunk-2VZJTDUX.js +2 -0
  7. package/dist/bundle/chunks/{chunk-BOZ37BOT.js → chunk-3KLWJIXM.js} +3 -4
  8. package/dist/bundle/chunks/{chunk-M2HSO7MH.js → chunk-3UO3QYMZ.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-6OD4TT33.js → chunk-5T3V75HH.js} +113 -111
  10. package/dist/bundle/chunks/chunk-6KXIFAMC.js +11 -0
  11. package/dist/bundle/chunks/{chunk-UCPWK6TZ.js → chunk-6MIPLTQG.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-JZ6YQU3A.js → chunk-7ZPFQY76.js} +3 -3
  13. package/dist/bundle/chunks/{chunk-MUYK27UR.js → chunk-AEJUOQ7U.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-F3DXL5MX.js → chunk-AJ722VIQ.js} +1 -1
  15. package/dist/bundle/chunks/{chunk-VYIJQQ5I.js → chunk-DTD3QN3S.js} +1 -1
  16. package/dist/bundle/chunks/chunk-DY6FUAWH.js +2 -0
  17. package/dist/bundle/chunks/{chunk-5XC2FNJ5.js → chunk-GLDP7LH2.js} +1 -1
  18. package/dist/bundle/chunks/{chunk-OPNVT7BU.js → chunk-KB3DR2ZH.js} +1 -1
  19. package/dist/bundle/chunks/{chunk-JR4X6ECO.js → chunk-M4NQKQUK.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-GXUYWMN2.js → chunk-PODQ2IEB.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-ARJJU3MS.js → chunk-PU7UDZ5F.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-64JQFFHH.js → chunk-SSJ5OP3B.js} +2 -2
  23. package/dist/bundle/chunks/{chunk-X63BXA24.js → chunk-TAFYWUE4.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-KICRBRVS.js → chunk-TU37KLCN.js} +2 -2
  25. package/dist/bundle/chunks/{chunk-R6LVC7SP.js → chunk-TWTHGDQS.js} +4 -4
  26. package/dist/bundle/chunks/chunk-WS7QGU5H.js +8 -0
  27. package/dist/bundle/chunks/{chunk-IPRJIKLL.js → chunk-WSQMYWLV.js} +1 -1
  28. package/dist/bundle/chunks/chunk-ZBHRTH5C.js +2 -0
  29. package/dist/bundle/chunks/cli-main-O4CFWDWV.js +3 -0
  30. package/dist/bundle/chunks/{google-generative-ai-Y2IYMUVC.js → google-generative-ai-UJIX64UU.js} +1 -1
  31. package/dist/bundle/chunks/{google-vertex-TKBBMPHV.js → google-vertex-KJEY5SZY.js} +1 -1
  32. package/dist/bundle/chunks/help-fast-path-KFMAFECE.js +2 -0
  33. package/dist/bundle/chunks/host-command-JEBCPKMK.js +2 -0
  34. package/dist/bundle/chunks/host-lifecycle-FWIB56UI.js +3 -0
  35. package/dist/bundle/chunks/host-lifecycle.js +2 -2
  36. package/dist/bundle/chunks/{interactive-host-runtime-F5L4USLR.js → interactive-host-runtime-HBK4XNHJ.js} +1 -1
  37. package/dist/bundle/chunks/interactive-mode-WKFWOHXN.js +2 -0
  38. package/dist/bundle/chunks/{mistral-conversations-ZYDVFRYF.js → mistral-conversations-PNYVN6YU.js} +1 -1
  39. package/dist/bundle/chunks/{multi-session-host-EUTEGVLS.js → multi-session-host-DWBOLTS7.js} +2 -2
  40. package/dist/bundle/chunks/openai-codex-responses-TBF5EMKG.js +10 -0
  41. package/dist/bundle/chunks/{openai-completions-4V76L5ZJ.js → openai-completions-IJIBZB2G.js} +1 -1
  42. package/dist/bundle/chunks/{openai-images-4XAZQLDT.js → openai-images-JA5N5DUU.js} +1 -1
  43. package/dist/bundle/chunks/openai-responses-3XYO7ROE.js +2 -0
  44. package/dist/bundle/chunks/{openrouter-images-Z3WQ5BDR.js → openrouter-images-T4GY3JYM.js} +1 -1
  45. package/dist/bundle/chunks/{package-manager-cli-JPUWMUEJ.js → package-manager-cli-JUKHAT7U.js} +1 -1
  46. package/dist/bundle/chunks/{rotation-stream-S56Y7WMM.js → rotation-stream-67OZ4U6R.js} +1 -1
  47. package/dist/bundle/chunks/rpc-mode-746KEL7Z.js +2 -0
  48. package/dist/bundle/chunks/{session-picker-PFPJVVIC.js → session-picker-TO42QRV2.js} +1 -1
  49. package/dist/bundle/chunks/session-worker.js +399 -398
  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/cli/args.d.ts.map +1 -1
  54. package/dist/cli/args.js +10 -2
  55. package/dist/cli/args.js.map +1 -1
  56. package/dist/core/agent-session.d.ts +1 -1
  57. package/dist/core/agent-session.js +8 -8
  58. package/dist/core/agent-session.js.map +1 -1
  59. package/dist/core/auth-provider-key-migration.d.ts +27 -0
  60. package/dist/core/auth-provider-key-migration.d.ts.map +1 -0
  61. package/dist/core/auth-provider-key-migration.js +40 -0
  62. package/dist/core/auth-provider-key-migration.js.map +1 -0
  63. package/dist/core/auth-storage.d.ts +26 -1
  64. package/dist/core/auth-storage.d.ts.map +1 -1
  65. package/dist/core/auth-storage.js +93 -20
  66. package/dist/core/auth-storage.js.map +1 -1
  67. package/dist/core/credential-accounts.d.ts +1 -1
  68. package/dist/core/credential-accounts.d.ts.map +1 -1
  69. package/dist/core/credential-accounts.js +8 -5
  70. package/dist/core/credential-accounts.js.map +1 -1
  71. package/dist/core/credential-pool/env-slots.d.ts.map +1 -1
  72. package/dist/core/credential-pool/env-slots.js +5 -2
  73. package/dist/core/credential-pool/env-slots.js.map +1 -1
  74. package/dist/core/dynamic-prompt/build.js +1 -1
  75. package/dist/core/dynamic-prompt/build.js.map +1 -1
  76. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/account-command.d.ts +2 -2
  77. package/dist/core/extensions/builtin/anthropic-subscription/account-command.d.ts.map +1 -0
  78. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/account-command.js +24 -24
  79. package/dist/core/extensions/builtin/anthropic-subscription/account-command.js.map +1 -0
  80. package/dist/core/extensions/builtin/anthropic-subscription/account-events.d.ts.map +1 -0
  81. package/dist/core/extensions/builtin/anthropic-subscription/account-events.js.map +1 -0
  82. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/account-management.d.ts +1 -1
  83. package/dist/core/extensions/builtin/anthropic-subscription/account-management.d.ts.map +1 -0
  84. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/account-management.js +2 -2
  85. package/dist/core/extensions/builtin/anthropic-subscription/account-management.js.map +1 -0
  86. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/accounts.d.ts +8 -8
  87. package/dist/core/extensions/builtin/anthropic-subscription/accounts.d.ts.map +1 -0
  88. package/dist/core/extensions/builtin/anthropic-subscription/accounts.js.map +1 -0
  89. package/dist/core/extensions/builtin/anthropic-subscription/affinity.d.ts.map +1 -0
  90. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/affinity.js +2 -2
  91. package/dist/core/extensions/builtin/anthropic-subscription/affinity.js.map +1 -0
  92. package/dist/core/extensions/builtin/anthropic-subscription/api-id.d.ts.map +1 -0
  93. package/dist/core/extensions/builtin/anthropic-subscription/api-id.js.map +1 -0
  94. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/auth-attempt.d.ts +2 -2
  95. package/dist/core/extensions/builtin/anthropic-subscription/auth-attempt.d.ts.map +1 -0
  96. package/dist/core/extensions/builtin/anthropic-subscription/auth-attempt.js.map +1 -0
  97. package/dist/core/extensions/builtin/anthropic-subscription/auth-environment.d.ts.map +1 -0
  98. package/dist/core/extensions/builtin/anthropic-subscription/auth-environment.js.map +1 -0
  99. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/auth-lane.d.ts +5 -5
  100. package/dist/core/extensions/builtin/anthropic-subscription/auth-lane.d.ts.map +1 -0
  101. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/auth-lane.js +10 -10
  102. package/dist/core/extensions/builtin/anthropic-subscription/auth-lane.js.map +1 -0
  103. package/dist/core/extensions/builtin/anthropic-subscription/availability.d.ts.map +1 -0
  104. package/dist/core/extensions/builtin/anthropic-subscription/availability.js.map +1 -0
  105. package/dist/core/extensions/builtin/anthropic-subscription/bounded-queue.d.ts.map +1 -0
  106. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/bounded-queue.js +1 -1
  107. package/dist/core/extensions/builtin/anthropic-subscription/bounded-queue.js.map +1 -0
  108. package/dist/core/extensions/builtin/anthropic-subscription/config-dir-credentials.d.ts +18 -0
  109. package/dist/core/extensions/builtin/anthropic-subscription/config-dir-credentials.d.ts.map +1 -0
  110. package/dist/core/extensions/builtin/anthropic-subscription/config-dir-credentials.js +81 -0
  111. package/dist/core/extensions/builtin/anthropic-subscription/config-dir-credentials.js.map +1 -0
  112. package/dist/core/extensions/builtin/anthropic-subscription/content-blocks.d.ts.map +1 -0
  113. package/dist/core/extensions/builtin/anthropic-subscription/content-blocks.js.map +1 -0
  114. package/dist/core/extensions/builtin/anthropic-subscription/custom-tools-schema.d.ts.map +1 -0
  115. package/dist/core/extensions/builtin/anthropic-subscription/custom-tools-schema.js.map +1 -0
  116. package/dist/core/extensions/builtin/anthropic-subscription/custom-tools.d.ts.map +1 -0
  117. package/dist/core/extensions/builtin/anthropic-subscription/custom-tools.js.map +1 -0
  118. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/errors.d.ts +1 -1
  119. package/dist/core/extensions/builtin/anthropic-subscription/errors.d.ts.map +1 -0
  120. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/errors.js +1 -1
  121. package/dist/core/extensions/builtin/anthropic-subscription/errors.js.map +1 -0
  122. package/dist/core/extensions/builtin/anthropic-subscription/executable-path-lookup.d.ts.map +1 -0
  123. package/dist/core/extensions/builtin/anthropic-subscription/executable-path-lookup.js.map +1 -0
  124. package/dist/core/extensions/builtin/anthropic-subscription/executable.d.ts.map +1 -0
  125. package/dist/core/extensions/builtin/anthropic-subscription/executable.js.map +1 -0
  126. package/dist/core/extensions/builtin/anthropic-subscription/failover.d.ts.map +1 -0
  127. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/failover.js +1 -1
  128. package/dist/core/extensions/builtin/anthropic-subscription/failover.js.map +1 -0
  129. package/dist/core/extensions/builtin/anthropic-subscription/guidance.d.ts.map +1 -0
  130. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/guidance.js +2 -2
  131. package/dist/core/extensions/builtin/anthropic-subscription/guidance.js.map +1 -0
  132. package/dist/core/extensions/builtin/anthropic-subscription/index.d.ts +11 -0
  133. package/dist/core/extensions/builtin/anthropic-subscription/index.d.ts.map +1 -0
  134. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/index.js +19 -13
  135. package/dist/core/extensions/builtin/anthropic-subscription/index.js.map +1 -0
  136. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/oauth-login.d.ts +3 -3
  137. package/dist/core/extensions/builtin/anthropic-subscription/oauth-login.d.ts.map +1 -0
  138. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/oauth-login.js +3 -3
  139. package/dist/core/extensions/builtin/anthropic-subscription/oauth-login.js.map +1 -0
  140. package/dist/core/extensions/builtin/anthropic-subscription/options.d.ts +18 -0
  141. package/dist/core/extensions/builtin/anthropic-subscription/options.d.ts.map +1 -0
  142. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/options.js +3 -3
  143. package/dist/core/extensions/builtin/anthropic-subscription/options.js.map +1 -0
  144. package/dist/core/extensions/builtin/anthropic-subscription/prompt-bridge.d.ts.map +1 -0
  145. package/dist/core/extensions/builtin/anthropic-subscription/prompt-bridge.js.map +1 -0
  146. package/dist/core/extensions/builtin/anthropic-subscription/prompt-directive-dedupe.d.ts.map +1 -0
  147. package/dist/core/extensions/builtin/anthropic-subscription/prompt-directive-dedupe.js.map +1 -0
  148. package/dist/core/extensions/builtin/anthropic-subscription/refusal.d.ts.map +1 -0
  149. package/dist/core/extensions/builtin/anthropic-subscription/refusal.js.map +1 -0
  150. package/dist/core/extensions/builtin/anthropic-subscription/sdk-boundary.d.ts.map +1 -0
  151. package/dist/core/extensions/builtin/anthropic-subscription/sdk-boundary.js.map +1 -0
  152. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/sdk-boundary.lazy.d.ts +1 -1
  153. package/dist/core/extensions/builtin/anthropic-subscription/sdk-boundary.lazy.d.ts.map +1 -0
  154. package/dist/core/extensions/builtin/anthropic-subscription/sdk-boundary.lazy.js.map +1 -0
  155. package/dist/core/extensions/builtin/anthropic-subscription/session-binding-store.d.ts.map +1 -0
  156. package/dist/core/extensions/builtin/anthropic-subscription/session-binding-store.js.map +1 -0
  157. package/dist/core/extensions/builtin/anthropic-subscription/session-binding.d.ts.map +1 -0
  158. package/dist/core/extensions/builtin/anthropic-subscription/session-binding.js.map +1 -0
  159. package/dist/core/extensions/builtin/anthropic-subscription/session-commit-boundary.d.ts.map +1 -0
  160. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-commit-boundary.js +4 -3
  161. package/dist/core/extensions/builtin/anthropic-subscription/session-commit-boundary.js.map +1 -0
  162. package/dist/core/extensions/builtin/anthropic-subscription/session-continuity.d.ts.map +1 -0
  163. package/dist/core/extensions/builtin/anthropic-subscription/session-continuity.js.map +1 -0
  164. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-entry-annotations.d.ts +3 -3
  165. package/dist/core/extensions/builtin/anthropic-subscription/session-entry-annotations.d.ts.map +1 -0
  166. package/dist/core/extensions/builtin/anthropic-subscription/session-entry-annotations.js.map +1 -0
  167. package/dist/core/extensions/builtin/anthropic-subscription/session-observability.d.ts.map +1 -0
  168. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-observability.js +1 -1
  169. package/dist/core/extensions/builtin/anthropic-subscription/session-observability.js.map +1 -0
  170. package/dist/core/extensions/builtin/anthropic-subscription/session-reaper.d.ts.map +1 -0
  171. package/dist/core/extensions/builtin/anthropic-subscription/session-reaper.js.map +1 -0
  172. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-reattach.d.ts +5 -5
  173. package/dist/core/extensions/builtin/anthropic-subscription/session-reattach.d.ts.map +1 -0
  174. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-reattach.js +1 -1
  175. package/dist/core/extensions/builtin/anthropic-subscription/session-reattach.js.map +1 -0
  176. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry-pump.d.ts +2 -2
  177. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.d.ts.map +1 -0
  178. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry-pump.js +6 -6
  179. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.js.map +1 -0
  180. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry-state.d.ts +3 -3
  181. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-state.d.ts.map +1 -0
  182. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-state.js.map +1 -0
  183. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-wiring.d.ts.map +1 -0
  184. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry-wiring.js +2 -2
  185. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-wiring.js.map +1 -0
  186. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry.d.ts +12 -12
  187. package/dist/core/extensions/builtin/anthropic-subscription/session-registry.d.ts.map +1 -0
  188. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry.js +4 -4
  189. package/dist/core/extensions/builtin/anthropic-subscription/session-registry.js.map +1 -0
  190. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-restored-admission.d.ts +2 -2
  191. package/dist/core/extensions/builtin/anthropic-subscription/session-restored-admission.d.ts.map +1 -0
  192. package/dist/core/extensions/builtin/anthropic-subscription/session-restored-admission.js.map +1 -0
  193. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-stream.d.ts +2 -2
  194. package/dist/core/extensions/builtin/anthropic-subscription/session-stream.d.ts.map +1 -0
  195. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-stream.js +1 -1
  196. package/dist/core/extensions/builtin/anthropic-subscription/session-stream.js.map +1 -0
  197. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-sync.d.ts +5 -5
  198. package/dist/core/extensions/builtin/anthropic-subscription/session-sync.d.ts.map +1 -0
  199. package/dist/core/extensions/builtin/anthropic-subscription/session-sync.js.map +1 -0
  200. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-attempt.d.ts +11 -0
  201. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-attempt.d.ts.map +1 -0
  202. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-attempt.js.map +1 -0
  203. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.d.ts +14 -0
  204. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.d.ts.map +1 -0
  205. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-turn-claim.js +1 -1
  206. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.js.map +1 -0
  207. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.d.ts.map +1 -0
  208. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.js.map +1 -0
  209. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/settings.d.ts +11 -11
  210. package/dist/core/extensions/builtin/anthropic-subscription/settings.d.ts.map +1 -0
  211. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/settings.js +9 -9
  212. package/dist/core/extensions/builtin/anthropic-subscription/settings.js.map +1 -0
  213. package/dist/core/extensions/builtin/anthropic-subscription/stream-events.d.ts.map +1 -0
  214. package/dist/core/extensions/builtin/anthropic-subscription/stream-events.js.map +1 -0
  215. package/dist/core/extensions/builtin/anthropic-subscription/stream-guidance.d.ts.map +1 -0
  216. package/dist/core/extensions/builtin/anthropic-subscription/stream-guidance.js.map +1 -0
  217. package/dist/core/extensions/builtin/anthropic-subscription/stream-protocol.d.ts.map +1 -0
  218. package/dist/core/extensions/builtin/anthropic-subscription/stream-protocol.js.map +1 -0
  219. package/dist/core/extensions/builtin/anthropic-subscription/stream.d.ts +3 -0
  220. package/dist/core/extensions/builtin/anthropic-subscription/stream.d.ts.map +1 -0
  221. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/stream.js +5 -5
  222. package/dist/core/extensions/builtin/anthropic-subscription/stream.js.map +1 -0
  223. package/dist/core/extensions/builtin/anthropic-subscription/system-prompt.d.ts.map +1 -0
  224. package/dist/core/extensions/builtin/anthropic-subscription/system-prompt.js.map +1 -0
  225. package/dist/core/extensions/builtin/anthropic-subscription/tool-watch.d.ts.map +1 -0
  226. package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/tool-watch.js +6 -2
  227. package/dist/core/extensions/builtin/anthropic-subscription/tool-watch.js.map +1 -0
  228. package/dist/core/extensions/builtin/anthropic-subscription/tools.d.ts.map +1 -0
  229. package/dist/core/extensions/builtin/anthropic-subscription/tools.js.map +1 -0
  230. package/dist/core/extensions/builtin/compaction/index.js +2 -2
  231. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  232. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +5 -5
  233. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts.map +1 -1
  234. package/dist/core/extensions/builtin/compaction/lane-policy.js +9 -9
  235. package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -1
  236. package/dist/core/extensions/builtin/compaction/openai-remote-model.d.ts +1 -1
  237. package/dist/core/extensions/builtin/compaction/openai-remote-model.d.ts.map +1 -1
  238. package/dist/core/extensions/builtin/compaction/openai-remote-model.js +6 -6
  239. package/dist/core/extensions/builtin/compaction/openai-remote-model.js.map +1 -1
  240. package/dist/core/extensions/builtin/compaction/openai-remote.js +1 -1
  241. package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
  242. package/dist/core/extensions/builtin/compaction/speculative-summary.js +2 -2
  243. package/dist/core/extensions/builtin/compaction/speculative-summary.js.map +1 -1
  244. package/dist/core/extensions/builtin/compaction/speculative.js +1 -1
  245. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  246. package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js +1 -1
  247. package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -1
  248. package/dist/core/extensions/builtin/goal/terminal-provider-error.js +1 -1
  249. package/dist/core/extensions/builtin/goal/terminal-provider-error.js.map +1 -1
  250. package/dist/core/extensions/builtin/gpt-account.js +18 -18
  251. package/dist/core/extensions/builtin/gpt-account.js.map +1 -1
  252. package/dist/core/extensions/builtin/index.js +2 -2
  253. package/dist/core/extensions/builtin/index.js.map +1 -1
  254. package/dist/core/extensions/builtin/oauth-login-interaction.d.ts +2 -2
  255. package/dist/core/extensions/builtin/oauth-login-interaction.d.ts.map +1 -1
  256. package/dist/core/extensions/builtin/oauth-login-interaction.js +1 -1
  257. package/dist/core/extensions/builtin/oauth-login-interaction.js.map +1 -1
  258. package/dist/core/extensions/builtin/prompt-preset/file-operations.d.ts +9 -1
  259. package/dist/core/extensions/builtin/prompt-preset/file-operations.d.ts.map +1 -1
  260. package/dist/core/extensions/builtin/prompt-preset/file-operations.js +60 -17
  261. package/dist/core/extensions/builtin/prompt-preset/file-operations.js.map +1 -1
  262. package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.d.ts.map +1 -1
  263. package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js +7 -3
  264. package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js.map +1 -1
  265. package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.d.ts.map +1 -1
  266. package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js +7 -3
  267. package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js.map +1 -1
  268. package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.d.ts.map +1 -1
  269. package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js +7 -3
  270. package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js.map +1 -1
  271. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +1 -1
  272. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js.map +1 -1
  273. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +1 -1
  274. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  275. package/dist/core/extensions/builtin/prompt-preset/gpt-5.d.ts.map +1 -1
  276. package/dist/core/extensions/builtin/prompt-preset/gpt-5.js +7 -3
  277. package/dist/core/extensions/builtin/prompt-preset/gpt-5.js.map +1 -1
  278. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +1 -1
  279. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
  280. package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +2 -2
  281. package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js.map +1 -1
  282. package/dist/core/extensions/builtin/rules/rules/constants.d.ts +1 -1
  283. package/dist/core/extensions/builtin/rules/rules/constants.js +1 -1
  284. package/dist/core/extensions/builtin/rules/rules/constants.js.map +1 -1
  285. package/dist/core/extensions/builtin/service-tier.js +3 -3
  286. package/dist/core/extensions/builtin/service-tier.js.map +1 -1
  287. package/dist/core/model-config.d.ts +3 -0
  288. package/dist/core/model-config.d.ts.map +1 -1
  289. package/dist/core/model-config.js +26 -3
  290. package/dist/core/model-config.js.map +1 -1
  291. package/dist/core/model-resolver.js +1 -1
  292. package/dist/core/model-resolver.js.map +1 -1
  293. package/dist/core/model-runtime.d.ts +2 -0
  294. package/dist/core/model-runtime.d.ts.map +1 -1
  295. package/dist/core/model-runtime.js +10 -2
  296. package/dist/core/model-runtime.js.map +1 -1
  297. package/dist/core/provider-display-names.d.ts.map +1 -1
  298. package/dist/core/provider-display-names.js +2 -1
  299. package/dist/core/provider-display-names.js.map +1 -1
  300. package/dist/core/retry-fallback/expansion.js +1 -1
  301. package/dist/core/retry-fallback/expansion.js.map +1 -1
  302. package/dist/core/retry-fallback/settings.d.ts +1 -1
  303. package/dist/core/retry-fallback/settings.js +1 -1
  304. package/dist/core/retry-fallback/settings.js.map +1 -1
  305. package/dist/core/session-manager.d.ts.map +1 -1
  306. package/dist/core/session-manager.js +16 -4
  307. package/dist/core/session-manager.js.map +1 -1
  308. package/dist/core/settings-manager.d.ts +5 -0
  309. package/dist/core/settings-manager.d.ts.map +1 -1
  310. package/dist/core/settings-manager.js +68 -2
  311. package/dist/core/settings-manager.js.map +1 -1
  312. package/dist/modes/app-server/server/account.d.ts +1 -1
  313. package/dist/modes/app-server/server/account.d.ts.map +1 -1
  314. package/dist/modes/app-server/server/account.js +6 -1
  315. package/dist/modes/app-server/server/account.js.map +1 -1
  316. package/dist/modes/app-server/server/server-core.js +1 -1
  317. package/dist/modes/app-server/server/server-core.js.map +1 -1
  318. package/dist/modes/interactive/components/progressive-transcript-container.d.ts +12 -0
  319. package/dist/modes/interactive/components/progressive-transcript-container.d.ts.map +1 -1
  320. package/dist/modes/interactive/components/progressive-transcript-container.js +17 -2
  321. package/dist/modes/interactive/components/progressive-transcript-container.js.map +1 -1
  322. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  323. package/dist/modes/interactive/interactive-mode.js +14 -1
  324. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  325. package/dist/modes/rpc/connection-handler.js +3 -3
  326. package/dist/modes/rpc/connection-handler.js.map +1 -1
  327. package/dist/modes/rpc/host-process-metrics.d.ts.map +1 -1
  328. package/dist/modes/rpc/host-process-metrics.js +24 -31
  329. package/dist/modes/rpc/host-process-metrics.js.map +1 -1
  330. package/dist/modes/rpc/host-process-table.d.ts +36 -0
  331. package/dist/modes/rpc/host-process-table.d.ts.map +1 -0
  332. package/dist/modes/rpc/host-process-table.js +162 -0
  333. package/dist/modes/rpc/host-process-table.js.map +1 -0
  334. package/dist/modes/rpc/rpc-client.d.ts +1 -1
  335. package/dist/modes/rpc/rpc-client.js +1 -1
  336. package/dist/modes/rpc/rpc-client.js.map +1 -1
  337. package/dist/modes/rpc/rpc-types.js.map +1 -1
  338. package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
  339. package/dist/modes/rpc/worker-session-registry.js +30 -0
  340. package/dist/modes/rpc/worker-session-registry.js.map +1 -1
  341. package/docs/providers.md +9 -9
  342. package/docs/release-guide.md +1 -1
  343. package/docs/rpc.md +4 -4
  344. package/docs/settings.md +5 -5
  345. package/docs/usage.md +2 -2
  346. package/examples/extensions/AGENTS.md +1 -1
  347. package/examples/extensions/README.md +1 -1
  348. package/examples/extensions/{openai-codex-usage → chatgpt-subscription-usage}/codex-usage.ts +1 -1
  349. package/examples/extensions/{openai-codex-usage → chatgpt-subscription-usage}/index.ts +4 -4
  350. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +12 -0
  351. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  352. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  353. package/node_modules/@earendil-works/pi-ai/README.md +3 -3
  354. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +1 -1
  355. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  356. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.d.ts +3 -3
  357. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.d.ts.map +1 -1
  358. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.js.map +1 -1
  359. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +5 -5
  360. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  361. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +10 -10
  362. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  363. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts +1 -1
  364. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts.map +1 -1
  365. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js +1 -1
  366. package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js.map +1 -1
  367. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +1 -1
  368. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  369. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +1 -1
  370. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  371. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/{openai-codex.d.ts → chatgpt-subscription.d.ts} +3 -3
  372. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/chatgpt-subscription.d.ts.map +1 -0
  373. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/{openai-codex.js → chatgpt-subscription.js} +35 -35
  374. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/chatgpt-subscription.js.map +1 -0
  375. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts +2 -2
  376. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts.map +1 -1
  377. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +4 -3
  378. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -1
  379. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +7 -0
  380. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -1
  381. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +20 -2
  382. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -1
  383. package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +2 -2
  384. package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js.map +1 -1
  385. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -2
  386. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  387. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
  388. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  389. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.d.ts +20 -0
  390. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.d.ts.map +1 -1
  391. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.js +56 -0
  392. package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.js.map +1 -1
  393. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +2 -2
  394. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  395. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +2 -2
  396. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  397. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
  398. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -2
  399. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  400. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.d.ts +3 -0
  401. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.d.ts.map +1 -0
  402. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.js +22 -0
  403. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.js.map +1 -0
  404. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.models.d.ts +4 -0
  405. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.models.d.ts.map +1 -0
  406. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.models.js +6 -0
  407. package/node_modules/@earendil-works/pi-ai/dist/providers/chatgpt-subscription.models.js.map +1 -0
  408. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  409. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  410. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  411. package/node_modules/@earendil-works/pi-ai/dist/providers/data/chatgpt-subscription.json +1 -0
  412. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  413. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +1 -1
  414. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  415. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  416. package/node_modules/@earendil-works/pi-ai/dist/utils/{openai-codex-auth.d.ts → chatgpt-subscription-auth.d.ts} +3 -3
  417. package/node_modules/@earendil-works/pi-ai/dist/utils/chatgpt-subscription-auth.d.ts.map +1 -0
  418. package/node_modules/@earendil-works/pi-ai/dist/utils/{openai-codex-auth.js → chatgpt-subscription-auth.js} +4 -4
  419. package/node_modules/@earendil-works/pi-ai/dist/utils/chatgpt-subscription-auth.js.map +1 -0
  420. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  421. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  422. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  423. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  424. package/package.json +7 -7
  425. package/dist/bundle/chunks/azure-openai-responses-3AH7MJWF.js +0 -2
  426. package/dist/bundle/chunks/chunk-56TWFZ2C.js +0 -2
  427. package/dist/bundle/chunks/chunk-JEFYJDHP.js +0 -8
  428. package/dist/bundle/chunks/chunk-K3HEWWSS.js +0 -2
  429. package/dist/bundle/chunks/chunk-NK2RNX25.js +0 -11
  430. package/dist/bundle/chunks/chunk-NMB4C6ZZ.js +0 -2
  431. package/dist/bundle/chunks/cli-main-AFJNXUSL.js +0 -3
  432. package/dist/bundle/chunks/help-fast-path-4KYBVD2Z.js +0 -2
  433. package/dist/bundle/chunks/host-command-OVA6GEWC.js +0 -2
  434. package/dist/bundle/chunks/host-lifecycle-IDQPLYEA.js +0 -3
  435. package/dist/bundle/chunks/interactive-mode-UFBSCOP7.js +0 -2
  436. package/dist/bundle/chunks/openai-codex-responses-MEIUNROM.js +0 -10
  437. package/dist/bundle/chunks/openai-codex.js +0 -75
  438. package/dist/bundle/chunks/openai-responses-YR7WRBG3.js +0 -2
  439. package/dist/bundle/chunks/rpc-mode-JDVHUBZY.js +0 -2
  440. package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.d.ts.map +0 -1
  441. package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.js.map +0 -1
  442. package/dist/core/extensions/builtin/claude-sdk-oauth/account-events.d.ts.map +0 -1
  443. package/dist/core/extensions/builtin/claude-sdk-oauth/account-events.js.map +0 -1
  444. package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.d.ts.map +0 -1
  445. package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.js.map +0 -1
  446. package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.d.ts.map +0 -1
  447. package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.js.map +0 -1
  448. package/dist/core/extensions/builtin/claude-sdk-oauth/affinity.d.ts.map +0 -1
  449. package/dist/core/extensions/builtin/claude-sdk-oauth/affinity.js.map +0 -1
  450. package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.d.ts.map +0 -1
  451. package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.js.map +0 -1
  452. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.d.ts.map +0 -1
  453. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.js.map +0 -1
  454. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-environment.d.ts.map +0 -1
  455. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-environment.js.map +0 -1
  456. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.d.ts.map +0 -1
  457. package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js.map +0 -1
  458. package/dist/core/extensions/builtin/claude-sdk-oauth/availability.d.ts.map +0 -1
  459. package/dist/core/extensions/builtin/claude-sdk-oauth/availability.js.map +0 -1
  460. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +0 -1
  461. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js.map +0 -1
  462. package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.d.ts +0 -3
  463. package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.d.ts.map +0 -1
  464. package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.js +0 -27
  465. package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.js.map +0 -1
  466. package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.d.ts.map +0 -1
  467. package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.js.map +0 -1
  468. package/dist/core/extensions/builtin/claude-sdk-oauth/custom-tools-schema.d.ts.map +0 -1
  469. package/dist/core/extensions/builtin/claude-sdk-oauth/custom-tools-schema.js.map +0 -1
  470. package/dist/core/extensions/builtin/claude-sdk-oauth/custom-tools.d.ts.map +0 -1
  471. package/dist/core/extensions/builtin/claude-sdk-oauth/custom-tools.js.map +0 -1
  472. package/dist/core/extensions/builtin/claude-sdk-oauth/errors.d.ts.map +0 -1
  473. package/dist/core/extensions/builtin/claude-sdk-oauth/errors.js.map +0 -1
  474. package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.d.ts.map +0 -1
  475. package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.js.map +0 -1
  476. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.d.ts.map +0 -1
  477. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.js.map +0 -1
  478. package/dist/core/extensions/builtin/claude-sdk-oauth/failover.d.ts.map +0 -1
  479. package/dist/core/extensions/builtin/claude-sdk-oauth/failover.js.map +0 -1
  480. package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts.map +0 -1
  481. package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.js.map +0 -1
  482. package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts +0 -11
  483. package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts.map +0 -1
  484. package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +0 -1
  485. package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.d.ts.map +0 -1
  486. package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js.map +0 -1
  487. package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts +0 -18
  488. package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts.map +0 -1
  489. package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +0 -1
  490. package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.d.ts.map +0 -1
  491. package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js.map +0 -1
  492. package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-directive-dedupe.d.ts.map +0 -1
  493. package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-directive-dedupe.js.map +0 -1
  494. package/dist/core/extensions/builtin/claude-sdk-oauth/refusal.d.ts.map +0 -1
  495. package/dist/core/extensions/builtin/claude-sdk-oauth/refusal.js.map +0 -1
  496. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +0 -1
  497. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.js.map +0 -1
  498. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.lazy.d.ts.map +0 -1
  499. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.lazy.js.map +0 -1
  500. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding-store.d.ts.map +0 -1
  501. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding-store.js.map +0 -1
  502. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +0 -1
  503. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +0 -1
  504. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +0 -1
  505. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js.map +0 -1
  506. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +0 -1
  507. package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +0 -1
  508. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts.map +0 -1
  509. package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js.map +0 -1
  510. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +0 -1
  511. package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +0 -1
  512. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +0 -1
  513. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js.map +0 -1
  514. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +0 -1
  515. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +0 -1
  516. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +0 -1
  517. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +0 -1
  518. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.d.ts.map +0 -1
  519. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.js.map +0 -1
  520. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +0 -1
  521. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +0 -1
  522. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +0 -1
  523. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +0 -1
  524. package/dist/core/extensions/builtin/claude-sdk-oauth/session-restored-admission.d.ts.map +0 -1
  525. package/dist/core/extensions/builtin/claude-sdk-oauth/session-restored-admission.js.map +0 -1
  526. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +0 -1
  527. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +0 -1
  528. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +0 -1
  529. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +0 -1
  530. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts +0 -11
  531. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts.map +0 -1
  532. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js.map +0 -1
  533. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts +0 -14
  534. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts.map +0 -1
  535. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js.map +0 -1
  536. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +0 -1
  537. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js.map +0 -1
  538. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts.map +0 -1
  539. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +0 -1
  540. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts.map +0 -1
  541. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js.map +0 -1
  542. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.d.ts.map +0 -1
  543. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js.map +0 -1
  544. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.d.ts.map +0 -1
  545. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.js.map +0 -1
  546. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts +0 -3
  547. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +0 -1
  548. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +0 -1
  549. package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.d.ts.map +0 -1
  550. package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.js.map +0 -1
  551. package/dist/core/extensions/builtin/claude-sdk-oauth/tool-watch.d.ts.map +0 -1
  552. package/dist/core/extensions/builtin/claude-sdk-oauth/tool-watch.js.map +0 -1
  553. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +0 -1
  554. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +0 -1
  555. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +0 -1
  556. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +0 -1
  557. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +0 -1
  558. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.d.ts +0 -3
  559. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.d.ts.map +0 -1
  560. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js +0 -22
  561. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js.map +0 -1
  562. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts +0 -4
  563. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts.map +0 -1
  564. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js +0 -6
  565. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js.map +0 -1
  566. package/node_modules/@earendil-works/pi-ai/dist/utils/openai-codex-auth.d.ts.map +0 -1
  567. package/node_modules/@earendil-works/pi-ai/dist/utils/openai-codex-auth.js.map +0 -1
  568. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/account-events.d.ts +0 -0
  569. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/account-events.js +0 -0
  570. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/accounts.js +0 -0
  571. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/affinity.d.ts +0 -0
  572. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/api-id.d.ts +0 -0
  573. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/api-id.js +0 -0
  574. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/auth-attempt.js +0 -0
  575. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/auth-environment.d.ts +0 -0
  576. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/auth-environment.js +0 -0
  577. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/availability.d.ts +0 -0
  578. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/availability.js +0 -0
  579. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/bounded-queue.d.ts +0 -0
  580. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/content-blocks.d.ts +0 -0
  581. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/content-blocks.js +0 -0
  582. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/custom-tools-schema.d.ts +0 -0
  583. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/custom-tools-schema.js +0 -0
  584. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/custom-tools.d.ts +0 -0
  585. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/custom-tools.js +0 -0
  586. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/executable-path-lookup.d.ts +0 -0
  587. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/executable-path-lookup.js +0 -0
  588. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/executable.d.ts +0 -0
  589. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/executable.js +0 -0
  590. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/failover.d.ts +0 -0
  591. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/guidance.d.ts +0 -0
  592. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/prompt-bridge.d.ts +0 -0
  593. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/prompt-bridge.js +0 -0
  594. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/prompt-directive-dedupe.d.ts +0 -0
  595. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/prompt-directive-dedupe.js +0 -0
  596. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/refusal.d.ts +0 -0
  597. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/refusal.js +0 -0
  598. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/sdk-boundary.d.ts +0 -0
  599. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/sdk-boundary.js +0 -0
  600. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/sdk-boundary.lazy.js +0 -0
  601. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-binding-store.d.ts +0 -0
  602. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-binding-store.js +0 -0
  603. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-binding.d.ts +0 -0
  604. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-binding.js +0 -0
  605. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-commit-boundary.d.ts +0 -0
  606. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-continuity.d.ts +0 -0
  607. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-continuity.js +0 -0
  608. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-entry-annotations.js +0 -0
  609. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-observability.d.ts +0 -0
  610. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-reaper.d.ts +0 -0
  611. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-reaper.js +0 -0
  612. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry-state.js +0 -0
  613. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-registry-wiring.d.ts +0 -0
  614. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-restored-admission.js +0 -0
  615. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-sync.js +0 -0
  616. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-turn-attempt.js +0 -0
  617. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-turn-types.d.ts +0 -0
  618. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/session-turn-types.js +0 -0
  619. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/stream-events.d.ts +0 -0
  620. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/stream-events.js +0 -0
  621. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/stream-guidance.d.ts +0 -0
  622. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/stream-guidance.js +0 -0
  623. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/stream-protocol.d.ts +0 -0
  624. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/stream-protocol.js +0 -0
  625. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/system-prompt.d.ts +0 -0
  626. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/system-prompt.js +0 -0
  627. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/tool-watch.d.ts +0 -0
  628. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/tools.d.ts +0 -0
  629. /package/dist/core/extensions/builtin/{claude-sdk-oauth → anthropic-subscription}/tools.js +0 -0
  630. /package/examples/extensions/{openai-codex-usage → chatgpt-subscription-usage}/README.md +0 -0
@@ -1,7 +1,7 @@
1
1
  import type { OAuthAuth } from "../types.ts";
2
2
  type OAuthFlowLoaders = {
3
3
  anthropic: () => OAuthAuth | Promise<OAuthAuth>;
4
- openaiCodex: () => OAuthAuth | Promise<OAuthAuth>;
4
+ chatgptSubscription: () => OAuthAuth | Promise<OAuthAuth>;
5
5
  githubCopilot: () => OAuthAuth | Promise<OAuthAuth>;
6
6
  openrouter: () => OAuthAuth | Promise<OAuthAuth>;
7
7
  kimiCoding: () => OAuthAuth | Promise<OAuthAuth>;
@@ -16,7 +16,7 @@ type OAuthFlowLoaders = {
16
16
  /** Registers statically bundled OAuth flows for standalone Bun binaries. */
17
17
  export declare function registerBundledOAuthFlowLoaders(loaders: OAuthFlowLoaders): void;
18
18
  export declare const loadAnthropicOAuth: () => Promise<OAuthAuth>;
19
- export declare const loadOpenAICodexOAuth: () => Promise<OAuthAuth>;
19
+ export declare const loadChatGptSubscriptionOAuth: () => Promise<OAuthAuth>;
20
20
  export declare const loadGitHubCopilotOAuth: () => Promise<OAuthAuth>;
21
21
  export declare const loadOpenRouterOAuth: () => Promise<OAuthAuth>;
22
22
  export declare const loadKimiCodingOAuth: () => Promise<OAuthAuth>;
@@ -1 +1 @@
1
- {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/auth/oauth/load.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAa7C,KAAK,gBAAgB,GAAG;IACvB,SAAS,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAChD,WAAW,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClD,aAAa,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACpD,UAAU,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACjD,UAAU,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACjD,GAAG,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7C,KAAK,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,EAAE,CAA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loadAnthropicOAuth = async () => {
26
26
  return bundledLoaders.anthropic();
27
27
  return (await importOAuthModule("./anthropic.ts")).anthropicOAuth;
28
28
  };
29
- export const loadOpenAICodexOAuth = async () => {
29
+ export const loadChatGptSubscriptionOAuth = async () => {
30
30
  if (bundledLoaders)
31
- return bundledLoaders.openaiCodex();
32
- return (await importOAuthModule("./openai-codex.ts")).openaiCodexOAuth;
31
+ return bundledLoaders.chatgptSubscription();
32
+ return (await importOAuthModule("./chatgpt-subscription.ts"))
33
+ .chatgptSubscriptionOAuth;
33
34
  };
34
35
  export const loadGitHubCopilotOAuth = async () => {
35
36
  if (bundledLoaders)
@@ -1 +1 @@
1
- {"version":3,"file":"load.js","sourceRoot":"","sources":["../../../src/auth/oauth/load.ts"],"names":[],"mappings":";;;;;;;;AAEA;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAoB,EAAE;IACjE,MAAM,gBAAgB,GAAG,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzG,OAAO,MAAM,kCAAC,gBAAgB,EAAC,CAAC;AACjC,CAAC,CAAC;AAcF,IAAI,cAA4C,CAAC;AAEjD,4EAA4E;AAC5E,MAAM,UAAU,+BAA+B,CAAC,OAAyB;IACxE,cAAc,GAAG,OAAO,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAAwB,EAAE;IAChE,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC;IACtD,OAAQ,CAAC,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,CAAmC,CAAC,cAAc,CAAC;AACtG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,IAAwB,EAAE;IAClE,IAAI,cAAc;QAAE,OAAO,cAA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c,GAAG,KAAK,IAAwB,EAAE;IAC5D,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC,KAAK,EAAE,CAAC;IAClD,OAAQ,CAAC,MAAM,iBAAiB,CAAC,YAAY,CAAC,CAA+B,CAAC,UAAU,CAAC;AAC1F,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,OAA0C,EAAsB,EAAE;IACvG,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1D,OACC,CAAC,MAAM,iBAAiB,CAAC,aAAa,CAAC,CAGvC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["import type { OAuthAuth } from \"../types.ts\";\n\n/**\n * Loads an OAuth flow module through a variable specifier so bundlers cannot\n * follow the import into Node-only flow code (`node:http` callback servers,\n * `node:crypto` PKCE). The `.ts`/`.js` rewrite keeps the trick working from\n * both source and built output.\n */\nconst importOAuthModule = (specifier: string): Promise<unknown> => {\n\tconst runtimeSpecifier = import.meta.url.endsWith(\".js\") ? specifier.replace(/\\.ts$/, \".js\") : specifier;\n\treturn import(runtimeSpecifier);\n};\n\ntype OAuthFlowLoaders = {\n\tanthropic: () => OAuthAuth | Promise<OAuthAuth>;\n\topenaiCodex: () => OAuthAuth | Promise<OAuthAuth>;\n\tgithubCopilot: () => OAuthAuth | Promise<OAuthAuth>;\n\topenrouter: () => OAuthAuth | Promise<OAuthAuth>;\n\tkimiCoding: () => OAuthAuth | Promise<OAuthAuth>;\n\txai: () => OAuthAuth | Promise<OAuthAuth>;\n\tcursor: () => OAuthAuth | Promise<OAuthAuth>;\n\tdevin: () => OAuthAuth | Promise<OAuthAuth>;\n\tradius: (options: { name: string; gateway: string }) => OAuthAuth | Promise<OAuthAuth>;\n};\n\nlet bundledLoaders: OAuthFlowLoaders | undefined;\n\n/** Registers statically bundled OAuth flows for standalone Bun binaries. */\nexport function registerBundledOAuthFlowLoaders(loaders: OAuthFlowLoaders): void {\n\tbundledLoaders = loaders;\n}\n\nexport const loadAnthropicOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.anthropic();\n\treturn ((await importOAuthModule(\"./anthropic.ts\")) as { anthropicOAuth: OAuthAuth }).anthropicOAuth;\n};\n\nexport const loadOpenAICodexOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.openaiCodex();\n\treturn ((await importOAuthModule(\"./openai-codex.ts\")) as { openaiCodexOAuth: OAuthAuth }).openaiCodexOAuth;\n};\n\nexport const loadGitHubCopilotOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.githubCopilot();\n\treturn ((await importOAuthModule(\"./github-copilot.ts\")) as { githubCopilotOAuth: OAuthAuth }).githubCopilotOAuth;\n};\n\nexport const loadOpenRouterOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.openrouter();\n\treturn ((await importOAuthModule(\"./openrouter.ts\")) as { openRouterOAuth: OAuthAuth }).openRouterOAuth;\n};\n\nexport const loadKimiCodingOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.kimiCoding();\n\treturn ((await importOAuthModule(\"./kimi-coding.ts\")) as { kimiCodingOAuth: OAuthAuth }).kimiCodingOAuth;\n};\n\nexport const loadXaiOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.xai();\n\treturn ((await importOAuthModule(\"./xai.ts\")) as { xaiOAuth: OAuthAuth }).xaiOAuth;\n};\n\nexport const loadCursorOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.cursor();\n\treturn ((await importOAuthModule(\"./cursor.ts\")) as { cursorOAuth: OAuthAuth }).cursorOAuth;\n};\n\nexport const loadDevinOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.devin();\n\treturn ((await importOAuthModule(\"./devin.ts\")) as { devinOAuth: OAuthAuth }).devinOAuth;\n};\n\nexport const loadRadiusOAuth = async (options: { name: string; gateway: string }): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.radius(options);\n\treturn (\n\t\t(await importOAuthModule(\"./radius.ts\")) as {\n\t\t\tcreateRadiusOAuth: (input: { name: string; gateway: string }) => OAuthAuth;\n\t\t}\n\t).createRadiusOAuth(options);\n};\n"]}
1
+ {"version":3,"file":"load.js","sourceRoot":"","sources":["../../../src/auth/oauth/load.ts"],"names":[],"mappings":";;;;;;;;AAEA;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAoB,EAAE;IACjE,MAAM,gBAAgB,GAAG,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzG,OAAO,MAAM,kCAAC,gBAAgB,EAAC,CAAC;AACjC,CAAC,CAAC;AAcF,IAAI,cAA4C,CAAC;AAEjD,4EAA4E;AAC5E,MAAM,UAAU,+BAA+B,CAAC,OAAyB;IACxE,cAAc,GAAG,OAAO,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAAwB,EAAE;IAChE,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC;IACtD,OAAQ,CAAC,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,CAAmC,CAAC,cAAc,CAAC;AACtG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,IAAwB,EAAE;IAC1E,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC,mBAAmB,EAAE,CAAC;IAChE,OAAQ,CAAC,MAAM,iBAAiB,CAAC,2BAA2B,CAAC,CAA6C;SACxG,wBAAwB,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,CAAC,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B,CAAC,UAAU,CAAC;AAC1F,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,OAA0C,EAAsB,EAAE;IACvG,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1D,OACC,CAAC,MAAM,iBAAiB,CAAC,aAAa,CAAC,CAGvC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["import type { OAuthAuth } from \"../types.ts\";\n\n/**\n * Loads an OAuth flow module through a variable specifier so bundlers cannot\n * follow the import into Node-only flow code (`node:http` callback servers,\n * `node:crypto` PKCE). The `.ts`/`.js` rewrite keeps the trick working from\n * both source and built output.\n */\nconst importOAuthModule = (specifier: string): Promise<unknown> => {\n\tconst runtimeSpecifier = import.meta.url.endsWith(\".js\") ? specifier.replace(/\\.ts$/, \".js\") : specifier;\n\treturn import(runtimeSpecifier);\n};\n\ntype OAuthFlowLoaders = {\n\tanthropic: () => OAuthAuth | Promise<OAuthAuth>;\n\tchatgptSubscription: () => OAuthAuth | Promise<OAuthAuth>;\n\tgithubCopilot: () => OAuthAuth | Promise<OAuthAuth>;\n\topenrouter: () => OAuthAuth | Promise<OAuthAuth>;\n\tkimiCoding: () => OAuthAuth | Promise<OAuthAuth>;\n\txai: () => OAuthAuth | Promise<OAuthAuth>;\n\tcursor: () => OAuthAuth | Promise<OAuthAuth>;\n\tdevin: () => OAuthAuth | Promise<OAuthAuth>;\n\tradius: (options: { name: string; gateway: string }) => OAuthAuth | Promise<OAuthAuth>;\n};\n\nlet bundledLoaders: OAuthFlowLoaders | undefined;\n\n/** Registers statically bundled OAuth flows for standalone Bun binaries. */\nexport function registerBundledOAuthFlowLoaders(loaders: OAuthFlowLoaders): void {\n\tbundledLoaders = loaders;\n}\n\nexport const loadAnthropicOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.anthropic();\n\treturn ((await importOAuthModule(\"./anthropic.ts\")) as { anthropicOAuth: OAuthAuth }).anthropicOAuth;\n};\n\nexport const loadChatGptSubscriptionOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.chatgptSubscription();\n\treturn ((await importOAuthModule(\"./chatgpt-subscription.ts\")) as { chatgptSubscriptionOAuth: OAuthAuth })\n\t\t.chatgptSubscriptionOAuth;\n};\n\nexport const loadGitHubCopilotOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.githubCopilot();\n\treturn ((await importOAuthModule(\"./github-copilot.ts\")) as { githubCopilotOAuth: OAuthAuth }).githubCopilotOAuth;\n};\n\nexport const loadOpenRouterOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.openrouter();\n\treturn ((await importOAuthModule(\"./openrouter.ts\")) as { openRouterOAuth: OAuthAuth }).openRouterOAuth;\n};\n\nexport const loadKimiCodingOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.kimiCoding();\n\treturn ((await importOAuthModule(\"./kimi-coding.ts\")) as { kimiCodingOAuth: OAuthAuth }).kimiCodingOAuth;\n};\n\nexport const loadXaiOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.xai();\n\treturn ((await importOAuthModule(\"./xai.ts\")) as { xaiOAuth: OAuthAuth }).xaiOAuth;\n};\n\nexport const loadCursorOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.cursor();\n\treturn ((await importOAuthModule(\"./cursor.ts\")) as { cursorOAuth: OAuthAuth }).cursorOAuth;\n};\n\nexport const loadDevinOAuth = async (): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.devin();\n\treturn ((await importOAuthModule(\"./devin.ts\")) as { devinOAuth: OAuthAuth }).devinOAuth;\n};\n\nexport const loadRadiusOAuth = async (options: { name: string; gateway: string }): Promise<OAuthAuth> => {\n\tif (bundledLoaders) return bundledLoaders.radius(options);\n\treturn (\n\t\t(await importOAuthModule(\"./radius.ts\")) as {\n\t\t\tcreateRadiusOAuth: (input: { name: string; gateway: string }) => OAuthAuth;\n\t\t}\n\t).createRadiusOAuth(options);\n};\n"]}
@@ -94,6 +94,13 @@ export declare function appendLoginSlot(current: PooledCredential | undefined, f
94
94
  * `<providerId>-managed` in both OAuth fields. It is a marker, never a token.
95
95
  */
96
96
  export declare function managedSentinelMaterial(providerId: string): string;
97
+ /**
98
+ * Every sentinel material a stored credential may legitimately carry for this
99
+ * provider: the canonical `<providerId>-managed` plus the legacy material of
100
+ * any renamed ancestor id, because credentials written before a rename keep
101
+ * the old literal verbatim.
102
+ */
103
+ export declare function managedSentinelMaterials(providerId: string): string[];
97
104
  /**
98
105
  * A POOL SLOT carrying that marker can never authenticate: `projectSlot` hands
99
106
  * it to the provider's `check`, which rejects it, and the request dies with
@@ -1 +1 @@
1
- {"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/auth/pool/slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG;IAC5B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,GAAG,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S,CAQnH;AAED;;;;;GAKG;AACH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,CAS7G;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,CAe3F"}
@@ -1,3 +1,4 @@
1
+ import { LEGACY_PROVIDER_IDS } from "../../legacy-provider-ids.js";
1
2
  export const DEFAULT_SLOT_NAME = "default";
2
3
  const SLOT_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;
3
4
  export function assertValidSlotName(name) {
@@ -322,6 +323,23 @@ export function appendLoginSlot(current, flat, onAllocated) {
322
323
  export function managedSentinelMaterial(providerId) {
323
324
  return `${providerId}-managed`;
324
325
  }
326
+ const LEGACY_SENTINEL_MATERIALS = new Map(Object.entries(LEGACY_PROVIDER_IDS).map(([legacyId, canonicalId]) => [
327
+ canonicalId,
328
+ managedSentinelMaterial(legacyId),
329
+ ]));
330
+ /**
331
+ * Every sentinel material a stored credential may legitimately carry for this
332
+ * provider: the canonical `<providerId>-managed` plus the legacy material of
333
+ * any renamed ancestor id, because credentials written before a rename keep
334
+ * the old literal verbatim.
335
+ */
336
+ export function managedSentinelMaterials(providerId) {
337
+ const materials = [managedSentinelMaterial(providerId)];
338
+ const legacy = LEGACY_SENTINEL_MATERIALS.get(providerId);
339
+ if (legacy !== undefined && !materials.includes(legacy))
340
+ materials.push(legacy);
341
+ return materials;
342
+ }
325
343
  /**
326
344
  * A POOL SLOT carrying that marker can never authenticate: `projectSlot` hands
327
345
  * it to the provider's `check`, which rejects it, and the request dies with
@@ -330,8 +348,8 @@ export function managedSentinelMaterial(providerId) {
330
348
  * slot.
331
349
  */
332
350
  export function isManagedSentinelSlot(providerId, slot) {
333
- const sentinel = managedSentinelMaterial(providerId);
334
- return slot.access === sentinel && slot.refresh === sentinel;
351
+ const materials = managedSentinelMaterials(providerId);
352
+ return materials.includes(slot.access ?? "") && slot.refresh === slot.access;
335
353
  }
336
354
  /**
337
355
  * Drops those poisoned slots from a stored credential, clearing a pin that
@@ -1 +1 @@
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,4OAA4O,CAAC;AAE9O;;;GAGG;AACH,MAAM,mBAAmB,GAA2B;IACnD,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;CACb,CAAC;AAEF,MAAM,oBAAoB,GAAG,IAAI,IAAI,CAAC,SAAS,CAA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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 { 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"]}
1
+ {"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../src/auth/pool/slots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMnE,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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,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,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 { LEGACY_PROVIDER_IDS } from \"../../legacy-provider-ids.ts\";\nimport 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\nconst LEGACY_SENTINEL_MATERIALS: ReadonlyMap<string, string> = new Map(\n\tObject.entries(LEGACY_PROVIDER_IDS).map(([legacyId, canonicalId]) => [\n\t\tcanonicalId,\n\t\tmanagedSentinelMaterial(legacyId),\n\t]),\n);\n\n/**\n * Every sentinel material a stored credential may legitimately carry for this\n * provider: the canonical `<providerId>-managed` plus the legacy material of\n * any renamed ancestor id, because credentials written before a rename keep\n * the old literal verbatim.\n */\nexport function managedSentinelMaterials(providerId: string): string[] {\n\tconst materials = [managedSentinelMaterial(providerId)];\n\tconst legacy = LEGACY_SENTINEL_MATERIALS.get(providerId);\n\tif (legacy !== undefined && !materials.includes(legacy)) materials.push(legacy);\n\treturn materials;\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 materials = managedSentinelMaterials(providerId);\n\treturn materials.includes(slot.access ?? \"\") && slot.refresh === slot.access;\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,10 +1,10 @@
1
1
  import { anthropicOAuth } from "./auth/oauth/anthropic.js";
2
+ import { chatgptSubscriptionOAuth } from "./auth/oauth/chatgpt-subscription.js";
2
3
  import { cursorOAuth } from "./auth/oauth/cursor.js";
3
4
  import { devinOAuth } from "./auth/oauth/devin.js";
4
5
  import { githubCopilotOAuth } from "./auth/oauth/github-copilot.js";
5
6
  import { kimiCodingOAuth } from "./auth/oauth/kimi-coding.js";
6
7
  import { registerBundledOAuthFlowLoaders } from "./auth/oauth/load.js";
7
- import { openaiCodexOAuth } from "./auth/oauth/openai-codex.js";
8
8
  import { openRouterOAuth } from "./auth/oauth/openrouter.js";
9
9
  import { createRadiusOAuth } from "./auth/oauth/radius.js";
10
10
  import { xaiOAuth } from "./auth/oauth/xai.js";
@@ -12,7 +12,7 @@ import { xaiOAuth } from "./auth/oauth/xai.js";
12
12
  export function registerBunOAuthFlows() {
13
13
  registerBundledOAuthFlowLoaders({
14
14
  anthropic: () => anthropicOAuth,
15
- openaiCodex: () => openaiCodexOAuth,
15
+ chatgptSubscription: () => chatgptSubscriptionOAuth,
16
16
  githubCopilot: () => githubCopilotOAuth,
17
17
  openrouter: () => openRouterOAuth,
18
18
  kimiCoding: () => kimiCodingOAuth,
@@ -1 +1 @@
1
- {"version":3,"file":"bun-oauth.js","sourceRoot":"","sources":["../src/bun-oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,6EAA6E;AAC7E,MAAM,UAAU,qBAAqB;IACpC,+BAA+B,CAAC;QAC/B,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc;QAC/B,WAAW,EAAE,GAAG,EAAE,CAAC,gBAAgB;QACnC,aAAa,EAAE,GAAG,EAAE,CAAC,kBAAkB;QACvC,UAAU,EAAE,GAAG,EAAE,CAAC,eAAe;QACjC,UAAU,EAAE,GAAG,EAAE,CAAC,eAAe;QACjC,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ;QACnB,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW;QACzB,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU;QACvB,MAAM,EAAE,iBAAiB;KACzB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { anthropicOAuth } from \"./auth/oauth/anthropic.ts\";\nimport { cursorOAuth } from \"./auth/oauth/cursor.ts\";\nimport { devinOAuth } from \"./auth/oauth/devin.ts\";\nimport { githubCopilotOAuth } from \"./auth/oauth/github-copilot.ts\";\nimport { kimiCodingOAuth } from \"./auth/oauth/kimi-coding.ts\";\nimport { registerBundledOAuthFlowLoaders } from \"./auth/oauth/load.ts\";\nimport { openaiCodexOAuth } from \"./auth/oauth/openai-codex.ts\";\nimport { openRouterOAuth } from \"./auth/oauth/openrouter.ts\";\nimport { createRadiusOAuth } from \"./auth/oauth/radius.ts\";\nimport { xaiOAuth } from \"./auth/oauth/xai.ts\";\n\n/** Register OAuth flows statically embedded in the standalone Bun binary. */\nexport function registerBunOAuthFlows(): void {\n\tregisterBundledOAuthFlowLoaders({\n\t\tanthropic: () => anthropicOAuth,\n\t\topenaiCodex: () => openaiCodexOAuth,\n\t\tgithubCopilot: () => githubCopilotOAuth,\n\t\topenrouter: () => openRouterOAuth,\n\t\tkimiCoding: () => kimiCodingOAuth,\n\t\txai: () => xaiOAuth,\n\t\tcursor: () => cursorOAuth,\n\t\tdevin: () => devinOAuth,\n\t\tradius: createRadiusOAuth,\n\t});\n}\n"]}
1
+ {"version":3,"file":"bun-oauth.js","sourceRoot":"","sources":["../src/bun-oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,6EAA6E;AAC7E,MAAM,UAAU,qBAAqB;IACpC,+BAA+B,CAAC;QAC/B,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc;QAC/B,mBAAmB,EAAE,GAAG,EAAE,CAAC,wBAAwB;QACnD,aAAa,EAAE,GAAG,EAAE,CAAC,kBAAkB;QACvC,UAAU,EAAE,GAAG,EAAE,CAAC,eAAe;QACjC,UAAU,EAAE,GAAG,EAAE,CAAC,eAAe;QACjC,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ;QACnB,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW;QACzB,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU;QACvB,MAAM,EAAE,iBAAiB;KACzB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { anthropicOAuth } from \"./auth/oauth/anthropic.ts\";\nimport { chatgptSubscriptionOAuth } from \"./auth/oauth/chatgpt-subscription.ts\";\nimport { cursorOAuth } from \"./auth/oauth/cursor.ts\";\nimport { devinOAuth } from \"./auth/oauth/devin.ts\";\nimport { githubCopilotOAuth } from \"./auth/oauth/github-copilot.ts\";\nimport { kimiCodingOAuth } from \"./auth/oauth/kimi-coding.ts\";\nimport { registerBundledOAuthFlowLoaders } from \"./auth/oauth/load.ts\";\nimport { openRouterOAuth } from \"./auth/oauth/openrouter.ts\";\nimport { createRadiusOAuth } from \"./auth/oauth/radius.ts\";\nimport { xaiOAuth } from \"./auth/oauth/xai.ts\";\n\n/** Register OAuth flows statically embedded in the standalone Bun binary. */\nexport function registerBunOAuthFlows(): void {\n\tregisterBundledOAuthFlowLoaders({\n\t\tanthropic: () => anthropicOAuth,\n\t\tchatgptSubscription: () => chatgptSubscriptionOAuth,\n\t\tgithubCopilot: () => githubCopilotOAuth,\n\t\topenrouter: () => openRouterOAuth,\n\t\tkimiCoding: () => kimiCodingOAuth,\n\t\txai: () => xaiOAuth,\n\t\tcursor: () => cursorOAuth,\n\t\tdevin: () => devinOAuth,\n\t\tradius: createRadiusOAuth,\n\t});\n}\n"]}
@@ -12,7 +12,7 @@ export type { GoogleApiThinkingLevel, ResolvedGoogleThinkingLevel } from "./api/
12
12
  export type { GoogleVertexOptions } from "./api/google-vertex.ts";
13
13
  export * from "./api/lazy.ts";
14
14
  export type { MistralOptions } from "./api/mistral-conversations.ts";
15
- export type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from "./api/openai-codex-responses.ts";
15
+ export type { ChatGptSubscriptionWebSocketDebugStats, OpenAICodexResponsesOptions, } from "./api/openai-codex-responses.ts";
16
16
  export type { OpenAICompletionsOptions } from "./api/openai-completions.ts";
17
17
  export type { OpenAIResponsesOptions } from "./api/openai-responses.ts";
18
18
  export { convertResponsesMessages } from "./api/openai-responses-shared.ts";
@@ -42,13 +42,13 @@ export { wrapStreamWithInvokeRecovery } from "./tool-call-middleware/recovery-st
42
42
  export * from "./types.ts";
43
43
  export * from "./utils/assistant-message-frame.ts";
44
44
  export { type CursorExecResolvedCarrier, copyCursorExecResolved, isCursorExecResolved, kCursorExecResolved, } from "./utils/block-symbols.ts";
45
+ export { extractChatGptSubscriptionAccountId } from "./utils/chatgpt-subscription-auth.ts";
45
46
  export * from "./utils/diagnostics.ts";
46
47
  export { dropFailedAssistantTurns } from "./utils/drop-failed-assistant-turns.ts";
47
48
  export * from "./utils/empty-response-errors.ts";
48
49
  export { estimateContextTokens } from "./utils/estimate.ts";
49
50
  export * from "./utils/event-stream.ts";
50
51
  export * from "./utils/json-parse.ts";
51
- export { extractOpenAiCodexAccountId } from "./utils/openai-codex-auth.ts";
52
52
  export * from "./utils/overflow.ts";
53
53
  export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, resolvePromptCacheTtlSeconds, } from "./utils/prompt-cache-ttl.ts";
54
54
  export * from "./utils/provider-failure-description.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+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B,EAC9B,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;AAC3F,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EACN,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,4BAA4B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,cAAc,yCAAyC,CAAC;AACxD,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"}
@@ -28,13 +28,13 @@ export { wrapStreamWithInvokeRecovery } from "./tool-call-middleware/recovery-st
28
28
  export * from "./types.js";
29
29
  export * from "./utils/assistant-message-frame.js";
30
30
  export { copyCursorExecResolved, isCursorExecResolved, kCursorExecResolved, } from "./utils/block-symbols.js";
31
+ export { extractChatGptSubscriptionAccountId } from "./utils/chatgpt-subscription-auth.js";
31
32
  export * from "./utils/diagnostics.js";
32
33
  export { dropFailedAssistantTurns } from "./utils/drop-failed-assistant-turns.js";
33
34
  export * from "./utils/empty-response-errors.js";
34
35
  export { estimateContextTokens } from "./utils/estimate.js";
35
36
  export * from "./utils/event-stream.js";
36
37
  export * from "./utils/json-parse.js";
37
- export { extractOpenAiCodexAccountId } from "./utils/openai-codex-auth.js";
38
38
  export * from "./utils/overflow.js";
39
39
  export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, resolvePromptCacheTtlSeconds, } from "./utils/prompt-cache-ttl.js";
40
40
  export * from "./utils/provider-failure-description.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,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,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EACN,yBAAyB,EAQzB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,GACrB,MAA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,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"]}
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;AAQ9B,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,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EACN,yBAAyB,EAQzB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEN,0BAA0B,EAC1B,gCAAgC,GAChC,MAAM,kCAAkC,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CA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O,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 {\n\tChatGptSubscriptionWebSocketDebugStats,\n\tOpenAICodexResponsesOptions,\n} 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 { extractChatGptSubscriptionAccountId } from \"./utils/chatgpt-subscription-auth.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 * 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"]}
@@ -5,4 +5,24 @@ export declare const LEGACY_PROVIDER_IDS: Readonly<{
5
5
  export declare function normalizeProviderId(id: string): string;
6
6
  export declare function normalizeModelRef(ref: string): string;
7
7
  export declare function isLegacyProviderId(id: string): boolean;
8
+ /**
9
+ * Legacy spellings that normalize to `canonicalId`, for read boundaries that
10
+ * must try the canonical key first and then fall back to state written by an
11
+ * earlier version. Returns an empty array for an id that was never renamed.
12
+ */
13
+ export declare function legacyProviderIdsFor(canonicalId: string): string[];
14
+ /**
15
+ * Read `record` by provider id, trying the canonical key first and then every
16
+ * legacy spelling that normalizes to it. Never throws and never rewrites.
17
+ */
18
+ export declare function readByProviderId<T>(record: Record<string, T> | undefined, providerId: string): T | undefined;
19
+ /**
20
+ * The error a TYPED legacy provider id must produce: it names the new id so the
21
+ * user can retype it, instead of a generic "Unknown provider" or a filtered
22
+ * selector that silently shows nothing.
23
+ *
24
+ * This is for ids the user TYPES. Ids read from disk (settings, models.json,
25
+ * sessions, auth.json) are normalized instead and never rejected.
26
+ */
27
+ export declare function legacyProviderIdRejection(typed: string): string | undefined;
8
28
  //# sourceMappingURL=legacy-provider-ids.d.ts.map
@@ -1 +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"}
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;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAIlE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAQ5G;AAYD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW3E"}
@@ -23,4 +23,60 @@ export function normalizeModelRef(ref) {
23
23
  export function isLegacyProviderId(id) {
24
24
  return Object.hasOwn(LEGACY_PROVIDER_IDS, id);
25
25
  }
26
+ /**
27
+ * Legacy spellings that normalize to `canonicalId`, for read boundaries that
28
+ * must try the canonical key first and then fall back to state written by an
29
+ * earlier version. Returns an empty array for an id that was never renamed.
30
+ */
31
+ export function legacyProviderIdsFor(canonicalId) {
32
+ return Object.entries(LEGACY_PROVIDER_IDS)
33
+ .filter(([, canonical]) => canonical === canonicalId)
34
+ .map(([legacy]) => legacy);
35
+ }
36
+ /**
37
+ * Read `record` by provider id, trying the canonical key first and then every
38
+ * legacy spelling that normalizes to it. Never throws and never rewrites.
39
+ */
40
+ export function readByProviderId(record, providerId) {
41
+ if (record === undefined)
42
+ return undefined;
43
+ const canonical = normalizeProviderId(providerId);
44
+ if (record[canonical] !== undefined)
45
+ return record[canonical];
46
+ for (const legacy of legacyProviderIdsFor(canonical)) {
47
+ if (record[legacy] !== undefined)
48
+ return record[legacy];
49
+ }
50
+ return undefined;
51
+ }
52
+ /**
53
+ * Display names the renamed providers used to ship with. A user who types one
54
+ * of these means the legacy provider just as much as someone typing its id, so
55
+ * both are rejected with the same message.
56
+ */
57
+ const LEGACY_PROVIDER_DISPLAY_NAMES = Object.freeze({
58
+ "openai codex": "openai-codex",
59
+ "claude sdk oauth": "claude-sdk-oauth",
60
+ });
61
+ /**
62
+ * The error a TYPED legacy provider id must produce: it names the new id so the
63
+ * user can retype it, instead of a generic "Unknown provider" or a filtered
64
+ * selector that silently shows nothing.
65
+ *
66
+ * This is for ids the user TYPES. Ids read from disk (settings, models.json,
67
+ * sessions, auth.json) are normalized instead and never rejected.
68
+ */
69
+ export function legacyProviderIdRejection(typed) {
70
+ const trimmed = typed.trim();
71
+ const lowered = trimmed.toLowerCase();
72
+ const legacyId = Object.hasOwn(LEGACY_PROVIDER_DISPLAY_NAMES, lowered)
73
+ ? LEGACY_PROVIDER_DISPLAY_NAMES[lowered]
74
+ : Object.hasOwn(LEGACY_PROVIDER_IDS, lowered)
75
+ ? lowered
76
+ : undefined;
77
+ if (legacyId === undefined)
78
+ return undefined;
79
+ const canonical = LEGACY_PROVIDER_IDS[legacyId];
80
+ return `${legacyId} was renamed to ${canonical}. Use ${canonical}.`;
81
+ }
26
82
  //# sourceMappingURL=legacy-provider-ids.js.map
@@ -1 +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.h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AO,SAAS,CAAC;IAC7C,MAAM,SAAS,GAAG,mBAAmB,CAAC,QAA4B,CAAC,CAAC;IACpE,OAAO,GAAG,QAAQ,mBAAmB,SAAS,SAAS,SAAS,GAAG,CAAC;AACrE,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\n/**\n * Legacy spellings that normalize to `canonicalId`, for read boundaries that\n * must try the canonical key first and then fall back to state written by an\n * earlier version. Returns an empty array for an id that was never renamed.\n */\nexport function legacyProviderIdsFor(canonicalId: string): string[] {\n\treturn Object.entries(LEGACY_PROVIDER_IDS)\n\t\t.filter(([, canonical]) => canonical === canonicalId)\n\t\t.map(([legacy]) => legacy);\n}\n\n/**\n * Read `record` by provider id, trying the canonical key first and then every\n * legacy spelling that normalizes to it. Never throws and never rewrites.\n */\nexport function readByProviderId<T>(record: Record<string, T> | undefined, providerId: string): T | undefined {\n\tif (record === undefined) return undefined;\n\tconst canonical = normalizeProviderId(providerId);\n\tif (record[canonical] !== undefined) return record[canonical];\n\tfor (const legacy of legacyProviderIdsFor(canonical)) {\n\t\tif (record[legacy] !== undefined) return record[legacy];\n\t}\n\treturn undefined;\n}\n\n/**\n * Display names the renamed providers used to ship with. A user who types one\n * of these means the legacy provider just as much as someone typing its id, so\n * both are rejected with the same message.\n */\nconst LEGACY_PROVIDER_DISPLAY_NAMES: Readonly<Record<string, string>> = Object.freeze({\n\t\"openai codex\": \"openai-codex\",\n\t\"claude sdk oauth\": \"claude-sdk-oauth\",\n});\n\n/**\n * The error a TYPED legacy provider id must produce: it names the new id so the\n * user can retype it, instead of a generic \"Unknown provider\" or a filtered\n * selector that silently shows nothing.\n *\n * This is for ids the user TYPES. Ids read from disk (settings, models.json,\n * sessions, auth.json) are normalized instead and never rejected.\n */\nexport function legacyProviderIdRejection(typed: string): string | undefined {\n\tconst trimmed = typed.trim();\n\tconst lowered = trimmed.toLowerCase();\n\tconst legacyId = Object.hasOwn(LEGACY_PROVIDER_DISPLAY_NAMES, lowered)\n\t\t? LEGACY_PROVIDER_DISPLAY_NAMES[lowered]\n\t\t: Object.hasOwn(LEGACY_PROVIDER_IDS, lowered)\n\t\t\t? lowered\n\t\t\t: undefined;\n\tif (legacyId === undefined) return undefined;\n\tconst canonical = LEGACY_PROVIDER_IDS[legacyId as LegacyProviderId];\n\treturn `${legacyId} was renamed to ${canonical}. Use ${canonical}.`;\n}\n"]}