@code-yeongyu/senpi 2026.9.2 → 2026.9.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 (214) hide show
  1. package/CHANGELOG.md +124 -2
  2. package/dist/beta/omo-local-update-fingerprint.d.ts.map +1 -1
  3. package/dist/beta/omo-local-update-fingerprint.js +0 -1
  4. package/dist/beta/omo-local-update-fingerprint.js.map +1 -1
  5. package/dist/core/agent-session.d.ts +1 -0
  6. package/dist/core/agent-session.d.ts.map +1 -1
  7. package/dist/core/agent-session.js +7 -4
  8. package/dist/core/agent-session.js.map +1 -1
  9. package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
  10. package/dist/core/dynamic-prompt/build.js +2 -5
  11. package/dist/core/dynamic-prompt/build.js.map +1 -1
  12. package/dist/core/dynamic-prompt/index.d.ts +1 -2
  13. package/dist/core/dynamic-prompt/index.d.ts.map +1 -1
  14. package/dist/core/dynamic-prompt/index.js +1 -2
  15. package/dist/core/dynamic-prompt/index.js.map +1 -1
  16. package/dist/core/dynamic-prompt/intent-gate.d.ts.map +1 -1
  17. package/dist/core/dynamic-prompt/intent-gate.js +9 -24
  18. package/dist/core/dynamic-prompt/intent-gate.js.map +1 -1
  19. package/dist/core/dynamic-prompt/policies.d.ts.map +1 -1
  20. package/dist/core/dynamic-prompt/policies.js +3 -7
  21. package/dist/core/dynamic-prompt/policies.js.map +1 -1
  22. package/dist/core/dynamic-prompt/style.d.ts.map +1 -1
  23. package/dist/core/dynamic-prompt/style.js +6 -8
  24. package/dist/core/dynamic-prompt/style.js.map +1 -1
  25. package/dist/core/dynamic-prompt/verification.js +1 -1
  26. package/dist/core/dynamic-prompt/verification.js.map +1 -1
  27. package/dist/core/dynamic-prompt/working-task.d.ts +2 -0
  28. package/dist/core/dynamic-prompt/working-task.d.ts.map +1 -0
  29. package/dist/core/dynamic-prompt/working-task.js +10 -0
  30. package/dist/core/dynamic-prompt/working-task.js.map +1 -0
  31. package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts.map +1 -1
  32. package/dist/core/extensions/builtin/claude-sdk-oauth/options.js +6 -2
  33. package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +1 -1
  34. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
  35. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +2 -1
  36. package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
  37. package/dist/core/extensions/builtin/compaction/extension-wiring.js +1 -1
  38. package/dist/core/extensions/builtin/compaction/extension-wiring.js.map +1 -1
  39. package/dist/core/extensions/builtin/config-reload/watch-event-source.d.ts +1 -1
  40. package/dist/core/extensions/builtin/config-reload/watch-event-source.d.ts.map +1 -1
  41. package/dist/core/extensions/builtin/config-reload/watch-event-source.js +27 -9
  42. package/dist/core/extensions/builtin/config-reload/watch-event-source.js.map +1 -1
  43. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts.map +1 -1
  44. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +52 -50
  45. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -1
  46. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.d.ts.map +1 -1
  47. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +2 -1
  48. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
  49. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
  50. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +7 -1
  51. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
  52. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
  53. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +7 -1
  54. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
  55. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
  56. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +7 -1
  57. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
  58. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -1
  59. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +7 -1
  60. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
  61. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.d.ts.map +1 -1
  62. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +2 -1
  63. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
  64. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts +50 -0
  65. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -0
  66. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js +66 -0
  67. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js.map +1 -0
  68. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +5 -1
  69. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  70. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +6 -1
  71. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  72. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.d.ts.map +1 -1
  73. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js +11 -1
  74. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
  75. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.d.ts.map +1 -1
  76. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js +11 -1
  77. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js.map +1 -1
  78. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
  79. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +2 -1
  80. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
  81. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  82. package/dist/core/extensions/builtin/prompt-preset/presets.js +8 -2
  83. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  84. package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
  85. package/dist/core/extensions/builtin/terminal/extension.js +8 -3
  86. package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
  87. package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts +4 -3
  88. package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
  89. package/dist/core/extensions/builtin/terminal/monitor-notify.js +18 -18
  90. package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
  91. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +7 -0
  92. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
  93. package/dist/core/extensions/builtin/terminal/monitor-registry.js +37 -8
  94. package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
  95. package/dist/core/extensions/builtin/terminal/monitor-status.js +1 -1
  96. package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
  97. package/dist/core/extensions/builtin/terminal/prompt.d.ts +1 -1
  98. package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
  99. package/dist/core/extensions/builtin/terminal/prompt.js +17 -13
  100. package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
  101. package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
  102. package/dist/core/extensions/builtin/terminal/tools/bash-output.js +14 -2
  103. package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
  104. package/dist/core/extensions/builtin/terminal/tools/context.d.ts +2 -0
  105. package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
  106. package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
  107. package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
  108. package/dist/core/extensions/builtin/terminal/tools/monitor.js +27 -10
  109. package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
  110. package/dist/core/provider-composer.d.ts.map +1 -1
  111. package/dist/core/provider-composer.js +17 -8
  112. package/dist/core/provider-composer.js.map +1 -1
  113. package/dist/core/settings-manager.d.ts +2 -2
  114. package/dist/core/settings-manager.d.ts.map +1 -1
  115. package/dist/core/settings-manager.js +5 -3
  116. package/dist/core/settings-manager.js.map +1 -1
  117. package/dist/index.d.ts +1 -1
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +1 -1
  120. package/dist/index.js.map +1 -1
  121. package/dist/modes/index.d.ts +1 -1
  122. package/dist/modes/index.d.ts.map +1 -1
  123. package/dist/modes/index.js +1 -1
  124. package/dist/modes/index.js.map +1 -1
  125. package/dist/modes/rpc/host-ensure.d.ts +6 -0
  126. package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
  127. package/dist/modes/rpc/host-ensure.js +36 -9
  128. package/dist/modes/rpc/host-ensure.js.map +1 -1
  129. package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
  130. package/dist/modes/rpc/host-lifecycle.js +16 -4
  131. package/dist/modes/rpc/host-lifecycle.js.map +1 -1
  132. package/dist/modes/rpc/multi-session-host.d.ts +7 -4
  133. package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
  134. package/dist/modes/rpc/multi-session-host.js +7 -4
  135. package/dist/modes/rpc/multi-session-host.js.map +1 -1
  136. package/dist/modes/rpc/rpc-client.d.ts +8 -0
  137. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  138. package/dist/modes/rpc/rpc-client.js +62 -7
  139. package/dist/modes/rpc/rpc-client.js.map +1 -1
  140. package/dist/modes/rpc/rpc-mode.d.ts +1 -1
  141. package/dist/modes/rpc/rpc-mode.js +1 -1
  142. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  143. package/dist/modes/rpc/session-command-router.d.ts +22 -0
  144. package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
  145. package/dist/modes/rpc/session-command-router.js +132 -94
  146. package/dist/modes/rpc/session-command-router.js.map +1 -1
  147. package/dist/modes/rpc/session-event-fanout.d.ts +40 -0
  148. package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -0
  149. package/dist/modes/rpc/session-event-fanout.js +146 -0
  150. package/dist/modes/rpc/session-event-fanout.js.map +1 -0
  151. package/dist/modes/rpc/session-event-writer.d.ts +6 -13
  152. package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
  153. package/dist/modes/rpc/session-event-writer.js +48 -96
  154. package/dist/modes/rpc/session-event-writer.js.map +1 -1
  155. package/dist/modes/rpc/session-registry.d.ts +9 -8
  156. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  157. package/dist/modes/rpc/session-registry.js +14 -42
  158. package/dist/modes/rpc/session-registry.js.map +1 -1
  159. package/dist/modes/rpc/session-teardown.d.ts +12 -0
  160. package/dist/modes/rpc/session-teardown.d.ts.map +1 -0
  161. package/dist/modes/rpc/session-teardown.js +117 -0
  162. package/dist/modes/rpc/session-teardown.js.map +1 -0
  163. package/docs/rpc.md +10 -6
  164. package/docs/settings.md +4 -4
  165. package/docs/terminal-tools.md +26 -6
  166. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +57 -0
  167. package/node_modules/@code-yeongyu/senpi-codemode/README.md +4 -2
  168. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  169. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/skill-contribution.ts +43 -9
  170. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +4 -1
  171. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +10 -1
  172. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/SKILL.md +1 -1
  173. package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md +1 -1
  174. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +3 -1
  175. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +2 -0
  176. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +3 -0
  177. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  178. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -2
  179. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  180. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  181. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +1 -1
  182. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  183. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts +5 -0
  184. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
  185. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +26 -4
  186. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
  187. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  188. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  189. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
  190. package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
  191. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  192. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  193. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  194. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
  195. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  196. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  197. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts.map +1 -1
  198. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js +3 -1
  199. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js.map +1 -1
  200. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
  201. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  202. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  203. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  204. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  205. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  206. package/package.json +7 -7
  207. package/dist/core/dynamic-prompt/exploration.d.ts +0 -2
  208. package/dist/core/dynamic-prompt/exploration.d.ts.map +0 -1
  209. package/dist/core/dynamic-prompt/exploration.js +0 -6
  210. package/dist/core/dynamic-prompt/exploration.js.map +0 -1
  211. package/dist/core/dynamic-prompt/parallel-tools.d.ts +0 -2
  212. package/dist/core/dynamic-prompt/parallel-tools.d.ts.map +0 -1
  213. package/dist/core/dynamic-prompt/parallel-tools.js +0 -8
  214. package/dist/core/dynamic-prompt/parallel-tools.js.map +0 -1
package/docs/rpc.md CHANGED
@@ -62,10 +62,14 @@ On Windows, listeners and clients deterministically map the logical socket path
62
62
  `\\.\pipe\senpi-rpc-<sha256[:32]>`. Callers keep using the same `unix://` CLI value; the logical path remains the
63
63
  ownership and settings identity, and callers never construct the pipe name themselves.
64
64
 
65
- Socket event visibility is an all-sessions broadcast: every connected client receives lifecycle and agent events from
66
- every open session, each tagged with its routing `sessionId`. Correlated responses and extension UI requests are sent
67
- only to the connection that issued the command. This lets a non-owner observe a foreign turn without requiring a
68
- separate subscription protocol.
65
+ Socket event visibility is attachment-scoped for session content: each connection receives agent output only from sessions
66
+ attached to that connection, with every record tagged by its routing `sessionId`. Content-free lifecycle records
67
+ (`agent_start`, `agent_settled`, `agent_idle`, `session_opened`, and `session_closed`) are broadcast to all registered
68
+ connections, including the supervisor's unattached observer, so host lifecycle accounting remains accurate without exposing
69
+ session content. Correlated responses and dialog extension UI
70
+ requests (select, confirm, input, and editor) are requester-only; other extension UI state records go to the session's
71
+ attached connections. To observe a foreign session, open it by its existing
72
+ `sessionPath`; the host attaches that connection during `open_session`.
69
73
 
70
74
  ### Client information and rendered components
71
75
 
@@ -175,7 +179,7 @@ so they hold even for embedders and hand-started hosts that have no supervisor.
175
179
  | --- | --- | --- | --- |
176
180
  | `get_protocol_info` | - | `{ protocolVersion: 1, serverVersion: string, capabilities: string[], mode: "classic"\|"multi" }` | Answered in BOTH modes; side-effect-free; the capability probe. Multi-session hosts include `multi_session` plus the negotiated launch capabilities. |
177
181
  | `open_session` | `sessionPath?`, `cwd?`, `provider?`, `modelId?`, `thinkingLevel?`, `permissionPreset?` (all optional; paths MUST be absolute) | `{ sessionId, state: RpcSessionState, attached?: true }` | `sessionPath` = today's `--session` semantics (open-if-exists else create persisting there, `session-manager.ts:926-940`); `provider`/`modelId` applied only on create (resume restores the session's model — mirrors `SenpiSessionRuntime.ts:198-200`); params form the immutable launch profile (D8). When the path is already held by a fully-open session, the open ATTACHES to it: same routing handle, `attached: true`, one more attachment counted; the runtime is torn down only when the last attachment closes. Fails with `too_many_sessions` at the occupancy cap (see [Shared host occupancy](#shared-host-occupancy-idle-eviction-session-cap-empty-host-exit)); idle sessions past the eviction window are closed by the host itself. |
178
- | `close_session` | `sessionId` | `{}` | Aborts active work, awaits agent idle + settled persistence, flushes queued events, detaches subscriptions; its response is the LAST record tagged with that handle — no events after (test-pinned). |
182
+ | `close_session` | `sessionId` | `{}` | Aborts active work, awaits agent idle + settled persistence for up to the host grace window (default 10s), then force-releases the session; its response is the LAST record tagged with that handle for the first closer — no events after (test-pinned). A concurrent close joins the same teardown and receives its own successful response. |
179
183
  | `list_sessions` | - | `{ sessions: [{ sessionId, durableSessionId, sessionPath, cwd, name, status }] }` | Includes `opening`/`closing` entries with their status. |
180
184
  | every existing command | + `sessionId` (REQUIRED in multi mode) | unchanged | Routed to that session. |
181
185
 
@@ -206,7 +210,7 @@ Strict FIFO per session; one total stdout order; cross-session order unspecified
206
210
 
207
211
  ### Duplicate/idempotency
208
212
 
209
- Duplicate `open_session` while a path reservation is held by a fully-open session → ATTACH (`attached: true`, same handle); while held by an `opening`/`closing` entry → `session_path_in_use`. `close_session` releases one attachment; the runtime is disposed only when the last attachment closes. `close_session` on unknown/already-closed → `unknown_session` error. Request `id`s are client-owned; the server echoes them without dedup.
213
+ Duplicate `open_session` while a path reservation is held by a fully-open session → ATTACH (`attached: true`, same handle); while held by an `opening`/`closing` entry → `session_path_in_use`. `close_session` releases one attachment; the runtime is disposed only when the last attachment closes. A close for an entry already `closing` joins its in-flight teardown. `close_session` on unknown/already-closed → `unknown_session` error. The grace window is configurable by the host through `SENPI_RPC_CLOSE_GRACE_MS`. Request `id`s are client-owned; the server echoes them without dedup.
210
214
 
211
215
  ## Protocol Overview
212
216
 
package/docs/settings.md CHANGED
@@ -212,14 +212,14 @@ Set `PI_SKIP_VERSION_CHECK=1` to disable the senpi version update check. Use `--
212
212
  | Setting | Type | Default | Description |
213
213
  |---------|------|---------|-------------|
214
214
  | `retry.enabled` | boolean | `true` | Enable automatic agent-level retry on transient errors |
215
- | `retry.maxRetries` | number | `3` | Maximum agent-level retry attempts |
215
+ | `retry.maxRetries` | number | `5` | Maximum agent-level retry attempts |
216
216
  | `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff (2s, 4s, 8s) |
217
217
  | `retry.modelFallback` | boolean | `true` | Let eligible retry failures advance through configured per-model fallback chains |
218
218
  | `retry.fallbackChains` | `Record<string, string[]>` | `{}` | Ordered exact model-selector to fallback-selector chains |
219
219
  | `retry.fallbackRevertPolicy` | `"cooldown-expiry"` \| `"never"` | `"cooldown-expiry"` | Automatic primary-model restoration policy |
220
220
  | `retry.abortServerSideFallback` | boolean | `true` | Abort a turn when the provider substitutes a different model after a classifier decline |
221
221
  | `retry.provider.timeoutMs` | number | `300000` | Provider/SDK request timeout and stream idle timeout in milliseconds |
222
- | `retry.provider.streamStartTimeoutMs` | number | `90000` | Maximum wait for the first provider stream event; `0` disables |
222
+ | `retry.provider.streamStartTimeoutMs` | number | `300000` | Maximum wait for the first provider stream event; `0` disables |
223
223
  | `retry.provider.streamRetryTimeoutMs` | number | `30000` | First-request liveness cap after a known provider stream/transport timeout; `0` disables the cap |
224
224
  | `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts |
225
225
  | `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay honored on the same model before the fallback chain engages (60s) |
@@ -236,11 +236,11 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
236
236
  {
237
237
  "retry": {
238
238
  "enabled": true,
239
- "maxRetries": 3,
239
+ "maxRetries": 5,
240
240
  "baseDelayMs": 2000,
241
241
  "provider": {
242
242
  "timeoutMs": 3600000,
243
- "streamStartTimeoutMs": 90000,
243
+ "streamStartTimeoutMs": 300000,
244
244
  "streamRetryTimeoutMs": 30000,
245
245
  "maxRetries": 0,
246
246
  "maxRetryDelayMs": 60000
@@ -12,7 +12,7 @@ platform/runtime).
12
12
  |------|---------|
13
13
  | `bash` | Run a command in a PTY. `run_in_background: true` starts a persistent session and returns a `bash_id` immediately. Foreground `timeout` (seconds) is a kill deadline. |
14
14
  | `bash_output` | Peek at a session without blocking: new output since the last read, or the status line. `filter` regex-filters lines; `view: "screen"` returns the rendered xterm grid. |
15
- | `monitor` | Watch a long-running command (`description`, `command`, `filter?`, `timeout_ms?`, `persistent?`) and inject matching PTY output lines as coalesced events. While watches are live, the interactive footer shows a brief `watching …` status (descriptions, count, paused markers). |
15
+ | `monitor` | Watch a change and inject it as coalesced events, passing `command` XOR `path`: a long-running command (`description`, `command`, `filter?`, `timeout_ms?`, `persistent?`) injects matching PTY output lines, while a file (`description`, `path`, `event?`) fires once natively. While watches are live, the interactive footer shows a brief `watching …` status (descriptions, count, paused markers). |
16
16
  | `bash_input` | Send stdin (`input`) or named keys (`keys: ["ctrl+c"]`, `["enter"]`, `["up"]`) to steer a REPL or interrupt a process. |
17
17
  | `bash_resize` | Resize a session's PTY (`cols`, `rows`) so full-screen TUIs reflow. |
18
18
  | `kill_bash` | Tree-kill one session (`bash_id`) or all (`all: true`), leaving no orphans. |
@@ -80,17 +80,33 @@ monitor({ description: "PR checks",
80
80
  Expected event: the verdict line when checks settle, then the summary. Merge on
81
81
  pass, pull the failing job's log on fail. The command exits by itself.
82
82
 
83
- ### File or port transition
83
+ ### File transition (native file branch)
84
84
 
85
85
  ```js
86
86
  monitor({ description: "artifact written",
87
- command: "until test -f dist/app.tar.gz; do sleep 2; done; printf 'READY\n'",
87
+ path: "dist/app.tar.gz",
88
+ event: "create" })
89
+ ```
90
+
91
+ One file, watched natively — no shell, no poll loop. `create` (the default)
92
+ fires only when the file appears after registration; to watch a file that
93
+ already exists, pass `event: "modify"`. Registration needs the parent directory
94
+ (`dist/` here) to exist already, and the target must be a regular file, not a
95
+ symlink — when the build creates the directory too, keep a command poll loop
96
+ like the port recipe below. This branch is XOR with `command` and takes no
97
+ `filter` and no `persistent`. Expected event: one hit when the file lands, then
98
+ the watch is done. Consume the artifact.
99
+
100
+ ### Port transition
101
+
102
+ ```js
103
+ monitor({ description: "postgres up",
104
+ command: "until nc -z localhost 5432; do sleep 1; done; printf 'READY\n'",
88
105
  filter: "^READY$" })
89
106
  ```
90
107
 
91
- Same shape works for ports: `until nc -z localhost 5432; do sleep 1; done;
92
- printf 'READY\n'`. Expected event: `READY`, then exit. Consume the artifact
93
- or connect.
108
+ A port has no native watch, so the sleep loop belongs inside the command.
109
+ Expected event: `READY`, then exit. Connect.
94
110
 
95
111
  ### Child-agent sentinel watch
96
112
 
@@ -113,6 +129,10 @@ results and integrate. Exits on its own; no cleanup.
113
129
  | Expecting `filter` to stop the command | `filter` gates events only; make the command exit on the condition |
114
130
  | `persistent: true` with `timeout_ms` | The timeout is ignored when persistent; pick one |
115
131
  | Sentinel printed without a trailing newline | Sentinels must be newline-terminated: `printf 'READY\n'` |
132
+ | Polling `test -f` in a command to await one file | Use the file branch: `monitor({ description, path, event? })` |
133
+ | `event: "create"` on a file that already exists | `create` fires only on appearance; use `event: "modify"` |
134
+ | `path` whose parent directory the build has yet to create | Registration fails; poll for it with a `command` watch instead |
135
+ | Passing `command` and `path` in one call | They are XOR; pick the branch that matches what you await |
116
136
  | Monitoring sub-minute deterministic work | Run it directly in the foreground |
117
137
  | Rearming a monitor that was never paused | Rearm only a `bash_id` named in a pause notice |
118
138
 
@@ -12,6 +12,63 @@
12
12
 
13
13
  ### Removed
14
14
 
15
+ ## [2026.9.3] - 2026-09-03
16
+
17
+ ### Breaking Changes
18
+
19
+ ### Added
20
+
21
+ ### Changed
22
+
23
+ ### Fixed
24
+
25
+ ### Removed
26
+
27
+ ## [2026.9.2-4] - 2026-09-02
28
+
29
+ ### Breaking Changes
30
+
31
+ ### Added
32
+
33
+ ### Changed
34
+
35
+ ### Fixed
36
+
37
+ ### Removed
38
+
39
+ ## [2026.9.2-3] - 2026-09-02
40
+
41
+ ### Breaking Changes
42
+
43
+ ### Added
44
+
45
+ ### Changed
46
+
47
+ - The eval prompt's JS runtime line is now runtime-aware: on a bun kernel it names `Bun <version>` and
48
+ `Bun.*` builtins, and only while the bundled `bun-1-4` skill is active it adds a MUST READ pointer to
49
+ that skill's absolute path before the first js cell; node kernels keep the Node.js worker wording.
50
+ `activeBunSkillPath()` exposes the same gate the `resources_discover` contribution uses.
51
+ - The bundled `bun-1-4` skill description is rewritten as a fact-framed MUST READ notice with
52
+ English-only copy (Korean trigger words removed; the `Bun.stringWidth` example no longer uses Hangul).
53
+
54
+ ### Fixed
55
+
56
+ - Compiled binaries now contribute the bundled `bun-1-4` skill by resolving the codemode sidecar shipped next to the executable, and a missing skill is reported on stderr so it can no longer corrupt the RPC protocol stream on stdout.
57
+
58
+ ### Removed
59
+
60
+ ## [2026.9.2-2] - 2026-09-02
61
+
62
+ ### Breaking Changes
63
+
64
+ ### Added
65
+
66
+ ### Changed
67
+
68
+ ### Fixed
69
+
70
+ ### Removed
71
+
15
72
  ## [2026.9.2] - 2026-09-02
16
73
 
17
74
  ### Breaking Changes
@@ -36,7 +36,9 @@ task-tool names are known.
36
36
  resolves absolute executable paths, and the eval prompt host line names the
37
37
  JS runtime (`node`/`bun`).
38
38
  - JavaScript import rewriting for supported local modules and package imports
39
- in the persistent Node.js worker.
39
+ in the persistent JS worker (Bun when senpi runs on bun, Node.js otherwise).
40
+ - On a Bun >= 1.4 kernel the eval prompt names the bundled `bun-1-4` skill as
41
+ MUST READ before the first js cell; node kernels keep the Node.js wording.
40
42
  - GPT models receive a terse `eval` prompt dialect that prioritizes composing
41
43
  active tools through `tool.<name>(args)` and documents detach-on-timeout.
42
44
 
@@ -44,7 +46,7 @@ task-tool names are known.
44
46
 
45
47
  | Language | Default | Runtime | Notes |
46
48
  | --- | --- | --- | --- |
47
- | `js` | enabled | Node.js worker | Requires Node.js 24 or newer; supports top-level `await` and `return`. |
49
+ | `js` | enabled | In-process worker on senpi's own runtime (Bun or Node.js 24+) | Supports top-level `await` and `return`; the eval prompt's runtime line follows the kernel. |
48
50
  | `py` | enabled | `python3` or `python` | Optional interpreter detected at session start. |
49
51
  | `rb` | disabled | `ruby` | Optional interpreter detected at session start. |
50
52
  | `jl` | disabled | `julia` | Optional interpreter detected at session start. |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-codemode",
3
- "version": "2026.9.2",
3
+ "version": "2026.9.3",
4
4
  "private": true,
5
5
  "description": "Source-only senpi extension package for codemode evaluation tools",
6
6
  "type": "module",
@@ -31,14 +31,14 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/parser": "8.0.4",
34
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.2",
34
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.3",
35
35
  "typebox": "1.3.18"
36
36
  },
37
37
  "peerDependencies": {
38
- "@code-yeongyu/senpi": "2026.9.2"
38
+ "@code-yeongyu/senpi": "2026.9.3"
39
39
  },
40
40
  "devDependencies": {
41
- "@code-yeongyu/senpi": "2026.9.2"
41
+ "@code-yeongyu/senpi": "2026.9.3"
42
42
  },
43
43
  "keywords": [
44
44
  "senpi",
@@ -1,6 +1,7 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
+ import { type CodemodeRuntimeAssetEnvironment, resolveCodemodeRuntimeAsset } from "../kernels/shared/runtime-asset.ts";
4
5
 
5
6
  const BUN_SKILL_BASE_DIR = dirname(fileURLToPath(import.meta.url));
6
7
 
@@ -27,29 +28,62 @@ export function bunVersionSupportsSkill(version: string | undefined): boolean {
27
28
  return major > 1 || (major === 1 && minor >= 4);
28
29
  }
29
30
 
30
- /** Absolute path of the bundled bun-1-4 SKILL.md, or undefined (logged once) when it is not shipped. */
31
- export function bundledBunSkillPath(baseDir: string = BUN_SKILL_BASE_DIR): string | undefined {
32
- const candidate = join(baseDir, "..", "skill", "bun-1-4", "SKILL.md");
31
+ const BUN_SKILL_PACKAGE_RELATIVE_PATH = join("skill", "bun-1-4", "SKILL.md");
32
+
33
+ /**
34
+ * Absolute path of the bundled bun-1-4 SKILL.md, or undefined (logged once) when it is not shipped.
35
+ *
36
+ * A compiled Bun binary has no readable module-relative asset, so resolution falls back to the
37
+ * codemode sidecar shipped next to the executable, exactly as the Ruby and Julia kernel runners do.
38
+ * The miss is reported on stderr because stdout carries the RPC protocol stream.
39
+ */
40
+ export function bundledBunSkillPath(
41
+ baseDir: string = BUN_SKILL_BASE_DIR,
42
+ environment: CodemodeRuntimeAssetEnvironment = {},
43
+ ): string | undefined {
44
+ const localPath = join(baseDir, "..", "skill", "bun-1-4", "SKILL.md");
45
+ const candidate = resolveCodemodeRuntimeAsset(localPath, BUN_SKILL_PACKAGE_RELATIVE_PATH, environment);
33
46
  if (existsSync(candidate)) return candidate;
34
47
  if (!loggedMissingBunSkill) {
35
48
  loggedMissingBunSkill = true;
36
- console.debug(`[senpi-codemode] bundled bun-1-4 skill not found at ${candidate}; skipping contribution`);
49
+ // A compiled binary never has the module-relative asset, so naming only that path
50
+ // would hide the sidecar location an operator actually has to populate.
51
+ const executableDir = dirname(environment.executablePath ?? process.execPath);
52
+ const sidecarPath = join(
53
+ executableDir,
54
+ "node_modules",
55
+ "@code-yeongyu",
56
+ "senpi-codemode",
57
+ "src",
58
+ BUN_SKILL_PACKAGE_RELATIVE_PATH,
59
+ );
60
+ console.error(
61
+ `[senpi-codemode] bundled bun-1-4 skill not found at ${localPath} or ${sidecarPath}; skipping contribution`,
62
+ );
37
63
  }
38
64
  return undefined;
39
65
  }
40
66
 
41
67
  /**
42
- * Builds the `resources_discover` handler that contributes the bundled bun-1-4 skill
43
- * only when the in-process js eval kernel itself runs bun >= 1.4 (`process.versions.bun`).
44
- * A node kernel never receives the skill, regardless of any bun binary on PATH.
68
+ * Absolute path of the bundled bun-1-4 SKILL.md when it is active for this process:
69
+ * the in-process js eval kernel itself runs bun >= 1.4 (`process.versions.bun`) and the
70
+ * asset is shipped. A node kernel never activates it, regardless of any bun binary on PATH.
45
71
  */
72
+ export function activeBunSkillPath(
73
+ getKernelBunVersion: BunKernelVersionSource = kernelBunVersion,
74
+ baseDir?: string,
75
+ ): string | undefined {
76
+ if (!bunVersionSupportsSkill(getKernelBunVersion())) return undefined;
77
+ return bundledBunSkillPath(baseDir);
78
+ }
79
+
80
+ /** Builds the `resources_discover` handler that contributes the active bun-1-4 skill, if any. */
46
81
  export function createBunSkillDiscoverHandler(
47
82
  getKernelBunVersion: BunKernelVersionSource = kernelBunVersion,
48
83
  baseDir?: string,
49
84
  ): () => { skillPaths: string[] } | undefined {
50
85
  return () => {
51
- if (!bunVersionSupportsSkill(getKernelBunVersion())) return undefined;
52
- const skillPath = bundledBunSkillPath(baseDir);
86
+ const skillPath = activeBunSkillPath(getKernelBunVersion, baseDir);
53
87
  return skillPath === undefined ? undefined : { skillPaths: [skillPath] };
54
88
  };
55
89
  }
@@ -16,7 +16,7 @@ import {
16
16
  import { jsRuntimeInfo, jsRuntimeLabel } from "./extension/runtime-info.ts";
17
17
  import type { CodemodeSessionManager, CreateCodemodeSessionManagerOptions } from "./extension/session-manager.ts";
18
18
  import { SessionManagerProxy } from "./extension/session-manager-proxy.ts";
19
- import { registerBunSkillContribution } from "./extension/skill-contribution.ts";
19
+ import { activeBunSkillPath, registerBunSkillContribution } from "./extension/skill-contribution.ts";
20
20
  import { WAKE_SOURCE_STATE_EVENT, type WakeSourceState } from "./extension/wake-source-state.ts";
21
21
  import { EvalDetachedCellManager, type EvalDetachedCellStatusEntry } from "./tool/detached-cell-manager.ts";
22
22
  import {
@@ -68,6 +68,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
68
68
  const manager = new SessionManagerProxy();
69
69
  const complete = options.complete ?? ((request, ctx) => createCompletionHandler()(ctx)(request));
70
70
  const renderers = { renderCall: renderEvalCall, renderResult: renderEvalResult };
71
+ const bunSkillPath = activeBunSkillPath();
71
72
  let activeRuntime: SessionRuntime | undefined;
72
73
  let activeModelId: string | undefined;
73
74
  let activeContext: ExtensionContext | undefined;
@@ -125,6 +126,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
125
126
  spawnDefaultAgent: runtime.settings.taskTools.task,
126
127
  hostLine: hostLine(),
127
128
  runtimes: runtime.runtimes,
129
+ ...(bunSkillPath === undefined ? {} : { bunSkillPath }),
128
130
  ...(modelId === undefined ? {} : { modelId }),
129
131
  }),
130
132
  );
@@ -159,6 +161,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
159
161
  renderers,
160
162
  hostLine: hostLine(),
161
163
  runtimes: { js: jsRuntimeInfo() },
164
+ ...(bunSkillPath === undefined ? {} : { bunSkillPath }),
162
165
  }),
163
166
  );
164
167
  pi.registerRemovedToolHint(
@@ -1,3 +1,5 @@
1
+ import type { EvalRuntimeInfo } from "../tool/types.ts";
2
+
1
3
  export interface EnabledLanguages {
2
4
  readonly py: boolean;
3
5
  readonly js: boolean;
@@ -18,6 +20,10 @@ export interface EvalPromptOptions {
18
20
  readonly modelId?: string;
19
21
  /** Preformatted host line (e.g. "darwin arm64 · Apple M5 Max · 18 cores"); enables the host-sizing note. */
20
22
  readonly hostLine?: string;
23
+ /** Identity of the in-process js kernel; a bun runtime swaps the Node.js worker line for the Bun one. */
24
+ readonly jsRuntime?: EvalRuntimeInfo;
25
+ /** Absolute path of the active bun-1-4 skill; rendered as a MUST READ pointer only on a bun kernel. */
26
+ readonly bunSkillPath?: string;
21
27
  }
22
28
 
23
29
  /** Prompt dialect for the eval-first batching emphasis. */
@@ -132,7 +138,7 @@ Fields:
132
138
  A detached cell keeps its language kernel busy while it finishes; another language can continue. Do not re-run a detached cell: the same-language busy error names its cell id and output tail. Completion arrives as one notification with the final value/error and buffered output. Stopping a cell interrupts its kernel; the stop result states whether kernel state survived or the kernel was restarted and its variables lost.
133
139
 
134
140
  {{#if py}}Live event loop: use top-level \`await\` directly; \`asyncio.run(…)\` raises "cannot be called from a running event loop".{{/if}}
135
- {{#if js}}JS runs under Node.js worker: top-level \`await\`/\`return\` work; \`fetch\`/\`Buffer\` available.{{/if}}
141
+ {{#if js}}{{#if jsBun}}JS runs in-process on Bun {{jsVersion}}: top-level \`await\`/\`return\` work; \`Bun.*\` builtins available.{{#if bunSkillPath}} MUST READ the bun-1-4 skill at {{bunSkillPath}} before your first js cell — its builtins replace the npm packages you would otherwise install.{{/if}}{{else}}JS runs under Node.js worker: top-level \`await\`/\`return\` work; \`fetch\`/\`Buffer\` available.{{/if}}{{/if}}
136
142
  {{#if rb}}Ruby: synchronous; helper options are keyword args{{#if spawns}} (e.g. \`output("id", limit: 2)\`){{/if}}; the last expression auto-displays unless it is \`nil\`, an assignment, or a definition (like IRB).{{/if}}
137
143
  {{#if jl}}Julia: synchronous; helper options are standard keyword args{{#if spawns}} (e.g. \`output("id", limit=2)\`){{/if}}; the last expression auto-displays unless it is an assignment or a definition (like the Julia REPL).{{/if}}
138
144
  On error, fix and re-run only the failing step. State usually survives a normal error, but a timeout or stop may have restarted the kernel — its message says which. Before rebuilding state, check a sentinel (a variable you defined earlier); only re-establish what is actually gone, since blind re-runs duplicate side effects.
@@ -212,6 +218,9 @@ export function buildEvalPrompt(
212
218
  styleKimi: style === "kimi",
213
219
  styleDefault: style === "default",
214
220
  hostLine: options.hostLine ?? "",
221
+ jsBun: options.jsRuntime?.name === "bun",
222
+ jsVersion: options.jsRuntime?.version ?? "",
223
+ bunSkillPath: options.bunSkillPath ?? "",
215
224
  };
216
225
  const examples = REUSE_CHAIN_EXAMPLES.filter((example) => enabled[example.language])
217
226
  .map((example) => {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bun-1-4
3
- description: "MUST USE whenever writing or running JavaScript/TypeScript with Bun including JS through the eval tool, bun -e one-liners, scratch scripts, servers, CLIs, tests, bundling, or package management. Bun 1.4 replaced 15+ npm deps with builtins: consult BEFORE npm-installing sharp, puppeteer/playwright (scraping), marked, node-cron, node-pty, concurrently, serve-static, tar, json5, fast-xml-parser, string-width — Bun ships it. Triggers: bun, Bun.serve, bun test, bun build, bun install, bun run, JS 스크립트, 번들링, 이미지 리사이즈, 헤드리스 브라우저, 크론, PTY, eval js."
3
+ description: "MUST READ before your first js eval cell: this session's eval js kernel runs Bun 1.4+ (this skill is present only when it does). Also read before any bun -e, script, server, CLI, test, bundle, or package-management work. Bun 1.4 ships builtins that replace 15+ npm deps check here BEFORE installing sharp, puppeteer/playwright (scraping), marked, node-cron, node-pty, concurrently, serve-static, tar, json5, fast-xml-parser, string-width. Triggers: eval js, bun, Bun.serve, bun test, bun build, bun install, bun run, image resize, headless browser, markdown render, cron, PTY."
4
4
  ---
5
5
 
6
6
  # Bun 1.4 — Use the Builtins First
@@ -139,7 +139,7 @@ Blog: [#also-built-in](https://bun.com/blog/bun-v1.4#also-built-in)
139
139
  Docs: <https://bun.com/docs/runtime/utils>
140
140
 
141
141
  ```ts
142
- Bun.stringWidth("한글 text"); // terminal columns, ANSI + grapheme aware
142
+ Bun.stringWidth("\x1b[32mgreen\x1b[0m e\u0301"); // terminal columns, ANSI + grapheme aware
143
143
  Bun.sliceAnsi(str, 0, 20); // slice by columns, preserving ANSI codes
144
144
  Bun.wrapAnsi(str, 80); // wrap by columns
145
145
  ```
@@ -39,8 +39,10 @@ export interface CreateEvalToolOptions {
39
39
  readonly spawnDefaultAgent?: string;
40
40
  readonly modelId?: string;
41
41
  readonly hostLine?: string;
42
- /** Display identity of each language's runtime, shown in headers and details. */
42
+ /** Display identity of each language's runtime, shown in headers and details; `js` also selects the prompt's runtime line. */
43
43
  readonly runtimes?: EvalRuntimes;
44
+ /** Absolute path of the active bun-1-4 skill; the prompt names it as MUST READ on a bun kernel. */
45
+ readonly bunSkillPath?: string;
44
46
  }
45
47
 
46
48
  export interface EvalCellInvocation {
@@ -31,6 +31,8 @@ export function createEvalTool(options: CreateEvalToolOptions): ToolDefinition<E
31
31
  ...(options.spawnDefaultAgent === undefined ? {} : { spawnDefaultAgent: options.spawnDefaultAgent }),
32
32
  ...(options.modelId === undefined ? {} : { modelId: options.modelId }),
33
33
  ...(options.hostLine === undefined ? {} : { hostLine: options.hostLine }),
34
+ ...(options.runtimes?.js === undefined ? {} : { jsRuntime: options.runtimes.js }),
35
+ ...(options.bunSkillPath === undefined ? {} : { bunSkillPath: options.bunSkillPath }),
34
36
  });
35
37
  const languages = enabledLanguageList(options.enabledLanguages);
36
38
  const cellManager =
@@ -21,6 +21,9 @@ export declare function agentLoop(prompts: AgentMessage[], context: AgentContext
21
21
  export declare function agentLoopContinue(context: AgentContext, config: AgentLoopConfig, signal: AbortSignal | undefined, streamFn: StreamFn): EventStream<AgentEvent, AgentMessage[]>;
22
22
  export declare function runAgentLoop(prompts: AgentMessage[], context: AgentContext, config: AgentLoopConfig, emit: AgentEventSink, signal: AbortSignal | undefined, streamFn: StreamFn): Promise<AgentMessage[]>;
23
23
  export declare function runAgentLoopContinue(context: AgentContext, config: AgentLoopConfig, emit: AgentEventSink, signal: AbortSignal | undefined, streamFn: StreamFn): Promise<AgentMessage[]>;
24
+ export declare class StreamStartTimeoutError extends Error {
25
+ constructor(timeoutMs: number);
26
+ }
24
27
  /** Build the provider context using the same transform and conversion pipeline as an agent request. */
25
28
  export declare function buildProviderContext(context: AgentContext, config: Pick<AgentLoopConfig, "convertToLlm" | "transformContext">, signal?: AbortSignal): Promise<Context>;
26
29
  export interface PreparedAgentToolCall {
@@ -1 +1 @@
1
- {"version":3,"file":"agent-loop.d.ts","sourceRoot":"","sources":["../src/agent-loop.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,KAAK,OAAO,EAEZ,WAAW,EAIX,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EAEf,YAAY,EACZ,SAAS,EACT,aAAa,EAEb,QAAQ,EACR,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,CAAC,CAiBzC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,CAAC,CAwBzC;AAED,wBAAsB,YAAY,CACjC,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC,CAgBzB;AAED,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC,CAiBzB;AA6QD,uGAAuG;AACvG,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,cAAc,GAAG,kBAAkB,CAAC,EAClE,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,OAAO,CAAC,CAgBlB;AA+lBD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACd;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,aAAa,CAYrG;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,qBAAqB,CAOpG"}
1
+ {"version":3,"file":"agent-loop.d.ts","sourceRoot":"","sources":["../src/agent-loop.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,KAAK,OAAO,EAEZ,WAAW,EAIX,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EAEf,YAAY,EACZ,SAAS,EACT,aAAa,EAEb,QAAQ,EACR,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,CAAC,CAiBzC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,CAAC,CAwBzC;AAED,wBAAsB,YAAY,CACjC,OAAO,EAAE,YAAY,EAAE,EACvB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC,CAgBzB;AAED,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC,CAiBzB;AAmBD,qBAAa,uBAAwB,SAAQ,KAAK;gBACrC,SAAS,EAAE,MAAM;CAM7B;AAqPD,uGAAuG;AACvG,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,cAAc,GAAG,kBAAkB,CAAC,EAClE,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,OAAO,CAAC,CAgBlB;AA+lBD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACd;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,aAAa,CAYrG;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,qBAAqB,CAOpG"}
@@ -82,9 +82,9 @@ class StreamIdleTimeoutError extends Error {
82
82
  // The wording must keep matching the retryable-error classifier
83
83
  // ("timed out" in packages/ai/src/utils/retry.ts) so a dead stream start is
84
84
  // retried instead of dead-ending the session.
85
- class StreamStartTimeoutError extends Error {
85
+ export class StreamStartTimeoutError extends Error {
86
86
  constructor(timeoutMs) {
87
- super(`Provider stream start timed out after ${timeoutMs}ms`);
87
+ super(`Provider stream start timed out after ${timeoutMs}ms (raise streamStartTimeoutMs — retry.provider.streamStartTimeoutMs in senpi settings; 0 disables)`);
88
88
  this.name = "StreamStartTimeoutError";
89
89
  }
90
90
  }