@code-yeongyu/senpi 2026.9.27-2 → 2026.9.27-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 (293) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/bundle/chunks/anthropic-messages-3FGAXYJS.js +8 -0
  3. package/dist/bundle/chunks/{app-server-command-ATWHNOOO.js → app-server-command-ZVB35UIJ.js} +1 -1
  4. package/dist/bundle/chunks/azure-openai-responses-4SUOOZZ4.js +2 -0
  5. package/dist/bundle/chunks/{chunk-KMJXSXRX.js → chunk-357I4IUU.js} +2 -2
  6. package/dist/bundle/chunks/chunk-3SIQIY57.js +8 -0
  7. package/dist/bundle/chunks/chunk-45SZOLCU.js +2 -0
  8. package/dist/bundle/chunks/{chunk-77ACEMYL.js → chunk-6J6RDMBY.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-FD34HSJJ.js → chunk-C6LQNMRB.js} +1 -1
  10. package/dist/bundle/chunks/chunk-ELM77A26.js +2 -0
  11. package/dist/bundle/chunks/chunk-GZVCRV7I.js +3 -0
  12. package/dist/bundle/chunks/{chunk-TTY5BHCG.js → chunk-H2SGCPMD.js} +1 -1
  13. package/dist/bundle/chunks/chunk-KLBKUBDV.js +2 -0
  14. package/dist/bundle/chunks/chunk-L6QV7NZI.js +2 -0
  15. package/dist/bundle/chunks/{chunk-ZKZAATFM.js → chunk-LDB5UMH2.js} +2 -2
  16. package/dist/bundle/chunks/{chunk-HZAKOVHN.js → chunk-LGKKU4VM.js} +1 -1
  17. package/dist/bundle/chunks/{chunk-6Q6DGME2.js → chunk-NMDALHXH.js} +1 -1
  18. package/dist/bundle/chunks/chunk-NNILBBOH.js +18 -0
  19. package/dist/bundle/chunks/{chunk-SUQDU5KM.js → chunk-OQRUK2DK.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-67BC7VZV.js → chunk-OZN2KUPR.js} +6 -6
  21. package/dist/bundle/chunks/{chunk-X3T45623.js → chunk-QK4QKRTF.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-WM5FVFAP.js → chunk-QPZVJQC5.js} +1 -1
  23. package/dist/bundle/chunks/{chunk-HPY47AVX.js → chunk-QYAO24GB.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-6W2DB2GC.js → chunk-RULGEHQM.js} +1 -1
  25. package/dist/bundle/chunks/{chunk-6SLQ5HFO.js → chunk-RYI6XR6Z.js} +55 -53
  26. package/dist/bundle/chunks/chunk-U3VOXCGP.js +2 -0
  27. package/dist/bundle/chunks/{chunk-LPFZGWG2.js → chunk-Y7EIVDHZ.js} +1 -1
  28. package/dist/bundle/chunks/chunk-ZIVYE5YK.js +2 -0
  29. package/dist/bundle/chunks/cli-main-RONHLFWZ.js +3 -0
  30. package/dist/bundle/chunks/google-generative-ai-ZTGKZTGU.js +2 -0
  31. package/dist/bundle/chunks/google-vertex-CCZ376YK.js +2 -0
  32. package/dist/bundle/chunks/help-fast-path-5LRG6FCG.js +2 -0
  33. package/dist/bundle/chunks/host-command-JVPGQR74.js +2 -0
  34. package/dist/bundle/chunks/host-lifecycle-R4HLXLBM.js +3 -0
  35. package/dist/bundle/chunks/host-lifecycle.js +4 -4
  36. package/dist/bundle/chunks/interactive-host-runtime-FES2G62G.js +4 -0
  37. package/dist/bundle/chunks/interactive-mode-45EP2FVL.js +2 -0
  38. package/dist/bundle/chunks/{list-tips-EBRNBPBM.js → list-tips-XXMRDHN6.js} +1 -1
  39. package/dist/bundle/chunks/{multi-session-host-CE3W6COI.js → multi-session-host-EFCMD5OT.js} +6 -6
  40. package/dist/bundle/chunks/{openai-completions-4CLXDDHJ.js → openai-completions-OP6VFNUR.js} +1 -1
  41. package/dist/bundle/chunks/openai-images-6U5FCN5S.js +2 -0
  42. package/dist/bundle/chunks/openai-responses-7PWMBGYX.js +2 -0
  43. package/dist/bundle/chunks/openrouter-images-QIKWQZUD.js +2 -0
  44. package/dist/bundle/chunks/{package-manager-cli-2PHRL2SX.js → package-manager-cli-5XJS3TYM.js} +1 -1
  45. package/dist/bundle/chunks/rotation-stream-KW7PTEC4.js +2 -0
  46. package/dist/bundle/chunks/rpc-mode-ZHYECU24.js +2 -0
  47. package/dist/bundle/chunks/session-picker-QHIYVQP4.js +2 -0
  48. package/dist/bundle/chunks/session-worker.js +245 -238
  49. package/dist/bundle/chunks/{state-store-Q5EWEAFG.js → state-store-D4GGGT3J.js} +1 -1
  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/continue-moved.d.ts +15 -0
  54. package/dist/cli/continue-moved.d.ts.map +1 -0
  55. package/dist/cli/continue-moved.js +26 -0
  56. package/dist/cli/continue-moved.js.map +1 -0
  57. package/dist/core/agent-session-runtime.d.ts +3 -0
  58. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  59. package/dist/core/agent-session-runtime.js +43 -10
  60. package/dist/core/agent-session-runtime.js.map +1 -1
  61. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.d.ts.map +1 -1
  62. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.js +5 -1
  63. package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.js.map +1 -1
  64. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.d.ts +13 -1
  65. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.d.ts.map +1 -1
  66. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.js +25 -2
  67. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.js.map +1 -1
  68. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.d.ts +1 -0
  69. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.d.ts.map +1 -1
  70. package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.js.map +1 -1
  71. package/dist/core/extensions/builtin/mcp/catalog.d.ts +3 -0
  72. package/dist/core/extensions/builtin/mcp/catalog.d.ts.map +1 -1
  73. package/dist/core/extensions/builtin/mcp/catalog.js +9 -0
  74. package/dist/core/extensions/builtin/mcp/catalog.js.map +1 -1
  75. package/dist/core/extensions/builtin/mcp/connection-types.d.ts +2 -0
  76. package/dist/core/extensions/builtin/mcp/connection-types.d.ts.map +1 -1
  77. package/dist/core/extensions/builtin/mcp/connection-types.js.map +1 -1
  78. package/dist/core/extensions/builtin/mcp/connection.d.ts +1 -1
  79. package/dist/core/extensions/builtin/mcp/connection.d.ts.map +1 -1
  80. package/dist/core/extensions/builtin/mcp/connection.js +3 -2
  81. package/dist/core/extensions/builtin/mcp/connection.js.map +1 -1
  82. package/dist/core/extensions/builtin/mcp/expose/session.d.ts +3 -0
  83. package/dist/core/extensions/builtin/mcp/expose/session.d.ts.map +1 -1
  84. package/dist/core/extensions/builtin/mcp/expose/session.js +9 -2
  85. package/dist/core/extensions/builtin/mcp/expose/session.js.map +1 -1
  86. package/dist/core/extensions/builtin/mcp/service-register.d.ts.map +1 -1
  87. package/dist/core/extensions/builtin/mcp/service-register.js +7 -1
  88. package/dist/core/extensions/builtin/mcp/service-register.js.map +1 -1
  89. package/dist/core/extensions/builtin/mcp/service-tools-changed.d.ts +18 -0
  90. package/dist/core/extensions/builtin/mcp/service-tools-changed.d.ts.map +1 -0
  91. package/dist/core/extensions/builtin/mcp/service-tools-changed.js +61 -0
  92. package/dist/core/extensions/builtin/mcp/service-tools-changed.js.map +1 -0
  93. package/dist/core/extensions/builtin/mcp/service-types.d.ts +13 -0
  94. package/dist/core/extensions/builtin/mcp/service-types.d.ts.map +1 -1
  95. package/dist/core/extensions/builtin/mcp/service-types.js.map +1 -1
  96. package/dist/core/extensions/builtin/mcp/service.d.ts.map +1 -1
  97. package/dist/core/extensions/builtin/mcp/service.js +4 -37
  98. package/dist/core/extensions/builtin/mcp/service.js.map +1 -1
  99. package/dist/core/extensions/builtin/mcp/shared-lease.js +1 -1
  100. package/dist/core/extensions/builtin/mcp/shared-lease.js.map +1 -1
  101. package/dist/core/extensions/builtin/mcp/startup-race.d.ts.map +1 -1
  102. package/dist/core/extensions/builtin/mcp/startup-race.js +11 -1
  103. package/dist/core/extensions/builtin/mcp/startup-race.js.map +1 -1
  104. package/dist/core/moved-sessions.d.ts +10 -0
  105. package/dist/core/moved-sessions.d.ts.map +1 -0
  106. package/dist/core/moved-sessions.js +84 -0
  107. package/dist/core/moved-sessions.js.map +1 -0
  108. package/dist/core/process-crash-record.d.ts +62 -0
  109. package/dist/core/process-crash-record.d.ts.map +1 -0
  110. package/dist/core/process-crash-record.js +216 -0
  111. package/dist/core/process-crash-record.js.map +1 -0
  112. package/dist/core/resume-target.d.ts +20 -0
  113. package/dist/core/resume-target.d.ts.map +1 -0
  114. package/dist/core/resume-target.js +30 -0
  115. package/dist/core/resume-target.js.map +1 -0
  116. package/dist/core/session-discovery.d.ts.map +1 -1
  117. package/dist/core/session-discovery.js +1 -0
  118. package/dist/core/session-discovery.js.map +1 -1
  119. package/dist/core/session-hold-errors.d.ts +20 -0
  120. package/dist/core/session-hold-errors.d.ts.map +1 -0
  121. package/dist/core/session-hold-errors.js +28 -0
  122. package/dist/core/session-hold-errors.js.map +1 -0
  123. package/dist/core/session-holders.d.ts +22 -0
  124. package/dist/core/session-holders.d.ts.map +1 -0
  125. package/dist/core/session-holders.js +234 -0
  126. package/dist/core/session-holders.js.map +1 -0
  127. package/dist/core/session-manager.d.ts +5 -0
  128. package/dist/core/session-manager.d.ts.map +1 -1
  129. package/dist/core/session-manager.js.map +1 -1
  130. package/dist/core/session-rebind.d.ts +7 -1
  131. package/dist/core/session-rebind.d.ts.map +1 -1
  132. package/dist/core/session-rebind.js +21 -5
  133. package/dist/core/session-rebind.js.map +1 -1
  134. package/dist/core/session-summary-index-file.d.ts.map +1 -1
  135. package/dist/core/session-summary-index-file.js +5 -2
  136. package/dist/core/session-summary-index-file.js.map +1 -1
  137. package/dist/core/session-summary.d.ts +3 -0
  138. package/dist/core/session-summary.d.ts.map +1 -1
  139. package/dist/core/session-summary.js +7 -0
  140. package/dist/core/session-summary.js.map +1 -1
  141. package/dist/legacy-dir-copy.d.ts +9 -0
  142. package/dist/legacy-dir-copy.d.ts.map +1 -0
  143. package/dist/legacy-dir-copy.js +69 -0
  144. package/dist/legacy-dir-copy.js.map +1 -0
  145. package/dist/legacy-senpi-dir-migration.d.ts.map +1 -1
  146. package/dist/legacy-senpi-dir-migration.js +64 -48
  147. package/dist/legacy-senpi-dir-migration.js.map +1 -1
  148. package/dist/main.d.ts.map +1 -1
  149. package/dist/main.js +45 -19
  150. package/dist/main.js.map +1 -1
  151. package/dist/migrations-state.d.ts +1 -1
  152. package/dist/migrations-state.d.ts.map +1 -1
  153. package/dist/migrations-state.js +5 -1
  154. package/dist/migrations-state.js.map +1 -1
  155. package/dist/migrations.d.ts.map +1 -1
  156. package/dist/migrations.js +4 -0
  157. package/dist/migrations.js.map +1 -1
  158. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  159. package/dist/modes/interactive/components/session-selector.js +5 -3
  160. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  161. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  162. package/dist/modes/interactive/interactive-mode.js +8 -4
  163. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  164. package/dist/modes/interactive/resume-rebind.d.ts +12 -0
  165. package/dist/modes/interactive/resume-rebind.d.ts.map +1 -0
  166. package/dist/modes/interactive/resume-rebind.js +37 -0
  167. package/dist/modes/interactive/resume-rebind.js.map +1 -0
  168. package/dist/modes/interactive/tips/catalog/computer-tips.d.ts +7 -0
  169. package/dist/modes/interactive/tips/catalog/computer-tips.d.ts.map +1 -0
  170. package/dist/modes/interactive/tips/catalog/computer-tips.js +36 -0
  171. package/dist/modes/interactive/tips/catalog/computer-tips.js.map +1 -0
  172. package/dist/modes/interactive/tips/registry.d.ts.map +1 -1
  173. package/dist/modes/interactive/tips/registry.js +2 -0
  174. package/dist/modes/interactive/tips/registry.js.map +1 -1
  175. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  176. package/dist/modes/rpc/connection-handler.js +3 -0
  177. package/dist/modes/rpc/connection-handler.js.map +1 -1
  178. package/dist/modes/rpc/host-child-exit.d.ts.map +1 -1
  179. package/dist/modes/rpc/host-child-exit.js +4 -0
  180. package/dist/modes/rpc/host-child-exit.js.map +1 -1
  181. package/dist/modes/rpc/host-crash-record.d.ts +8 -0
  182. package/dist/modes/rpc/host-crash-record.d.ts.map +1 -1
  183. package/dist/modes/rpc/host-crash-record.js.map +1 -1
  184. package/dist/modes/rpc/host-crash-record.test.js +11 -0
  185. package/dist/modes/rpc/host-crash-record.test.js.map +1 -1
  186. package/dist/modes/rpc/rpc-client.d.ts +2 -2
  187. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  188. package/dist/modes/rpc/rpc-client.js +14 -6
  189. package/dist/modes/rpc/rpc-client.js.map +1 -1
  190. package/dist/modes/rpc/rpc-request-deadline.d.ts +17 -0
  191. package/dist/modes/rpc/rpc-request-deadline.d.ts.map +1 -0
  192. package/dist/modes/rpc/rpc-request-deadline.js +27 -0
  193. package/dist/modes/rpc/rpc-request-deadline.js.map +1 -0
  194. package/dist/modes/rpc/rpc-types.d.ts +9 -2
  195. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  196. package/dist/modes/rpc/rpc-types.js.map +1 -1
  197. package/dist/modes/rpc/session-command-router.d.ts +3 -6
  198. package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
  199. package/dist/modes/rpc/session-command-router.js +9 -22
  200. package/dist/modes/rpc/session-command-router.js.map +1 -1
  201. package/dist/modes/rpc/session-path-key.d.ts +10 -0
  202. package/dist/modes/rpc/session-path-key.d.ts.map +1 -0
  203. package/dist/modes/rpc/session-path-key.js +33 -0
  204. package/dist/modes/rpc/session-path-key.js.map +1 -0
  205. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  206. package/dist/modes/rpc/session-registry.js +6 -10
  207. package/dist/modes/rpc/session-registry.js.map +1 -1
  208. package/dist/modes/rpc/session-sweep.d.ts +18 -0
  209. package/dist/modes/rpc/session-sweep.d.ts.map +1 -0
  210. package/dist/modes/rpc/session-sweep.js +32 -0
  211. package/dist/modes/rpc/session-sweep.js.map +1 -0
  212. package/dist/pi-dir-restore.d.ts +4 -0
  213. package/dist/pi-dir-restore.d.ts.map +1 -0
  214. package/dist/pi-dir-restore.js +92 -0
  215. package/dist/pi-dir-restore.js.map +1 -0
  216. package/docs/rpc.md +8 -3
  217. package/docs/sdk.md +29 -0
  218. package/docs/sessions.md +4 -0
  219. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +12 -0
  220. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  221. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +2 -2
  222. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  223. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +7 -0
  224. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  225. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -1
  226. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js +3 -1
  227. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js.map +1 -1
  228. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +3 -1
  229. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  230. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  231. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  232. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  233. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +10 -7
  234. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  235. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  236. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +9 -1
  237. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  238. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
  239. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  240. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  241. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  242. package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.d.ts +33 -0
  243. package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.d.ts.map +1 -0
  244. package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.js +56 -0
  245. package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.js.map +1 -0
  246. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  247. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  248. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +3 -0
  249. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  250. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  251. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.d.ts +5 -0
  252. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.d.ts.map +1 -0
  253. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.js +18 -0
  254. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.js.map +1 -0
  255. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.d.ts +26 -0
  256. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.d.ts.map +1 -0
  257. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.js +103 -0
  258. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.js.map +1 -0
  259. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.d.ts +36 -0
  260. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.d.ts.map +1 -0
  261. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.js +129 -0
  262. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.js.map +1 -0
  263. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
  264. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +5 -4
  265. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  266. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  267. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  268. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  269. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  270. package/package.json +7 -7
  271. package/dist/bundle/chunks/anthropic-messages-UYDVRFAS.js +0 -8
  272. package/dist/bundle/chunks/azure-openai-responses-DODWR4W6.js +0 -2
  273. package/dist/bundle/chunks/chunk-2L26KPZ6.js +0 -8
  274. package/dist/bundle/chunks/chunk-3CC5ZOBV.js +0 -13
  275. package/dist/bundle/chunks/chunk-L6JO4M6J.js +0 -3
  276. package/dist/bundle/chunks/chunk-SFYHCFRO.js +0 -2
  277. package/dist/bundle/chunks/chunk-TTHMOL5G.js +0 -2
  278. package/dist/bundle/chunks/chunk-UYCGOK6M.js +0 -2
  279. package/dist/bundle/chunks/chunk-ZTVQY5V6.js +0 -2
  280. package/dist/bundle/chunks/cli-main-HOM6UH3H.js +0 -3
  281. package/dist/bundle/chunks/google-generative-ai-VIEFECKJ.js +0 -2
  282. package/dist/bundle/chunks/google-vertex-Q64CKFID.js +0 -2
  283. package/dist/bundle/chunks/help-fast-path-YGYHMV2W.js +0 -2
  284. package/dist/bundle/chunks/host-command-XXSAFWBW.js +0 -2
  285. package/dist/bundle/chunks/host-lifecycle-GOMGJ25O.js +0 -3
  286. package/dist/bundle/chunks/interactive-host-runtime-IYCZWJGX.js +0 -4
  287. package/dist/bundle/chunks/interactive-mode-ZMO7YVYU.js +0 -2
  288. package/dist/bundle/chunks/openai-images-JA5N5DUU.js +0 -2
  289. package/dist/bundle/chunks/openai-responses-IBFGBAJP.js +0 -2
  290. package/dist/bundle/chunks/openrouter-images-MW5TXV7L.js +0 -2
  291. package/dist/bundle/chunks/rotation-stream-NATO6IMN.js +0 -2
  292. package/dist/bundle/chunks/rpc-mode-WCETTMFV.js +0 -2
  293. package/dist/bundle/chunks/session-picker-BP7THCWF.js +0 -2
@@ -1,5 +1,6 @@
1
1
  import Anthropic from "@anthropic-ai/sdk";
2
2
  import { calculateCost } from "../models.js";
3
+ import { readProviderDiagnostic } from "../provider-diagnostic.js";
3
4
  import { registerSessionResourceCleanup } from "../session-resources.js";
4
5
  import { isVideoMimeType } from "../types.js";
5
6
  import { combineAbortSignals } from "../utils/abort-signals.js";
@@ -10,6 +11,8 @@ import { headersToRecord, providerHeadersToRecord } from "../utils/headers.js";
10
11
  import { parseJsonWithRepair, parseStreamingJson } from "../utils/json-parse.js";
11
12
  import { getPiUserAgent } from "../utils/pi-user-agent.js";
12
13
  import { getAnthropicCompat, isAnthropicApiBaseUrl } from "../utils/prompt-cache-ttl.js";
14
+ import { attachProviderDiagnostic } from "../utils/provider-diagnostic-carrier.js";
15
+ import { anthropicProviderDiagnosticFromError, anthropicProviderDiagnosticFromSseData, awaitProviderTransport, } from "../utils/provider-diagnostic-sources.js";
13
16
  import { getProviderEnvValue } from "../utils/provider-env.js";
14
17
  import { retryProviderRequest } from "../utils/provider-retry.js";
15
18
  import { appendRetryAfterMsMarker, extract429RetryAfterMs } from "../utils/retry-hint.js";
@@ -790,7 +793,7 @@ async function* iterateAnthropicEvents(response, signal) {
790
793
  if (hintMs !== undefined) {
791
794
  errorText = appendRetryAfterMsMarker(errorText, hintMs);
792
795
  }
793
- throw new Error(errorText);
796
+ throw attachProviderDiagnostic(new Error(errorText), anthropicProviderDiagnosticFromSseData(sse.data));
794
797
  }
795
798
  if (!ANTHROPIC_MESSAGE_EVENTS.has(sse.event ?? "")) {
796
799
  continue;
@@ -888,18 +891,15 @@ export const stream = (model, context, options) => {
888
891
  maxRetries: 0,
889
892
  ...(payloadRequestMetadata.headers ? { headers: payloadRequestMetadata.headers } : {}),
890
893
  };
894
+ const send = (body) => awaitProviderTransport(() => client.beta.messages.create({ ...body, stream: true }, requestOptions).asResponse(), anthropicProviderDiagnosticFromError);
891
895
  try {
892
- const response = await client.beta.messages
893
- .create({ ...params, stream: true }, requestOptions)
894
- .asResponse();
896
+ const response = await send(params);
895
897
  return { params, response };
896
898
  }
897
899
  catch (error) {
898
900
  if (isForcedToolChoiceUnsupportedError(error, isForcedAnthropicToolChoice(params.tool_choice))) {
899
901
  params = omitToolChoiceParam(params);
900
- const response = await client.beta.messages
901
- .create({ ...params, stream: true }, requestOptions)
902
- .asResponse();
902
+ const response = await send(params);
903
903
  return { params, response };
904
904
  }
905
905
  throw error;
@@ -1254,6 +1254,9 @@ export const stream = (model, context, options) => {
1254
1254
  ...(failure.shouldRetry !== undefined ? { shouldRetry: failure.shouldRetry } : {}),
1255
1255
  },
1256
1256
  });
1257
+ const providerDiagnostic = output.stopReason === "error" ? readProviderDiagnostic(error) : undefined;
1258
+ if (providerDiagnostic !== undefined)
1259
+ output.providerDiagnostic = providerDiagnostic;
1257
1260
  output.errorMessage = errorMessage;
1258
1261
  stream.push({ type: "error", reason: output.stopReason, error: output });
1259
1262
  stream.end();