@code-yeongyu/senpi 2026.11.10 → 2026.11.11

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 (320) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/dist/bundle/{SKILL-B4R7BVOT.md → SKILL-R7FEIQKG.md} +1 -1
  3. package/dist/bundle/chunks/{SKILL-AZ6ONO52.js → SKILL-5O2UKORG.js} +1 -1
  4. package/dist/bundle/chunks/{SKILL-B4R7BVOT.md → SKILL-R7FEIQKG.md} +1 -1
  5. package/dist/bundle/chunks/{args-77GYOPEO.js → args-HFYB6URH.js} +1 -1
  6. package/dist/bundle/chunks/{azure-openai-responses-YFZ734T3.js → azure-openai-responses-MNN2TINI.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-ZUQCYIRY.js → chunk-2ODGHBUD.js} +1 -1
  8. package/dist/bundle/chunks/chunk-3IYEGHBI.js +2 -0
  9. package/dist/bundle/chunks/{chunk-I5ASHSLZ.js → chunk-4JMGWVRH.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-YKYWL2NO.js → chunk-5F2XC6UC.js} +3 -3
  11. package/dist/bundle/chunks/{chunk-MSDBBOB2.js → chunk-5H43O4MA.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-R3OP7IA4.js → chunk-5PIZWSNG.js} +4 -4
  13. package/dist/bundle/chunks/{chunk-33MZJTQ3.js → chunk-B4WD5XHP.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-Q63YLZMN.js → chunk-BPEA5SWW.js} +2 -2
  15. package/dist/bundle/chunks/{chunk-MOVJQVMC.js → chunk-BUDJLVMF.js} +3 -3
  16. package/dist/bundle/chunks/{chunk-V5FSENW6.js → chunk-COKX65TE.js} +1 -1
  17. package/dist/bundle/chunks/{chunk-2EJ4BGBM.js → chunk-DHORIIVQ.js} +1 -1
  18. package/dist/bundle/chunks/{chunk-NH7SYIGN.js → chunk-DLPV4B3R.js} +1 -1
  19. package/dist/bundle/chunks/{chunk-RCHIMH7N.js → chunk-DQY26AX3.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-Y7Z7XPUF.js → chunk-DZQA5LVN.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-2CNSCMYC.js → chunk-E5O4SP5I.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-3Q5ZENSD.js → chunk-E6ZBTSC6.js} +1 -1
  23. package/dist/bundle/chunks/{chunk-GVPZPVVO.js → chunk-IBDAV2AL.js} +3 -3
  24. package/dist/bundle/chunks/chunk-IREUIMFE.js +11 -0
  25. package/dist/bundle/chunks/{chunk-KU7OCWJF.js → chunk-J4ADZ2OK.js} +1 -1
  26. package/dist/bundle/chunks/{chunk-T2SMQPRE.js → chunk-K3GAGIPX.js} +1 -1
  27. package/dist/bundle/chunks/{chunk-BELNOPAI.js → chunk-L3KVP7VJ.js} +3 -3
  28. package/dist/bundle/chunks/{chunk-IYSJFQUU.js → chunk-L6DF5G6K.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-7MN7YNO5.js → chunk-L7DGTA3L.js} +1 -1
  30. package/dist/bundle/chunks/chunk-LJFQYCFH.js +2 -0
  31. package/dist/bundle/chunks/{chunk-J2NGJKXL.js → chunk-LXINMDMX.js} +1 -1
  32. package/dist/bundle/chunks/{chunk-H33A33M4.js → chunk-M2VJVJMK.js} +1 -1
  33. package/dist/bundle/chunks/{chunk-2U6HXWXS.js → chunk-NNQ34ZDW.js} +1 -1
  34. package/dist/bundle/chunks/chunk-NQKCJQHB.js +2 -0
  35. package/dist/bundle/chunks/{chunk-EJB5E2JK.js → chunk-NRZAJUUO.js} +2 -2
  36. package/dist/bundle/chunks/{chunk-R2Z7CX77.js → chunk-OSNR3IRD.js} +1 -1
  37. package/dist/bundle/chunks/{chunk-O3FG6HML.js → chunk-PJI5GT7U.js} +1 -1
  38. package/dist/bundle/chunks/{chunk-FDNM2DAE.js → chunk-PUZDKFRT.js} +164 -164
  39. package/dist/bundle/chunks/{chunk-BPNSOZ2C.js → chunk-QUVSIW2R.js} +1 -1
  40. package/dist/bundle/chunks/{chunk-WXYMAUFX.js → chunk-QX7WD3IM.js} +1 -1
  41. package/dist/bundle/chunks/{chunk-Y4ONXQMR.js → chunk-RGHVPUUX.js} +1 -1
  42. package/dist/bundle/chunks/{chunk-RYPM5BZQ.js → chunk-S7NAJQB3.js} +1 -1
  43. package/dist/bundle/chunks/{chunk-2BH54YQR.js → chunk-SANWO37B.js} +1 -1
  44. package/dist/bundle/chunks/{chunk-YQZNARTX.js → chunk-SS5VTBAV.js} +1 -1
  45. package/dist/bundle/chunks/{chunk-LT353NSF.js → chunk-T4CUD7RF.js} +1 -1
  46. package/dist/bundle/chunks/{chunk-J7FW7MED.js → chunk-TCZORL3V.js} +1 -1
  47. package/dist/bundle/chunks/{chunk-KU72IKV5.js → chunk-VGSWOLIY.js} +1 -1
  48. package/dist/bundle/chunks/{chunk-DBQBJTMF.js → chunk-VUY4BZDI.js} +1 -1
  49. package/dist/bundle/chunks/chunk-XI6THO4F.js +2 -0
  50. package/dist/bundle/chunks/{chunk-FAFIGBUD.js → chunk-XUDKT4UH.js} +3 -3
  51. package/dist/bundle/chunks/{cli-main-BX5AFWJQ.js → cli-main-7II7GCIR.js} +1 -1
  52. package/dist/bundle/chunks/{credential-accounts-LVVPKFEY.js → credential-accounts-N3B5YJS7.js} +1 -1
  53. package/dist/bundle/chunks/{dispatch-EP35KKJ3.js → dispatch-YUYZQXRP.js} +1 -1
  54. package/dist/bundle/chunks/github-copilot.js +1 -1
  55. package/dist/bundle/chunks/{hand-entry-F6PWKNPJ.js → hand-entry-ONOLRMVB.js} +3 -3
  56. package/dist/bundle/chunks/{headless-host-HKGNJGYT.js → headless-host-53UMJMM6.js} +1 -1
  57. package/dist/bundle/chunks/{health-write-FBF74QJ7.js → health-write-JLSF5EVV.js} +1 -1
  58. package/dist/bundle/chunks/{help-fast-path-5SCPY3OH.js → help-fast-path-552QLMWT.js} +1 -1
  59. package/dist/bundle/chunks/{host-command-47QQKJEY.js → host-command-KWMJLPBS.js} +1 -1
  60. package/dist/bundle/chunks/{host-lifecycle-VSAH4M3R.js → host-lifecycle-4WQDCN3Y.js} +1 -1
  61. package/dist/bundle/chunks/host-lifecycle.js +5 -5
  62. package/dist/bundle/chunks/{host-session-command-SL4AN5WD.js → host-session-command-ZDYEKCUB.js} +1 -1
  63. package/dist/bundle/chunks/{host-socket-request-DMYXC56U.js → host-socket-request-QN4Q2P5E.js} +1 -1
  64. package/dist/bundle/chunks/{interactive-mode-JDMIHJMQ.js → interactive-mode-EPE4M32G.js} +1 -1
  65. package/dist/bundle/chunks/{login-health-EVXVLHB2.js → login-health-TOSQT5RG.js} +1 -1
  66. package/dist/bundle/chunks/{main-4RITUAQF.js → main-OM7BKVZG.js} +1 -1
  67. package/dist/bundle/chunks/{multi-session-host-SKDD4OWM.js → multi-session-host-DB6XMY53.js} +11 -8
  68. package/dist/bundle/chunks/openai-codex-responses-VRGOAFEG.js +10 -0
  69. package/dist/bundle/chunks/{openai-responses-NIVBWE2H.js → openai-responses-I7PXRWCM.js} +2 -2
  70. package/dist/bundle/chunks/{package-manager-cli-B5VA4KFO.js → package-manager-cli-GLU5Q2KV.js} +1 -1
  71. package/dist/bundle/chunks/{role-HQUN4XXK.js → role-AEOLJRTP.js} +1 -1
  72. package/dist/bundle/chunks/{rotation-stream-F3BEMXBE.js → rotation-stream-E3FJFHXJ.js} +1 -1
  73. package/dist/bundle/chunks/rpc-mode-SDJVBT36.js +2 -0
  74. package/dist/bundle/chunks/{rpc-monitor-source-C6VQ3BC4.js → rpc-monitor-source-PGTDSGWP.js} +1 -1
  75. package/dist/bundle/chunks/{run-attached-tui-R3RB5P7G.js → run-attached-tui-4AENRP7P.js} +1 -1
  76. package/dist/bundle/chunks/{schedule-command-FPEQCX33.js → schedule-command-5SQD7M5N.js} +1 -1
  77. package/dist/bundle/chunks/session-control-endpoint-R25A2QGS.js +3 -0
  78. package/dist/bundle/chunks/{session-picker-2FZSNFS7.js → session-picker-GZM5CVQL.js} +1 -1
  79. package/dist/bundle/chunks/{session-slot-CZGQQCOC.js → session-slot-RH7JLO3F.js} +1 -1
  80. package/dist/bundle/chunks/session-worker.js +335 -332
  81. package/dist/bundle/chunks/{state-store-S7QAESIF.js → state-store-IECVTYXC.js} +1 -1
  82. package/dist/bundle/cli.js +2 -2
  83. package/dist/bundle/host-supervisor.js +5 -5
  84. package/dist/bundle/index.js +1 -1
  85. package/dist/bundle/rpc-entry.js +1 -1
  86. package/dist/bundle/runtime-manifest.json +1 -1
  87. package/dist/cli.js +9 -3
  88. package/dist/core/agent-session-runtime.d.ts +2 -0
  89. package/dist/core/agent-session-runtime.js +5 -0
  90. package/dist/core/agent-session.d.ts +15 -3
  91. package/dist/core/agent-session.js +91 -18
  92. package/dist/core/assistant-error-redaction.d.ts +9 -0
  93. package/dist/core/assistant-error-redaction.js +27 -0
  94. package/dist/core/config-reference-redaction.js +90 -10
  95. package/dist/core/context-files.d.ts +10 -0
  96. package/dist/core/context-files.js +58 -12
  97. package/dist/core/credential-accounts.d.ts +2 -0
  98. package/dist/core/credential-accounts.js +10 -1
  99. package/dist/core/dynamic-prompt/intent-gate.js +2 -2
  100. package/dist/core/dynamic-prompt/style.js +2 -2
  101. package/dist/core/dynamic-prompt/verification.js +2 -2
  102. package/dist/core/egress/wire.d.ts +13 -0
  103. package/dist/core/extensions/builtin/anthropic-subscription/accounts.d.ts +3 -0
  104. package/dist/core/extensions/builtin/anthropic-subscription/auth-lane.js +3 -2
  105. package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-account-test.js +3 -1
  106. package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-connection-test.d.ts +3 -1
  107. package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-connection-test.js +47 -16
  108. package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-login-slots.d.ts +1 -1
  109. package/dist/core/extensions/builtin/anthropic-subscription/claude-cli-login-slots.js +4 -2
  110. package/dist/core/extensions/builtin/anthropic-subscription/claude-settings-env.d.ts +20 -0
  111. package/dist/core/extensions/builtin/anthropic-subscription/claude-settings-env.js +39 -0
  112. package/dist/core/extensions/builtin/anthropic-subscription/context-window.d.ts +17 -0
  113. package/dist/core/extensions/builtin/anthropic-subscription/context-window.js +23 -0
  114. package/dist/core/extensions/builtin/anthropic-subscription/errors.d.ts +1 -0
  115. package/dist/core/extensions/builtin/anthropic-subscription/errors.js +14 -5
  116. package/dist/core/extensions/builtin/anthropic-subscription/oauth-login.js +3 -3
  117. package/dist/core/extensions/builtin/anthropic-subscription/prompt-cache-ttl.d.ts +10 -4
  118. package/dist/core/extensions/builtin/anthropic-subscription/prompt-cache-ttl.js +14 -5
  119. package/dist/core/extensions/builtin/anthropic-subscription/query-environment.d.ts +3 -2
  120. package/dist/core/extensions/builtin/anthropic-subscription/query-environment.js +5 -4
  121. package/dist/core/extensions/builtin/anthropic-subscription/sdk-boundary.lazy.d.ts +2 -1
  122. package/dist/core/extensions/builtin/anthropic-subscription/sdk-boundary.lazy.js +1 -0
  123. package/dist/core/extensions/builtin/anthropic-subscription/stream.js +11 -1
  124. package/dist/core/extensions/builtin/config-reload/change-groups.js +6 -2
  125. package/dist/core/extensions/builtin/goal/continuation.d.ts +6 -0
  126. package/dist/core/extensions/builtin/goal/continuation.js +3 -2
  127. package/dist/core/extensions/builtin/goal/index.js +14 -26
  128. package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts +8 -6
  129. package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +77 -39
  130. package/dist/core/extensions/builtin/goal/monitor-continuation.js +66 -7
  131. package/dist/core/extensions/builtin/goal/persistence.js +20 -0
  132. package/dist/core/extensions/builtin/goal/provider-retry.d.ts +9 -0
  133. package/dist/core/extensions/builtin/goal/provider-retry.js +16 -0
  134. package/dist/core/extensions/builtin/goal/reload-reengagement.d.ts +3 -2
  135. package/dist/core/extensions/builtin/goal/reload-reengagement.js +4 -4
  136. package/dist/core/extensions/builtin/goal/session-start-continuation.d.ts +28 -0
  137. package/dist/core/extensions/builtin/goal/session-start-continuation.js +75 -0
  138. package/dist/core/extensions/builtin/goal/store.d.ts +3 -2
  139. package/dist/core/extensions/builtin/goal/store.js +9 -2
  140. package/dist/core/extensions/builtin/goal/types.d.ts +9 -0
  141. package/dist/core/extensions/builtin/handoff-hint/index.js +15 -11
  142. package/dist/core/extensions/builtin/handoff-hint/replacement-relay.d.ts +16 -0
  143. package/dist/core/extensions/builtin/handoff-hint/replacement-relay.js +17 -0
  144. package/dist/core/extensions/builtin/html-render/tool.js +13 -3
  145. package/dist/core/extensions/builtin/imagegen/skill/SKILL.md +1 -1
  146. package/dist/core/extensions/builtin/imagegen/tool.js +4 -14
  147. package/dist/core/extensions/builtin/mcp/auth/catalog-identity.js +32 -8
  148. package/dist/core/extensions/builtin/mcp/auth/commands-auth.js +2 -1
  149. package/dist/core/extensions/builtin/mcp/auth/context.js +3 -0
  150. package/dist/core/extensions/builtin/mcp/auth/oauth-grant.d.ts +43 -0
  151. package/dist/core/extensions/builtin/mcp/auth/oauth-grant.js +196 -0
  152. package/dist/core/extensions/builtin/mcp/auth/oauth-issuer.d.ts +7 -1
  153. package/dist/core/extensions/builtin/mcp/auth/oauth-issuer.js +13 -0
  154. package/dist/core/extensions/builtin/mcp/auth/oauth-provider.d.ts +6 -17
  155. package/dist/core/extensions/builtin/mcp/auth/oauth-provider.js +67 -88
  156. package/dist/core/extensions/builtin/mcp/auth/oauth-refresh.d.ts +1 -1
  157. package/dist/core/extensions/builtin/mcp/auth/oauth-refresh.js +25 -4
  158. package/dist/core/extensions/builtin/mcp/auth/oauth.js +10 -7
  159. package/dist/core/extensions/builtin/mcp/auth/registered-redirect.d.ts +19 -0
  160. package/dist/core/extensions/builtin/mcp/auth/registered-redirect.js +55 -0
  161. package/dist/core/extensions/builtin/mcp/auth/token-store.d.ts +23 -1
  162. package/dist/core/extensions/builtin/mcp/auth/token-store.js +3 -0
  163. package/dist/core/extensions/builtin/mcp/catalog-cache.js +7 -6
  164. package/dist/core/extensions/builtin/mcp/catalog.js +3 -2
  165. package/dist/core/extensions/builtin/mcp/invocation.js +6 -0
  166. package/dist/core/extensions/builtin/mcp/service-register.js +16 -2
  167. package/dist/core/extensions/builtin/mcp/service-tools-changed.js +61 -54
  168. package/dist/core/extensions/builtin/mcp/startup-race.d.ts +2 -0
  169. package/dist/core/extensions/builtin/mcp/startup-race.js +25 -7
  170. package/dist/core/extensions/builtin/permission-system/parsers.js +1 -0
  171. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +3 -3
  172. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-2.js +9 -8
  173. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +3 -3
  174. package/dist/core/extensions/builtin/prompt-preset/claude-haiku-5-5.js +3 -3
  175. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5-5.js +3 -3
  176. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +4 -4
  177. package/dist/core/extensions/builtin/prompt-preset/claude-sonnet-5-5.js +3 -3
  178. package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.js +3 -3
  179. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +3 -3
  180. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +2 -2
  181. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +3 -3
  182. package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +1 -1
  183. package/dist/core/extensions/builtin/prompt-preset/grok-4.6.js +4 -4
  184. package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js +5 -5
  185. package/dist/core/extensions/builtin/prompt-preset/kimi-k3-1.js +4 -4
  186. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +7 -6
  187. package/dist/core/extensions/loader.js +24 -4
  188. package/dist/core/extensions/runner.d.ts +9 -1
  189. package/dist/core/extensions/runner.js +9 -4
  190. package/dist/core/extensions/types.d.ts +19 -3
  191. package/dist/core/hand/hook-advertise.d.ts +41 -0
  192. package/dist/core/hand/hook-advertise.js +98 -0
  193. package/dist/core/hand/hook-contract.d.ts +66 -0
  194. package/dist/core/hand/hook-contract.js +138 -0
  195. package/dist/core/open-timing.d.ts +2 -0
  196. package/dist/core/open-timing.js +7 -1
  197. package/dist/core/resource-loader.js +21 -3
  198. package/dist/core/retry-fallback/controller-types.d.ts +2 -0
  199. package/dist/core/retry-fallback/controller.js +9 -2
  200. package/dist/core/retry-fallback/cooldown.d.ts +7 -0
  201. package/dist/core/retry-fallback/cooldown.js +13 -1
  202. package/dist/core/retry-fallback/credential-recovery.d.ts +7 -0
  203. package/dist/core/retry-fallback/credential-recovery.js +24 -0
  204. package/dist/core/retry-fallback/log.d.ts +7 -1
  205. package/dist/core/retry-fallback/log.js +82 -5
  206. package/dist/core/retry-fallback/model-config-error.js +2 -1
  207. package/dist/core/retry-fallback/settings.d.ts +8 -5
  208. package/dist/core/retry-fallback/settings.js +9 -6
  209. package/dist/core/session-manager.d.ts +2 -0
  210. package/dist/core/session-manager.js +15 -1
  211. package/dist/core/settings-manager.d.ts +6 -0
  212. package/dist/core/settings-manager.js +8 -0
  213. package/dist/core/turn-origin.d.ts +18 -10
  214. package/dist/core/turn-origin.js +34 -30
  215. package/dist/core/ultrafast-lanes.d.ts +1 -0
  216. package/dist/core/ultrafast-lanes.js +4 -2
  217. package/dist/modes/interactive/components/footer.d.ts +23 -5
  218. package/dist/modes/interactive/components/footer.js +45 -16
  219. package/dist/modes/interactive/interactive-mode.js +9 -1
  220. package/dist/modes/interactive/session-control-rpc-commands.d.ts +1 -1
  221. package/dist/modes/interactive/session-control-rpc-commands.js +5 -0
  222. package/dist/modes/rpc/admit-external-message-command.d.ts +2 -0
  223. package/dist/modes/rpc/admit-external-message-command.js +5 -1
  224. package/dist/modes/rpc/compact-admission-validation.js +4 -1
  225. package/dist/modes/rpc/connection-authority.d.ts +2 -1
  226. package/dist/modes/rpc/connection-authority.js +11 -9
  227. package/dist/modes/rpc/connection-handler.d.ts +2 -0
  228. package/dist/modes/rpc/connection-handler.js +33 -7
  229. package/dist/modes/rpc/connection-roles.d.ts +7 -0
  230. package/dist/modes/rpc/connection-roles.js +15 -0
  231. package/dist/modes/rpc/custom-capability.d.ts +6 -0
  232. package/dist/modes/rpc/custom-capability.js +6 -0
  233. package/dist/modes/rpc/delegated-drive-origin.d.ts +6 -6
  234. package/dist/modes/rpc/delegated-drive-origin.js +7 -8
  235. package/dist/modes/rpc/delegation-declaration.d.ts +2 -0
  236. package/dist/modes/rpc/delegation-declaration.js +7 -3
  237. package/dist/modes/rpc/effect-commands.d.ts +33 -0
  238. package/dist/modes/rpc/host-capabilities.d.ts +1 -0
  239. package/dist/modes/rpc/host-capabilities.js +7 -1
  240. package/dist/modes/rpc/host-gc-evidence.d.ts +1 -1
  241. package/dist/modes/rpc/host-gc-evidence.js +9 -3
  242. package/dist/modes/rpc/host-gc.js +4 -1
  243. package/dist/modes/rpc/host-observe-request.d.ts +2 -0
  244. package/dist/modes/rpc/host-observe-request.js +6 -1
  245. package/dist/modes/rpc/host-park-ledger.d.ts +19 -0
  246. package/dist/modes/rpc/host-park-ledger.js +110 -0
  247. package/dist/modes/rpc/lifecycle-delivery.js +4 -1
  248. package/dist/modes/rpc/loopless-tool-handlers.d.ts +6 -0
  249. package/dist/modes/rpc/loopless-tool-handlers.js +14 -1
  250. package/dist/modes/rpc/media-placeholders.js +1 -0
  251. package/dist/modes/rpc/method-classes-schema-host.d.ts +42 -1
  252. package/dist/modes/rpc/method-classes-schema-host.js +24 -21
  253. package/dist/modes/rpc/method-classes-schema-session.d.ts +20 -0
  254. package/dist/modes/rpc/method-classes-schema-session.js +6 -0
  255. package/dist/modes/rpc/method-classes-schema.d.ts +62 -1
  256. package/dist/modes/rpc/method-classes-schema.js +5 -2
  257. package/dist/modes/rpc/method-classes.d.ts +4 -0
  258. package/dist/modes/rpc/method-classes.js +6 -0
  259. package/dist/modes/rpc/multi-session-host.js +1 -1
  260. package/dist/modes/rpc/project-file-commands.d.ts +32 -0
  261. package/dist/modes/rpc/project-file-commands.js +195 -0
  262. package/dist/modes/rpc/project-file-path.d.ts +34 -0
  263. package/dist/modes/rpc/project-file-path.js +93 -0
  264. package/dist/modes/rpc/rpc-error-types.d.ts +9 -1
  265. package/dist/modes/rpc/rpc-error-types.js +8 -0
  266. package/dist/modes/rpc/rpc-host-command-types.d.ts +14 -1
  267. package/dist/modes/rpc/rpc-host-response-types.d.ts +21 -0
  268. package/dist/modes/rpc/rpc-mutation-response-types.d.ts +7 -0
  269. package/dist/modes/rpc/rpc-read-response-types.d.ts +7 -0
  270. package/dist/modes/rpc/rpc-session-command-types.d.ts +10 -0
  271. package/dist/modes/rpc/rpc-session-state-types.d.ts +2 -0
  272. package/dist/modes/rpc/session-attachment-gate.js +6 -0
  273. package/dist/modes/rpc/session-binding.d.ts +1 -0
  274. package/dist/modes/rpc/session-binding.js +6 -1
  275. package/dist/modes/rpc/session-command-activity.js +1 -0
  276. package/dist/modes/rpc/session-connection-context.d.ts +2 -0
  277. package/dist/modes/rpc/session-connection-context.js +4 -0
  278. package/dist/modes/rpc/session-registry-attach.d.ts +2 -0
  279. package/dist/modes/rpc/session-registry-attach.js +15 -11
  280. package/dist/modes/rpc/session-registry-claims.js +2 -0
  281. package/dist/modes/rpc/session-registry-open.js +13 -7
  282. package/dist/modes/rpc/session-registry-opening.js +2 -1
  283. package/dist/modes/rpc/session-registry-types.d.ts +4 -0
  284. package/dist/modes/rpc/session-registry.d.ts +3 -0
  285. package/dist/modes/rpc/session-registry.js +27 -3
  286. package/dist/modes/rpc/session-router-close.js +1 -0
  287. package/dist/modes/rpc/session-router-context.d.ts +4 -2
  288. package/dist/modes/rpc/session-router-context.js +3 -0
  289. package/dist/modes/rpc/session-router-host-reads.js +1 -0
  290. package/dist/modes/rpc/session-router-occupancy.js +10 -1
  291. package/dist/modes/rpc/session-router-open-result.d.ts +12 -0
  292. package/dist/modes/rpc/session-router-open-result.js +63 -0
  293. package/dist/modes/rpc/session-router-open.d.ts +3 -0
  294. package/dist/modes/rpc/session-router-open.js +15 -63
  295. package/dist/modes/rpc/session-router-park.d.ts +15 -0
  296. package/dist/modes/rpc/session-router-park.js +176 -0
  297. package/dist/modes/rpc/session-router-routing.d.ts +1 -1
  298. package/dist/modes/rpc/session-router-routing.js +7 -0
  299. package/dist/modes/rpc/session-status-source.js +2 -2
  300. package/dist/private-fd-startup-fillers.d.ts +2 -2
  301. package/dist/private-fd-startup-fillers.js +34 -4
  302. package/dist/senpi +9 -3
  303. package/docs/engine-socket/fixtures/admission-routes/h-legacy.json +1 -1
  304. package/docs/engine-socket/fixtures/rpc-inbound-samples.json +44 -2
  305. package/docs/extensions.md +11 -1
  306. package/docs/rpc.md +106 -2
  307. package/docs/settings.md +5 -3
  308. package/docs/skills.md +1 -1
  309. package/docs/usage.md +1 -1
  310. package/native/socket-secret/prebuilds/win32-arm64/senpi_socket_secret.win32-arm64.node +0 -0
  311. package/native/socket-secret/prebuilds/win32-x64/senpi_socket_secret.win32-x64.node +0 -0
  312. package/package.json +6 -6
  313. package/dist/bundle/chunks/chunk-436DNN4Z.js +0 -2
  314. package/dist/bundle/chunks/chunk-DLAY7CIU.js +0 -2
  315. package/dist/bundle/chunks/chunk-SJI6UB23.js +0 -2
  316. package/dist/bundle/chunks/chunk-XH2MWTXA.js +0 -11
  317. package/dist/bundle/chunks/chunk-YK3ZZCHI.js +0 -2
  318. package/dist/bundle/chunks/openai-codex-responses-ABB2J43U.js +0 -10
  319. package/dist/bundle/chunks/rpc-mode-ZDUGW2IM.js +0 -2
  320. package/dist/bundle/chunks/session-control-endpoint-MEDV66PS.js +0 -3
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
2
- import{AgentSession,AgentSessionRuntime,ArminComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultResourceLoader,EVAL_HANDLE_ERROR_CODES,EvalHandleError,ExtensionRunner,FooterComponent,InteractiveMode,JOB_WIDGET_STATE_EVENT,KILL_GUARD_MODULE_URL,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,ReservedCustodyKey,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,TextTap,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageSelectorComponent,buildNoticeBox,calculateContextTokens,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,connectWebViewService,convertToPng,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createReadOnlyTools,createReadTool,createReadToolDefinition,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,kernelToolsStorage,killGuardProtectedPids,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,noticeEntryRenderer,noticeMessageRenderer,parseFrontmatter,parseSkillBlock,prepareBranchEntries,readKillGuardSetting,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,shouldCompact,stripFrontmatter,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-FDNM2DAE.js";import"./chunks/chunk-KU7OCWJF.js";import{RELOCATION_TOOL_NAMES,SESSION_CONTROL_DELIVERY_TYPE,isSessionControlDeliveryDetails,sessionControlRemoteOriginOf,sessionControlSenderOf}from"./chunks/chunk-R3OP7IA4.js";import{RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,UnknownCommandError,isTransportGoneError}from"./chunks/chunk-YQZNARTX.js";import"./chunks/chunk-SJI6UB23.js";import"./chunks/chunk-RYPM5BZQ.js";import"./chunks/chunk-NLYT7BND.js";import{DefaultPackageManager,SessionSelectorComponent,SettingsManager}from"./chunks/chunk-FAFIGBUD.js";import"./chunks/chunk-FEQDJBDL.js";import"./chunks/chunk-436DNN4Z.js";import{CURRENT_SESSION_VERSION,SessionManager,VIRTUAL_MODEL_STATE_ENTRY,buildContextEntries,buildSessionContext,buildSessionProjection,convertToLlm,getLatestCompactionEntry,migrateSessionEntries,parseSessionEntries,sessionEntryToContextMessages}from"./chunks/chunk-BELNOPAI.js";import"./chunks/chunk-J2I56WLK.js";import"./chunks/chunk-GTJJ73DE.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunks/chunk-VD7AKTGP.js";import{AssistantMessageComponent,CustomEditor,ExtensionEditorComponent,REQUIRED_COMPACTION_ERROR_MESSAGE,RequiredCompactionError,UserMessageComponent,copyToClipboard}from"./chunks/chunk-7MN7YNO5.js";import"./chunks/chunk-H33A33M4.js";import"./chunks/chunk-TQHNFP77.js";import{DynamicBorder,ExtensionInputComponent,ExtensionSelectorComponent,Theme,findReservedKeywordRuns,findReservedKeywordSpans,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunks/chunk-ZUQCYIRY.js";import{SecretInputUnavailableError}from"./chunks/chunk-HKCFMDJN.js";import"./chunks/chunk-3Q5ZENSD.js";import"./chunks/chunk-3QPE75AR.js";import"./chunks/chunk-4GKU755E.js";import"./chunks/chunk-Y3TMJV3J.js";import"./chunks/chunk-O3FG6HML.js";import"./chunks/chunk-MOVB6H22.js";import{registerRpcRemoteSource}from"./chunks/chunk-NH7SYIGN.js";import"./chunks/chunk-VPVD5G32.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-SOMFLLPD.js";import{readOwnFootprint,readProcessFootprint}from"./chunks/chunk-MTQQ2VQH.js";import{DEFAULT_HOST_LAUNCH_SPEC,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HostLaunchSpecError,PINNED_HOST_CLIENT_CAPABILITIES,TUI_PROBE_TIMEOUT_MS,classifyEndpointLiveness,endpointProbeTimeoutMs,ensureHost,handoffHost,loadHostLaunchSpec,parseHostLaunchSpec,readAllHostStatus,readHostStatus,runHostCommand,runHostRequest}from"./chunks/chunk-IYSJFQUU.js";import{GENERATION_HANDOFF_CAPABILITY,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,REQUIRED_HOST_CAPABILITIES,compareEngineOrdinal,decideHostAction,engineBuildIdentity,engineBuildIdentityFrom,gcHostEndpoints,parseHostProtocolInfo,probeHost,stopHost}from"./chunks/chunk-YKYWL2NO.js";import{createSyntheticSourceInfo}from"./chunks/chunk-QMRJYMNH.js";import{listHostEndpoints}from"./chunks/chunk-Y7Z7XPUF.js";import{parseArgs}from"./chunks/chunk-IEY2SL46.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-I5ASHSLZ.js";import"./chunks/chunk-2CNSCMYC.js";import"./chunks/chunk-DX43FSQT.js";import"./chunks/chunk-7WYJAYHH.js";import"./chunks/chunk-GVPZPVVO.js";import"./chunks/chunk-R2Z7CX77.js";import"./chunks/chunk-UCXBDE6R.js";import{ENDPOINT_REGISTRY_VERSION,createHostDaemonPaths,daemonDirectoryName,shardKey,shardSocketPath,shardSocketPathForKey}from"./chunks/chunk-YI6KRJDC.js";import"./chunks/chunk-DBQBJTMF.js";import"./chunks/chunk-SF4MQDKZ.js";import"./chunks/chunk-EJB5E2JK.js";import"./chunks/chunk-RCHIMH7N.js";import"./chunks/chunk-GILDYS3O.js";import"./chunks/chunk-KLAX467B.js";import"./chunks/chunk-C4AHHZ6P.js";import"./chunks/chunk-J7FW7MED.js";import"./chunks/chunk-2EJ4BGBM.js";import"./chunks/chunk-GZVCRV7I.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-U3VOXCGP.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-MSDBBOB2.js";import"./chunks/chunk-WHQ2QPP5.js";import"./chunks/chunk-J2NGJKXL.js";import"./chunks/chunk-WB4BUHOH.js";import"./chunks/chunk-NJ43NBSP.js";import"./chunks/chunk-KDUJCDLM.js";import{decideKillGuardRequest}from"./chunks/chunk-6APXZK7W.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-2IKL4F24.js";import"./chunks/chunk-KJR3XXMI.js";import"./chunks/chunk-IYL5E4QQ.js";import"./chunks/chunk-7THM57HH.js";import"./chunks/chunk-AC72EWI5.js";import"./chunks/chunk-RQFD6LG2.js";import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatSize,getJobWidgetState,registerJobWidgetSource,setJobWidgetAuthorResolver,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunks/chunk-2U6HXWXS.js";import{sanitizeTerminalLabel,visibleWidth}from"./chunks/chunk-TMXRR3N7.js";import"./chunks/chunk-LPYBKMPT.js";import{activateKillGuardRuntime,activeKillGuardEnvironment,getPowerShellConfig,getShellConfig,releaseKillGuardRuntime,withBundledBunCommands}from"./chunks/chunk-33MZJTQ3.js";import"./chunks/chunk-V5FSENW6.js";import"./chunks/chunk-R7J5TEYK.js";import"./chunks/chunk-BPNSOZ2C.js";import"./chunks/chunk-DLAY7CIU.js";import"./chunks/chunk-WXYMAUFX.js";import{KILL_GUARD_TAG}from"./chunks/chunk-WOHQJ6JB.js";import"./chunks/chunk-COH5F7QV.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-Y7QPP7BG.js";import"./chunks/chunk-XH2MWTXA.js";import"./chunks/chunk-GVSBCJFI.js";import"./chunks/chunk-QTS2XGPQ.js";import"./chunks/chunk-Z6TEQEZO.js";import"./chunks/chunk-ZG3MNTNX.js";import"./chunks/chunk-WHPDEDCC.js";import"./chunks/chunk-HK46JMSC.js";import"./chunks/chunk-5ROMKDLK.js";import"./chunks/chunk-3W47LTXQ.js";import"./chunks/chunk-UAOOH2V7.js";import"./chunks/chunk-WDTJ6JKE.js";import"./chunks/chunk-OH5TKHW7.js";import"./chunks/chunk-NDNQ23SK.js";import"./chunks/chunk-JGKH3D6W.js";import"./chunks/chunk-3SASTB6Y.js";import"./chunks/chunk-PJ34QVL5.js";import"./chunks/chunk-BMX2U22F.js";import"./chunks/chunk-GLTOBXZY.js";import"./chunks/chunk-2BH54YQR.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-ZFIC2DZV.js";import"./chunks/chunk-2SOVDETB.js";import"./chunks/chunk-YK3ZZCHI.js";import"./chunks/chunk-T2SMQPRE.js";import"./chunks/chunk-RUGTHELO.js";import"./chunks/chunk-42XRJQM6.js";import"./chunks/chunk-IHES3JES.js";import"./chunks/chunk-5XHOHZIR.js";import"./chunks/chunk-HW6AAS3R.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunks/chunk-SODMQEHO.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-EYSV6A7S.js";import"./chunks/chunk-MIENF2YK.js";import"./chunks/chunk-OXNWERO4.js";import"./chunks/chunk-44BJPS5I.js";import"./chunks/chunk-AOTHPTMU.js";import"./chunks/chunk-O5RYI3IW.js";import"./chunks/chunk-RFFMEA4B.js";import"./chunks/chunk-IKOFCODM.js";export{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_HOST_LAUNCH_SPEC,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ENDPOINT_REGISTRY_VERSION,EVAL_HANDLE_ERROR_CODES,EvalHandleError,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,GENERATION_HANDOFF_CAPABILITY,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,HostLaunchSpecError,InteractiveMode,JOB_WIDGET_STATE_EVENT,KILL_GUARD_MODULE_URL,KILL_GUARD_TAG,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,PINNED_HOST_CLIENT_CAPABILITIES,ProjectTrustStore,RELOCATION_TOOL_NAMES,REQUIRED_COMPACTION_ERROR_MESSAGE,REQUIRED_HOST_CAPABILITIES,RequiredCompactionError,ReservedCustodyKey,RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,SESSION_CONTROL_DELIVERY_TYPE,SecretInputUnavailableError,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,TUI_PROBE_TIMEOUT_MS,TextTap,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UnknownCommandError,UserMessageComponent,UserMessageSelectorComponent,VERSION,VIRTUAL_MODEL_STATE_ENTRY,activateKillGuardRuntime,activeKillGuardEnvironment,buildContextEntries,buildNoticeBox,buildSessionContext,buildSessionProjection,calculateContextTokens,classifyEndpointLiveness,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,compareEngineOrdinal,connectWebViewService,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createHostDaemonPaths,createLocalBashOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,daemonDirectoryName,decideHostAction,decideKillGuardRequest,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,endpointProbeTimeoutMs,engineBuildIdentity,engineBuildIdentityFrom,ensureHost,estimateTokens,findCutPoint,findReservedKeywordRuns,findReservedKeywordSpans,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,gcHostEndpoints,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getJobWidgetState,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,handoffHost,hasTrustRequiringProjectResources,highlightCode,initTheme,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isSessionControlDeliveryDetails,isToolCallEventType,isTransportGoneError,isWriteToolResult,kernelToolsStorage,keyHint,keyText,killGuardProtectedPids,listHostEndpoints,loadHostLaunchSpec,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,noticeEntryRenderer,noticeMessageRenderer,parseArgs,parseFrontmatter,parseHostLaunchSpec,parseHostProtocolInfo,parseSessionEntries,parseSkillBlock,prepareBranchEntries,probeHost,rawKeyHint,readAllHostStatus,readHostStatus,readKillGuardSetting,readOwnFootprint,readProcessFootprint,readStoredCredential,registerJobWidgetSource,registerReadClassifier,registerRpcRemoteSource,releaseKillGuardRuntime,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runHostCommand,runHostRequest,runPrintMode,runRpcMode,sanitizeTerminalLabel,serializeConversation,sessionControlRemoteOriginOf,sessionControlSenderOf,sessionEntryToContextMessages,setJobWidgetAuthorResolver,shardKey,shardSocketPath,shardSocketPathForKey,shouldCompact,stopHost,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,visibleWidth,withBundledBunCommands,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools};
2
+ import{AgentSession,AgentSessionRuntime,ArminComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultResourceLoader,EVAL_HANDLE_ERROR_CODES,EvalHandleError,ExtensionRunner,FooterComponent,InteractiveMode,JOB_WIDGET_STATE_EVENT,KILL_GUARD_MODULE_URL,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,ReservedCustodyKey,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,TextTap,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageSelectorComponent,buildNoticeBox,calculateContextTokens,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,connectWebViewService,convertToPng,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createReadOnlyTools,createReadTool,createReadToolDefinition,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,kernelToolsStorage,killGuardProtectedPids,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,noticeEntryRenderer,noticeMessageRenderer,parseFrontmatter,parseSkillBlock,prepareBranchEntries,readKillGuardSetting,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,shouldCompact,stripFrontmatter,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-PUZDKFRT.js";import"./chunks/chunk-J4ADZ2OK.js";import{RELOCATION_TOOL_NAMES,SESSION_CONTROL_DELIVERY_TYPE,isSessionControlDeliveryDetails,sessionControlRemoteOriginOf,sessionControlSenderOf}from"./chunks/chunk-5PIZWSNG.js";import{RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,UnknownCommandError,isTransportGoneError}from"./chunks/chunk-SS5VTBAV.js";import"./chunks/chunk-3IYEGHBI.js";import"./chunks/chunk-S7NAJQB3.js";import"./chunks/chunk-NLYT7BND.js";import{DefaultPackageManager,SessionSelectorComponent,SettingsManager}from"./chunks/chunk-XUDKT4UH.js";import"./chunks/chunk-FEQDJBDL.js";import"./chunks/chunk-XI6THO4F.js";import{CURRENT_SESSION_VERSION,SessionManager,VIRTUAL_MODEL_STATE_ENTRY,buildContextEntries,buildSessionContext,buildSessionProjection,convertToLlm,getLatestCompactionEntry,migrateSessionEntries,parseSessionEntries,sessionEntryToContextMessages}from"./chunks/chunk-L3KVP7VJ.js";import"./chunks/chunk-J2I56WLK.js";import"./chunks/chunk-GTJJ73DE.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunks/chunk-VD7AKTGP.js";import{AssistantMessageComponent,CustomEditor,ExtensionEditorComponent,REQUIRED_COMPACTION_ERROR_MESSAGE,RequiredCompactionError,UserMessageComponent,copyToClipboard}from"./chunks/chunk-L7DGTA3L.js";import"./chunks/chunk-M2VJVJMK.js";import"./chunks/chunk-TQHNFP77.js";import{DynamicBorder,ExtensionInputComponent,ExtensionSelectorComponent,Theme,findReservedKeywordRuns,findReservedKeywordSpans,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunks/chunk-2ODGHBUD.js";import{SecretInputUnavailableError}from"./chunks/chunk-HKCFMDJN.js";import"./chunks/chunk-E6ZBTSC6.js";import"./chunks/chunk-3QPE75AR.js";import"./chunks/chunk-4GKU755E.js";import"./chunks/chunk-Y3TMJV3J.js";import"./chunks/chunk-PJI5GT7U.js";import"./chunks/chunk-MOVB6H22.js";import{registerRpcRemoteSource}from"./chunks/chunk-DLPV4B3R.js";import"./chunks/chunk-VPVD5G32.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-SOMFLLPD.js";import{readOwnFootprint,readProcessFootprint}from"./chunks/chunk-MTQQ2VQH.js";import{DEFAULT_HOST_LAUNCH_SPEC,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HostLaunchSpecError,PINNED_HOST_CLIENT_CAPABILITIES,TUI_PROBE_TIMEOUT_MS,classifyEndpointLiveness,endpointProbeTimeoutMs,ensureHost,handoffHost,loadHostLaunchSpec,parseHostLaunchSpec,readAllHostStatus,readHostStatus,runHostCommand,runHostRequest}from"./chunks/chunk-L6DF5G6K.js";import{GENERATION_HANDOFF_CAPABILITY,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,REQUIRED_HOST_CAPABILITIES,compareEngineOrdinal,decideHostAction,engineBuildIdentity,engineBuildIdentityFrom,gcHostEndpoints,parseHostProtocolInfo,probeHost,stopHost}from"./chunks/chunk-5F2XC6UC.js";import{createSyntheticSourceInfo}from"./chunks/chunk-QMRJYMNH.js";import{listHostEndpoints}from"./chunks/chunk-DZQA5LVN.js";import{parseArgs}from"./chunks/chunk-IEY2SL46.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-4JMGWVRH.js";import"./chunks/chunk-E5O4SP5I.js";import"./chunks/chunk-DX43FSQT.js";import"./chunks/chunk-7WYJAYHH.js";import"./chunks/chunk-IBDAV2AL.js";import"./chunks/chunk-OSNR3IRD.js";import"./chunks/chunk-UCXBDE6R.js";import{ENDPOINT_REGISTRY_VERSION,createHostDaemonPaths,daemonDirectoryName,shardKey,shardSocketPath,shardSocketPathForKey}from"./chunks/chunk-YI6KRJDC.js";import"./chunks/chunk-VUY4BZDI.js";import"./chunks/chunk-SF4MQDKZ.js";import"./chunks/chunk-NRZAJUUO.js";import"./chunks/chunk-DQY26AX3.js";import"./chunks/chunk-GILDYS3O.js";import"./chunks/chunk-KLAX467B.js";import"./chunks/chunk-C4AHHZ6P.js";import"./chunks/chunk-TCZORL3V.js";import"./chunks/chunk-DHORIIVQ.js";import"./chunks/chunk-GZVCRV7I.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-U3VOXCGP.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-5H43O4MA.js";import"./chunks/chunk-WHQ2QPP5.js";import"./chunks/chunk-LXINMDMX.js";import"./chunks/chunk-WB4BUHOH.js";import"./chunks/chunk-NJ43NBSP.js";import"./chunks/chunk-KDUJCDLM.js";import{decideKillGuardRequest}from"./chunks/chunk-6APXZK7W.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-2IKL4F24.js";import"./chunks/chunk-KJR3XXMI.js";import"./chunks/chunk-IYL5E4QQ.js";import"./chunks/chunk-7THM57HH.js";import"./chunks/chunk-AC72EWI5.js";import"./chunks/chunk-RQFD6LG2.js";import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatSize,getJobWidgetState,registerJobWidgetSource,setJobWidgetAuthorResolver,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunks/chunk-NNQ34ZDW.js";import{sanitizeTerminalLabel,visibleWidth}from"./chunks/chunk-TMXRR3N7.js";import"./chunks/chunk-LPYBKMPT.js";import{activateKillGuardRuntime,activeKillGuardEnvironment,getPowerShellConfig,getShellConfig,releaseKillGuardRuntime,withBundledBunCommands}from"./chunks/chunk-B4WD5XHP.js";import"./chunks/chunk-COKX65TE.js";import"./chunks/chunk-R7J5TEYK.js";import"./chunks/chunk-QUVSIW2R.js";import"./chunks/chunk-NQKCJQHB.js";import"./chunks/chunk-QX7WD3IM.js";import{KILL_GUARD_TAG}from"./chunks/chunk-WOHQJ6JB.js";import"./chunks/chunk-COH5F7QV.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-Y7QPP7BG.js";import"./chunks/chunk-IREUIMFE.js";import"./chunks/chunk-GVSBCJFI.js";import"./chunks/chunk-QTS2XGPQ.js";import"./chunks/chunk-Z6TEQEZO.js";import"./chunks/chunk-ZG3MNTNX.js";import"./chunks/chunk-WHPDEDCC.js";import"./chunks/chunk-HK46JMSC.js";import"./chunks/chunk-5ROMKDLK.js";import"./chunks/chunk-3W47LTXQ.js";import"./chunks/chunk-UAOOH2V7.js";import"./chunks/chunk-WDTJ6JKE.js";import"./chunks/chunk-OH5TKHW7.js";import"./chunks/chunk-NDNQ23SK.js";import"./chunks/chunk-JGKH3D6W.js";import"./chunks/chunk-3SASTB6Y.js";import"./chunks/chunk-PJ34QVL5.js";import"./chunks/chunk-BMX2U22F.js";import"./chunks/chunk-GLTOBXZY.js";import"./chunks/chunk-SANWO37B.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-ZFIC2DZV.js";import"./chunks/chunk-2SOVDETB.js";import"./chunks/chunk-LJFQYCFH.js";import"./chunks/chunk-K3GAGIPX.js";import"./chunks/chunk-RUGTHELO.js";import"./chunks/chunk-42XRJQM6.js";import"./chunks/chunk-IHES3JES.js";import"./chunks/chunk-5XHOHZIR.js";import"./chunks/chunk-HW6AAS3R.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunks/chunk-SODMQEHO.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-EYSV6A7S.js";import"./chunks/chunk-MIENF2YK.js";import"./chunks/chunk-OXNWERO4.js";import"./chunks/chunk-44BJPS5I.js";import"./chunks/chunk-AOTHPTMU.js";import"./chunks/chunk-O5RYI3IW.js";import"./chunks/chunk-RFFMEA4B.js";import"./chunks/chunk-IKOFCODM.js";export{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_HOST_LAUNCH_SPEC,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ENDPOINT_REGISTRY_VERSION,EVAL_HANDLE_ERROR_CODES,EvalHandleError,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,GENERATION_HANDOFF_CAPABILITY,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,HostLaunchSpecError,InteractiveMode,JOB_WIDGET_STATE_EVENT,KILL_GUARD_MODULE_URL,KILL_GUARD_TAG,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,PINNED_HOST_CLIENT_CAPABILITIES,ProjectTrustStore,RELOCATION_TOOL_NAMES,REQUIRED_COMPACTION_ERROR_MESSAGE,REQUIRED_HOST_CAPABILITIES,RequiredCompactionError,ReservedCustodyKey,RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,SESSION_CONTROL_DELIVERY_TYPE,SecretInputUnavailableError,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,TUI_PROBE_TIMEOUT_MS,TextTap,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UnknownCommandError,UserMessageComponent,UserMessageSelectorComponent,VERSION,VIRTUAL_MODEL_STATE_ENTRY,activateKillGuardRuntime,activeKillGuardEnvironment,buildContextEntries,buildNoticeBox,buildSessionContext,buildSessionProjection,calculateContextTokens,classifyEndpointLiveness,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,compareEngineOrdinal,connectWebViewService,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createHostDaemonPaths,createLocalBashOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,daemonDirectoryName,decideHostAction,decideKillGuardRequest,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,endpointProbeTimeoutMs,engineBuildIdentity,engineBuildIdentityFrom,ensureHost,estimateTokens,findCutPoint,findReservedKeywordRuns,findReservedKeywordSpans,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,gcHostEndpoints,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getJobWidgetState,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,handoffHost,hasTrustRequiringProjectResources,highlightCode,initTheme,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isSessionControlDeliveryDetails,isToolCallEventType,isTransportGoneError,isWriteToolResult,kernelToolsStorage,keyHint,keyText,killGuardProtectedPids,listHostEndpoints,loadHostLaunchSpec,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,noticeEntryRenderer,noticeMessageRenderer,parseArgs,parseFrontmatter,parseHostLaunchSpec,parseHostProtocolInfo,parseSessionEntries,parseSkillBlock,prepareBranchEntries,probeHost,rawKeyHint,readAllHostStatus,readHostStatus,readKillGuardSetting,readOwnFootprint,readProcessFootprint,readStoredCredential,registerJobWidgetSource,registerReadClassifier,registerRpcRemoteSource,releaseKillGuardRuntime,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runHostCommand,runHostRequest,runPrintMode,runRpcMode,sanitizeTerminalLabel,serializeConversation,sessionControlRemoteOriginOf,sessionControlSenderOf,sessionEntryToContextMessages,setJobWidgetAuthorResolver,shardKey,shardSocketPath,shardSocketPathForKey,shouldCompact,stopHost,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,visibleWidth,withBundledBunCommands,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
3
- import"./chunks/chunk-KU72IKV5.js";import{main}from"./chunks/chunk-FDNM2DAE.js";import"./chunks/chunk-KU7OCWJF.js";import"./chunks/chunk-R3OP7IA4.js";import"./chunks/chunk-YQZNARTX.js";import"./chunks/chunk-SJI6UB23.js";import"./chunks/chunk-RYPM5BZQ.js";import"./chunks/chunk-NLYT7BND.js";import"./chunks/chunk-FAFIGBUD.js";import{configureHttpDispatcher}from"./chunks/chunk-FEQDJBDL.js";import"./chunks/chunk-436DNN4Z.js";import"./chunks/chunk-BELNOPAI.js";import"./chunks/chunk-J2I56WLK.js";import"./chunks/chunk-GTJJ73DE.js";import"./chunks/chunk-VD7AKTGP.js";import"./chunks/chunk-7MN7YNO5.js";import"./chunks/chunk-H33A33M4.js";import"./chunks/chunk-TQHNFP77.js";import"./chunks/chunk-ZUQCYIRY.js";import"./chunks/chunk-HKCFMDJN.js";import"./chunks/chunk-3Q5ZENSD.js";import"./chunks/chunk-3QPE75AR.js";import"./chunks/chunk-4GKU755E.js";import"./chunks/chunk-Y3TMJV3J.js";import"./chunks/chunk-O3FG6HML.js";import"./chunks/chunk-MOVB6H22.js";import"./chunks/chunk-NH7SYIGN.js";import"./chunks/chunk-VPVD5G32.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-SOMFLLPD.js";import"./chunks/chunk-MTQQ2VQH.js";import"./chunks/chunk-IYSJFQUU.js";import"./chunks/chunk-YKYWL2NO.js";import"./chunks/chunk-QMRJYMNH.js";import"./chunks/chunk-Y7Z7XPUF.js";import"./chunks/chunk-IEY2SL46.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-I5ASHSLZ.js";import"./chunks/chunk-2CNSCMYC.js";import"./chunks/chunk-DX43FSQT.js";import"./chunks/chunk-7WYJAYHH.js";import"./chunks/chunk-GVPZPVVO.js";import"./chunks/chunk-R2Z7CX77.js";import"./chunks/chunk-UCXBDE6R.js";import"./chunks/chunk-YI6KRJDC.js";import"./chunks/chunk-DBQBJTMF.js";import"./chunks/chunk-SF4MQDKZ.js";import"./chunks/chunk-EJB5E2JK.js";import"./chunks/chunk-RCHIMH7N.js";import"./chunks/chunk-GILDYS3O.js";import"./chunks/chunk-KLAX467B.js";import"./chunks/chunk-C4AHHZ6P.js";import"./chunks/chunk-J7FW7MED.js";import"./chunks/chunk-2EJ4BGBM.js";import"./chunks/chunk-GZVCRV7I.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-U3VOXCGP.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-MSDBBOB2.js";import"./chunks/chunk-WHQ2QPP5.js";import"./chunks/chunk-J2NGJKXL.js";import"./chunks/chunk-WB4BUHOH.js";import"./chunks/chunk-NJ43NBSP.js";import"./chunks/chunk-KDUJCDLM.js";import"./chunks/chunk-6APXZK7W.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-2IKL4F24.js";import"./chunks/chunk-KJR3XXMI.js";import"./chunks/chunk-IYL5E4QQ.js";import"./chunks/chunk-7THM57HH.js";import"./chunks/chunk-AC72EWI5.js";import"./chunks/chunk-RQFD6LG2.js";import"./chunks/chunk-2U6HXWXS.js";import"./chunks/chunk-TMXRR3N7.js";import"./chunks/chunk-LPYBKMPT.js";import"./chunks/chunk-33MZJTQ3.js";import"./chunks/chunk-V5FSENW6.js";import"./chunks/chunk-R7J5TEYK.js";import"./chunks/chunk-BPNSOZ2C.js";import"./chunks/chunk-DLAY7CIU.js";import"./chunks/chunk-WXYMAUFX.js";import"./chunks/chunk-WOHQJ6JB.js";import"./chunks/chunk-COH5F7QV.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-Y7QPP7BG.js";import"./chunks/chunk-XH2MWTXA.js";import"./chunks/chunk-GVSBCJFI.js";import"./chunks/chunk-QTS2XGPQ.js";import"./chunks/chunk-Z6TEQEZO.js";import"./chunks/chunk-ZG3MNTNX.js";import"./chunks/chunk-WHPDEDCC.js";import"./chunks/chunk-HK46JMSC.js";import"./chunks/chunk-5ROMKDLK.js";import"./chunks/chunk-3W47LTXQ.js";import"./chunks/chunk-UAOOH2V7.js";import"./chunks/chunk-WDTJ6JKE.js";import"./chunks/chunk-OH5TKHW7.js";import"./chunks/chunk-NDNQ23SK.js";import"./chunks/chunk-JGKH3D6W.js";import"./chunks/chunk-3SASTB6Y.js";import"./chunks/chunk-PJ34QVL5.js";import"./chunks/chunk-BMX2U22F.js";import"./chunks/chunk-GLTOBXZY.js";import"./chunks/chunk-2BH54YQR.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-ZFIC2DZV.js";import"./chunks/chunk-2SOVDETB.js";import"./chunks/chunk-YK3ZZCHI.js";import"./chunks/chunk-T2SMQPRE.js";import"./chunks/chunk-RUGTHELO.js";import"./chunks/chunk-42XRJQM6.js";import"./chunks/chunk-IHES3JES.js";import"./chunks/chunk-5XHOHZIR.js";import"./chunks/chunk-HW6AAS3R.js";import{APP_NAME,scrubBrandFromEnvironment}from"./chunks/chunk-SODMQEHO.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-EYSV6A7S.js";import"./chunks/chunk-MIENF2YK.js";import"./chunks/chunk-FQXWKEVK.js";import"./chunks/chunk-OXNWERO4.js";import"./chunks/chunk-44BJPS5I.js";import"./chunks/chunk-AOTHPTMU.js";import"./chunks/chunk-O5RYI3IW.js";import"./chunks/chunk-RFFMEA4B.js";import"./chunks/chunk-IKOFCODM.js";process.title=`${APP_NAME}-rpc`;scrubBrandFromEnvironment();process.env.PI_CODING_AGENT="true";process.env.AI_AGENT=APP_NAME;process.emitWarning=(()=>{});configureHttpDispatcher();main(["--mode","rpc",...process.argv.slice(2)]);
3
+ import"./chunks/chunk-VGSWOLIY.js";import{main}from"./chunks/chunk-PUZDKFRT.js";import"./chunks/chunk-J4ADZ2OK.js";import"./chunks/chunk-5PIZWSNG.js";import"./chunks/chunk-SS5VTBAV.js";import"./chunks/chunk-3IYEGHBI.js";import"./chunks/chunk-S7NAJQB3.js";import"./chunks/chunk-NLYT7BND.js";import"./chunks/chunk-XUDKT4UH.js";import{configureHttpDispatcher}from"./chunks/chunk-FEQDJBDL.js";import"./chunks/chunk-XI6THO4F.js";import"./chunks/chunk-L3KVP7VJ.js";import"./chunks/chunk-J2I56WLK.js";import"./chunks/chunk-GTJJ73DE.js";import"./chunks/chunk-VD7AKTGP.js";import"./chunks/chunk-L7DGTA3L.js";import"./chunks/chunk-M2VJVJMK.js";import"./chunks/chunk-TQHNFP77.js";import"./chunks/chunk-2ODGHBUD.js";import"./chunks/chunk-HKCFMDJN.js";import"./chunks/chunk-E6ZBTSC6.js";import"./chunks/chunk-3QPE75AR.js";import"./chunks/chunk-4GKU755E.js";import"./chunks/chunk-Y3TMJV3J.js";import"./chunks/chunk-PJI5GT7U.js";import"./chunks/chunk-MOVB6H22.js";import"./chunks/chunk-DLPV4B3R.js";import"./chunks/chunk-VPVD5G32.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-SOMFLLPD.js";import"./chunks/chunk-MTQQ2VQH.js";import"./chunks/chunk-L6DF5G6K.js";import"./chunks/chunk-5F2XC6UC.js";import"./chunks/chunk-QMRJYMNH.js";import"./chunks/chunk-DZQA5LVN.js";import"./chunks/chunk-IEY2SL46.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-4JMGWVRH.js";import"./chunks/chunk-E5O4SP5I.js";import"./chunks/chunk-DX43FSQT.js";import"./chunks/chunk-7WYJAYHH.js";import"./chunks/chunk-IBDAV2AL.js";import"./chunks/chunk-OSNR3IRD.js";import"./chunks/chunk-UCXBDE6R.js";import"./chunks/chunk-YI6KRJDC.js";import"./chunks/chunk-VUY4BZDI.js";import"./chunks/chunk-SF4MQDKZ.js";import"./chunks/chunk-NRZAJUUO.js";import"./chunks/chunk-DQY26AX3.js";import"./chunks/chunk-GILDYS3O.js";import"./chunks/chunk-KLAX467B.js";import"./chunks/chunk-C4AHHZ6P.js";import"./chunks/chunk-TCZORL3V.js";import"./chunks/chunk-DHORIIVQ.js";import"./chunks/chunk-GZVCRV7I.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-U3VOXCGP.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-5H43O4MA.js";import"./chunks/chunk-WHQ2QPP5.js";import"./chunks/chunk-LXINMDMX.js";import"./chunks/chunk-WB4BUHOH.js";import"./chunks/chunk-NJ43NBSP.js";import"./chunks/chunk-KDUJCDLM.js";import"./chunks/chunk-6APXZK7W.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-2IKL4F24.js";import"./chunks/chunk-KJR3XXMI.js";import"./chunks/chunk-IYL5E4QQ.js";import"./chunks/chunk-7THM57HH.js";import"./chunks/chunk-AC72EWI5.js";import"./chunks/chunk-RQFD6LG2.js";import"./chunks/chunk-NNQ34ZDW.js";import"./chunks/chunk-TMXRR3N7.js";import"./chunks/chunk-LPYBKMPT.js";import"./chunks/chunk-B4WD5XHP.js";import"./chunks/chunk-COKX65TE.js";import"./chunks/chunk-R7J5TEYK.js";import"./chunks/chunk-QUVSIW2R.js";import"./chunks/chunk-NQKCJQHB.js";import"./chunks/chunk-QX7WD3IM.js";import"./chunks/chunk-WOHQJ6JB.js";import"./chunks/chunk-COH5F7QV.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-Y7QPP7BG.js";import"./chunks/chunk-IREUIMFE.js";import"./chunks/chunk-GVSBCJFI.js";import"./chunks/chunk-QTS2XGPQ.js";import"./chunks/chunk-Z6TEQEZO.js";import"./chunks/chunk-ZG3MNTNX.js";import"./chunks/chunk-WHPDEDCC.js";import"./chunks/chunk-HK46JMSC.js";import"./chunks/chunk-5ROMKDLK.js";import"./chunks/chunk-3W47LTXQ.js";import"./chunks/chunk-UAOOH2V7.js";import"./chunks/chunk-WDTJ6JKE.js";import"./chunks/chunk-OH5TKHW7.js";import"./chunks/chunk-NDNQ23SK.js";import"./chunks/chunk-JGKH3D6W.js";import"./chunks/chunk-3SASTB6Y.js";import"./chunks/chunk-PJ34QVL5.js";import"./chunks/chunk-BMX2U22F.js";import"./chunks/chunk-GLTOBXZY.js";import"./chunks/chunk-SANWO37B.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-ZFIC2DZV.js";import"./chunks/chunk-2SOVDETB.js";import"./chunks/chunk-LJFQYCFH.js";import"./chunks/chunk-K3GAGIPX.js";import"./chunks/chunk-RUGTHELO.js";import"./chunks/chunk-42XRJQM6.js";import"./chunks/chunk-IHES3JES.js";import"./chunks/chunk-5XHOHZIR.js";import"./chunks/chunk-HW6AAS3R.js";import{APP_NAME,scrubBrandFromEnvironment}from"./chunks/chunk-SODMQEHO.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-EYSV6A7S.js";import"./chunks/chunk-MIENF2YK.js";import"./chunks/chunk-FQXWKEVK.js";import"./chunks/chunk-OXNWERO4.js";import"./chunks/chunk-44BJPS5I.js";import"./chunks/chunk-AOTHPTMU.js";import"./chunks/chunk-O5RYI3IW.js";import"./chunks/chunk-RFFMEA4B.js";import"./chunks/chunk-IKOFCODM.js";process.title=`${APP_NAME}-rpc`;scrubBrandFromEnvironment();process.env.PI_CODING_AGENT="true";process.env.AI_AGENT=APP_NAME;process.emitWarning=(()=>{});configureHttpDispatcher();main(["--mode","rpc",...process.argv.slice(2)]);
@@ -1 +1 @@
1
- {"buildId":"32724f56b2d292ec","externals":["@earendil-works/chord","@earendil-works/pi-pty","@silvia-odwyer/photon-node","bufferutil","canvas","kerberos","supports-color","utf-8-validate"]}
1
+ {"buildId":"fa0084eb8586c359","externals":["@earendil-works/chord","@earendil-works/pi-pty","@silvia-odwyer/photon-node","bufferutil","canvas","kerberos","supports-color","utf-8-validate"]}
package/dist/cli.js CHANGED
@@ -26,6 +26,7 @@ import { dispatchKillGuardCommand } from "./cli/kill-guard-command.js";
26
26
  import { enableStartupCompileCache } from "./compile-cache.js";
27
27
  import { APP_NAME, DISPLAY_VERSION, findNodePackageDir, getAgentDir, getInstallPackageDir, isBundledNode, } from "./config.js";
28
28
  import { hasInheritedInspectorOption, releaseInheritedInspectorForChild } from "./inspector-policy.js";
29
+ import { runtimeExecArgv } from "./utils/runtime-exec-argv.js";
29
30
  import { prepareRuntimeSnapshot } from "./runtime-snapshot/enter.js";
30
31
  import { handleBootstrapSelfUpdate } from "./self-update-bootstrap.js";
31
32
  import { preparePrivateFdSpawn, spawnWithPrivateFds } from "./private-fd-spawn.js";
@@ -172,7 +173,9 @@ function requiresIsolatedProcess() {
172
173
  // same exec arguments and spawn again forever. The marker is read before anything else runs.
173
174
  if (process.env[ISOLATED_CHILD_ENV] === "1")
174
175
  return false;
175
- return process.execArgv.length > 0 || hasInheritedInspectorOption();
176
+ // Decide on the sanitized argv (senpi#2952): the caller's entry mode (-e/-p/-i and friends) is
177
+ // not a runtime option, so an eval caller alone must not force an isolated re-launch.
178
+ return runtimeExecArgv().length > 0 || hasInheritedInspectorOption();
176
179
  }
177
180
  async function spawnFullCli() {
178
181
  const extension = import.meta.url.endsWith(".ts") ? ".ts" : ".js";
@@ -184,9 +187,12 @@ async function spawnFullCli() {
184
187
  ? fileURLToPath(import.meta.url)
185
188
  : fileURLToPath(new URL(`./cli-main${extension}`, import.meta.url));
186
189
  releaseInheritedInspectorForChild();
187
- const childEnvironment = isBundledNode ? { ...process.env, [ISOLATED_CHILD_ENV]: "1" } : process.env;
190
+ // The child carries the caller's runtime options but never its entry mode (senpi#2952): forwarding
191
+ // raw execArgv replayed a `node -e` caller in the child. Both entries get the isolation marker so
192
+ // a re-entered cli.ts loads the agent in process instead of spawning again.
193
+ const childEnvironment = { ...process.env, [ISOLATED_CHILD_ENV]: "1" };
188
194
  return await new Promise((resolve, reject) => {
189
- const child = spawnWithPrivateFds(spawn, process.execPath, [...process.execArgv, fullCliPath, ...args], {
195
+ const child = spawnWithPrivateFds(spawn, process.execPath, [...runtimeExecArgv(), fullCliPath, ...args], {
190
196
  env: childEnvironment,
191
197
  stdio: reexecStdio(),
192
198
  });
@@ -114,6 +114,8 @@ export declare class AgentSessionRuntime {
114
114
  constructor(_session: AgentSession, _services: AgentSessionServices, createRuntime: CreateAgentSessionRuntimeFactory, _diagnostics?: AgentSessionRuntimeDiagnostic[], _modelFallbackMessage?: string, launchProfile?: Readonly<AgentSessionLaunchProfile>);
115
115
  /** Stops advertising the open session to other processes; a runtime that replaces this one holds its own. */
116
116
  releaseSessionHold(): void;
117
+ /** A speculative host session becomes durable only when a caller claims its already-built runtime. */
118
+ persistSession(): Promise<void>;
117
119
  get services(): AgentSessionServices;
118
120
  get session(): AgentSession;
119
121
  get cwd(): string;
@@ -65,6 +65,11 @@ export class AgentSessionRuntime {
65
65
  this._sessionHold?.release();
66
66
  this._sessionHold = undefined;
67
67
  }
68
+ /** A speculative host session becomes durable only when a caller claims its already-built runtime. */
69
+ async persistSession() {
70
+ await this.session.sessionManager.enablePersistence();
71
+ this._sessionHold ??= holdActiveSession(this.session.sessionManager, false, this._launchProfile?.holderEndpoint);
72
+ }
68
73
  get services() {
69
74
  return this._services;
70
75
  }
@@ -394,6 +394,8 @@ export type AgentSessionEvent = WithParentToolCallId<Exclude<AgentEvent, {
394
394
  model: string;
395
395
  outcome: "ok" | "failed";
396
396
  reason?: string;
397
+ message?: string;
398
+ status?: number;
397
399
  at: number;
398
400
  };
399
401
  } | {
@@ -971,8 +973,9 @@ export declare class AgentSession {
971
973
  private readonly _toolChildHostTargets;
972
974
  /** The composed filesystem policy the built-in file tools enforce; a tool child's `authorize` asks the same one. */
973
975
  private _filesystemPolicy;
974
- /** Settles once dispose() has stopped the tool child, swept what it launched, and closed its in-process offload jobs. */
976
+ /** Settles once dispose() has stopped the tool child, swept what it launched, closed its in-process offload jobs, and the fallback log's first-start removal has finished. */
975
977
  private _toolChildClosed;
978
+ private _fallbackLogSettled;
976
979
  private _extensionRunnerRef?;
977
980
  private _initialActiveToolNames?;
978
981
  private _defaultToolNames?;
@@ -1206,7 +1209,7 @@ export declare class AgentSession {
1206
1209
  getMessageRevision(): number;
1207
1210
  /** Resolved agent state directory for this session. */
1208
1211
  get agentDir(): string;
1209
- /** Resolves after dispose() once the tool child has exited and its launched groups are swept; awaited by disposers. */
1212
+ /** Resolves after dispose() once the tool child has exited, its launched groups are swept and the fallback log has stopped writing; awaited by disposers. */
1210
1213
  whenToolChildClosed(): Promise<void>;
1211
1214
  /** The `list_sessions` row of this session's tool child (senpi#3566); `none` under the in-process runtime. */
1212
1215
  toolChildRow(): SessionToolChildRow;
@@ -1926,7 +1929,7 @@ export declare class AgentSession {
1926
1929
  */
1927
1930
  private _recordEngineTurnStart;
1928
1931
  /**
1929
- * A refused engine turn still records its message and settles a cross-session delivery it carries. A delivery
1932
+ * A refused engine turn still records its message and settles a cross-session delivery it carries. A message
1930
1933
  * whose entry the file refuses leaves the context too: its sender redelivers it, and it must not appear twice.
1931
1934
  */
1932
1935
  private _recordRefusedEngineTurnMessage;
@@ -2599,6 +2602,15 @@ export declare class AgentSession {
2599
2602
  private _computeContextUsage;
2600
2603
  /** The live context in tokens, and whether a provider reported it (otherwise it is a per-message estimate). */
2601
2604
  private _measureContextTokens;
2605
+ /**
2606
+ * Whether the latest reported usage predates the latest model switch: no
2607
+ * assistant message after the switch reported usage, so the last reported
2608
+ * figure belongs to the previous model's tokenizer. Assistant messages are
2609
+ * appended to the branch only once they stop streaming (a pending assistant
2610
+ * message is rejected), so a switch that lands mid-turn still precedes the
2611
+ * message entry carrying the new model's usage.
2612
+ */
2613
+ private _isUsageStaleAfterModelChange;
2602
2614
  /**
2603
2615
  * Export session to HTML.
2604
2616
  * @param outputPath Optional output path (defaults to session directory)
@@ -96,7 +96,7 @@ import { deliveryIdOf, ExternalAdmission } from "./external-admission.js";
96
96
  import { HELD_INPUT_ENTRY, HeldInputs, heldInputHistory } from "./held-inputs.js";
97
97
  import { shouldWarnHighReasoning } from "./high-reasoning-warning.js";
98
98
  import { customTurnOrigin, inputAttributionOf, inputOriginOf } from "./input-origin.js";
99
- import { copyInputTurnMark, hasInputTurnMark, inputTurnMark, markInputTurnOrigin, noteRunStart, noteUserMessageStart, } from "./turn-origin.js";
99
+ import { copyInputTurnMark, endTurnContinuation, hasInputTurnMark, inputTurnMark, markInputTurnOrigin, noteRunStart, noteTurnContinuation, recordIsDelegated, noteUserMessageStart, } from "./turn-origin.js";
100
100
  import { releaseDecisionPreset } from "./permission-decision.js";
101
101
  import { markInterrupted } from "./interrupted-tool-result.js";
102
102
  import { deliveredReceipts, itemNoticeMessage, QueuedDeliveryCleared, } from "./itemized-send.js";
@@ -134,6 +134,7 @@ import { followProviderAccountChanges, RetryFallbackController, } from "./retry-
134
134
  import { SelectorCooldowns } from "./retry-fallback/cooldown.js";
135
135
  import { classifyRateLimitedWait, degradeWithoutFallback, nextInTurnDelayMs, probeBackSchedule, } from "./retry-fallback/hint-policy.js";
136
136
  import { createFallbackLogger } from "./retry-fallback/log.js";
137
+ import { redactAssistantErrorText } from "./assistant-error-redaction.js";
137
138
  import { createModelConfigErrorReporter, isModelConfigFailure, } from "./retry-fallback/model-config-error.js";
138
139
  import { ProbeBackScheduler } from "./retry-fallback/probe-scheduler.js";
139
140
  import { REQUEST_SHAPE_FAILURE_TEXT, REQUEST_SHAPE_RECOVERY_ENTRY_TYPE, REQUEST_SHAPE_RECOVERY_NOTE, RequestShapeRecovery, } from "./retry-fallback/request-shape.js";
@@ -188,6 +189,8 @@ function evalHelperCall(name) {
188
189
  return `tool.${name}({ action: "..." })`;
189
190
  if (name === "monitor")
190
191
  return `tool.monitor({ description: "...", command: "...", filter: "..." })`;
192
+ if (name === "generate_image")
193
+ return `tool.generate_image({ prompt: "..." })`;
191
194
  return `tool.${name}({ ... })`;
192
195
  }
193
196
  /**
@@ -617,8 +620,9 @@ export class AgentSession {
617
620
  this._abortDuringBeforeSettle = false;
618
621
  this._baseToolDefinitions = new Map();
619
622
  this._toolChildHostTargets = new Map();
620
- /** Settles once dispose() has stopped the tool child, swept what it launched, and closed its in-process offload jobs. */
623
+ /** Settles once dispose() has stopped the tool child, swept what it launched, closed its in-process offload jobs, and the fallback log's first-start removal has finished. */
621
624
  this._toolChildClosed = Promise.resolve();
625
+ this._fallbackLogSettled = Promise.resolve();
622
626
  this._usesDefaultTools = false;
623
627
  /** Policy tools withheld from the model, retained so disarming can restore direct access. */
624
628
  this._withheldEvalOnlyToolNames = new Set();
@@ -667,6 +671,7 @@ export class AgentSession {
667
671
  this._endSelectedModels = new WeakMap();
668
672
  /** Internal handler for agent events - shared by subscribe and reconnect */
669
673
  this._handleAgentEvent = (event, signal) => {
674
+ redactAssistantErrorText(event);
670
675
  let queuedEvent = event;
671
676
  let pendingMessage;
672
677
  // Lifecycle events this event raises are delivered just before it, in the same queue (LifecycleEventSequencer).
@@ -842,6 +847,7 @@ export class AgentSession {
842
847
  this._modelRegistry = config.modelRegistry ?? new ModelRegistry(modelRuntime);
843
848
  this._agentDir = config.agentDir ?? getAgentDir();
844
849
  const fallbackLogger = createFallbackLogger(this._agentDir);
850
+ this._fallbackLogSettled = fallbackLogger.settled();
845
851
  this._modelConfigErrors = createModelConfigErrorReporter(fallbackLogger, (event) => this._emit(event));
846
852
  this._sessionLogger = createSessionLogger(this._agentDir, {
847
853
  context: () => ({
@@ -2062,7 +2068,7 @@ export class AgentSession {
2062
2068
  get agentDir() {
2063
2069
  return this._agentDir;
2064
2070
  }
2065
- /** Resolves after dispose() once the tool child has exited and its launched groups are swept; awaited by disposers. */
2071
+ /** Resolves after dispose() once the tool child has exited, its launched groups are swept and the fallback log has stopped writing; awaited by disposers. */
2066
2072
  whenToolChildClosed() {
2067
2073
  return this._toolChildClosed;
2068
2074
  }
@@ -3517,7 +3523,7 @@ export class AgentSession {
3517
3523
  ?.close()
3518
3524
  .catch((error) => this._sessionLogger.warn("tool_child_close_failed", { error: String(error) })) ??
3519
3525
  Promise.resolve();
3520
- this._toolChildClosed = Promise.all([inProcessClosed, childClosed]).then(() => undefined);
3526
+ this._toolChildClosed = Promise.all([inProcessClosed, childClosed, this._fallbackLogSettled]).then(() => undefined);
3521
3527
  this._disconnectFromAgent();
3522
3528
  this._unsubscribeSettingsSource?.();
3523
3529
  this._unsubscribeSettingsSource = undefined;
@@ -5508,6 +5514,8 @@ export class AgentSession {
5508
5514
  // Restored input with no source keeps no mark: an unmarked turn is engine work, never a trusted origin.
5509
5515
  if (input.source !== undefined)
5510
5516
  markInputTurnOrigin(message, inputTurnMark(input));
5517
+ else if (recordIsDelegated())
5518
+ markInputTurnOrigin(message, "delegated");
5511
5519
  if (input.inputId !== undefined)
5512
5520
  this._queuedInputDispositions.track(message, input.inputId);
5513
5521
  this._queuedMessages.set(queuedId, message);
@@ -5898,6 +5906,10 @@ export class AgentSession {
5898
5906
  };
5899
5907
  // A delivery that found a run already streaming becomes a steer or follow-up: it keeps the origin it was admitted with.
5900
5908
  copyInputTurnMark(message, appMessage);
5909
+ // senpi#6342: a custom message a cross-account record's own handling sends carries that origin wherever it waits
5910
+ // (joining a streaming run, parked behind a compaction, held for the next turn), so the turn it opens still asks.
5911
+ if (!hasInputTurnMark(appMessage) && recordIsDelegated())
5912
+ markInputTurnOrigin(appMessage, "delegated");
5901
5913
  if (this._sizesOnlyStartup && options?.triggerTurn === true) {
5902
5914
  // Size inspection makes no model call (#3483): keep the message for a turn that never starts.
5903
5915
  this._pendingNextTurnMessages.push(appMessage);
@@ -6572,7 +6584,7 @@ export class AgentSession {
6572
6584
  }
6573
6585
  }
6574
6586
  /**
6575
- * A refused engine turn still records its message and settles a cross-session delivery it carries. A delivery
6587
+ * A refused engine turn still records its message and settles a cross-session delivery it carries. A message
6576
6588
  * whose entry the file refuses leaves the context too: its sender redelivers it, and it must not appear twice.
6577
6589
  */
6578
6590
  _recordRefusedEngineTurnMessage(appMessage) {
@@ -6581,12 +6593,17 @@ export class AgentSession {
6581
6593
  this.externalAdmission.observePersisted(appMessage);
6582
6594
  }
6583
6595
  catch (error) {
6584
- if (deliveryIdOf(appMessage) !== undefined) {
6585
- const index = this.agent.state.messages.lastIndexOf(appMessage);
6586
- if (index >= 0)
6587
- this.agent.state.messages.splice(index, 1);
6588
- }
6589
- this.externalAdmission.observeRefused(appMessage, error instanceof Error ? error.message : String(error));
6596
+ // The session file refused the entry: the message leaves the context too, so the context matches the
6597
+ // file, and the failure follows the same contract as the main persistence path — it is recorded,
6598
+ // logged, and emitted (senpi#2972). This holds for non-delivery messages as well as deliveries.
6599
+ const errorMessage = error instanceof Error ? error.message : String(error);
6600
+ const index = this.agent.state.messages.lastIndexOf(appMessage);
6601
+ if (index >= 0)
6602
+ this.agent.state.messages.splice(index, 1);
6603
+ this._transcriptWriteFailures.record(appMessage, error);
6604
+ this._sessionLogger.warn("transcript_write_failed", { role: appMessage.role, error: errorMessage });
6605
+ this._emit({ type: "transcript_write_failed", role: appMessage.role, errorMessage });
6606
+ this.externalAdmission.observeRefused(appMessage, errorMessage);
6590
6607
  this._takePersistWatcher(appMessage)?.failed(error);
6591
6608
  }
6592
6609
  }
@@ -6672,12 +6689,27 @@ export class AgentSession {
6672
6689
  const start = { type: "message_start", message: appMessage };
6673
6690
  this._recoveryIdentity?.observe(start);
6674
6691
  const entryId = this.sessionManager.appendCustomMessageEntry(appMessage.customType, appMessage.content, appMessage.display, appMessage.details, { recoveryOwner: recoveryCarrier(start) });
6675
- this._emitEntryAppended(entryId);
6692
+ // The entry is written: only a failure of the write itself counts as refused. Bookkeeping (ticket,
6693
+ // watcher settlement, revision) runs before any notification, and each notification is guarded on its
6694
+ // own, so a throwing listener can neither leave a persisted delivery unsettled nor suppress a later
6695
+ // notification (senpi#2972).
6676
6696
  this._recordWrittenTicket(appMessage, entryId);
6677
6697
  this._takePersistWatcher(appMessage)?.persisted(entryId);
6678
6698
  this._incrementMessageRevision();
6679
- this._emit(start);
6680
- this._emit({ type: "message_end", message: appMessage });
6699
+ const notify = (emit) => {
6700
+ try {
6701
+ emit();
6702
+ }
6703
+ catch (error) {
6704
+ this._sessionLogger.warn("custom_message_listener_failed", {
6705
+ customType: appMessage.customType,
6706
+ error: error instanceof Error ? error.message : String(error),
6707
+ });
6708
+ }
6709
+ };
6710
+ notify(() => this._emitEntryAppended(entryId));
6711
+ notify(() => this._emit(start));
6712
+ notify(() => this._emit({ type: "message_end", message: appMessage }));
6681
6713
  }
6682
6714
  _flushPendingCustomMessages() {
6683
6715
  const pending = this._pendingCustomMessages;
@@ -9355,7 +9387,7 @@ export class AgentSession {
9355
9387
  }
9356
9388
  this._scheduledContinuationRecompacted = true;
9357
9389
  }
9358
- async _continueAgentAfterCurrentRun(options = {}, retryTimeoutMs) {
9390
+ async _continueAgentAfterCurrentRun(options = {}, retryTimeoutMs, keepsTurnOrigin = false) {
9359
9391
  await this.agent.waitForIdle();
9360
9392
  try {
9361
9393
  if (this.agent.state.isStreaming)
@@ -9382,6 +9414,8 @@ export class AgentSession {
9382
9414
  this._transcriptWriteFailures.startRun();
9383
9415
  await runBoundedRetryContinuation({
9384
9416
  continueRun: async () => {
9417
+ if (keepsTurnOrigin)
9418
+ noteTurnContinuation(this.sessionManager);
9385
9419
  if (this._continueWithQueuedInput) {
9386
9420
  // Joined input of a start that never ran: the transcript tail may be anything, even empty.
9387
9421
  this._continueWithQueuedInput = false;
@@ -9426,6 +9460,7 @@ export class AgentSession {
9426
9460
  throw error;
9427
9461
  }
9428
9462
  finally {
9463
+ endTurnContinuation(this.sessionManager);
9429
9464
  this._scheduledContinuationRecompacted = false;
9430
9465
  this._continueWithQueuedInput = false;
9431
9466
  }
@@ -9457,13 +9492,13 @@ export class AgentSession {
9457
9492
  this._continueWithQueuedInput = true;
9458
9493
  this._scheduleContinuationAfterCurrentEvent();
9459
9494
  }
9460
- _scheduleContinuationAfterCurrentEvent(options = {}, retryContinuation = false, retryTimeoutMs) {
9495
+ _scheduleContinuationAfterCurrentEvent(options = {}, retryContinuation = false, retryTimeoutMs, keepsTurnOrigin = retryContinuation) {
9461
9496
  // Tool hooks wait for queued message persistence, so continue() cannot run inside this event promise.
9462
9497
  const currentEventQueue = this._agentEventQueue;
9463
9498
  const finishContinuationWork = this._sessionWorkBarrier.begin();
9464
9499
  const continueAfterEvent = async () => {
9465
9500
  try {
9466
- const outcome = await this._continueAgentAfterCurrentRun(options, retryTimeoutMs);
9501
+ const outcome = await this._continueAgentAfterCurrentRun(options, retryTimeoutMs, keepsTurnOrigin);
9467
9502
  if (retryContinuation && outcome === "taken-over") {
9468
9503
  DEFERRED_RETRY_QUEUE_OWNERS.delete(this);
9469
9504
  }
@@ -9605,7 +9640,8 @@ export class AgentSession {
9605
9640
  // kept tail still covers (one per rung climbed so far); the retry must
9606
9641
  // continue from the turn they failed to answer, so strip the whole run.
9607
9642
  this._stripTrailingFailedAssistants();
9608
- this._scheduleContinuationAfterCurrentEvent();
9643
+ // The recovery run repeats this turn, so it keeps the turn's origin.
9644
+ this._scheduleContinuationAfterCurrentEvent({}, false, undefined, true);
9609
9645
  return true;
9610
9646
  }
9611
9647
  else if (this.pendingMessageCount > 0) {
@@ -11945,8 +11981,45 @@ export class AgentSession {
11945
11981
  const estimate = branchEntries.some((entry) => entry.type === "context_edit")
11946
11982
  ? estimateProjectedContextTokens(this.sessionManager.buildSessionProjection(), branchEntries)
11947
11983
  : estimateContextTokens(messages);
11984
+ // A model switch after the last reported usage invalidates that usage: it was
11985
+ // counted with the previous model's tokenizer, so showing it against the new
11986
+ // model's window misstates the context (oh-my-openagent#11684). Fall back to
11987
+ // the content estimate, like the compaction and context-edit paths above.
11988
+ if (estimate.lastUsageIndex !== null && this._isUsageStaleAfterModelChange(branchEntries)) {
11989
+ return { tokens: messages.reduce((sum, message) => sum + estimateTokens(message), 0), reported: false };
11990
+ }
11948
11991
  return { tokens: estimate.tokens, reported: estimate.usageTokens > 0 };
11949
11992
  }
11993
+ /**
11994
+ * Whether the latest reported usage predates the latest model switch: no
11995
+ * assistant message after the switch reported usage, so the last reported
11996
+ * figure belongs to the previous model's tokenizer. Assistant messages are
11997
+ * appended to the branch only once they stop streaming (a pending assistant
11998
+ * message is rejected), so a switch that lands mid-turn still precedes the
11999
+ * message entry carrying the new model's usage.
12000
+ */
12001
+ _isUsageStaleAfterModelChange(branchEntries) {
12002
+ let latestModelChangeIndex = -1;
12003
+ for (let i = branchEntries.length - 1; i >= 0; i--) {
12004
+ if (branchEntries[i].type === "model_change") {
12005
+ latestModelChangeIndex = i;
12006
+ break;
12007
+ }
12008
+ }
12009
+ if (latestModelChangeIndex === -1)
12010
+ return false;
12011
+ for (let i = branchEntries.length - 1; i > latestModelChangeIndex; i--) {
12012
+ const entry = branchEntries[i];
12013
+ if (entry.type === "message" && entry.message.role === "assistant") {
12014
+ const assistant = entry.message;
12015
+ if (assistant.stopReason !== "aborted" && assistant.stopReason !== "error") {
12016
+ if (calculateContextTokens(assistant.usage) > 0)
12017
+ return false;
12018
+ }
12019
+ }
12020
+ }
12021
+ return true;
12022
+ }
11950
12023
  /**
11951
12024
  * Export session to HTML.
11952
12025
  * @param outputPath Optional output path (defaults to session directory)
@@ -0,0 +1,9 @@
1
+ import type { AgentEvent } from "@earendil-works/pi-agent-core";
2
+ /**
3
+ * Provider error text can echo a value a config reference resolved to (omo#12965). An assistant message carries that
4
+ * text from its first streamed partial to its final form, and the final object is the one agent state keeps and the
5
+ * transcript persists, so every message event is redacted in place before a listener, the transcript or the state
6
+ * reads it.
7
+ */
8
+ export declare function redactAssistantErrorText(event: AgentEvent): void;
9
+ //# sourceMappingURL=assistant-error-redaction.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { redactSensitiveTokenValues } from "./sensitive-output.js";
2
+ function redactErrorText(message) {
3
+ if (message.role === "assistant" && message.errorMessage) {
4
+ message.errorMessage = redactSensitiveTokenValues(message.errorMessage);
5
+ }
6
+ }
7
+ /**
8
+ * Provider error text can echo a value a config reference resolved to (omo#12965). An assistant message carries that
9
+ * text from its first streamed partial to its final form, and the final object is the one agent state keeps and the
10
+ * transcript persists, so every message event is redacted in place before a listener, the transcript or the state
11
+ * reads it.
12
+ */
13
+ export function redactAssistantErrorText(event) {
14
+ if (event.type !== "message_start" && event.type !== "message_update" && event.type !== "message_end")
15
+ return;
16
+ redactErrorText(event.message);
17
+ if (event.type !== "message_update")
18
+ return;
19
+ const update = event.assistantMessageEvent;
20
+ if ("partial" in update)
21
+ redactErrorText(update.partial);
22
+ else if (update.type === "done")
23
+ redactErrorText(update.message);
24
+ else
25
+ redactErrorText(update.error);
26
+ }
27
+ //# sourceMappingURL=assistant-error-redaction.js.map