@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 +1 @@
1
- {"version":3,"file":"legacy-senpi-dir-migration.js","sourceRoot":"","sources":["../src/legacy-senpi-dir-migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,SAAS,wBAAwB,CAAC,QAAgB,EAAE,SAAiB;IACpE,IAAI,CAAC;QACJ,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,YAAY,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,SAAS,kBAAkB,CAAC,SAAiB,EAAE,UAAkB;IAChE,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACvE,OAAO,YAAY,KAAK,EAAE,IAAI,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAA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EAAE,eAAe,EAAE,6BAA6B,CAAC,CAC9F,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;QAC/C,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;AACF,CAAC","sourcesContent":["import os from \"node:os\";\nimport chalk from \"chalk\";\nimport { existsSync, mkdirSync, readdirSync, realpathSync, renameSync } from \"fs\";\nimport { dirname, isAbsolute, join, relative, resolve } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"./config.ts\";\n\nfunction pathsPointToSameLocation(leftPath: string, rightPath: string): boolean {\n\ttry {\n\t\treturn realpathSync(leftPath) === realpathSync(rightPath);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isWithinOrSamePath(childPath: string, parentPath: string): boolean {\n\tconst relativePath = relative(resolve(parentPath), resolve(childPath));\n\treturn relativePath === \"\" || (!relativePath.startsWith(\"..\") && !isAbsolute(relativePath));\n}\n\nfunction migratePathPreservingExisting(oldPath: string, newPath: string, label: string): void {\n\tif (!existsSync(oldPath)) return;\n\tif (existsSync(newPath) && pathsPointToSameLocation(oldPath, newPath)) return;\n\n\tif (!existsSync(newPath)) {\n\t\ttry {\n\t\t\tmkdirSync(dirname(newPath), { recursive: true });\n\t\t\trenameSync(oldPath, newPath);\n\t\t\tconsole.log(chalk.green(`Migrated ${label} ${oldPath} → ${newPath}`));\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}\n\n\tlet entries: string[];\n\ttry {\n\t\tentries = readdirSync(oldPath);\n\t} catch {\n\t\treturn;\n\t}\n\n\tlet movedAny = false;\n\tfor (const entry of entries) {\n\t\tconst source = join(oldPath, entry);\n\t\tconst target = join(newPath, entry);\n\t\tif (existsSync(target)) continue;\n\t\ttry {\n\t\t\trenameSync(source, target);\n\t\t\tmovedAny = true;\n\t\t} catch {}\n\t}\n\n\tif (movedAny) {\n\t\tconsole.log(chalk.green(`Migrated missing ${label} entries ${oldPath} → ${newPath}`));\n\t}\n}\n\nexport function migrateLegacySenpiDirs(cwd: string): void {\n\tif (CONFIG_DIR_NAME === \".pi\") return;\n\n\tconst homeDir = os.homedir();\n\tconst globalNewAgentDir = getAgentDir();\n\tconst globalNewMomDir = join(homeDir, CONFIG_DIR_NAME, \"mom\");\n\tconst projectNewDir = join(cwd, CONFIG_DIR_NAME);\n\tconst shouldMigrateHomeConfig = isWithinOrSamePath(globalNewAgentDir, join(homeDir, CONFIG_DIR_NAME));\n\n\tconst moves: Array<readonly [string, string, string]> = [\n\t\t[join(cwd, \".pi\"), projectNewDir, \"project config directory\"],\n\t\t[join(cwd, CONFIG_DIR_NAME, \".pi\"), projectNewDir, \"nested project config directory\"],\n\t];\n\n\tif (shouldMigrateHomeConfig) {\n\t\tmoves.unshift(\n\t\t\t[join(homeDir, \".pi\", \"agent\"), globalNewAgentDir, \"global agent directory\"],\n\t\t\t[join(homeDir, CONFIG_DIR_NAME, \".pi\", \"agent\"), globalNewAgentDir, \"nested global agent directory\"],\n\t\t\t[join(homeDir, \".pi\", \"mom\"), globalNewMomDir, \"global mom directory\"],\n\t\t\t[join(homeDir, CONFIG_DIR_NAME, \".pi\", \"mom\"), globalNewMomDir, \"nested global mom directory\"],\n\t\t);\n\t}\n\n\tfor (const [oldPath, newPath, label] of moves) {\n\t\tmigratePathPreservingExisting(oldPath, newPath, label);\n\t}\n}\n"]}
1
+ {"version":3,"file":"legacy-senpi-dir-migration.js","sourceRoot":"","sources":["../src/legacy-senpi-dir-migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;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AE,eAAe;YACnB,KAAK,EAAE,6BAA6B;YACpC,QAAQ,EAAE,MAAM;SAChB,CACD,CAAC;IACH,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;AACF,CAAC","sourcesContent":["import os from \"node:os\";\nimport chalk from \"chalk\";\nimport { existsSync, mkdirSync, readdirSync, renameSync } from \"fs\";\nimport { dirname, join } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"./config.ts\";\nimport {\n\tcopyMissingEntries,\n\tisRegenerableEntry,\n\tisWithinOrSamePath,\n\tpathsPointToSameLocation,\n} from \"./legacy-dir-copy.ts\";\n\n/**\n * Official `.pi` directories belong to an upstream pi install that keeps running on this machine,\n * so they are only ever copied. Only `.pi` leftovers nested in our own config dir are moved.\n */\ntype LegacyDirTransfer = \"copy\" | \"move\";\n\ninterface LegacyDir {\n\treadonly from: string;\n\treadonly to: string;\n\treadonly label: string;\n\treadonly transfer: LegacyDirTransfer;\n}\n\nfunction copyLegacyDir({ from, to, label }: LegacyDir): void {\n\tconst copied = copyMissingEntries(from, to, (entry) => !isRegenerableEntry(entry));\n\tif (copied.length > 0) {\n\t\tconsole.log(chalk.green(`Copied ${label} ${from} → ${to}`));\n\t\tconsole.log(chalk.dim(\"The original directory is untouched; the two installs keep separate state from now on.\"));\n\t}\n}\n\nfunction moveLegacyDir({ from, to, label }: LegacyDir): void {\n\tif (!existsSync(to)) {\n\t\tmkdirSync(dirname(to), { recursive: true });\n\t\trenameSync(from, to);\n\t\tconsole.log(chalk.green(`Migrated ${label} ${from} → ${to}`));\n\t\treturn;\n\t}\n\n\tlet movedAny = false;\n\tfor (const entry of readdirSync(from)) {\n\t\tconst target = join(to, entry);\n\t\tif (existsSync(target)) continue;\n\t\trenameSync(join(from, entry), target);\n\t\tmovedAny = true;\n\t}\n\tif (movedAny) {\n\t\tconsole.log(chalk.green(`Migrated missing ${label} entries ${from} → ${to}`));\n\t}\n}\n\nfunction transferLegacyDir(dir: LegacyDir): void {\n\tif (!existsSync(dir.from)) return;\n\tif (existsSync(dir.to) && pathsPointToSameLocation(dir.from, dir.to)) return;\n\ttry {\n\t\tswitch (dir.transfer) {\n\t\t\tcase \"copy\":\n\t\t\t\tcopyLegacyDir(dir);\n\t\t\t\treturn;\n\t\t\tcase \"move\":\n\t\t\t\tmoveLegacyDir(dir);\n\t\t\t\treturn;\n\t\t}\n\t} catch (error) {\n\t\tconst reason = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(chalk.yellow(`Skipped the ${dir.label} ${dir.from}: ${reason}`));\n\t}\n}\n\nexport function migrateLegacySenpiDirs(cwd: string): void {\n\tif (CONFIG_DIR_NAME === \".pi\") return;\n\n\tconst homeDir = os.homedir();\n\tconst globalNewAgentDir = getAgentDir();\n\tconst globalNewMomDir = join(homeDir, CONFIG_DIR_NAME, \"mom\");\n\tconst projectNewDir = join(cwd, CONFIG_DIR_NAME);\n\tconst shouldMigrateHomeConfig = isWithinOrSamePath(globalNewAgentDir, join(homeDir, CONFIG_DIR_NAME));\n\n\tconst dirs: LegacyDir[] = [\n\t\t{ from: join(cwd, \".pi\"), to: projectNewDir, label: \"project config directory\", transfer: \"copy\" },\n\t\t{\n\t\t\tfrom: join(cwd, CONFIG_DIR_NAME, \".pi\"),\n\t\t\tto: projectNewDir,\n\t\t\tlabel: \"nested project config directory\",\n\t\t\ttransfer: \"move\",\n\t\t},\n\t];\n\n\tif (shouldMigrateHomeConfig) {\n\t\tdirs.unshift(\n\t\t\t{\n\t\t\t\tfrom: join(homeDir, \".pi\", \"agent\"),\n\t\t\t\tto: globalNewAgentDir,\n\t\t\t\tlabel: \"global agent directory\",\n\t\t\t\ttransfer: \"copy\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tfrom: join(homeDir, CONFIG_DIR_NAME, \".pi\", \"agent\"),\n\t\t\t\tto: globalNewAgentDir,\n\t\t\t\tlabel: \"nested global agent directory\",\n\t\t\t\ttransfer: \"move\",\n\t\t\t},\n\t\t\t{ from: join(homeDir, \".pi\", \"mom\"), to: globalNewMomDir, label: \"global mom directory\", transfer: \"copy\" },\n\t\t\t{\n\t\t\t\tfrom: join(homeDir, CONFIG_DIR_NAME, \".pi\", \"mom\"),\n\t\t\t\tto: globalNewMomDir,\n\t\t\t\tlabel: \"nested global mom directory\",\n\t\t\t\ttransfer: \"move\",\n\t\t\t},\n\t\t);\n\t}\n\n\tfor (const dir of dirs) {\n\t\ttransferLegacyDir(dir);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAOH,OAAO,EAAE,KAAK,IAAI,EAAgF,MAAM,eAAe,CAAC;AAgCxH,OAAO,EACN,6BAA6B,EAG7B,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,KAAK,gCAAgC,EAA6B,MAAM,iCAAiC,CAAC;AACnH,OAAO,EACN,KAAK,6BAA6B,EAGlC,MAAM,kCAAkC,CAAC;AAM1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAQlE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,yBAAyB,CAAC;AAQ9E,OAAO,EAAwB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGjF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA8C7D,wBAAgB,+BAA+B,CAC9C,MAAM,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAChD,6BAA6B,EAAE,CAKjC;AAuCD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,IAAI,EACZ,kBAAkB,EAAE,OAAO,EAC3B,kBAAkB,GAAE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AED,MAAM,WAAW,uBAAuB;IACvC,MAAM,EAAE,IAAI,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,kGAAkG;AAClG,wBAAgB,uBAAuB,CACtC,aAAa,EAAE,uBAAuB,EACtC,KAAK,GAAE;IACN,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;IACvC,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,uBAAuB,CAAC,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;IAC3E;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CACvB,GACJ,gCAAgC,CAqMlC;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,iBAse/D"}
package/dist/main.js CHANGED
@@ -5,6 +5,7 @@
5
5
  * This file handles CLI argument parsing and translates them into
6
6
  * createAgentSession() options. The SDK does the heavy lifting.
7
7
  */
8
+ import { existsSync } from "node:fs";
8
9
  import { join, resolve } from "node:path";
9
10
  import { createInterface } from "node:readline";
10
11
  import { modelsAreEqual } from "@earendil-works/pi-ai";
@@ -13,6 +14,7 @@ import chalk from "chalk";
13
14
  import { normalizeSessionName, parseArgs, printHelp, resolveSessionRuntime } from "./cli/args.js";
14
15
  import { checkProviderAuth, createAuthCheckModelRuntime, getProviderCredential, } from "./cli/auth-check.js";
15
16
  import { AuthCommandError, getAuthCommandName, getAuthCommandUsage, isAuthCommandHelp, parseAuthCommand, printAuthCommandHelp, validateAuthCommandArgs, } from "./cli/auth-command.js";
17
+ import { movedSessionToContinue } from "./cli/continue-moved.js";
16
18
  import { resolveCredentialForPrint } from "./cli/credential-print.js";
17
19
  import { chooseCrossProjectAction, confirmSameRepositoryRebind } from "./cli/cross-project-session.js";
18
20
  import { dispatchAppServerCommand, dispatchConfigCommand, dispatchHostCommand, dispatchPackageCommand, } from "./cli/deferred-commands.js";
@@ -36,8 +38,11 @@ import { exportFromFile } from "./core/export-html/index.js";
36
38
  import { applyHttpProxySettings, configureHttpDispatcher } from "./core/http-dispatcher.js";
37
39
  import { getModelNarrowingPatterns, resolveCliModel, resolveModelScope, } from "./core/model-resolver.js";
38
40
  import { ModelRuntime } from "./core/model-runtime.js";
41
+ import { markMovedSessions, withMovedSessions } from "./core/moved-sessions.js";
39
42
  import { restoreStdout, takeOverStdout } from "./core/output-guard.js";
43
+ import { recordProcessLifetime } from "./core/process-crash-record.js";
40
44
  import { resolveProjectTrusted } from "./core/project-trust.js";
45
+ import { resolveResumeTarget } from "./core/resume-target.js";
41
46
  import { formatMissingSessionCwdPrompt, getMissingSessionCwdIssue, MissingSessionCwdError, } from "./core/session-cwd.js";
42
47
  import { assertValidSessionId, SessionManager } from "./core/session-manager.js";
43
48
  import { classifySessionRepository, readSessionCwd, rebindSessionFile } from "./core/session-rebind.js";
@@ -364,9 +369,9 @@ function forkSessionOrExit(sourcePath, cwd, sessionDir, sessionId) {
364
369
  process.exit(1);
365
370
  }
366
371
  }
367
- function rebindSessionOrExit(sourcePath, cwd, sessionDir) {
372
+ async function rebindSessionOrExit(sourcePath, cwd, sessionDir) {
368
373
  try {
369
- const reboundPath = rebindSessionFile(sourcePath, cwd, sessionDir);
374
+ const reboundPath = await rebindSessionFile(sourcePath, cwd, sessionDir);
370
375
  console.log(chalk.dim(`Session moved to ${cwd}`));
371
376
  return SessionManager.open(reboundPath, sessionDir);
372
377
  }
@@ -460,33 +465,51 @@ export async function createSessionManager(parsed, cwd, sessionDir, settingsMana
460
465
  if (parsed.resume) {
461
466
  try {
462
467
  const { selectSession } = await import("./cli/session-picker.js");
463
- const selectedPath = await selectSession((onProgress) => SessionManager.list(cwd, sessionDir, onProgress), (onProgress) => SessionManager.listAll(sessionDir, onProgress), settingsManager);
468
+ const movedOptions = sessionDir === undefined ? {} : { sessionDir };
469
+ const selectedPath = await selectSession((onProgress) => withMovedSessions(SessionManager.list(cwd, sessionDir, onProgress), cwd, movedOptions), async (onProgress) => markMovedSessions(await SessionManager.listAll(sessionDir, onProgress), cwd), settingsManager);
464
470
  if (!selectedPath) {
465
471
  console.log(chalk.dim("No session selected"));
466
472
  process.exit(0);
467
473
  }
468
- const selectedCwd = sessionCwdOrUndefined(selectedPath);
469
- if (selectedCwd !== undefined &&
470
- resolvePath(selectedCwd) !== resolvePath(cwd) &&
471
- (await classifySessionRepository(selectedPath, selectedCwd, cwd)) === "same") {
472
- console.log(chalk.yellow(`Session found in different project: ${selectedCwd}`));
473
- const rebind = await confirmSameRepositoryRebind({
474
- sessionArg: selectedPath,
475
- cwd,
476
- confirm: promptConfirm,
477
- out: (line) => console.log(line),
478
- });
479
- if (rebind)
480
- return rebindSessionOrExit(selectedPath, cwd, sessionDir);
481
- }
482
- return SessionManager.open(selectedPath, sessionDir);
474
+ const target = await resolveResumeTarget({
475
+ sessionPath: selectedPath,
476
+ cwd,
477
+ ...movedOptions,
478
+ confirm: (selectedCwd) => {
479
+ console.log(chalk.yellow(`Session found in different project: ${selectedCwd}`));
480
+ return confirmSameRepositoryRebind({
481
+ sessionArg: selectedPath,
482
+ cwd,
483
+ confirm: promptConfirm,
484
+ out: (line) => console.log(line),
485
+ });
486
+ },
487
+ }).catch((error) => {
488
+ console.error(chalk.red(`Error: ${error instanceof Error ? error.message : String(error)}`));
489
+ return process.exit(1);
490
+ });
491
+ if (target.rebound)
492
+ console.log(chalk.dim(`Session moved to ${cwd}`));
493
+ return SessionManager.open(target.path, sessionDir);
483
494
  }
484
495
  finally {
485
496
  stopThemeWatcher();
486
497
  }
487
498
  }
488
499
  if (parsed.continue) {
489
- return SessionManager.continueRecent(cwd, sessionDir);
500
+ const recent = SessionManager.continueRecent(cwd, sessionDir);
501
+ const recentFile = recent.getSessionFile();
502
+ if (recentFile !== undefined && existsSync(recentFile))
503
+ return recent;
504
+ const moved = await movedSessionToContinue({
505
+ cwd,
506
+ ...(sessionDir === undefined ? {} : { sessionDir }),
507
+ interactive: appMode === "interactive",
508
+ confirm: promptConfirm,
509
+ out: (line) => console.log(line),
510
+ err: (line) => console.error(line),
511
+ });
512
+ return moved === undefined ? recent : rebindSessionOrExit(moved, cwd, sessionDir);
490
513
  }
491
514
  if (parsed.sessionId) {
492
515
  const existingSession = await findLocalSessionByExactId(parsed.sessionId, cwd, sessionDir);
@@ -1103,6 +1126,9 @@ export async function main(args, options) {
1103
1126
  }
1104
1127
  }
1105
1128
  time("readPipedStdin");
1129
+ // An RPC process always has a parent that watches its exit; every other mode dies unobserved.
1130
+ recordProcessLifetime(agentDir, appMode, { supervised: appMode === "rpc" });
1131
+ time("recordProcessLifetime");
1106
1132
  const { initialMessage, initialImages, initialTitlePrompt } = await prepareInitialMessage(parsed, settingsManager.getImageAutoResize(), stdinContent);
1107
1133
  time("prepareInitialMessage");
1108
1134
  if (parsed.grokNeo && appMode === "interactive") {