@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.
- package/CHANGELOG.md +124 -2
- package/dist/beta/omo-local-update-fingerprint.d.ts.map +1 -1
- package/dist/beta/omo-local-update-fingerprint.js +0 -1
- package/dist/beta/omo-local-update-fingerprint.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -4
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/build.js +2 -5
- package/dist/core/dynamic-prompt/build.js.map +1 -1
- package/dist/core/dynamic-prompt/index.d.ts +1 -2
- package/dist/core/dynamic-prompt/index.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/index.js +1 -2
- package/dist/core/dynamic-prompt/index.js.map +1 -1
- package/dist/core/dynamic-prompt/intent-gate.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/intent-gate.js +9 -24
- package/dist/core/dynamic-prompt/intent-gate.js.map +1 -1
- package/dist/core/dynamic-prompt/policies.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/policies.js +3 -7
- package/dist/core/dynamic-prompt/policies.js.map +1 -1
- package/dist/core/dynamic-prompt/style.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/style.js +6 -8
- package/dist/core/dynamic-prompt/style.js.map +1 -1
- package/dist/core/dynamic-prompt/verification.js +1 -1
- package/dist/core/dynamic-prompt/verification.js.map +1 -1
- package/dist/core/dynamic-prompt/working-task.d.ts +2 -0
- package/dist/core/dynamic-prompt/working-task.d.ts.map +1 -0
- package/dist/core/dynamic-prompt/working-task.js +10 -0
- package/dist/core/dynamic-prompt/working-task.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.js +6 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +2 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/extension-wiring.js +1 -1
- package/dist/core/extensions/builtin/compaction/extension-wiring.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-event-source.d.ts +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-event-source.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-event-source.js +27 -9
- package/dist/core/extensions/builtin/config-reload/watch-event-source.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +52 -50
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts +50 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js +66 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +5 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +6 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js +11 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js +11 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +8 -2
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +8 -3
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts +4 -3
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.js +18 -18
- package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +7 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +37 -8
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.js +17 -13
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js +14 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +2 -0
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +27 -10
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +17 -8
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/settings-manager.d.ts +2 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +5 -3
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/rpc/host-ensure.d.ts +6 -0
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +36 -9
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
- package/dist/modes/rpc/host-lifecycle.js +16 -4
- package/dist/modes/rpc/host-lifecycle.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.d.ts +7 -4
- package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +7 -4
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +8 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +62 -7
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts +22 -0
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +132 -94
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-fanout.d.ts +40 -0
- package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -0
- package/dist/modes/rpc/session-event-fanout.js +146 -0
- package/dist/modes/rpc/session-event-fanout.js.map +1 -0
- package/dist/modes/rpc/session-event-writer.d.ts +6 -13
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +48 -96
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/modes/rpc/session-registry.d.ts +9 -8
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js +14 -42
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-teardown.d.ts +12 -0
- package/dist/modes/rpc/session-teardown.d.ts.map +1 -0
- package/dist/modes/rpc/session-teardown.js +117 -0
- package/dist/modes/rpc/session-teardown.js.map +1 -0
- package/docs/rpc.md +10 -6
- package/docs/settings.md +4 -4
- package/docs/terminal-tools.md +26 -6
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +57 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +4 -2
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/skill-contribution.ts +43 -9
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +4 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +10 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/SKILL.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +3 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +26 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
- package/dist/core/dynamic-prompt/exploration.d.ts +0 -2
- package/dist/core/dynamic-prompt/exploration.d.ts.map +0 -1
- package/dist/core/dynamic-prompt/exploration.js +0 -6
- package/dist/core/dynamic-prompt/exploration.js.map +0 -1
- package/dist/core/dynamic-prompt/parallel-tools.d.ts +0 -2
- package/dist/core/dynamic-prompt/parallel-tools.d.ts.map +0 -1
- package/dist/core/dynamic-prompt/parallel-tools.js +0 -8
- 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
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
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 | `
|
|
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 | `
|
|
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":
|
|
239
|
+
"maxRetries": 5,
|
|
240
240
|
"baseDelayMs": 2000,
|
|
241
241
|
"provider": {
|
|
242
242
|
"timeoutMs": 3600000,
|
|
243
|
-
"streamStartTimeoutMs":
|
|
243
|
+
"streamStartTimeoutMs": 300000,
|
|
244
244
|
"streamRetryTimeoutMs": 30000,
|
|
245
245
|
"maxRetries": 0,
|
|
246
246
|
"maxRetryDelayMs": 60000
|
package/docs/terminal-tools.md
CHANGED
|
@@ -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?`)
|
|
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
|
|
83
|
+
### File transition (native file branch)
|
|
84
84
|
|
|
85
85
|
```js
|
|
86
86
|
monitor({ description: "artifact written",
|
|
87
|
-
|
|
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
|
-
|
|
92
|
-
|
|
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
|
|
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 |
|
|
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.
|
|
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.
|
|
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.
|
|
38
|
+
"@code-yeongyu/senpi": "2026.9.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@code-yeongyu/senpi": "2026.9.
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* A node kernel never
|
|
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
|
-
|
|
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
|
|
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
|
package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md
CHANGED
|
@@ -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("
|
|
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;
|
|
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
|
}
|