mixdog 0.9.171 → 0.9.173
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/package.json +4 -3
- package/scripts/build-ffmpeg-runtime.sh +57 -58
- package/scripts/build-runtime-linux.sh +211 -191
- package/scripts/build-runtime-macos.sh +94 -76
- package/scripts/code-graph-description-contract.mjs +1 -2
- package/scripts/context-renewal-live-check.mjs +1 -1
- package/scripts/coverage-query.mjs +27 -0
- package/scripts/daemon-stub.mjs +1 -2
- package/scripts/fixtures/patch-replay-corpus.json +85 -28
- package/scripts/generate-runtime-manifest.mjs +13 -17
- package/scripts/graph-parity.mjs +312 -226
- package/scripts/lib/coverage.mjs +309 -0
- package/scripts/lib/embedding-model-bench-core.mjs +9 -11
- package/scripts/lib/embedding-model-bench-core.test.mjs +47 -0
- package/scripts/lib/parse-since.mjs +22 -0
- package/scripts/lib/recall-bench-eval.mjs +8 -16
- package/scripts/lib/run-node-tests.mjs +152 -0
- package/scripts/lib/test-failure-records.mjs +46 -0
- package/scripts/lib/test-failure-summary.mjs +59 -0
- package/scripts/lib/test-summary-reporter.mjs +30 -0
- package/scripts/llm-trace-summary.mjs +2 -23
- package/scripts/local-provider-live-check.mjs +1 -1
- package/scripts/media-image-live.mjs +4 -6
- package/scripts/mouse-probe.mjs +2 -14
- package/scripts/native-binary-arch.mjs +1 -1
- package/scripts/office/author-deck.mjs +4 -1
- package/scripts/office/build-pptx-icons.mjs +0 -1
- package/scripts/patch-replay.mjs +4 -1
- package/scripts/perf/transcript-baseline.mjs +10 -8
- package/scripts/perf/transcript-runtime-probe.mjs +20 -4
- package/scripts/pg-memory-diet.mjs +10 -9
- package/scripts/prune-embedding-runtime.mjs +1 -20
- package/scripts/recall-bench-cases.json +64 -9
- package/scripts/recall-event-cases.json +398 -41
- package/scripts/recall-history-cases.json +396 -36
- package/scripts/recall-quality-cases.json +146 -17
- package/scripts/recall-repo-cases.json +188 -24
- package/scripts/recall-usecase-cases.json +96 -16
- package/scripts/release-timing-report.mjs +4 -1
- package/scripts/routing-corpus.mjs +113 -143
- package/scripts/run-office-live-tests.mjs +2 -1
- package/scripts/session-diag.mjs +2 -28
- package/scripts/session-sweep.mjs +103 -57
- package/scripts/smoke-runtime-negative.sh +22 -16
- package/scripts/test-direct.mjs +5 -0
- package/scripts/test.mjs +117 -54
- package/scripts/tool-efficiency-diag.mjs +4 -1
- package/scripts/tool-failures.mjs +1 -20
- package/scripts/tui-frame-harness.mjs +7 -8
- package/src/app.mjs +79 -74
- package/src/cli.mjs +0 -2
- package/src/defaults/skills/browser-use/SKILL.md +41 -15
- package/src/defaults/skills/code-tidy/SKILL.md +212 -77
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +149 -52
- package/src/defaults/skills/code-tidy/references/dead-code.md +61 -19
- package/src/defaults/skills/computer-use/SKILL.md +28 -8
- package/src/defaults/skills/docx/SKILL.md +2 -0
- package/src/defaults/skills/docx/references/native-authoring.md +7 -2
- package/src/defaults/skills/goal-management/SKILL.md +25 -11
- package/src/defaults/skills/local-provider/SKILL.md +1 -1
- package/src/defaults/skills/memory-management/SKILL.md +1 -1
- package/src/defaults/skills/pdf/SKILL.md +3 -2
- package/src/defaults/skills/pptx/SKILL.md +18 -13
- package/src/defaults/skills/pptx/references/charts.md +10 -5
- package/src/defaults/skills/pptx/references/direction.md +1 -1
- package/src/defaults/skills/pptx/references/kit.md +153 -44
- package/src/defaults/skills/pptx/references/pictures.md +10 -1
- package/src/defaults/skills/pptx/scripts/qc-pages.mjs +161 -116
- package/src/defaults/skills/setup/SKILL.md +1 -1
- package/src/defaults/skills/skill-creator/SKILL.md +3 -3
- package/src/defaults/skills/skill-creator/references/design.md +3 -3
- package/src/defaults/skills/xlsx/SKILL.md +10 -7
- package/src/headless-exec.mjs +329 -698
- package/src/headless-json-lifecycle.mjs +461 -0
- package/src/headless-role.mjs +1 -1
- package/src/help.mjs +2 -2
- package/src/lib/keychain-cjs.cjs +7 -8
- package/src/lib/mixdog-debug.cjs +4 -5
- package/src/lib/plugin-paths.cjs +2 -2
- package/src/lib/rules-builder.cjs +22 -61
- package/src/lib/text-utils.cjs +1 -3
- package/src/repl/runtime-handle.mjs +46 -0
- package/src/repl/slash-commands.mjs +130 -0
- package/src/repl/stream-sink.mjs +129 -0
- package/src/repl/turn-output.mjs +51 -0
- package/src/repl.mjs +99 -381
- package/src/rules/agent/40-cycle1-agent.md +4 -3
- package/src/rules/agent/AGENT.md +11 -11
- package/src/rules/lead/LEAD.md +14 -12
- package/src/rules/shared/05-parallel-calls.md +3 -5
- package/src/rules/shared/15-skills.md +4 -0
- package/src/rules/shared/45-destructive.md +4 -4
- package/src/rules/shared/70-delivery.md +10 -3
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/abort-link.mjs +44 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/ask-args.mjs +128 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/preset.mjs +72 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/session-prep.mjs +114 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/turn.mjs +111 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/watchdog.mjs +80 -0
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +112 -606
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +1 -2
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +84 -88
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +41 -44
- package/src/runtime/agent/orchestrator/agent-trace-io.mjs +18 -25
- package/src/runtime/agent/orchestrator/agent-trace.mjs +6 -41
- package/src/runtime/agent/orchestrator/cache-break-trace.mjs +3 -2
- package/src/runtime/agent/orchestrator/cache-mtime.mjs +2 -2
- package/src/runtime/agent/orchestrator/config-presets.mjs +1 -1
- package/src/runtime/agent/orchestrator/config-providers-merge.mjs +56 -0
- package/src/runtime/agent/orchestrator/config-storage.mjs +9 -11
- package/src/runtime/agent/orchestrator/config.mjs +37 -77
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +5 -14
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +9 -17
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +11 -17
- package/src/runtime/agent/orchestrator/context/skill-state.mjs +0 -16
- package/src/runtime/agent/orchestrator/dispatch-persist.mjs +2 -2
- package/src/runtime/agent/orchestrator/internal-agents.mjs +4 -7
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +1 -2
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +238 -0
- package/src/runtime/agent/orchestrator/mcp/client-handshake.mjs +70 -0
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +110 -0
- package/src/runtime/agent/orchestrator/mcp/client.mjs +89 -438
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +167 -71
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +55 -116
- package/src/runtime/agent/orchestrator/providers/anthropic-api-recovery.mjs +75 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +152 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-api-transport.mjs +168 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +0 -10
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-fast-mode.mjs +3 -11
- package/src/runtime/agent/orchestrator/providers/anthropic-leaked-toolcall.mjs +8 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +2 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +25 -13
- package/src/runtime/agent/orchestrator/providers/anthropic-midstream-recovery.mjs +248 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +11 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +2 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +6 -6
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-midstream.mjs +33 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-recovery.mjs +131 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/abort-wiring.mjs +67 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/gzip-post.mjs +52 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/initial-status.mjs +75 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request.mjs +136 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +205 -798
- package/src/runtime/agent/orchestrator/providers/anthropic-recovery-guards.mjs +86 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-server-fallback.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/leak-guard.mjs +75 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-blocks.mjs +112 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events/content-block-delta.mjs +86 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events/content-block-start.mjs +82 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events/content-block-stop.mjs +101 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events/message-events.mjs +67 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events.mjs +22 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-outcome.mjs +156 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-state.mjs +37 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn.mjs +55 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-watchdogs.mjs +162 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +78 -918
- package/src/runtime/agent/orchestrator/providers/anthropic-turn-result.mjs +88 -0
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +88 -594
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +7 -2
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +4 -5
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +42 -299
- package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +31 -24
- package/src/runtime/agent/orchestrator/providers/antigravity-response.mjs +101 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-stream.mjs +161 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-transport.mjs +114 -0
- package/src/runtime/agent/orchestrator/providers/api-usage.mjs +2 -7
- package/src/runtime/agent/orchestrator/providers/cursor-auth.mjs +8 -9
- package/src/runtime/agent/orchestrator/providers/cursor-wire-exec.mjs +368 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-models.mjs +96 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-normalization.mjs +182 -103
- package/src/runtime/agent/orchestrator/providers/cursor-wire-protobuf.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/cursor-wire-request.mjs +197 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-stream-bridge.mjs +157 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-stream-messages.mjs +106 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-stream-sink.mjs +53 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-transport.mjs +269 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire.mjs +117 -1246
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +261 -183
- package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/gemini-cache-policy.mjs +266 -0
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/gemini-request-body.mjs +54 -0
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +145 -0
- package/src/runtime/agent/orchestrator/providers/gemini-rest-stream/sse-lines.mjs +21 -0
- package/src/runtime/agent/orchestrator/providers/gemini-rest-stream/watchdogs.mjs +68 -0
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +65 -56
- package/src/runtime/agent/orchestrator/providers/gemini-sdk-request.mjs +107 -0
- package/src/runtime/agent/orchestrator/providers/gemini-sdk-stream/cancellation.mjs +71 -0
- package/src/runtime/agent/orchestrator/providers/gemini-sdk-stream/reader.mjs +108 -0
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +71 -283
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +431 -781
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +3 -4
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +16 -24
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +2 -8
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +17 -12
- package/src/runtime/agent/orchestrator/providers/lib/gemini-model-catalog.mjs +9 -7
- package/src/runtime/agent/orchestrator/providers/lib/grok-tool-schema.mjs +77 -63
- package/src/runtime/agent/orchestrator/providers/lib/oauth-pkce.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/lib/openai-tool-args.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/lib/responses-terminal-fields.mjs +28 -0
- package/src/runtime/agent/orchestrator/providers/lib/stream-outcome.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/lib/usage-primitives.mjs +0 -7
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +93 -50
- package/src/runtime/agent/orchestrator/providers/model-cache.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/model-catalog-projection.mjs +9 -7
- package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +21 -21
- package/src/runtime/agent/orchestrator/providers/model-list-sanitize.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/model-pricing-rates.mjs +8 -7
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +167 -124
- package/src/runtime/agent/orchestrator/providers/openai-codex-metadata.mjs +5 -5
- package/src/runtime/agent/orchestrator/providers/openai-codex-model.mjs +5 -8
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +243 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/chunk-events.mjs +46 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-result.mjs +82 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +127 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/tool-call-acc.mjs +69 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream.mjs +35 -302
- package/src/runtime/agent/orchestrator/providers/openai-compat-models.mjs +78 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-options.mjs +76 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-response-normalization.mjs +358 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-events.mjs +342 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-state.mjs +172 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +51 -43
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream-common.mjs +24 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +32 -534
- package/src/runtime/agent/orchestrator/providers/openai-compat-trace.mjs +2 -8
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +11 -11
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +262 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +23 -24
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +35 -970
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-request.mjs +228 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/output-items.mjs +110 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/terminal-frames.mjs +122 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events.mjs +69 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-items.mjs +142 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-outcome.mjs +101 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-stamps.mjs +114 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-state.mjs +74 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/text-relay.mjs +114 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state.mjs +45 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-watchdogs.mjs +176 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-catalog.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-dispatch.mjs +258 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +70 -1095
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +3 -3
- package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +3 -3
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +98 -1504
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +49 -215
- package/src/runtime/agent/orchestrator/providers/openai-responses-input.mjs +80 -60
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +160 -141
- package/src/runtime/agent/orchestrator/providers/openai-startup-prewarm.mjs +4 -7
- package/src/runtime/agent/orchestrator/providers/openai-transport-policy.mjs +6 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-delta.mjs +12 -11
- package/src/runtime/agent/orchestrator/providers/openai-ws-events.mjs +4 -11
- package/src/runtime/agent/orchestrator/providers/openai-ws-handshake.mjs +108 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-headers.mjs +5 -18
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +193 -306
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state/citations.mjs +53 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state/replay-items.mjs +80 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state/tool-calls.mjs +245 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state/usage.mjs +15 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state.mjs +227 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send/acquire-attempt.mjs +94 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send/attempt-request.mjs +145 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send/reasoning-replay.mjs +36 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send/send-context.mjs +154 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/attempt-context.mjs +74 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/handshake-failure.mjs +105 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/policy.mjs +142 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/stream-failure-stamps.mjs +81 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/stream-failure.mjs +109 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts.mjs +63 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-outcome.mjs +384 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-span.mjs +93 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-trace.mjs +316 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +125 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/outcome.mjs +28 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/socket-handlers.mjs +192 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/terminal-frames.mjs +118 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/turn-state-headers.mjs +106 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +139 -1447
- package/src/runtime/agent/orchestrator/providers/openai-ws-terminal.mjs +120 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-text-relay.mjs +84 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-warmup.mjs +171 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +204 -0
- package/src/runtime/agent/orchestrator/providers/opencode-go-usage.mjs +76 -253
- package/src/runtime/agent/orchestrator/providers/provider-catalog-cache.mjs +3 -3
- package/src/runtime/agent/orchestrator/providers/registry.mjs +13 -0
- package/src/runtime/agent/orchestrator/providers/retry-backoff.mjs +219 -0
- package/src/runtime/agent/orchestrator/providers/retry-classification.mjs +575 -0
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +52 -1317
- package/src/runtime/agent/orchestrator/providers/retry-executor.mjs +263 -0
- package/src/runtime/agent/orchestrator/providers/retry-midstream.mjs +345 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool/owner-affinity.mjs +121 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool/pool-tasks.mjs +74 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool/stream-order.mjs +71 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool/worker-slots/pending-queue.mjs +54 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool/worker-slots/slot-pick.mjs +28 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool/worker-slots/slot-spawn.mjs +92 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool/worker-slots.mjs +165 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-pool.mjs +66 -492
- package/src/runtime/agent/orchestrator/providers/trace-utils.mjs +10 -4
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +28 -551
- package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +105 -117
- package/src/runtime/agent/orchestrator/session/compact/budget.mjs +18 -17
- package/src/runtime/agent/orchestrator/session/compact/constants.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +9 -8
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +333 -246
- package/src/runtime/agent/orchestrator/session/compact/summary-schema.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/compact/summary.mjs +47 -341
- package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/context-compaction-policy.mjs +9 -13
- package/src/runtime/agent/orchestrator/session/context-tool-pairs.mjs +295 -0
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +220 -434
- package/src/runtime/agent/orchestrator/session/eager-dispatch/admission.mjs +132 -0
- package/src/runtime/agent/orchestrator/session/eager-dispatch/barriers.mjs +120 -0
- package/src/runtime/agent/orchestrator/session/eager-dispatch/entry.mjs +98 -0
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +51 -323
- package/src/runtime/agent/orchestrator/session/evidence-union.mjs +21 -551
- package/src/runtime/agent/orchestrator/session/explicit-skills.mjs +0 -3
- package/src/runtime/agent/orchestrator/session/loop/arg-schema-coerce.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/loop/assistant-commit.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/loop/compact-debug.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +147 -100
- package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/loop/context-overflow.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/loop/diagnostics.mjs +1 -8
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +142 -81
- package/src/runtime/agent/orchestrator/session/loop/hidden-agents.mjs +5 -5
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +183 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/continuation.mjs +48 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/diagnostic.mjs +8 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/empty-nudge.mjs +32 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/output-limit.mjs +39 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/refusal.mjs +25 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/segments.mjs +42 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +42 -200
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/request-projection.mjs +5 -8
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +297 -0
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +11 -13
- package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +7 -7
- package/src/runtime/agent/orchestrator/session/loop/termination.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/test-isolation.mjs +73 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +3 -6
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/after-hook.mjs +36 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +74 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/call-prep.mjs +106 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +103 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/read-only-deadline.mjs +113 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +59 -422
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +9 -12
- package/src/runtime/agent/orchestrator/session/loop/tool-phase.mjs +86 -0
- package/src/runtime/agent/orchestrator/session/loop/transcript-repair.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/usage.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/manager/agent-runtime-singleton.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-call-interrupt.mjs +52 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-queue.mjs +96 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +149 -1447
- package/src/runtime/agent/orchestrator/session/manager/ask-support.mjs +48 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-commit.mjs +184 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +180 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-failure.mjs +209 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +191 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-open.mjs +132 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-prepare.mjs +247 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +199 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-state.mjs +126 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-steering-drain.mjs +63 -0
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +301 -256
- package/src/runtime/agent/orchestrator/session/manager/delivered-completions.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/manager/failed-turn-rewind.mjs +47 -0
- package/src/runtime/agent/orchestrator/session/manager/foreign-pending-messages.mjs +81 -66
- package/src/runtime/agent/orchestrator/session/manager/idle-cleanup.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/message-sanitize.mjs +6 -25
- package/src/runtime/agent/orchestrator/session/manager/pending-claim-ledger.mjs +68 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-delivered-ledger.mjs +56 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-lifecycle-epoch.mjs +84 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +13 -12
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +58 -670
- package/src/runtime/agent/orchestrator/session/manager/pending-persist-queue.mjs +264 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-file.mjs +131 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-sweep.mjs +73 -0
- package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge/file-entries.mjs +36 -0
- package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge/file-prefetch.mjs +85 -0
- package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge/symbol-prefetch.mjs +31 -0
- package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge.mjs +36 -203
- package/src/runtime/agent/orchestrator/session/manager/prepared-resume-cache.mjs +122 -0
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +2 -31
- package/src/runtime/agent/orchestrator/session/manager/rules-source-cache.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +10 -6
- package/src/runtime/agent/orchestrator/session/manager/runtime-loaders.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +60 -33
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +156 -163
- package/src/runtime/agent/orchestrator/session/manager/session-id.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +195 -714
- package/src/runtime/agent/orchestrator/session/manager/session-owner-liveness.mjs +135 -0
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +150 -0
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +154 -0
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +135 -0
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +7 -20
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-context.mjs +5 -12
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +4 -10
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +3 -5
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption-journal.mjs +114 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +75 -164
- package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +204 -173
- package/src/runtime/agent/orchestrator/session/manager.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +448 -464
- package/src/runtime/agent/orchestrator/session/provider-prefix-guard.mjs +24 -33
- package/src/runtime/agent/orchestrator/session/runtime-user-context.mjs +2 -5
- package/src/runtime/agent/orchestrator/session/save-session-worker.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +662 -620
- package/src/runtime/agent/orchestrator/session/store/fs-probe.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/lifecycle-barriers.mjs +275 -0
- package/src/runtime/agent/orchestrator/session/store/lifecycle-read.mjs +67 -0
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +8 -585
- package/src/runtime/agent/orchestrator/session/store/live-cache-eviction.mjs +72 -0
- package/src/runtime/agent/orchestrator/session/store/liveness-veto.mjs +53 -0
- package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/load-session.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/store/paths-heartbeat.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/store/pending-saves.mjs +55 -0
- package/src/runtime/agent/orchestrator/session/store/save-fault.mjs +15 -14
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +221 -207
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +9 -17
- package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +149 -0
- package/src/runtime/agent/orchestrator/session/store/session-observers.mjs +55 -0
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/store/summary-rebuild-worker.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/sweep/stale-sweep.mjs +74 -0
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-finish.mjs +90 -0
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-plan.mjs +81 -0
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-record.mjs +92 -0
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-row.mjs +313 -0
- package/src/runtime/agent/orchestrator/session/store/write-admission.mjs +108 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-pool.mjs +37 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +531 -0
- package/src/runtime/agent/orchestrator/session/store-summary-archived-agent.mjs +126 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +24 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +5 -13
- package/src/runtime/agent/orchestrator/session/store-summary-locations.mjs +46 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +14 -763
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +126 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +41 -779
- package/src/runtime/agent/orchestrator/session/synthetic-user-envelope.mjs +6 -2
- package/src/runtime/agent/orchestrator/session/tool-batch/execute-call.mjs +265 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/finalize.mjs +259 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/flush.mjs +65 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/plan.mjs +99 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +123 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/record-outcome.mjs +160 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/state.mjs +54 -0
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +24 -1061
- package/src/runtime/agent/orchestrator/session/tool-envelope.mjs +7 -5
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +19 -13
- package/src/runtime/agent/orchestrator/stable-hash-stringify.mjs +10 -0
- package/src/runtime/agent/orchestrator/tool-loop-guard.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/bash-policy-scan.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +5 -8
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +67 -87
- package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +155 -159
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/abort-signals.mjs +66 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/backgrounded-result.mjs +82 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/benign-exit.mjs +86 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/command-preflight.mjs +46 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +169 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/deadline-plan.mjs +75 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/inline-hoist.mjs +36 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/invocation-plan.mjs +84 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/result-format.mjs +113 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +24 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/transport-artifacts.mjs +114 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +109 -905
- package/src/runtime/agent/orchestrator/tools/builtin/binary-file.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +9 -4
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +80 -132
- package/src/runtime/agent/orchestrator/tools/builtin/diff-utils.mjs +7 -2
- package/src/runtime/agent/orchestrator/tools/builtin/external-tool-adapters.mjs +251 -210
- package/src/runtime/agent/orchestrator/tools/builtin/find-files-tool.mjs +529 -0
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-policy.mjs +45 -27
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +174 -713
- package/src/runtime/agent/orchestrator/tools/builtin/git-partial-stage.mjs +45 -20
- package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/grep-formatting.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/hash-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-context-expander.mjs +124 -107
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-output.mjs +107 -54
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-path-fanout.mjs +243 -212
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-pattern-fanout.mjs +330 -331
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-request.mjs +290 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-single-file-rescue.mjs +80 -67
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-grep-chunks.mjs +7 -6
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-input-helpers.mjs +13 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-task-output.mjs +112 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/tool-progress.mjs +10 -0
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool-shared.mjs +48 -0
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +314 -791
- package/src/runtime/agent/orchestrator/tools/builtin/native-search-client.mjs +9 -8
- package/src/runtime/agent/orchestrator/tools/builtin/path-diagnostics.mjs +69 -80
- package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +19 -10
- package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-batch.mjs +16 -21
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +0 -5
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +174 -103
- package/src/runtime/agent/orchestrator/tools/builtin/read-image.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-line-collector.mjs +160 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-mode-tool.mjs +14 -14
- package/src/runtime/agent/orchestrator/tools/builtin/read-office-files.mjs +8 -11
- package/src/runtime/agent/orchestrator/tools/builtin/read-open.mjs +3 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +16 -19
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-fast-paths.mjs +178 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-guards.mjs +161 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-media.mjs +53 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-render.mjs +207 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-stream.mjs +79 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +122 -832
- package/src/runtime/agent/orchestrator/tools/builtin/read-snapshot-runtime.mjs +3 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-special-files.mjs +5 -11
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +140 -226
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +126 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-entries.mjs +137 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-render.mjs +158 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-snapshot.mjs +88 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/glob-survey.mjs +100 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/image-fast-path.mjs +32 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/reach-preflight.mjs +95 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +116 -704
- package/src/runtime/agent/orchestrator/tools/builtin/read-window-widen.mjs +42 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-windows.mjs +11 -4
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +47 -30
- package/src/runtime/agent/orchestrator/tools/builtin/search-builders.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +494 -427
- package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +552 -787
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +34 -42
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +16 -22
- package/src/runtime/agent/orchestrator/tools/builtin/shell-lossless-compact.mjs +1 -4
- package/src/runtime/agent/orchestrator/tools/builtin/shell-output.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +3 -5
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-store.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-validation.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +26 -17
- package/src/runtime/agent/orchestrator/tools/builtin/text-stats.mjs +7 -4
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +22 -24
- package/src/runtime/agent/orchestrator/tools/code-graph/aggregate-roots.mjs +9 -10
- package/src/runtime/agent/orchestrator/tools/code-graph/ast-calls.mjs +1 -4
- package/src/runtime/agent/orchestrator/tools/code-graph/build-file-infos.mjs +182 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +15 -160
- package/src/runtime/agent/orchestrator/tools/code-graph/constants.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +94 -87
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/abort-race.mjs +33 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/federation.mjs +144 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/root-resolution.mjs +142 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/work.mjs +125 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +192 -1055
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary/child-kill.mjs +55 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary/jsonl-records.mjs +22 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary/spawn-jsonl.mjs +135 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary.mjs +43 -235
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/calls.mjs +152 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/dependents.mjs +91 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/shared.mjs +81 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/structure.mjs +75 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/symbols.mjs +150 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/project-root.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +43 -42
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +5 -7
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/text-columns.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.golden.json +47 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.mjs +243 -290
- package/src/runtime/agent/orchestrator/tools/code-graph-prewarm-worker.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/env-scrub.mjs +7 -11
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +11 -11
- package/src/runtime/agent/orchestrator/tools/lib/isolated-test-env.mjs +30 -0
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +90 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promotion-results.mjs +158 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background.mjs +142 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +165 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +208 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +175 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-spawn-retry.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/codex-batch.mjs +245 -0
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/request.mjs +96 -0
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/route.mjs +46 -0
- package/src/runtime/agent/orchestrator/tools/patch/constants.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/patch/dispatch/native-proofs.mjs +65 -0
- package/src/runtime/agent/orchestrator/tools/patch/dispatch/native-report.mjs +65 -0
- package/src/runtime/agent/orchestrator/tools/patch/dispatch/native-snapshots.mjs +72 -0
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +35 -174
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +116 -358
- package/src/runtime/agent/orchestrator/tools/patch/mutation-output.mjs +30 -0
- package/src/runtime/agent/orchestrator/tools/patch/native-server.mjs +25 -39
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +69 -1401
- package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +13 -16
- package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +11 -6
- package/src/runtime/agent/orchestrator/tools/patch/post-patch-excerpts.mjs +99 -0
- package/src/runtime/agent/orchestrator/tools/patch/read-redirects.mjs +81 -0
- package/src/runtime/agent/orchestrator/tools/patch/replay-capture.mjs +183 -0
- package/src/runtime/agent/orchestrator/tools/patch/rollback-state.mjs +51 -0
- package/src/runtime/agent/orchestrator/tools/patch/section-coalesce.mjs +82 -0
- package/src/runtime/agent/orchestrator/tools/patch/sequence/report.mjs +88 -0
- package/src/runtime/agent/orchestrator/tools/patch/sequence/run.mjs +70 -0
- package/src/runtime/agent/orchestrator/tools/patch/sequence/units.mjs +132 -0
- package/src/runtime/agent/orchestrator/tools/patch/sequence.mjs +84 -0
- package/src/runtime/agent/orchestrator/tools/patch/text-lines.mjs +267 -0
- package/src/runtime/agent/orchestrator/tools/patch/ui-diff.mjs +108 -0
- package/src/runtime/agent/orchestrator/tools/patch/v4a-anchors.mjs +14 -12
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +447 -455
- package/src/runtime/agent/orchestrator/tools/patch/v4a-windows.mjs +4 -19
- package/src/runtime/agent/orchestrator/tools/patch/wave.mjs +125 -0
- package/src/runtime/agent/orchestrator/tools/patch-binary-fetcher.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch-manifest.json +11 -11
- package/src/runtime/agent/orchestrator/tools/patch.mjs +0 -19
- package/src/runtime/agent/orchestrator/tools/progress-message.mjs +6 -5
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +271 -994
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +7 -13
- package/src/runtime/agent/orchestrator/tools/shell-exec-policy.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/shell-policy.mjs +12 -13
- package/src/runtime/agent/orchestrator/tools/shell-powershell.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +4 -5
- package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +11 -11
- package/src/runtime/agent/orchestrator/tools/tool-batch-trace.mjs +9 -13
- package/src/runtime/attachments/store.mjs +16 -21
- package/src/runtime/browser-bridge/action-schema.mjs +396 -325
- package/src/runtime/browser-bridge/client.mjs +20 -18
- package/src/runtime/browser-bridge/input-fields.mjs +13 -9
- package/src/runtime/channels/index.mjs +1 -1
- package/src/runtime/channels/lib/config.mjs +1 -10
- package/src/runtime/channels/lib/crash-log.mjs +4 -4
- package/src/runtime/channels/lib/event-pipeline.mjs +8 -8
- package/src/runtime/channels/lib/event-queue.mjs +18 -24
- package/src/runtime/channels/lib/executor.mjs +12 -91
- package/src/runtime/channels/lib/owned-runtime/automation-services.mjs +105 -0
- package/src/runtime/channels/lib/owned-runtime/automation-start.mjs +44 -0
- package/src/runtime/channels/lib/owned-runtime/config-reload.mjs +79 -0
- package/src/runtime/channels/lib/owned-runtime/owned-start.mjs +172 -0
- package/src/runtime/channels/lib/owned-runtime/owned-stop.mjs +59 -0
- package/src/runtime/channels/lib/owned-runtime/ownership-refresh.mjs +36 -0
- package/src/runtime/channels/lib/owned-runtime/state.mjs +22 -0
- package/src/runtime/channels/lib/owned-runtime.mjs +45 -488
- package/src/runtime/channels/lib/owner-heartbeat.mjs +0 -4
- package/src/runtime/channels/lib/parent-bridge.mjs +2 -2
- package/src/runtime/channels/lib/runtime-paths.mjs +35 -41
- package/src/runtime/channels/lib/scheduler.mjs +155 -147
- package/src/runtime/channels/lib/settings.mjs +1 -1
- package/src/runtime/channels/lib/state-file.mjs +1 -6
- package/src/runtime/channels/lib/status-snapshot.mjs +53 -53
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +17 -25
- package/src/runtime/channels/lib/voice-transcription.mjs +132 -109
- package/src/runtime/channels/lib/webhook/deliveries.mjs +0 -5
- package/src/runtime/channels/lib/webhook/listener-lifecycle.mjs +119 -0
- package/src/runtime/channels/lib/webhook/log.mjs +3 -3
- package/src/runtime/channels/lib/webhook/relay-tunnel/leg-heartbeat.mjs +35 -0
- package/src/runtime/channels/lib/webhook/relay-tunnel/limits.mjs +6 -0
- package/src/runtime/channels/lib/webhook/relay-tunnel/local-forward.mjs +93 -0
- package/src/runtime/channels/lib/webhook/relay-tunnel.mjs +50 -168
- package/src/runtime/channels/lib/webhook/request-handler.mjs +258 -0
- package/src/runtime/channels/lib/webhook/session-dispatch.mjs +132 -0
- package/src/runtime/channels/lib/webhook/signature.mjs +1 -1
- package/src/runtime/channels/lib/webhook/verification.mjs +103 -0
- package/src/runtime/channels/lib/webhook.mjs +46 -497
- package/src/runtime/channels/lib/whisper-language.mjs +3 -10
- package/src/runtime/channels/lib/worker-bootstrap.mjs +51 -43
- package/src/runtime/channels/lib/worker-ipc.mjs +4 -4
- package/src/runtime/channels/lib/worker-main.mjs +9 -13
- package/src/runtime/computer-bridge/action-schema.mjs +200 -133
- package/src/runtime/computer-bridge/actions.mjs +19 -2
- package/src/runtime/computer-bridge/capture-size.mjs +8 -2
- package/src/runtime/computer-bridge/client.mjs +179 -147
- package/src/runtime/computer-bridge/core-actions.mjs +158 -101
- package/src/runtime/computer-bridge/pending-continuation.mjs +4 -7
- package/src/runtime/github/client.mjs +7 -10
- package/src/runtime/github/commands.mjs +9 -3
- package/src/runtime/github/contract.mjs +10 -1
- package/src/runtime/local-provider/asset-installer.mjs +5 -7
- package/src/runtime/local-provider/catalog.mjs +4 -3
- package/src/runtime/local-provider/hardware.mjs +7 -20
- package/src/runtime/local-provider/model-state.mjs +8 -6
- package/src/runtime/local-provider/resumable-installations.mjs +12 -19
- package/src/runtime/local-provider/server-process/child-state.mjs +73 -0
- package/src/runtime/local-provider/server-process/readiness.mjs +42 -0
- package/src/runtime/local-provider/server-process.mjs +28 -113
- package/src/runtime/media/adapters/codex-image.mjs +1 -1
- package/src/runtime/media/adapters/xai-media.mjs +7 -2
- package/src/runtime/media/auth.mjs +16 -13
- package/src/runtime/media/catalog-errors.mjs +3 -5
- package/src/runtime/media/catalog.mjs +18 -12
- package/src/runtime/media/defaults.mjs +2 -2
- package/src/runtime/media/jobs.mjs +1 -2
- package/src/runtime/media/lanes.mjs +2 -1
- package/src/runtime/media/renditions.mjs +11 -10
- package/src/runtime/media/store.mjs +7 -9
- package/src/runtime/media/tool.mjs +1 -5
- package/src/runtime/memory/data/runtime-manifest.json +9 -9
- package/src/runtime/memory/index.mjs +13 -25
- package/src/runtime/memory/lib/agent-ipc.mjs +1 -1
- package/src/runtime/memory/lib/core-memory-file.mjs +7 -5
- package/src/runtime/memory/lib/core-memory-store.mjs +3 -7
- package/src/runtime/memory/lib/cycle-llm-adapters.mjs +1 -1
- package/src/runtime/memory/lib/cycle-scheduler/backlog-probe.mjs +65 -0
- package/src/runtime/memory/lib/cycle-scheduler/cycle1-runs.mjs +120 -0
- package/src/runtime/memory/lib/cycle-scheduler/cycle2-runs.mjs +120 -0
- package/src/runtime/memory/lib/cycle-scheduler/health-ledger.mjs +96 -0
- package/src/runtime/memory/lib/cycle-scheduler/scheduled-enqueue.mjs +50 -0
- package/src/runtime/memory/lib/cycle-scheduler/tick-loop.mjs +104 -0
- package/src/runtime/memory/lib/cycle-scheduler.mjs +71 -475
- package/src/runtime/memory/lib/cycle-signatures.mjs +1 -2
- package/src/runtime/memory/lib/cycle1/cycle1-plan.mjs +94 -0
- package/src/runtime/memory/lib/cycle1/cycle1-result.mjs +113 -0
- package/src/runtime/memory/lib/cycle1/cycle1-rows.mjs +194 -0
- package/src/runtime/memory/lib/cycle1/cycle1-window.mjs +193 -0
- package/src/runtime/memory/lib/embedding-provider.mjs +12 -22
- package/src/runtime/memory/lib/embedding-worker.mjs +31 -37
- package/src/runtime/memory/lib/http-router/admin-routes.mjs +167 -0
- package/src/runtime/memory/lib/http-router/admin-trace-routes.mjs +65 -0
- package/src/runtime/memory/lib/http-router/ingest-routes.mjs +122 -0
- package/src/runtime/memory/lib/http-router/lifecycle-routes.mjs +96 -0
- package/src/runtime/memory/lib/http-router/mcp-route.mjs +49 -0
- package/src/runtime/memory/lib/http-router/session-routes.mjs +67 -0
- package/src/runtime/memory/lib/http-router/tool-routes.mjs +84 -0
- package/src/runtime/memory/lib/http-router.mjs +43 -659
- package/src/runtime/memory/lib/http-wire.mjs +1 -2
- package/src/runtime/memory/lib/ingest/ingest-embed-flush.mjs +72 -0
- package/src/runtime/memory/lib/ingest/ingest-insert.mjs +66 -0
- package/src/runtime/memory/lib/ingest/ingest-occurrences.mjs +109 -0
- package/src/runtime/memory/lib/ingest/ordinal-state.mjs +181 -0
- package/src/runtime/memory/lib/ingest/transcript-discovery.mjs +52 -0
- package/src/runtime/memory/lib/ingest/transcript-offsets.mjs +54 -0
- package/src/runtime/memory/lib/ingest/transcript-rows.mjs +81 -0
- package/src/runtime/memory/lib/ingest/transcript-tail.mjs +110 -0
- package/src/runtime/memory/lib/ingest/transcript-watcher.mjs +216 -0
- package/src/runtime/memory/lib/light-ko-morph.mjs +1 -1
- package/src/runtime/memory/lib/memory-action-handlers/core-actions.mjs +127 -0
- package/src/runtime/memory/lib/memory-action-handlers/cycle-actions.mjs +153 -0
- package/src/runtime/memory/lib/memory-action-handlers/cycle-backfill-action.mjs +84 -0
- package/src/runtime/memory/lib/memory-action-handlers/cycle-rebuild-action.mjs +94 -0
- package/src/runtime/memory/lib/memory-action-handlers/maintenance-actions.mjs +76 -0
- package/src/runtime/memory/lib/memory-action-handlers/manage-actions.mjs +220 -0
- package/src/runtime/memory/lib/memory-action-handlers.mjs +49 -679
- package/src/runtime/memory/lib/memory-categories.mjs +13 -0
- package/src/runtime/memory/lib/memory-chunk-quality.mjs +193 -94
- package/src/runtime/memory/lib/memory-config-flags.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle-requests.mjs +70 -88
- package/src/runtime/memory/lib/memory-cycle1.mjs +66 -558
- package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +4 -3
- package/src/runtime/memory/lib/memory-cycle2-review.mjs +5 -3
- package/src/runtime/memory/lib/memory-cycle2-shared.mjs +2 -2
- package/src/runtime/memory/lib/memory-embed.mjs +14 -11
- package/src/runtime/memory/lib/memory-extraction.mjs +1 -1
- package/src/runtime/memory/lib/memory-ops-policy.mjs +3 -2
- package/src/runtime/memory/lib/memory-process-lock.mjs +1 -1
- package/src/runtime/memory/lib/memory-recall-scope-filter.mjs +8 -4
- package/src/runtime/memory/lib/memory-recall-store.mjs +70 -678
- package/src/runtime/memory/lib/memory-schema/core-and-meta.mjs +60 -0
- package/src/runtime/memory/lib/memory-schema/entries.mjs +94 -0
- package/src/runtime/memory/lib/memory-schema/entry-triggers.mjs +54 -0
- package/src/runtime/memory/lib/memory-schema/score-params.mjs +66 -0
- package/src/runtime/memory/lib/memory-text-utils.mjs +10 -10
- package/src/runtime/memory/lib/memory.mjs +21 -295
- package/src/runtime/memory/lib/model-profile.mjs +1 -1
- package/src/runtime/memory/lib/pg/adapter.mjs +7 -6
- package/src/runtime/memory/lib/pg/process.mjs +259 -267
- package/src/runtime/memory/lib/pg/supervisor.mjs +11 -17
- package/src/runtime/memory/lib/query-core-recall.mjs +82 -0
- package/src/runtime/memory/lib/query-fan-out.mjs +66 -0
- package/src/runtime/memory/lib/query-handlers.mjs +61 -1124
- package/src/runtime/memory/lib/query-hybrid-search.mjs +369 -0
- package/src/runtime/memory/lib/query-id-lookup.mjs +60 -0
- package/src/runtime/memory/lib/query-last-browse.mjs +266 -0
- package/src/runtime/memory/lib/query-maintenance-handlers.mjs +115 -91
- package/src/runtime/memory/lib/query-ranking.mjs +13 -14
- package/src/runtime/memory/lib/query-raw-merge.mjs +27 -0
- package/src/runtime/memory/lib/query-raw-window.mjs +64 -0
- package/src/runtime/memory/lib/query-search-plan.mjs +117 -0
- package/src/runtime/memory/lib/query-session-recall.mjs +153 -0
- package/src/runtime/memory/lib/query-window-browse.mjs +63 -0
- package/src/runtime/memory/lib/recall-event-context.mjs +1 -1
- package/src/runtime/memory/lib/recall-format.mjs +322 -289
- package/src/runtime/memory/lib/recall-hybrid/concept-expansion.mjs +211 -0
- package/src/runtime/memory/lib/recall-hybrid/hybrid-sql.mjs +250 -0
- package/src/runtime/memory/lib/recall-hybrid/members.mjs +33 -0
- package/src/runtime/memory/lib/recall-hybrid/plan.mjs +80 -0
- package/src/runtime/memory/lib/recall-hybrid/root-resolution.mjs +131 -0
- package/src/runtime/memory/lib/runtime-fetcher.mjs +77 -71
- package/src/runtime/memory/lib/session-ingest-runtime.mjs +50 -433
- package/src/runtime/memory/lib/session-ingest.mjs +8 -136
- package/src/runtime/memory/lib/tool-call-handler.mjs +2 -3
- package/src/runtime/memory/lib/trace-store/agent-call-inserts.mjs +90 -0
- package/src/runtime/memory/lib/trace-store/agent-call-rows.mjs +81 -0
- package/src/runtime/memory/lib/trace-store/agent-session-summary.mjs +65 -0
- package/src/runtime/memory/lib/trace-store.mjs +21 -260
- package/src/runtime/memory/lib/transcript-ingest.mjs +38 -478
- package/src/runtime/memory/tool-defs.mjs +5 -8
- package/src/runtime/office/README.md +3 -2
- package/src/runtime/office/authoring/pptx-author-action.mjs +140 -72
- package/src/runtime/office/authoring/pptx-author-session.mjs +6 -9
- package/src/runtime/office/authoring/pptx-brief.mjs +63 -20
- package/src/runtime/office/authoring/pptx-contact-sheet.mjs +3 -1
- package/src/runtime/office/authoring/pptx-receipt.mjs +89 -69
- package/src/runtime/office/authoring/pptx-script-normalize.mjs +1 -1
- package/src/runtime/office/bench/benchmark.mjs +102 -82
- package/src/runtime/office/bench/deck-bench.mjs +6 -3
- package/src/runtime/office/bench/quality-live-benchmark.mjs +33 -0
- package/src/runtime/office/capabilities-aliases.mjs +61 -0
- package/src/runtime/office/capabilities-catalog.mjs +593 -0
- package/src/runtime/office/capabilities-signatures.mjs +588 -0
- package/src/runtime/office/capabilities.mjs +265 -1460
- package/src/runtime/office/com/com-adapter.mjs +15 -3
- package/src/runtime/office/com/office-com-host.ps1 +5246 -4978
- package/src/runtime/office/core/office-actions-batch.mjs +365 -324
- package/src/runtime/office/core/office-actions-inspect.mjs +108 -115
- package/src/runtime/office/core/office-actions-lifecycle.mjs +39 -253
- package/src/runtime/office/core/office-actions-open.mjs +30 -41
- package/src/runtime/office/core/office-actions-render.mjs +30 -258
- package/src/runtime/office/core/office-core.mjs +34 -25
- package/src/runtime/office/core/office-documents.mjs +3 -1
- package/src/runtime/office/core/office-finalize/commit-stage.mjs +54 -0
- package/src/runtime/office/core/office-finalize/holds.mjs +57 -0
- package/src/runtime/office/core/office-finalize/review-stage.mjs +90 -0
- package/src/runtime/office/core/office-finalize/session-save.mjs +50 -0
- package/src/runtime/office/core/office-qa/design-review-stage.mjs +80 -0
- package/src/runtime/office/core/office-qa/fix-operations.mjs +47 -0
- package/src/runtime/office/core/office-qa/preview-stage.mjs +90 -0
- package/src/runtime/office/core/office-qa/review-assembly.mjs +87 -0
- package/src/runtime/office/core/office-recalculation.mjs +2 -2
- package/src/runtime/office/core/office-render-preview.mjs +11 -13
- package/src/runtime/office/core/office-session-dispatch.mjs +86 -0
- package/src/runtime/office/core/office-sessionless-actions.mjs +115 -0
- package/src/runtime/office/core/office-sessions.mjs +275 -288
- package/src/runtime/office/core/office-transactions.mjs +2 -4
- package/src/runtime/office/core/pagination.mjs +6 -6
- package/src/runtime/office/core/pptx-page-cache.mjs +1 -1
- package/src/runtime/office/core/tabular.mjs +24 -22
- package/src/runtime/office/design/composition-system.mjs +35 -29
- package/src/runtime/office/design/content-model.mjs +5 -2
- package/src/runtime/office/design/design-art-direction.mjs +22 -15
- package/src/runtime/office/design/design-creative-director.mjs +8 -9
- package/src/runtime/office/design/design-discipline.mjs +23 -18
- package/src/runtime/office/design/design-system.mjs +5 -8
- package/src/runtime/office/design/design-tokens.mjs +42 -33
- package/src/runtime/office/design/docx/design-docx/front-matter.mjs +81 -0
- package/src/runtime/office/design/docx/design-docx/section.mjs +114 -0
- package/src/runtime/office/design/docx/design-docx/writer.mjs +57 -0
- package/src/runtime/office/design/docx/design-docx-components.mjs +104 -173
- package/src/runtime/office/design/docx/design-docx.mjs +19 -222
- package/src/runtime/office/design/library/design-library-core.mjs +1 -1
- package/src/runtime/office/design/library/design-library-pack.mjs +11 -23
- package/src/runtime/office/design/library/design-library.mjs +23 -43
- package/src/runtime/office/design/library/design-template-fill.mjs +159 -0
- package/src/runtime/office/design/library/design-template-index.mjs +213 -174
- package/src/runtime/office/design/library/design-template-induct.mjs +223 -0
- package/src/runtime/office/design/library/design-template-inspect.mjs +165 -121
- package/src/runtime/office/design/native-design.mjs +2 -3
- package/src/runtime/office/design/xlsx/design-xlsx-components.mjs +12 -15
- package/src/runtime/office/design/xlsx/design-xlsx.mjs +450 -359
- package/src/runtime/office/index.mjs +7 -158
- package/src/runtime/office/pdf/pdf-adapter.mjs +41 -817
- package/src/runtime/office/pdf/pdf-analysis.mjs +385 -585
- package/src/runtime/office/pdf/pdf-batch-content.mjs +349 -0
- package/src/runtime/office/pdf/pdf-batch-structure.mjs +240 -0
- package/src/runtime/office/pdf/pdf-document.mjs +41 -0
- package/src/runtime/office/pdf/pdf-draw.mjs +1 -1
- package/src/runtime/office/pdf/pdf-edit-document.mjs +142 -0
- package/src/runtime/office/pdf/pdf-fonts.mjs +1 -1
- package/src/runtime/office/pdf/pdf-forms.mjs +3 -1
- package/src/runtime/office/pdf/pdf-marks.mjs +123 -0
- package/src/runtime/office/pdf/pdf-ocr.mjs +348 -0
- package/src/runtime/office/pdf/pdf-render.mjs +12 -13
- package/src/runtime/office/pdf/pdf-search.mjs +4 -1
- package/src/runtime/office/pdf/pdf-security.mjs +37 -9
- package/src/runtime/office/pdf/pdf-writer.mjs +670 -412
- package/src/runtime/office/portable/docx-revisions.mjs +15 -13
- package/src/runtime/office/portable/docx-runs.mjs +7 -12
- package/src/runtime/office/portable/docx-tracked-edits.mjs +15 -11
- package/src/runtime/office/portable/font-provisioner.mjs +2 -2
- package/src/runtime/office/portable/ooxml-validator.mjs +4 -1
- package/src/runtime/office/portable/portable-cells.mjs +67 -79
- package/src/runtime/office/portable/portable-chart-faults.mjs +42 -11
- package/src/runtime/office/portable/portable-chart.mjs +21 -17
- package/src/runtime/office/portable/portable-docx-edits.mjs +771 -0
- package/src/runtime/office/portable/portable-docx-operations.mjs +742 -0
- package/src/runtime/office/portable/portable-docx-parts.mjs +83 -63
- package/src/runtime/office/portable/portable-docx-xml.mjs +93 -65
- package/src/runtime/office/portable/portable-docx.mjs +84 -1340
- package/src/runtime/office/portable/portable-ooxml.mjs +5 -6
- package/src/runtime/office/portable/portable-opc.mjs +128 -34
- package/src/runtime/office/portable/portable-package.mjs +21 -30
- package/src/runtime/office/portable/portable-pivot.mjs +35 -30
- package/src/runtime/office/portable/portable-pptx-chart.mjs +7 -6
- package/src/runtime/office/portable/portable-pptx-charts.mjs +75 -65
- package/src/runtime/office/portable/portable-pptx-core.mjs +103 -113
- package/src/runtime/office/portable/portable-pptx-deck.mjs +21 -21
- package/src/runtime/office/portable/portable-pptx-package.mjs +23 -30
- package/src/runtime/office/portable/portable-pptx-shapes.mjs +370 -326
- package/src/runtime/office/portable/portable-shared-formulas.mjs +92 -0
- package/src/runtime/office/portable/portable-sheet-audits.mjs +394 -0
- package/src/runtime/office/portable/portable-sheet-page.mjs +22 -23
- package/src/runtime/office/portable/portable-sheet-parts.mjs +4 -5
- package/src/runtime/office/portable/portable-sheet-styles.mjs +19 -26
- package/src/runtime/office/portable/portable-sheet-xml.mjs +43 -36
- package/src/runtime/office/portable/portable-slide-shapes.mjs +48 -28
- package/src/runtime/office/portable/portable-snapshot-docx.mjs +622 -0
- package/src/runtime/office/portable/portable-snapshot-pptx.mjs +254 -0
- package/src/runtime/office/portable/portable-snapshot-shared.mjs +106 -0
- package/src/runtime/office/portable/portable-snapshot-xlsx.mjs +452 -0
- package/src/runtime/office/portable/portable-snapshot.mjs +8 -1134
- package/src/runtime/office/portable/portable-soffice.mjs +395 -234
- package/src/runtime/office/portable/portable-validation-package.mjs +310 -0
- package/src/runtime/office/portable/portable-validation.mjs +652 -1109
- package/src/runtime/office/portable/portable-xlsx-cell-values.mjs +15 -0
- package/src/runtime/office/portable/portable-xlsx-charts.mjs +192 -0
- package/src/runtime/office/portable/portable-xlsx-drawings.mjs +323 -0
- package/src/runtime/office/portable/portable-xlsx-operations.mjs +404 -0
- package/src/runtime/office/portable/portable-xlsx-pivot-ops.mjs +94 -0
- package/src/runtime/office/portable/portable-xlsx-range-layout.mjs +236 -0
- package/src/runtime/office/portable/portable-xlsx-sheet-edits.mjs +536 -0
- package/src/runtime/office/portable/portable-xlsx.mjs +135 -1387
- package/src/runtime/office/portable/portable-xml.mjs +13 -8
- package/src/runtime/office/portable/pptx-relations.mjs +12 -1
- package/src/runtime/office/portable/pptx-targets.mjs +2 -1
- package/src/runtime/office/portable/review-editability.mjs +7 -12
- package/src/runtime/office/portable/text-metrics.mjs +156 -139
- package/src/runtime/office/portable/xlsx-assertions.mjs +2 -15
- package/src/runtime/office/portable/xlsx-audit-support.mjs +2 -6
- package/src/runtime/office/portable/xlsx-contract.mjs +136 -106
- package/src/runtime/office/portable/xlsx-formula-audit.mjs +253 -118
- package/src/runtime/office/portable/xlsx-formula-engine.mjs +549 -0
- package/src/runtime/office/portable/xlsx-recalculate.mjs +278 -0
- package/src/runtime/office/portable/xlsx-sheet-hygiene.mjs +103 -27
- package/src/runtime/office/quality/assurance-checklist.mjs +82 -60
- package/src/runtime/office/quality/assurance-issue.mjs +5 -0
- package/src/runtime/office/quality/assurance-rendered.mjs +3 -2
- package/src/runtime/office/quality/assurance-structure-docx.mjs +205 -0
- package/src/runtime/office/quality/assurance-structure-pptx.mjs +763 -0
- package/src/runtime/office/quality/assurance-structure-xlsx.mjs +256 -0
- package/src/runtime/office/quality/assurance-structure.mjs +4 -798
- package/src/runtime/office/quality/assurance-trust.mjs +65 -55
- package/src/runtime/office/quality/design-aesthetics.mjs +175 -151
- package/src/runtime/office/quality/design-deck-diversity.mjs +87 -53
- package/src/runtime/office/quality/design-review-authored.mjs +2 -2
- package/src/runtime/office/quality/design-review-critique.mjs +43 -43
- package/src/runtime/office/quality/design-review.mjs +123 -109
- package/src/runtime/office/quality/document-acceptance.mjs +18 -10
- package/src/runtime/office/quality/inline-audit.mjs +9 -3
- package/src/runtime/office/quality/pptx-deck-rubric.mjs +14 -6
- package/src/runtime/office/quality/pptx-slide-roles.mjs +7 -9
- package/src/runtime/office/quality/presentation-acceptance.mjs +4 -12
- package/src/runtime/office/quality/quality-pipeline.mjs +70 -25
- package/src/runtime/office/quality/quality-score.mjs +7 -9
- package/src/runtime/office/quality/render-air.mjs +12 -5
- package/src/runtime/office/quality/visual-diff.mjs +0 -2
- package/src/runtime/shared/abort-controller.mjs +1 -1
- package/src/runtime/shared/agent-reap-state.mjs +35 -0
- package/src/runtime/shared/atomic-file.mjs +24 -13
- package/src/runtime/shared/automation-attachments.mjs +5 -4
- package/src/runtime/shared/background-tasks.mjs +44 -9
- package/src/runtime/shared/boot-profile.mjs +6 -2
- package/src/runtime/shared/buffered-appender.mjs +1 -1
- package/src/runtime/shared/child-spawn-gate.mjs +2 -2
- package/src/runtime/shared/code-point-order.mjs +5 -0
- package/src/runtime/shared/config-patch.mjs +9 -12
- package/src/runtime/shared/config.mjs +12 -18
- package/src/runtime/shared/err-text.mjs +11 -6
- package/src/runtime/shared/error-presentation.mjs +2 -8
- package/src/runtime/shared/extension-scopes.mjs +3 -1
- package/src/runtime/shared/file-lock.mjs +12 -7
- package/src/runtime/shared/injected-display-text.mjs +38 -0
- package/src/runtime/shared/inline-file-kind.mjs +51 -0
- package/src/runtime/shared/llm/cost.mjs +6 -9
- package/src/runtime/shared/llm/http-agent.mjs +1 -1
- package/src/runtime/shared/llm/index.mjs +1 -1
- package/src/runtime/shared/llm/reasoning-usage.mjs +42 -0
- package/src/runtime/shared/llm/usage-accounting.mjs +9 -6
- package/src/runtime/shared/llm/usage-ledger-import.mjs +3 -1
- package/src/runtime/shared/llm/usage-ledger-repair.mjs +6 -14
- package/src/runtime/shared/llm/usage-ledger-rollup.mjs +272 -0
- package/src/runtime/shared/llm/usage-ledger.mjs +30 -239
- package/src/runtime/shared/llm/usage-rollup.mjs +8 -2
- package/src/runtime/shared/loopback-listener.mjs +1 -6
- package/src/runtime/shared/open-url.mjs +1 -1
- package/src/runtime/shared/orchestration.mjs +2 -2
- package/src/runtime/shared/plugin-paths.mjs +3 -3
- package/src/runtime/shared/pristine-execution.mjs +2 -6
- package/src/runtime/shared/process-lifecycle.mjs +34 -52
- package/src/runtime/shared/process-shutdown.mjs +5 -5
- package/src/runtime/shared/provider-accounts.mjs +109 -11
- package/src/runtime/shared/resource-admission.mjs +32 -8
- package/src/runtime/shared/review-diff.mjs +34 -0
- package/src/runtime/shared/schedule-model-ref.mjs +14 -0
- package/src/runtime/shared/schedule-session-run.mjs +3 -13
- package/src/runtime/shared/schedules-db.mjs +17 -40
- package/src/runtime/shared/schema-value-error.mjs +3 -5
- package/src/runtime/shared/skill-selection.mjs +3 -1
- package/src/runtime/shared/staged-child-result.mjs +2 -9
- package/src/runtime/shared/staged-update.mjs +2 -6
- package/src/runtime/shared/task-notification-envelope.mjs +130 -58
- package/src/runtime/shared/time-format.mjs +6 -5
- package/src/runtime/shared/tool-card-model/agent-surface.mjs +175 -0
- package/src/runtime/shared/tool-card-model/aggregate-card.mjs +66 -0
- package/src/runtime/shared/tool-card-model/background-task.mjs +171 -0
- package/src/runtime/shared/tool-card-model/card-detail.mjs +115 -0
- package/src/runtime/shared/tool-card-model/card-header.mjs +48 -0
- package/src/runtime/shared/tool-card-model/card-input.mjs +85 -0
- package/src/runtime/shared/tool-card-model/card-status.mjs +84 -0
- package/src/runtime/shared/tool-card-model/displayed-result.mjs +43 -0
- package/src/runtime/shared/tool-card-model/generic-detail.mjs +81 -0
- package/src/runtime/shared/tool-card-model/git-result.mjs +9 -0
- package/src/runtime/shared/tool-card-model/inline-text.mjs +78 -0
- package/src/runtime/shared/tool-card-model/shell-surface.mjs +45 -0
- package/src/runtime/shared/tool-card-model/terminal-status.mjs +109 -0
- package/src/runtime/shared/tool-card-model.golden-cases.mjs +216 -0
- package/src/runtime/shared/tool-card-model.golden.json +955 -0
- package/src/runtime/shared/tool-card-model.mjs +110 -893
- package/src/runtime/shared/tool-execution-contract.mjs +123 -83
- package/src/runtime/shared/tool-primitives.mjs +2 -1
- package/src/runtime/shared/tool-result-summary.mjs +242 -238
- package/src/runtime/shared/tool-surface.mjs +63 -494
- package/src/runtime/shared/tool-work-units.mjs +508 -0
- package/src/runtime/shared/transcript-writer/rotation.mjs +90 -0
- package/src/runtime/shared/transcript-writer/session-record.mjs +49 -0
- package/src/runtime/shared/transcript-writer/transcript-file.mjs +108 -0
- package/src/runtime/shared/transcript-writer.mjs +35 -239
- package/src/runtime/shared/transport-error-text.mjs +53 -66
- package/src/runtime/shared/turn-snapshot-store.mjs +16 -4
- package/src/runtime/shared/turn-snapshot.mjs +31 -16
- package/src/runtime/shared/turn-worktree-snapshot.mjs +131 -27
- package/src/runtime/shared/update-checker.mjs +6 -1
- package/src/runtime/shared/user-cwd.mjs +4 -4
- package/src/runtime/shared/user-data-guard.mjs +32 -24
- package/src/runtime/shared/webhook-session-run.mjs +3 -15
- package/src/runtime/shared/webhooks-db.mjs +1 -1
- package/src/runtime/tidy/extract.mjs +1 -1
- package/src/runtime/tidy/history-comment.mjs +43 -17
- package/src/runtime/tidy/languages.mjs +20 -15
- package/src/runtime/tidy/process.mjs +18 -21
- package/src/runtime/tidy/report.mjs +210 -44
- package/src/runtime/tidy/resolve.mjs +16 -20
- package/src/runtime/tidy/rules/kotlin/no-history-comment.yml +1 -1
- package/src/runtime/tidy/rules/kotlin/todo-marker.yml +1 -1
- package/src/runtime/tidy/run-engines.mjs +29 -14
- package/src/runtime/tidy/runners/air.mjs +2 -20
- package/src/runtime/tidy/runners/biome.mjs +15 -19
- package/src/runtime/tidy/runners/dprint.mjs +2 -23
- package/src/runtime/tidy/runners/mago.mjs +5 -21
- package/src/runtime/tidy/runners/ruff.mjs +2 -8
- package/src/runtime/tidy/runners/shared.mjs +35 -9
- package/src/runtime/tidy/runners/stylua.mjs +2 -20
- package/src/runtime/tidy/shadow.mjs +138 -0
- package/src/runtime/tidy/structural.mjs +67 -47
- package/src/runtime/tidy/tool-defs.mjs +26 -6
- package/src/runtime/tidy/tool.mjs +260 -41
- package/src/runtime/tidy/worktree.mjs +114 -0
- package/src/runtime/web-search/index.mjs +71 -77
- package/src/runtime/web-search/lib/cache.mjs +1 -1
- package/src/runtime/web-search/lib/config.mjs +3 -3
- package/src/runtime/web-search/lib/document-content.mjs +3 -5
- package/src/runtime/web-search/lib/fetch-pipeline.mjs +3 -1
- package/src/runtime/web-search/lib/formatter.mjs +16 -9
- package/src/runtime/web-search/lib/http-fetch.mjs +42 -56
- package/src/runtime/web-search/lib/ssrf-guard.mjs +22 -60
- package/src/runtime/web-search/lib/state.mjs +0 -4
- package/src/runtime/web-search/lib/web-tools.mjs +3 -6
- package/src/session-runtime/agent-tool-routing.mjs +3 -5
- package/src/session-runtime/boot/apis.mjs +487 -0
- package/src/session-runtime/boot/begin.mjs +123 -0
- package/src/session-runtime/boot/config.mjs +108 -0
- package/src/session-runtime/boot/facade.mjs +88 -0
- package/src/session-runtime/boot/infrastructure.mjs +250 -0
- package/src/session-runtime/boot/providers.mjs +240 -0
- package/src/session-runtime/boot/session.mjs +125 -0
- package/src/session-runtime/boot/shared.mjs +33 -0
- package/src/session-runtime/boot/tools.mjs +250 -0
- package/src/session-runtime/builtin-features.mjs +1 -1
- package/src/session-runtime/config-helpers.mjs +35 -53
- package/src/session-runtime/config-lifecycle/config-writers.mjs +152 -0
- package/src/session-runtime/config-lifecycle/output-style-cache.mjs +42 -0
- package/src/session-runtime/config-lifecycle.mjs +26 -184
- package/src/session-runtime/context-inspection.mjs +434 -148
- package/src/session-runtime/context-status-cache.mjs +124 -0
- package/src/session-runtime/context-status-inspection.mjs +90 -0
- package/src/session-runtime/context-status-shape.mjs +254 -0
- package/src/session-runtime/context-status.mjs +40 -370
- package/src/session-runtime/cwd-plugins/core-memory-context.mjs +60 -0
- package/src/session-runtime/cwd-plugins/cwd-apply.mjs +83 -0
- package/src/session-runtime/cwd-plugins/plugin-status.mjs +124 -0
- package/src/session-runtime/cwd-plugins.mjs +16 -252
- package/src/session-runtime/fs-utils.mjs +11 -1
- package/src/session-runtime/goal-control.mjs +154 -0
- package/src/session-runtime/goal-deadlines.mjs +4 -4
- package/src/session-runtime/goal-facade-api.mjs +15 -12
- package/src/session-runtime/goal-mutations.mjs +258 -0
- package/src/session-runtime/goal-runtime.mjs +61 -794
- package/src/session-runtime/goal-state.mjs +18 -15
- package/src/session-runtime/goal-store.mjs +118 -0
- package/src/session-runtime/goal-tasks.mjs +7 -10
- package/src/session-runtime/goal-text.mjs +75 -27
- package/src/session-runtime/goal-title.mjs +52 -0
- package/src/session-runtime/goal-tool-defs.mjs +7 -8
- package/src/session-runtime/goal-tool-exec.mjs +156 -0
- package/src/session-runtime/goal-turns.mjs +217 -0
- package/src/session-runtime/hook-payload.mjs +2 -1
- package/src/session-runtime/inheritance-fit.mjs +3 -3
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +63 -0
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +42 -0
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +59 -0
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +63 -0
- package/src/session-runtime/internal-tool-executor.mjs +40 -189
- package/src/session-runtime/lifecycle/inheritance.mjs +192 -0
- package/src/session-runtime/lifecycle/memory-ingest.mjs +42 -0
- package/src/session-runtime/lifecycle/session-catalog.mjs +98 -0
- package/src/session-runtime/lifecycle/session-switch/context-switch.mjs +70 -0
- package/src/session-runtime/lifecycle/session-switch/resume.mjs +158 -0
- package/src/session-runtime/lifecycle/session-switch/session-delete.mjs +93 -0
- package/src/session-runtime/lifecycle/session-switch.mjs +45 -0
- package/src/session-runtime/lifecycle/shared.mjs +32 -0
- package/src/session-runtime/lifecycle/teardown/runtime-stops.mjs +94 -0
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +87 -0
- package/src/session-runtime/lifecycle/teardown.mjs +172 -0
- package/src/session-runtime/lifecycle-api.mjs +36 -850
- package/src/session-runtime/mcp-glue/connect.mjs +159 -0
- package/src/session-runtime/mcp-glue/server-catalog.mjs +100 -0
- package/src/session-runtime/mcp-glue/server-input.mjs +79 -0
- package/src/session-runtime/mcp-glue.mjs +21 -322
- package/src/session-runtime/model-capabilities.mjs +1 -3
- package/src/session-runtime/model-route/route-persist.mjs +49 -0
- package/src/session-runtime/model-route/route-tuning.mjs +60 -0
- package/src/session-runtime/model-route/set-route.mjs +156 -0
- package/src/session-runtime/model-route/web-search-route.mjs +103 -0
- package/src/session-runtime/model-route-api.mjs +21 -304
- package/src/session-runtime/native-web-search/routes.mjs +74 -0
- package/src/session-runtime/native-web-search/tool-shape.mjs +115 -0
- package/src/session-runtime/native-web-search.mjs +83 -237
- package/src/session-runtime/notification-bus.mjs +30 -7
- package/src/session-runtime/orchestration.mjs +10 -5
- package/src/session-runtime/plugin-mcp.mjs +7 -60
- package/src/session-runtime/prewarm/channel-start.mjs +95 -0
- package/src/session-runtime/prewarm/code-graph-prewarm.mjs +94 -0
- package/src/session-runtime/prewarm/tool-runtime-warmup.mjs +79 -0
- package/src/session-runtime/prewarm.mjs +13 -243
- package/src/session-runtime/provider-auth/accounts.mjs +79 -0
- package/src/session-runtime/provider-auth/login.mjs +78 -0
- package/src/session-runtime/provider-auth/refresh.mjs +57 -0
- package/src/session-runtime/provider-auth/setup.mjs +51 -0
- package/src/session-runtime/provider-auth-api.mjs +18 -251
- package/src/session-runtime/provider-models/catalog-load.mjs +90 -0
- package/src/session-runtime/provider-models/model-meta.mjs +77 -0
- package/src/session-runtime/provider-models/row-hydration.mjs +46 -0
- package/src/session-runtime/provider-models/web-search-catalog.mjs +111 -0
- package/src/session-runtime/provider-models.mjs +71 -286
- package/src/session-runtime/provider-request-snapshot.mjs +1 -1
- package/src/session-runtime/provider-usage.mjs +4 -4
- package/src/session-runtime/quick-model-rows/model-meta.mjs +32 -0
- package/src/session-runtime/quick-model-rows/provider-rows.mjs +77 -0
- package/src/session-runtime/quick-model-rows/web-search-rows.mjs +144 -0
- package/src/session-runtime/quick-model-rows.mjs +27 -221
- package/src/session-runtime/resource-api.mjs +28 -522
- package/src/session-runtime/resource-extension-sync.mjs +89 -0
- package/src/session-runtime/resource-mcp-api.mjs +199 -0
- package/src/session-runtime/resource-plugins-api.mjs +85 -0
- package/src/session-runtime/resource-recall-api.mjs +92 -0
- package/src/session-runtime/resource-scope-decorate.mjs +58 -0
- package/src/session-runtime/resource-skills-api.mjs +50 -0
- package/src/session-runtime/route-resolution.mjs +71 -0
- package/src/session-runtime/route-state.mjs +86 -0
- package/src/session-runtime/runtime-bootstrap.mjs +3 -3
- package/src/session-runtime/runtime-core.mjs +37 -1375
- package/src/session-runtime/runtime-paths.mjs +1 -3
- package/src/session-runtime/self-update.mjs +2 -3
- package/src/session-runtime/session-create/materialize.mjs +77 -0
- package/src/session-runtime/session-create/route-prep.mjs +49 -0
- package/src/session-runtime/session-create/session-options.mjs +73 -0
- package/src/session-runtime/session-create/session-start-hook.mjs +39 -0
- package/src/session-runtime/session-create.mjs +69 -0
- package/src/session-runtime/session-hooks.mjs +40 -100
- package/src/session-runtime/session-lifecycle.mjs +43 -417
- package/src/session-runtime/session-text.mjs +7 -37
- package/src/session-runtime/session-transcript.mjs +2 -4
- package/src/session-runtime/session-turn-api.mjs +37 -757
- package/src/session-runtime/settings-api.mjs +29 -528
- package/src/session-runtime/settings-builtin-tools-api.mjs +191 -0
- package/src/session-runtime/settings-compaction-api.mjs +161 -0
- package/src/session-runtime/settings-profile-api.mjs +100 -0
- package/src/session-runtime/settings-system-api.mjs +82 -0
- package/src/session-runtime/setup-tool/executor.mjs +354 -315
- package/src/session-runtime/setup-tool/extended-actions.mjs +42 -16
- package/src/session-runtime/setup-tool/settings-contract.mjs +99 -39
- package/src/session-runtime/setup-tool/tool-defs.mjs +22 -4
- package/src/session-runtime/setup-tool/ui-requests.mjs +25 -7
- package/src/session-runtime/skill-tool-loading.mjs +15 -8
- package/src/session-runtime/skills-api.mjs +7 -8
- package/src/session-runtime/statusline-route.mjs +1 -4
- package/src/session-runtime/tool-catalog-data.mjs +1 -2
- package/src/session-runtime/tool-catalog-schema.mjs +1 -7
- package/src/session-runtime/tool-catalog.mjs +30 -33
- package/src/session-runtime/tool-defs.mjs +2 -2
- package/src/session-runtime/tool-policy-refresh.mjs +33 -21
- package/src/session-runtime/tool-profile.mjs +0 -1
- package/src/session-runtime/tool-surface.mjs +6 -4
- package/src/session-runtime/turn/agent-ops.mjs +98 -0
- package/src/session-runtime/turn/session-ops.mjs +132 -0
- package/src/session-runtime/turn/share-ops.mjs +73 -0
- package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +90 -0
- package/src/session-runtime/turn/turn-run/snapshot-tracker.mjs +51 -0
- package/src/session-runtime/turn/turn-run/transcript.mjs +47 -0
- package/src/session-runtime/turn/turn-run/turn-open.mjs +60 -0
- package/src/session-runtime/turn/turn-run/turn-prepare.mjs +142 -0
- package/src/session-runtime/turn/turn-run/turn-settle.mjs +105 -0
- package/src/session-runtime/turn/turn-run/turn-timing.mjs +52 -0
- package/src/session-runtime/turn/turn-run.mjs +121 -0
- package/src/session-runtime/usage-stats-api.mjs +48 -33
- package/src/session-runtime/warmup/catalog-warmup.mjs +34 -0
- package/src/session-runtime/warmup/provider-warmups.mjs +105 -0
- package/src/session-runtime/warmup/statusline-usage-warmup.mjs +82 -0
- package/src/session-runtime/warmup/timer-arm.mjs +22 -0
- package/src/session-runtime/warmup-schedulers.mjs +11 -232
- package/src/session-runtime/workflow/agents.mjs +91 -0
- package/src/session-runtime/workflow/context.mjs +89 -0
- package/src/session-runtime/workflow/packs.mjs +68 -0
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +152 -0
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +98 -0
- package/src/session-runtime/workflow-agents-api/onboarding.mjs +113 -0
- package/src/session-runtime/workflow-agents-api/shared.mjs +23 -0
- package/src/session-runtime/workflow-agents-api/style-and-mode.mjs +61 -0
- package/src/session-runtime/workflow-agents-api/workflow-packs.mjs +117 -0
- package/src/session-runtime/workflow-agents-api.mjs +16 -515
- package/src/session-runtime/workflow-ids.mjs +56 -0
- package/src/session-runtime/workflow.mjs +17 -289
- package/src/standalone/agent-task-status.mjs +9 -4
- package/src/standalone/agent-tool/close-flow/close-all.mjs +67 -0
- package/src/standalone/agent-tool/close-flow.mjs +107 -0
- package/src/standalone/agent-tool/execute-send.mjs +91 -0
- package/src/standalone/agent-tool/execute-spawn.mjs +76 -0
- package/src/standalone/agent-tool/execute.mjs +83 -0
- package/src/standalone/agent-tool/helpers.mjs +6 -23
- package/src/standalone/agent-tool/job-views/agent-list.mjs +71 -0
- package/src/standalone/agent-tool/job-views/job-lookup.mjs +84 -0
- package/src/standalone/agent-tool/job-views/job-render.mjs +98 -0
- package/src/standalone/agent-tool/job-views/session-progress.mjs +81 -0
- package/src/standalone/agent-tool/job-views/spawn-meta.mjs +62 -0
- package/src/standalone/agent-tool/job-views.mjs +24 -373
- package/src/standalone/agent-tool/lead-worker-index/index-file.mjs +45 -0
- package/src/standalone/agent-tool/lead-worker-index/lead-rows.mjs +39 -0
- package/src/standalone/agent-tool/lead-worker-index/reap-timers.mjs +31 -0
- package/src/standalone/agent-tool/lead-worker-index/row-settlement.mjs +59 -0
- package/src/standalone/agent-tool/lead-worker-index.mjs +28 -163
- package/src/standalone/agent-tool/notify/early-completion.mjs +58 -0
- package/src/standalone/agent-tool/notify.mjs +10 -58
- package/src/standalone/agent-tool/provider-init.mjs +76 -68
- package/src/standalone/agent-tool/render.mjs +130 -118
- package/src/standalone/agent-tool/send-flow.mjs +186 -0
- package/src/standalone/agent-tool/spawn-flow/deferred-spawn.mjs +97 -0
- package/src/standalone/agent-tool/spawn-flow/job-start.mjs +83 -0
- package/src/standalone/agent-tool/spawn-flow/spawn-plan.mjs +89 -0
- package/src/standalone/agent-tool/spawn-flow/spawn-prep.mjs +120 -0
- package/src/standalone/agent-tool/spawn-flow/spawn-run.mjs +222 -0
- package/src/standalone/agent-tool/spawn-flow.mjs +30 -557
- package/src/standalone/agent-tool/tag-maps.mjs +29 -0
- package/src/standalone/agent-tool/tag-registry/tag-lookup.mjs +106 -0
- package/src/standalone/agent-tool/tag-registry/tag-refresh.mjs +34 -0
- package/src/standalone/agent-tool/tag-registry.mjs +63 -524
- package/src/standalone/agent-tool/terminal-reaper/reap-timers.mjs +142 -0
- package/src/standalone/agent-tool/terminal-reaper/row-helpers.mjs +25 -0
- package/src/standalone/agent-tool/terminal-reaper/scan-admission.mjs +89 -0
- package/src/standalone/agent-tool/terminal-reaper/stale-rows.mjs +52 -0
- package/src/standalone/agent-tool/terminal-reaper/tombstones.mjs +113 -0
- package/src/standalone/agent-tool/terminal-reaper.mjs +46 -0
- package/src/standalone/agent-tool/terminal-trace.mjs +40 -0
- package/src/standalone/agent-tool/tool-def.mjs +1 -2
- package/src/standalone/agent-tool/turn-review.mjs +27 -0
- package/src/standalone/agent-tool/worker-index/mutation-batch.mjs +41 -0
- package/src/standalone/agent-tool/worker-index/row-liveness.mjs +65 -0
- package/src/standalone/agent-tool/worker-index/row-shape.mjs +109 -0
- package/src/standalone/agent-tool/worker-index/row-store.mjs +100 -0
- package/src/standalone/agent-tool/worker-index.mjs +66 -345
- package/src/standalone/agent-tool/worker-rows.mjs +34 -16
- package/src/standalone/agent-tool.mjs +61 -650
- package/src/standalone/agent-watchdog-registry.mjs +36 -8
- package/src/standalone/channel-admin.mjs +16 -23
- package/src/standalone/channel-client/daemon-request.mjs +136 -0
- package/src/standalone/channel-client/notify-stream.mjs +130 -0
- package/src/standalone/channel-client/reconnect.mjs +113 -0
- package/src/standalone/channel-client/registration.mjs +87 -0
- package/src/standalone/channel-client.mjs +58 -460
- package/src/standalone/channel-transport/call-dispatch.mjs +209 -0
- package/src/standalone/channel-transport/client-registry/client-grace.mjs +69 -0
- package/src/standalone/channel-transport/client-registry/registration-replays.mjs +96 -0
- package/src/standalone/channel-transport/client-registry/sse-attach.mjs +44 -0
- package/src/standalone/channel-transport/client-registry.mjs +228 -0
- package/src/standalone/channel-transport/http-routes.mjs +171 -0
- package/src/standalone/channel-transport/remote-binding.mjs +99 -0
- package/src/standalone/channel-transport/remote-intent.mjs +52 -0
- package/src/standalone/channel-transport/remote-notify.mjs +46 -0
- package/src/standalone/channel-transport/remote-pointer.mjs +124 -0
- package/src/standalone/channel-transport/remote-state.mjs +47 -0
- package/src/standalone/channel-transport.mjs +111 -982
- package/src/standalone/channel-worker/client-heartbeat.mjs +103 -0
- package/src/standalone/channel-worker/daemon-attach.mjs +157 -0
- package/src/standalone/channel-worker/daemon-spawn.mjs +93 -0
- package/src/standalone/channel-worker.mjs +55 -342
- package/src/standalone/daemon-agent-control.mjs +65 -0
- package/src/standalone/daemon-boot-coordinator.mjs +6 -2
- package/src/standalone/daemon-channels-loader.mjs +60 -0
- package/src/standalone/daemon-crash-capture/paths.mjs +16 -0
- package/src/standalone/daemon-crash-capture/retention.mjs +217 -0
- package/src/standalone/daemon-crash-capture/spawn-capture.mjs +370 -0
- package/src/standalone/daemon-crash-capture.mjs +14 -568
- package/src/standalone/daemon-desktop-runtime.mjs +28 -0
- package/src/standalone/daemon-local-session-bridge.mjs +62 -0
- package/src/standalone/daemon-stored-session-views.mjs +55 -0
- package/src/standalone/daemon.mjs +175 -323
- package/src/standalone/desktop-service-registry.mjs +13 -14
- package/src/standalone/fair-call-scheduler/owner-groups.mjs +90 -0
- package/src/standalone/fair-call-scheduler/queue-item.mjs +21 -0
- package/src/standalone/fair-call-scheduler.mjs +94 -167
- package/src/standalone/folder-dialog.mjs +11 -12
- package/src/standalone/hook-bus/command-handler.mjs +61 -50
- package/src/standalone/hook-bus/config-loader.mjs +130 -0
- package/src/standalone/hook-bus/config.mjs +8 -9
- package/src/standalone/hook-bus/event-log.mjs +30 -0
- package/src/standalone/hook-bus/event-runner.mjs +108 -0
- package/src/standalone/hook-bus/handler-dispatch.mjs +75 -0
- package/src/standalone/hook-bus/rule-store.mjs +149 -0
- package/src/standalone/hook-bus/tool-gate.mjs +72 -0
- package/src/standalone/hook-bus.mjs +65 -511
- package/src/standalone/memory-runtime-proxy/calls.mjs +121 -0
- package/src/standalone/memory-runtime-proxy/client-registry.mjs +93 -0
- package/src/standalone/memory-runtime-proxy/daemon-spawn.mjs +158 -0
- package/src/standalone/memory-runtime-proxy/discovery.mjs +98 -0
- package/src/standalone/memory-runtime-proxy/owner-claim.mjs +67 -0
- package/src/standalone/memory-runtime-proxy/rpc.mjs +122 -0
- package/src/standalone/memory-runtime-proxy/start.mjs +51 -0
- package/src/standalone/memory-runtime-proxy/state.mjs +21 -0
- package/src/standalone/memory-runtime-proxy/tool-wire.mjs +32 -0
- package/src/standalone/memory-runtime-proxy.mjs +52 -712
- package/src/standalone/plugin-admin.mjs +4 -9
- package/src/standalone/provider-admin.mjs +197 -193
- package/src/standalone/seeds.mjs +132 -5
- package/src/standalone/session-client/attachment-calls.mjs +67 -0
- package/src/standalone/session-client/frame-stream.mjs +125 -0
- package/src/standalone/session-client/stream-link.mjs +85 -0
- package/src/standalone/session-client/stream-reconnect.mjs +119 -0
- package/src/standalone/session-client.mjs +87 -338
- package/src/standalone/session-frame-stream.mjs +7 -8
- package/src/standalone/session-protocol.mjs +1 -1
- package/src/standalone/session-proxy/project-routes.mjs +25 -0
- package/src/standalone/session-proxy/projection.mjs +112 -0
- package/src/standalone/session-proxy/proxy-view.mjs +50 -0
- package/src/standalone/session-proxy/remote-actions.mjs +121 -0
- package/src/standalone/session-proxy/resync.mjs +67 -0
- package/src/standalone/session-proxy/transitions.mjs +99 -0
- package/src/standalone/session-proxy/transport-calls.mjs +121 -0
- package/src/standalone/session-proxy.mjs +49 -527
- package/src/standalone/session-runtime-agent-control-client.mjs +13 -31
- package/src/standalone/session-runtime-agent-control.mjs +85 -0
- package/src/standalone/session-runtime-host.mjs +36 -582
- package/src/standalone/session-runtime-inline-host/agent-dispatch.mjs +66 -0
- package/src/standalone/session-runtime-inline-host/boot-loaders.mjs +96 -0
- package/src/standalone/session-runtime-inline-host/runtime-records.mjs +66 -0
- package/src/standalone/session-runtime-inline-host/telemetry.mjs +38 -0
- package/src/standalone/session-runtime-inline-host.mjs +33 -219
- package/src/standalone/session-runtime-proxy.mjs +164 -0
- package/src/standalone/session-runtime-shard-router.mjs +4 -7
- package/src/standalone/session-runtime-spawn-leases.mjs +82 -0
- package/src/standalone/session-runtime-worker.mjs +29 -13
- package/src/standalone/session-runtime-workload.mjs +98 -0
- package/src/standalone/session-service/agent-tree/agent-cancel.mjs +79 -0
- package/src/standalone/session-service/agent-tree/agent-child.mjs +59 -0
- package/src/standalone/session-service/agent-tree/agent-registry.mjs +73 -0
- package/src/standalone/session-service/agent-tree/agent-rehydrate.mjs +163 -0
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +71 -0
- package/src/standalone/session-service/agent-tree.mjs +93 -388
- package/src/standalone/session-service/entries/disposal.mjs +72 -0
- package/src/standalone/session-service/entries/external-binding.mjs +63 -0
- package/src/standalone/session-service/entries/lifecycle.mjs +96 -0
- package/src/standalone/session-service/entries/session-loads.mjs +109 -0
- package/src/standalone/session-service/entries.mjs +95 -0
- package/src/standalone/session-service/projection/address-index.mjs +54 -0
- package/src/standalone/session-service/projection/external-views.mjs +91 -0
- package/src/standalone/session-service/projection/frames.mjs +79 -0
- package/src/standalone/session-service/projection/revisions.mjs +100 -0
- package/src/standalone/session-service/projection.mjs +36 -274
- package/src/standalone/session-service/retention/busy.mjs +50 -0
- package/src/standalone/session-service/retention.mjs +119 -0
- package/src/standalone/session-service/session-calls/goal-recovery.mjs +44 -0
- package/src/standalone/session-service/session-calls/session-action.mjs +94 -0
- package/src/standalone/session-service/session-calls/session-turns.mjs +135 -0
- package/src/standalone/session-service/session-calls/session-views.mjs +192 -0
- package/src/standalone/session-service/session-calls.mjs +59 -0
- package/src/standalone/session-service/viewers.mjs +111 -0
- package/src/standalone/session-service.mjs +135 -992
- package/src/standalone/session-state-projection.mjs +5 -1
- package/src/standalone/session-transport/call-lanes.mjs +113 -0
- package/src/standalone/session-transport/call-route.mjs +104 -0
- package/src/standalone/session-transport/client-registry/client-grace.mjs +81 -0
- package/src/standalone/session-transport/client-registry/registration-replays.mjs +69 -0
- package/src/standalone/session-transport/client-registry.mjs +129 -0
- package/src/standalone/session-transport/routes.mjs +185 -0
- package/src/standalone/session-transport/stack.mjs +131 -0
- package/src/standalone/session-transport.mjs +31 -594
- package/src/standalone/sse-frames.mjs +27 -0
- package/src/standalone/usage-dashboard-model.mjs +28 -22
- package/src/standalone/usage-dashboard.mjs +167 -163
- package/src/standalone/usage-stats-hours.mjs +2 -6
- package/src/standalone/usage-stats-model.mjs +133 -120
- package/src/standalone/usage-stats-period.mjs +83 -22
- package/src/tui/App.jsx +27 -216
- package/src/tui/app/app-format.mjs +14 -1
- package/src/tui/app/app-view/floating-panel.jsx +229 -0
- package/src/tui/app/app-view/text-entry-labels.mjs +81 -0
- package/src/tui/app/app-view/transcript-viewport/trailing-bands.jsx +94 -0
- package/src/tui/app/app-view/transcript-viewport/transcript-rows.jsx +87 -0
- package/src/tui/app/app-view/transcript-viewport.jsx +74 -0
- package/src/tui/app/app-view.jsx +16 -427
- package/src/tui/app/clipboard.mjs +1 -1
- package/src/tui/app/core-memory-picker/core-rows.mjs +32 -0
- package/src/tui/app/core-memory-picker/entry-prompts.mjs +45 -0
- package/src/tui/app/core-memory-picker/list-panels.mjs +75 -0
- package/src/tui/app/core-memory-picker.mjs +33 -131
- package/src/tui/app/create-app-pickers.mjs +2 -2
- package/src/tui/app/doctor.mjs +163 -135
- package/src/tui/app/extension-pickers/mcp-servers-picker.mjs +115 -0
- package/src/tui/app/extension-pickers/plugins-pickers.mjs +236 -0
- package/src/tui/app/extension-pickers/scope-note.mjs +30 -0
- package/src/tui/app/extension-pickers/skills-pickers/project-skills.mjs +38 -0
- package/src/tui/app/extension-pickers/skills-pickers/skill-detail.mjs +80 -0
- package/src/tui/app/extension-pickers/skills-pickers/skill-items.mjs +44 -0
- package/src/tui/app/extension-pickers/skills-pickers.mjs +95 -0
- package/src/tui/app/extension-pickers.mjs +29 -532
- package/src/tui/app/input-parsers.mjs +6 -5
- package/src/tui/app/maintenance-pickers/auto-clear-picker.mjs +167 -0
- package/src/tui/app/maintenance-pickers/profile-picker.mjs +147 -0
- package/src/tui/app/maintenance-pickers/update-picker.mjs +175 -0
- package/src/tui/app/maintenance-pickers.mjs +18 -449
- package/src/tui/app/model-options.mjs +5 -39
- package/src/tui/app/model-picker/catalog-load.mjs +101 -0
- package/src/tui/app/model-picker/model-footer.mjs +79 -0
- package/src/tui/app/model-picker/provider-models-list.mjs +115 -0
- package/src/tui/app/model-picker/route-selection/context-window.mjs +47 -0
- package/src/tui/app/model-picker/route-selection/effort.mjs +87 -0
- package/src/tui/app/model-picker/route-selection/fast-parameters.mjs +84 -0
- package/src/tui/app/model-picker/route-selection/model-key.mjs +5 -0
- package/src/tui/app/model-picker/route-selection.mjs +61 -0
- package/src/tui/app/model-picker.mjs +57 -460
- package/src/tui/app/mouse-input/edge-autoscroll.mjs +53 -0
- package/src/tui/app/mouse-input/geometry.mjs +109 -0
- package/src/tui/app/mouse-input/sgr-buttons.mjs +14 -0
- package/src/tui/app/mouse-input/wheel-router.mjs +96 -0
- package/src/tui/app/onboarding/models-step.mjs +106 -0
- package/src/tui/app/onboarding/persist.mjs +49 -0
- package/src/tui/app/onboarding/role-model-picker.mjs +141 -0
- package/src/tui/app/onboarding/step-data.mjs +65 -0
- package/src/tui/app/onboarding-steps.mjs +45 -346
- package/src/tui/app/panel-signature.mjs +58 -0
- package/src/tui/app/panel-surface.mjs +2 -1
- package/src/tui/app/project-picker/create-flow.mjs +76 -0
- package/src/tui/app/project-picker/picker-state.mjs +78 -0
- package/src/tui/app/project-picker/project-service.mjs +57 -0
- package/src/tui/app/project-picker.mjs +29 -221
- package/src/tui/app/prompt-handlers/history-navigation.mjs +32 -0
- package/src/tui/app/prompt-handlers/paste-pipeline.mjs +72 -0
- package/src/tui/app/prompt-handlers/use-prompt-history-nav.mjs +31 -0
- package/src/tui/app/prompt-handlers/use-prompt-interrupt.mjs +102 -0
- package/src/tui/app/prompt-handlers/use-prompt-paste.mjs +48 -0
- package/src/tui/app/prompt-submit/chat-submit.mjs +66 -0
- package/src/tui/app/prompt-submit/panel-write.mjs +54 -0
- package/src/tui/app/prompt-submit/provider-prompts.mjs +103 -0
- package/src/tui/app/prompt-submit/settings-prompts.mjs +337 -0
- package/src/tui/app/prompt-submit.mjs +23 -561
- package/src/tui/app/provider-setup/api-key-actions.mjs +91 -0
- package/src/tui/app/provider-setup/oauth-actions.mjs +222 -0
- package/src/tui/app/provider-setup/provider-items.mjs +97 -0
- package/src/tui/app/provider-setup-picker.mjs +81 -499
- package/src/tui/app/resume-picker.mjs +2 -5
- package/src/tui/app/route-pickers/agents-picker.mjs +155 -0
- package/src/tui/app/route-pickers/output-style-picker.mjs +123 -0
- package/src/tui/app/route-pickers/workflow-picker.mjs +84 -0
- package/src/tui/app/route-pickers.mjs +13 -322
- package/src/tui/app/settings-picker/settings-navigation.mjs +69 -0
- package/src/tui/app/settings-picker/settings-rows.mjs +200 -0
- package/src/tui/app/settings-picker/settings-toggles/cycled.mjs +4 -0
- package/src/tui/app/settings-picker/settings-toggles/listed-cyclers.mjs +77 -0
- package/src/tui/app/settings-picker/settings-toggles/store-toggles.mjs +61 -0
- package/src/tui/app/settings-picker/settings-toggles/theme-cycler.mjs +36 -0
- package/src/tui/app/settings-picker/settings-toggles.mjs +62 -0
- package/src/tui/app/settings-picker.mjs +42 -431
- package/src/tui/app/shell-layout/panel-transition.mjs +140 -0
- package/src/tui/app/shell-layout/row-budgets.mjs +268 -0
- package/src/tui/app/shell-layout/surfaces.mjs +93 -0
- package/src/tui/app/shell-layout/viewport.mjs +151 -0
- package/src/tui/app/shell-layout.mjs +34 -568
- package/src/tui/app/slash-commands.mjs +14 -4
- package/src/tui/app/slash-dispatch/panel-commands.mjs +84 -0
- package/src/tui/app/slash-dispatch/route-commands.mjs +191 -0
- package/src/tui/app/slash-dispatch/session-commands.mjs +128 -0
- package/src/tui/app/slash-dispatch/slash-panel.mjs +43 -0
- package/src/tui/app/slash-dispatch.mjs +19 -449
- package/src/tui/app/store-service-call.mjs +17 -0
- package/src/tui/app/text-entry-policy.mjs +1 -3
- package/src/tui/app/theme-effort-pickers.mjs +4 -11
- package/src/tui/app/transcript-anchor-lock.mjs +120 -0
- package/src/tui/app/transcript-anchor-sync.mjs +173 -0
- package/src/tui/app/transcript-measure.mjs +245 -0
- package/src/tui/app/transcript-row-estimate.mjs +38 -122
- package/src/tui/app/transcript-scroll-anchor.mjs +42 -0
- package/src/tui/app/transcript-window.mjs +121 -122
- package/src/tui/app/usage-context-panels/context-model.mjs +282 -0
- package/src/tui/app/usage-context-panels/usage-panel.mjs +48 -0
- package/src/tui/app/usage-context-panels.mjs +24 -282
- package/src/tui/app/use-copy-selection.mjs +5 -4
- package/src/tui/app/use-disabled-skills.mjs +52 -0
- package/src/tui/app/use-global-key-input/copy-first.mjs +43 -0
- package/src/tui/app/use-global-key-input/shift-arrow.mjs +30 -0
- package/src/tui/app/use-global-key-input.mjs +12 -70
- package/src/tui/app/use-model-catalog-cache.mjs +86 -0
- package/src/tui/app/use-mouse-input.mjs +71 -229
- package/src/tui/app/use-pasted-buffers.mjs +56 -82
- package/src/tui/app/use-prompt-draft-flow/draft-change.mjs +66 -0
- package/src/tui/app/use-prompt-draft-flow/prompt-cancels.mjs +40 -0
- package/src/tui/app/use-prompt-draft-flow.mjs +39 -78
- package/src/tui/app/use-prompt-handlers.mjs +32 -257
- package/src/tui/app/use-prompt-hint.mjs +1 -1
- package/src/tui/app/use-prompt-queue-history/prompt-history.mjs +22 -0
- package/src/tui/app/use-prompt-queue-history/restore-to-prompt.mjs +147 -0
- package/src/tui/app/use-prompt-queue-history.mjs +21 -118
- package/src/tui/app/use-selection-focus.mjs +133 -0
- package/src/tui/app/use-selection-geometry.mjs +105 -0
- package/src/tui/app/use-selection-paint/paint-queue.mjs +90 -0
- package/src/tui/app/use-selection-paint/selection-clip.mjs +33 -0
- package/src/tui/app/use-selection-paint.mjs +121 -0
- package/src/tui/app/use-selection-stitch.mjs +128 -0
- package/src/tui/app/use-terminal-chrome.mjs +1 -1
- package/src/tui/app/use-transcript-activity.mjs +5 -4
- package/src/tui/app/use-transcript-follow.mjs +91 -0
- package/src/tui/app/use-transcript-scroll.mjs +220 -737
- package/src/tui/app/use-transcript-window/geometry.mjs +139 -0
- package/src/tui/app/use-transcript-window/instance-state.mjs +80 -0
- package/src/tui/app/use-transcript-window/selection-shift.mjs +57 -0
- package/src/tui/app/use-transcript-window/visible-items.mjs +46 -0
- package/src/tui/app/use-transcript-window.mjs +101 -827
- package/src/tui/app/use-welcome-prompt-hint.mjs +2 -2
- package/src/tui/app/workflow-cycle.mjs +63 -0
- package/src/tui/components/AnsiText.jsx +49 -19
- package/src/tui/components/ContextInspector.jsx +87 -39
- package/src/tui/components/ContextPanel.jsx +18 -34
- package/src/tui/components/ItemRightHintOverprint.jsx +2 -15
- package/src/tui/components/Markdown.jsx +4 -1
- package/src/tui/components/Message.jsx +9 -2
- package/src/tui/components/Picker.jsx +53 -62
- package/src/tui/components/PromptInput.jsx +89 -335
- package/src/tui/components/QueuedCommands.jsx +5 -6
- package/src/tui/components/SlashCommandPalette.jsx +1 -18
- package/src/tui/components/Spinner.jsx +26 -23
- package/src/tui/components/StatusLine.jsx +18 -51
- package/src/tui/components/TextEntryPanel.jsx +5 -52
- package/src/tui/components/ToolExecution.jsx +27 -43
- package/src/tui/components/TranscriptItem.jsx +5 -15
- package/src/tui/components/TurnDone.jsx +26 -46
- package/src/tui/components/UsagePanel.jsx +55 -66
- package/src/tui/components/panel-cell-text.mjs +19 -0
- package/src/tui/components/prompt-input/cursor-anchor.mjs +65 -0
- package/src/tui/components/prompt-input/edit-helpers.mjs +9 -6
- package/src/tui/components/prompt-input/key-signals.mjs +122 -0
- package/src/tui/components/prompt-input/mouse-selection.mjs +114 -0
- package/src/tui/components/prompt-input/restore-policy.d.mts +0 -1
- package/src/tui/components/prompt-input/restore-policy.mjs +3 -8
- package/src/tui/components/prompt-input/selected-text.jsx +25 -0
- package/src/tui/components/prompt-input/undo-stack.mjs +75 -0
- package/src/tui/components/tool-execution/text-format.mjs +2 -3
- package/src/tui/components/tool-output-format.mjs +4 -5
- package/src/tui/dist/index.mjs +10283 -8687
- package/src/tui/hooks/useSharedTick.mjs +3 -9
- package/src/tui/index.jsx +2 -2
- package/src/tui/input-editing.mjs +3 -1
- package/src/tui/markdown/ansi-line-wrap.mjs +37 -0
- package/src/tui/markdown/format-token.mjs +6 -41
- package/src/tui/markdown/measure-rendered-rows.mjs +14 -34
- package/src/tui/markdown/render-ansi.mjs +5 -5
- package/src/tui/markdown/stream-fence.mjs +1 -2
- package/src/tui/markdown/streaming-markdown.mjs +1 -7
- package/src/tui/markdown/table-layout/box-lines.mjs +46 -0
- package/src/tui/markdown/table-layout/cells.mjs +23 -0
- package/src/tui/markdown/table-layout/column-widths.mjs +65 -0
- package/src/tui/markdown/table-layout/vertical-lines.mjs +46 -0
- package/src/tui/markdown/table-layout.mjs +22 -189
- package/src/tui/paste-attachments.mjs +1 -2
- package/src/tui/prompt-history-store.mjs +1 -10
- package/src/tui/session/active-tool-summary.mjs +63 -0
- package/src/tui/session/agent-envelope.mjs +51 -22
- package/src/tui/session/agent-job-feed/agent-job-card.mjs +30 -0
- package/src/tui/session/agent-job-feed/agent-status-refresh.mjs +37 -0
- package/src/tui/session/agent-job-feed/execution-dedup.mjs +80 -0
- package/src/tui/session/agent-job-feed/execution-delivery.mjs +103 -0
- package/src/tui/session/agent-job-feed/model-notification.mjs +79 -0
- package/src/tui/session/agent-job-feed/notification-chain.mjs +64 -0
- package/src/tui/session/agent-job-feed/notification-router.mjs +66 -0
- package/src/tui/session/agent-job-feed/pending-resume.mjs +131 -0
- package/src/tui/session/agent-job-feed.mjs +57 -513
- package/src/tui/session/agent-response-tail.mjs +1 -1
- package/src/tui/session/context-state.mjs +5 -2
- package/src/tui/session/cross-surface-share.mjs +411 -0
- package/src/tui/session/draft-store.mjs +85 -0
- package/src/tui/session/goal-continuation/continuation-queue.mjs +90 -0
- package/src/tui/session/goal-continuation/deadline-delivery.mjs +76 -0
- package/src/tui/session/goal-continuation/goal-visibility.mjs +38 -0
- package/src/tui/session/goal-continuation.mjs +34 -178
- package/src/tui/session/initial-state.mjs +50 -0
- package/src/tui/session/live-share/delta.mjs +153 -0
- package/src/tui/session/live-share/mirror.mjs +106 -0
- package/src/tui/session/live-share/owner.mjs +237 -0
- package/src/tui/session/live-share/retry.mjs +54 -0
- package/src/tui/session/live-share/viewer/frame-router.mjs +32 -0
- package/src/tui/session/live-share/viewer/pipe-client.mjs +108 -0
- package/src/tui/session/live-share/viewer/submit-acks.mjs +65 -0
- package/src/tui/session/live-share/viewer/sync-waiters.mjs +53 -0
- package/src/tui/session/live-share/viewer.mjs +99 -0
- package/src/tui/session/live-share/wire.mjs +41 -0
- package/src/tui/session/live-share.mjs +34 -775
- package/src/tui/session/notice-surface.mjs +77 -0
- package/src/tui/session/notice-text.mjs +21 -17
- package/src/tui/session/notification-plan.mjs +7 -9
- package/src/tui/session/oauth-flows.mjs +4 -4
- package/src/tui/session/prompt-history.mjs +1 -1
- package/src/tui/session/queue-helpers.mjs +15 -15
- package/src/tui/session/render-timing.mjs +0 -1
- package/src/tui/session/session-api/commands.mjs +163 -0
- package/src/tui/session/session-api/controls.mjs +119 -0
- package/src/tui/session/session-api/extensions.mjs +154 -0
- package/src/tui/session/session-api/intake/abort.mjs +150 -0
- package/src/tui/session/session-api/intake/rewind.mjs +47 -0
- package/src/tui/session/session-api/intake/submission.mjs +106 -0
- package/src/tui/session/session-api/intake.mjs +54 -0
- package/src/tui/session/session-api/integrations.mjs +160 -0
- package/src/tui/session/session-api/lifecycle/dispose.mjs +50 -0
- package/src/tui/session/session-api/lifecycle/inheritance.mjs +73 -0
- package/src/tui/session/session-api/lifecycle/resume.mjs +78 -0
- package/src/tui/session/session-api/lifecycle/session-reset.mjs +147 -0
- package/src/tui/session/session-api/lifecycle.mjs +51 -0
- package/src/tui/session/session-api/media.mjs +125 -0
- package/src/tui/session/session-api/routes.mjs +205 -0
- package/src/tui/session/session-api/settings.mjs +163 -0
- package/src/tui/session/session-api/shared.mjs +34 -0
- package/src/tui/session/session-api-ext.mjs +18 -867
- package/src/tui/session/session-api.mjs +14 -1026
- package/src/tui/session/session-flow/auto-clear.mjs +185 -0
- package/src/tui/session/session-flow/drain.mjs +282 -0
- package/src/tui/session/session-flow/failed-turn-rewind.mjs +27 -0
- package/src/tui/session/session-flow/queue/entry-shape.mjs +53 -0
- package/src/tui/session/session-flow/queue/take-entries.mjs +82 -0
- package/src/tui/session/session-flow/queue.mjs +111 -0
- package/src/tui/session/session-flow/session-reset.mjs +130 -0
- package/src/tui/session/session-flow/steering.mjs +190 -0
- package/src/tui/session/session-flow.mjs +43 -846
- package/src/tui/session/tool-approval.mjs +14 -20
- package/src/tui/session/tool-card-results/aggregate-result.mjs +98 -0
- package/src/tui/session/tool-card-results/grouped-result.mjs +94 -0
- package/src/tui/session/tool-card-results/item-patch.mjs +28 -0
- package/src/tui/session/tool-card-results.mjs +45 -234
- package/src/tui/session/tool-result-status.mjs +14 -22
- package/src/tui/session/tool-result-text.mjs +17 -31
- package/src/tui/session/transcript-intake.mjs +151 -0
- package/src/tui/session/transcript-spill/spill-dir.mjs +102 -0
- package/src/tui/session/transcript-spill/spill-writer.mjs +160 -0
- package/src/tui/session/transcript-spill.mjs +44 -267
- package/src/tui/session/transcript-store/replace-items.mjs +66 -0
- package/src/tui/session/transcript-store/streaming-tail.mjs +49 -0
- package/src/tui/session/transcript-store.mjs +114 -0
- package/src/tui/session/tui-steering-persist.mjs +2 -2
- package/src/tui/session/turn-aggregate-cards/early-complete.mjs +62 -0
- package/src/tui/session/turn-aggregate-cards/header-sync.mjs +71 -0
- package/src/tui/session/turn-aggregate-cards.mjs +19 -122
- package/src/tui/session/turn-deferred-cards.mjs +2 -21
- package/src/tui/session/turn-stream.mjs +464 -0
- package/src/tui/session/turn-tool-cards.mjs +338 -0
- package/src/tui/session/turn.mjs +531 -1252
- package/src/tui/session-local.mjs +63 -910
- package/src/tui/spinner-meta.mjs +2 -2
- package/src/tui/statusline-ansi-bridge.mjs +1 -40
- package/src/tui/theme.mjs +3 -3
- package/src/tui/transcript-tool-failures.mjs +4 -7
- package/src/ui/ansi.mjs +6 -28
- package/src/ui/context-inspection.mjs +22 -10
- package/src/ui/context-measurement.mjs +10 -7
- package/src/ui/markdown.mjs +18 -19
- package/src/ui/model-display.mjs +5 -6
- package/src/ui/statusline-agents.mjs +9 -14
- package/src/ui/statusline-format.mjs +5 -3
- package/src/ui/statusline.mjs +214 -223
- package/src/ui/streaming-markdown-heal.mjs +7 -3
- package/src/ui/tool-card.mjs +1 -1
- package/src/workflows/default/WORKFLOW.md +4 -0
- package/src/rules/routes/common.md +0 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-turn-reminder.mjs +0 -96
- package/src/runtime/agent/orchestrator/session/batching-nudge.mjs +0 -461
- package/src/runtime/channels/lib/cli-worker-host.mjs +0 -2
- package/src/runtime/channels/lib/index-drop-trace.mjs +0 -89
- package/src/runtime/channels/lib/network-retry.mjs +0 -24
- package/src/runtime/memory/lib/llm-worker-host.mjs +0 -11
- package/src/standalone/opencode-go-login.mjs +0 -140
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { clean, rowMatchesContext } from './helpers.mjs';
|
|
2
|
+
|
|
3
|
+
// Spawn request dispatch: deciding what an explicitly tagged spawn means before
|
|
4
|
+
// a job is started, and starting it.
|
|
5
|
+
//
|
|
6
|
+
// Inputs: `registry` (tag resolution, live sessions, tombstones),
|
|
7
|
+
// `terminalTrace`, `sendFlow` (reuse path), `spawnFlow`, and `spawnResult`
|
|
8
|
+
// (job -> rendered tool output). Output: { spawn }.
|
|
9
|
+
export function createSpawnDispatch({ registry, terminalTrace, sendFlow, spawnFlow, spawnResult }) {
|
|
10
|
+
// Explicit-tag spawn priority (auto nextTag always creates a fresh session):
|
|
11
|
+
// 1) live + busy -> queue the prompt (reuse)
|
|
12
|
+
// 2) live + idle -> continue existing session (reuse)
|
|
13
|
+
// 3) lingering terminal trace -> reap trace and fresh spawn under same tag
|
|
14
|
+
// 4) genuinely new tag -> fresh deferred spawn
|
|
15
|
+
async function resolveExplicitTagSpawn(explicitTag, args, { scopedContext, context, notifyContext }) {
|
|
16
|
+
let liveSessionId = null;
|
|
17
|
+
try {
|
|
18
|
+
liveSessionId = registry.resolveTag(explicitTag, scopedContext, {
|
|
19
|
+
scanSessions: registry.wantsSessionScan(args),
|
|
20
|
+
excludeTerminalTraces: true,
|
|
21
|
+
});
|
|
22
|
+
} catch {
|
|
23
|
+
// Ambiguous across terminals — the normal spawn path surfaces the same
|
|
24
|
+
// error consistently.
|
|
25
|
+
liveSessionId = null;
|
|
26
|
+
}
|
|
27
|
+
if (liveSessionId && registry.getLiveSession(liveSessionId)) {
|
|
28
|
+
const prepared = await sendFlow.prepareSend({ ...args, tag: explicitTag }, scopedContext);
|
|
29
|
+
return { reused: sendFlow.dispatchToExistingSession(prepared, notifyContext, { reused: true }) };
|
|
30
|
+
}
|
|
31
|
+
if (terminalTrace.hasTerminalTrace(explicitTag, scopedContext)) {
|
|
32
|
+
terminalTrace.reapTerminalTraceForTag(explicitTag, scopedContext);
|
|
33
|
+
return { spawnArgs: args, respawned: true };
|
|
34
|
+
}
|
|
35
|
+
// Tombstone inheritance never honors allTerminals/global scope.
|
|
36
|
+
const tombstone = registry.tagTombstoneForTag(explicitTag, context);
|
|
37
|
+
if (tombstone) {
|
|
38
|
+
registry.consumeTagTombstone(tombstone);
|
|
39
|
+
return {
|
|
40
|
+
spawnArgs: {
|
|
41
|
+
...args,
|
|
42
|
+
agent: clean(args.agent) || clean(tombstone.agent),
|
|
43
|
+
...(clean(args.cwd) || !clean(tombstone.cwd) ? {} : { cwd: tombstone.cwd }),
|
|
44
|
+
},
|
|
45
|
+
respawned: true,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const foreignTombstone = registry
|
|
49
|
+
.readAllTagTombstones()
|
|
50
|
+
.find((row) => clean(row.tag) === explicitTag && !rowMatchesContext(row, context));
|
|
51
|
+
if (foreignTombstone) throw new Error(`agent spawn: tag "${explicitTag}" belongs to another terminal`);
|
|
52
|
+
return { spawnArgs: args, respawned: false };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function spawn(args, request) {
|
|
56
|
+
const explicitTag = clean(args.tag);
|
|
57
|
+
let spawnArgs = args;
|
|
58
|
+
let respawned = false;
|
|
59
|
+
if (explicitTag) {
|
|
60
|
+
const plan = await resolveExplicitTagSpawn(explicitTag, args, request);
|
|
61
|
+
if (plan.reused) return plan.reused;
|
|
62
|
+
spawnArgs = plan.spawnArgs;
|
|
63
|
+
respawned = plan.respawned;
|
|
64
|
+
}
|
|
65
|
+
const job = spawnFlow.startDeferredSpawnJob(
|
|
66
|
+
spawnArgs,
|
|
67
|
+
request.callerCwd,
|
|
68
|
+
request.context,
|
|
69
|
+
request.notifyContext,
|
|
70
|
+
respawned ? { respawned: true } : {}
|
|
71
|
+
);
|
|
72
|
+
return spawnResult(job);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return { spawn };
|
|
76
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { errorLine } from '../../runtime/shared/err-text.mjs';
|
|
2
|
+
import { createSendDispatch } from './execute-send.mjs';
|
|
3
|
+
import { createSpawnDispatch } from './execute-spawn.mjs';
|
|
4
|
+
import { agentScope, clean } from './helpers.mjs';
|
|
5
|
+
import { renderResult } from './render.mjs';
|
|
6
|
+
|
|
7
|
+
// The agent tool's request dispatch: list/status/read/cleanup/cancel/close/
|
|
8
|
+
// send/spawn. The dead-tag send fallback lives in execute-send.mjs and
|
|
9
|
+
// explicit-tag spawn resolution in execute-spawn.mjs.
|
|
10
|
+
export function createAgentExecute({
|
|
11
|
+
mgr,
|
|
12
|
+
defaultCwd,
|
|
13
|
+
awaitKeychainPrewarm,
|
|
14
|
+
registry,
|
|
15
|
+
views,
|
|
16
|
+
spawnFlow,
|
|
17
|
+
sendFlow,
|
|
18
|
+
closeFlow,
|
|
19
|
+
terminalTrace,
|
|
20
|
+
}) {
|
|
21
|
+
const spawnResult = (job) => renderResult(views.renderJob(job, false));
|
|
22
|
+
|
|
23
|
+
async function readJob(args, scopedContext) {
|
|
24
|
+
const job = views.getJobOrWorker(args, scopedContext);
|
|
25
|
+
if (job?.taskId == null && typeof mgr.readSessionHandoff === 'function') {
|
|
26
|
+
const handoff = await mgr.readSessionHandoff(job.meta?.sessionId);
|
|
27
|
+
if (handoff) job.result = handoff;
|
|
28
|
+
}
|
|
29
|
+
return renderResult(views.renderJob(job, true));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const { send } = createSendDispatch({ registry, defaultCwd, sendFlow, spawnFlow, spawnResult });
|
|
33
|
+
const { spawn } = createSpawnDispatch({ registry, terminalTrace, sendFlow, spawnFlow, spawnResult });
|
|
34
|
+
|
|
35
|
+
return async function execute(args = {}, context = {}) {
|
|
36
|
+
try {
|
|
37
|
+
await awaitKeychainPrewarm();
|
|
38
|
+
const type = clean(args.type) || 'spawn';
|
|
39
|
+
const request = {
|
|
40
|
+
callerCwd: clean(context.cwd || context.callerCwd),
|
|
41
|
+
scopedContext: agentScope(args, context),
|
|
42
|
+
context,
|
|
43
|
+
notifyContext: context,
|
|
44
|
+
};
|
|
45
|
+
const { scopedContext } = request;
|
|
46
|
+
if (typeof mgr.rehydrateAgentSessions === 'function') {
|
|
47
|
+
await mgr.rehydrateAgentSessions();
|
|
48
|
+
// Rebuild tag ownership from canonical records even if a daemon crash
|
|
49
|
+
// happened before the auxiliary worker row was flushed.
|
|
50
|
+
registry.refreshTagsFromSessions({ scanSessions: true, context: scopedContext });
|
|
51
|
+
}
|
|
52
|
+
switch (type) {
|
|
53
|
+
case 'status':
|
|
54
|
+
case 'list':
|
|
55
|
+
if (type === 'status' && (clean(args.task_id) || clean(args.tag) || clean(args.sessionId))) {
|
|
56
|
+
return renderResult(views.renderJob(views.getJobOrWorker(args, scopedContext), false), {
|
|
57
|
+
includeDiagnostics: true,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// Targetless status is the same compact overview as list.
|
|
61
|
+
return renderResult({
|
|
62
|
+
workers: views.list({ scanSessions: registry.wantsSessionScan(args), context: scopedContext }),
|
|
63
|
+
jobs: views.listJobs(scopedContext),
|
|
64
|
+
});
|
|
65
|
+
case 'read':
|
|
66
|
+
return await readJob(args, scopedContext);
|
|
67
|
+
case 'cleanup':
|
|
68
|
+
return renderResult(closeFlow.cleanup(args, scopedContext));
|
|
69
|
+
case 'cancel':
|
|
70
|
+
case 'close':
|
|
71
|
+
return renderResult(await closeFlow.close(args, scopedContext));
|
|
72
|
+
case 'send':
|
|
73
|
+
return await send(args, request);
|
|
74
|
+
case 'spawn':
|
|
75
|
+
return await spawn(args, request);
|
|
76
|
+
default:
|
|
77
|
+
throw new Error(`agent: unknown type "${type}"`);
|
|
78
|
+
}
|
|
79
|
+
} catch (err) {
|
|
80
|
+
return errorLine(err, { surface: 'agent' });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Dependency-light helpers
|
|
1
|
+
// Dependency-light helpers for the agent-tool facade.
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
4
|
import {
|
|
@@ -59,21 +59,7 @@ export function agentTagOf(session) {
|
|
|
59
59
|
return clean(session?.agentTag);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
* NUMBERS (session-service stamps `Date.now()`) and numeric strings once such a
|
|
64
|
-
* stamp round-trips through the JSON row store. Date.parse() returns NaN for
|
|
65
|
-
* the latter two, so every stamp comparison must go through here. Mirrors
|
|
66
|
-
* stampMs() in runtime/agent/orchestrator/session/store-summary-reader.mjs,
|
|
67
|
-
* which is module-private there. Never returns NaN. */
|
|
68
|
-
export function stampMs(value) {
|
|
69
|
-
if (typeof value === 'number') return Number.isFinite(value) && value > 0 ? value : 0;
|
|
70
|
-
const text = clean(value);
|
|
71
|
-
if (!text) return 0;
|
|
72
|
-
const numeric = Number(text);
|
|
73
|
-
if (Number.isFinite(numeric) && numeric > 0 && !/^\d{4}-/.test(text)) return numeric;
|
|
74
|
-
const parsed = Date.parse(text);
|
|
75
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
|
|
76
|
-
}
|
|
62
|
+
export { stampMs } from '../../runtime/shared/agent-reap-state.mjs';
|
|
77
63
|
|
|
78
64
|
export function normalizeAgentName(value) {
|
|
79
65
|
const id = clean(value)
|
|
@@ -114,13 +100,10 @@ export function sessionMatchesContext(session, context = {}) {
|
|
|
114
100
|
return !!sessionPid && sessionPid === wantedPid;
|
|
115
101
|
}
|
|
116
102
|
|
|
103
|
+
// A persisted worker row carries the same ownership fields as the session it
|
|
104
|
+
// describes, so it is scoped by exactly the same rule.
|
|
117
105
|
export function rowMatchesContext(row, context = {}) {
|
|
118
|
-
|
|
119
|
-
if (wantedSession) return clean(row?.parentSessionId || row?.ownerSessionId) === wantedSession;
|
|
120
|
-
const wantedPid = terminalPidForContext(context);
|
|
121
|
-
if (!wantedPid) return true;
|
|
122
|
-
const rowPid = positiveInt(row?.clientHostPid);
|
|
123
|
-
return !!rowPid && rowPid === wantedPid;
|
|
106
|
+
return sessionMatchesContext(row, context);
|
|
124
107
|
}
|
|
125
108
|
|
|
126
109
|
export function nonNegativeInt(value) {
|
|
@@ -273,7 +256,7 @@ function formatElapsedMs(ms) {
|
|
|
273
256
|
return remMin ? `${hr}h${remMin}m` : `${hr}h`;
|
|
274
257
|
}
|
|
275
258
|
|
|
276
|
-
export function elapsedFromStamps(startedAt, finishedAt,
|
|
259
|
+
export function elapsedFromStamps(startedAt, finishedAt, _status) {
|
|
277
260
|
const start = Date.parse(clean(startedAt));
|
|
278
261
|
if (!Number.isFinite(start)) return null;
|
|
279
262
|
const finish = Date.parse(clean(finishedAt));
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// job-views/agent-list.mjs
|
|
2
|
+
// The /agents list projection: one row per tagged agent session with its live
|
|
3
|
+
// progress, filtered by default to workers that can still do work.
|
|
4
|
+
import { ACTIVE_STAGES } from '../tool-def.mjs';
|
|
5
|
+
import { isTerminalWorkerStatus } from '../worker-rows.mjs';
|
|
6
|
+
|
|
7
|
+
// Idle, closed, errored and reaped/unknown rows are history and stay reachable
|
|
8
|
+
// through the task section (status/read keep their terminal result).
|
|
9
|
+
export function isActiveWorkerRow(row = {}) {
|
|
10
|
+
const stage = String(row.stage ?? '')
|
|
11
|
+
.trim()
|
|
12
|
+
.toLowerCase();
|
|
13
|
+
const status = String(row.status ?? '')
|
|
14
|
+
.trim()
|
|
15
|
+
.toLowerCase();
|
|
16
|
+
if (ACTIVE_STAGES.has(stage) || ACTIVE_STAGES.has(status)) return true;
|
|
17
|
+
const effective = stage || status;
|
|
18
|
+
if (!effective || effective === 'unknown') return false;
|
|
19
|
+
return !isTerminalWorkerStatus(effective);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function agentRow({ tag, session, runtime, progress, now }) {
|
|
23
|
+
const status = session.closed === true ? 'closed' : session.status || 'idle';
|
|
24
|
+
const stage =
|
|
25
|
+
session.stage ||
|
|
26
|
+
(status === 'idle' || status === 'error' || status === 'closed' ? status : runtime?.stage || status);
|
|
27
|
+
return {
|
|
28
|
+
tag,
|
|
29
|
+
sessionId: session.id,
|
|
30
|
+
agent: session.agent || null,
|
|
31
|
+
provider: session.provider,
|
|
32
|
+
model: session.model,
|
|
33
|
+
preset: session.presetName || null,
|
|
34
|
+
effort: session.effort || null,
|
|
35
|
+
fast: session.fast === true,
|
|
36
|
+
status,
|
|
37
|
+
stage,
|
|
38
|
+
...progress,
|
|
39
|
+
createdAt: session.createdAt || null,
|
|
40
|
+
updatedAt: session.updatedAt || null,
|
|
41
|
+
lastUsedAt: session.lastUsedAt || null,
|
|
42
|
+
clientHostPid: session.clientHostPid || null,
|
|
43
|
+
lastStreamDeltaAt: runtime?.lastStreamDeltaAt ? new Date(runtime.lastStreamDeltaAt).toISOString() : null,
|
|
44
|
+
staleSeconds: runtime?.lastStreamDeltaAt ? Math.floor((now - runtime.lastStreamDeltaAt) / 1000) : null,
|
|
45
|
+
windowTokens: Number(session.lastContextTokens ?? session.lastInputTokens) || 0,
|
|
46
|
+
windowCap: Number(session.contextWindow) || null,
|
|
47
|
+
permission: session.permission || null,
|
|
48
|
+
toolPermission: session.toolPermission || null,
|
|
49
|
+
messages: Array.isArray(session.messages)
|
|
50
|
+
? session.messages.length
|
|
51
|
+
: Math.max(0, Number(session.messageCount || 0)),
|
|
52
|
+
tools: Array.isArray(session.tools) ? session.tools.length : Math.max(0, Number(session.toolCount || 0)),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function createAgentList({ mgr, refreshTagsFromSessions, agentSessionEntries, progress }) {
|
|
57
|
+
return function list({ scanSessions = false, context = {}, includeTerminal = false } = {}) {
|
|
58
|
+
refreshTagsFromSessions({ scanSessions, context });
|
|
59
|
+
const now = Date.now();
|
|
60
|
+
const rows = agentSessionEntries({ scanSessions, context }).map(({ tag, session }) =>
|
|
61
|
+
agentRow({
|
|
62
|
+
tag,
|
|
63
|
+
session,
|
|
64
|
+
runtime: mgr.getSessionRuntime?.(session.id),
|
|
65
|
+
progress: progress.sessionProgressExtras(session.id, session.agent || null, now),
|
|
66
|
+
now,
|
|
67
|
+
})
|
|
68
|
+
);
|
|
69
|
+
return includeTerminal ? rows : rows.filter((row) => isActiveWorkerRow(row));
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// job-views/job-lookup.mjs
|
|
2
|
+
// Resolving read/status arguments to a job: by task id, then by tag/sessionId
|
|
3
|
+
// against the background-task registry, then — because background tasks are
|
|
4
|
+
// process-memory only while a worker SESSION can outlive its spawn task (task
|
|
5
|
+
// pruned, engine restarted) — a synthetic job built from the worker session.
|
|
6
|
+
import { getBackgroundTask, listBackgroundTasks, taskIdFromArgs } from '../../../runtime/shared/background-tasks.mjs';
|
|
7
|
+
import { clean } from '../helpers.mjs';
|
|
8
|
+
|
|
9
|
+
/** The worker's readable result: its last non-empty assistant message, else
|
|
10
|
+
* its last handoff, else a placeholder. */
|
|
11
|
+
function workerResultText(session) {
|
|
12
|
+
const msgs = Array.isArray(session.messages) ? session.messages : [];
|
|
13
|
+
const lastAssistant = msgs.findLast(
|
|
14
|
+
(m) => m?.role === 'assistant' && (typeof m.content === 'string' ? m.content.trim() : m.content)
|
|
15
|
+
);
|
|
16
|
+
if (lastAssistant) {
|
|
17
|
+
return typeof lastAssistant.content === 'string' ? lastAssistant.content : JSON.stringify(lastAssistant.content);
|
|
18
|
+
}
|
|
19
|
+
if (typeof session.lastHandoff === 'string' && session.lastHandoff.trim()) return session.lastHandoff;
|
|
20
|
+
return '(worker session has no assistant output yet)';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function createJobLookup({ mgr, tags, refreshTagsFromSessions }) {
|
|
24
|
+
function getJob(args, context = {}) {
|
|
25
|
+
const taskId = taskIdFromArgs(args);
|
|
26
|
+
if (taskId) {
|
|
27
|
+
const task = getBackgroundTask(taskId, { surface: 'agent', context });
|
|
28
|
+
if (!task) throw new Error(`agent read/status: task "${taskId}" not found`);
|
|
29
|
+
return task;
|
|
30
|
+
}
|
|
31
|
+
// Same precedence as close(): clean(args.tag || args.sessionId || ...).
|
|
32
|
+
const target = clean(args.tag || args.sessionId);
|
|
33
|
+
if (!target) throw new Error('agent read/status: task_id, tag, or sessionId is required');
|
|
34
|
+
const candidates = listBackgroundTasks({ surface: 'agent', context })
|
|
35
|
+
.filter(Boolean)
|
|
36
|
+
.filter((row) => row.tag === target || row.sessionId === target);
|
|
37
|
+
if (!candidates.length) throw new Error(`agent read/status: no task found for tag/sessionId "${target}"`);
|
|
38
|
+
// Prefer most recent when multiple tasks match the same tag.
|
|
39
|
+
candidates.sort((a, b) => new Date(b.startedAt || 0) - new Date(a.startedAt || 0));
|
|
40
|
+
const task = getBackgroundTask(candidates[0].task_id, { surface: 'agent', context });
|
|
41
|
+
if (!task) throw new Error(`agent read/status: task "${candidates[0].task_id}" not found`);
|
|
42
|
+
return task;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function workerFallbackJob(target, context = {}) {
|
|
46
|
+
refreshTagsFromSessions({ scanSessions: true, context });
|
|
47
|
+
const sessionId = tags.get(target) || (mgr.getSession(target) ? target : null);
|
|
48
|
+
if (!sessionId) return null;
|
|
49
|
+
const session = mgr.getSession(sessionId);
|
|
50
|
+
if (!session) return null;
|
|
51
|
+
return {
|
|
52
|
+
taskId: null,
|
|
53
|
+
operation: 'worker',
|
|
54
|
+
status: session.closed === true ? 'closed' : session.status || 'idle',
|
|
55
|
+
startedAt: session.createdAt || null,
|
|
56
|
+
finishedAt: null,
|
|
57
|
+
error: null,
|
|
58
|
+
result: workerResultText(session),
|
|
59
|
+
meta: {
|
|
60
|
+
tag: tags.has(target) ? target : session.tag || null,
|
|
61
|
+
sessionId,
|
|
62
|
+
agent: session.agent || null,
|
|
63
|
+
preset: session.presetName || null,
|
|
64
|
+
provider: session.provider || null,
|
|
65
|
+
model: session.model || null,
|
|
66
|
+
effort: session.effort || null,
|
|
67
|
+
fast: session.fast === true,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function getJobOrWorker(args, context = {}) {
|
|
73
|
+
try {
|
|
74
|
+
return getJob(args, context);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
const target = clean(args.tag || args.sessionId);
|
|
77
|
+
const fallback = target ? workerFallbackJob(target, context) : null;
|
|
78
|
+
if (fallback) return fallback;
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return { getJob, workerFallbackJob, getJobOrWorker };
|
|
84
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// job-views/job-render.mjs
|
|
2
|
+
// Shaping jobs for callers: the job list rows and the single-job status card,
|
|
3
|
+
// each pairing the task's own fields with either live worker progress or the
|
|
4
|
+
// frozen terminal view.
|
|
5
|
+
import { listBackgroundTasks } from '../../../runtime/shared/background-tasks.mjs';
|
|
6
|
+
import { positiveInt, terminalPidForContext } from '../helpers.mjs';
|
|
7
|
+
import { isTerminalJobStatus, terminalJobFrozenFields } from './session-progress.mjs';
|
|
8
|
+
|
|
9
|
+
/** The identity/route fields every job view starts with. `source` supplies the
|
|
10
|
+
* routing fields (a task summary or a job's meta); `afterAgent` slots extra
|
|
11
|
+
* fields right after `agent`. */
|
|
12
|
+
function jobHead({ taskId, type, status, startedAt, finishedAt, error }, source, afterAgent = {}) {
|
|
13
|
+
return {
|
|
14
|
+
task_id: taskId,
|
|
15
|
+
type,
|
|
16
|
+
status,
|
|
17
|
+
tag: source.tag || null,
|
|
18
|
+
sessionId: source.sessionId || null,
|
|
19
|
+
agent: source.agent || null,
|
|
20
|
+
...afterAgent,
|
|
21
|
+
preset: source.preset || null,
|
|
22
|
+
provider: source.provider || null,
|
|
23
|
+
model: source.model || null,
|
|
24
|
+
effort: source.effort || null,
|
|
25
|
+
fast: source.fast === true || source.fast === false ? source.fast : null,
|
|
26
|
+
startedAt,
|
|
27
|
+
finishedAt: finishedAt || null,
|
|
28
|
+
error: error || null,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function createJobRender({ progress }) {
|
|
33
|
+
function listJobs(context = {}) {
|
|
34
|
+
const wantedPid = terminalPidForContext(context);
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
const rows = listBackgroundTasks({ surface: 'agent', context }).map((task) => {
|
|
37
|
+
const head = jobHead({ ...task, taskId: task.task_id, type: task.operation }, task);
|
|
38
|
+
if (isTerminalJobStatus(task.status)) return { ...head, ...terminalJobFrozenFields(task.status, now) };
|
|
39
|
+
return {
|
|
40
|
+
...head,
|
|
41
|
+
...progress.jobWorkerSnapshot(task.sessionId),
|
|
42
|
+
...progress.sessionProgressExtras(task.sessionId, task.agent || null, now, task.status),
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
if (!wantedPid) return rows;
|
|
46
|
+
return rows.filter((row) => {
|
|
47
|
+
const pid = positiveInt(row.clientHostPid);
|
|
48
|
+
// Spawn-prep rows have no worker session (and therefore no pid) yet;
|
|
49
|
+
// they already passed taskMatchesScope, so the queued spawn stays
|
|
50
|
+
// visible instead of vanishing until a pool slot frees up (user bug:
|
|
51
|
+
// "spawned 5, only 4 listed").
|
|
52
|
+
return pid ? pid === wantedPid : true;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Before the worker session exists, live progress is empty and the status
|
|
57
|
+
* card would show only "status: running"; a minimal stage tells the caller
|
|
58
|
+
* the job is still spinning up rather than silently stalled. */
|
|
59
|
+
function spawningProgress(status) {
|
|
60
|
+
const spawning = status === 'running';
|
|
61
|
+
return {
|
|
62
|
+
worker_stage: spawning ? 'spawning' : status || 'unknown',
|
|
63
|
+
last_progress: spawning ? 'spawning worker session' : status || 'unknown',
|
|
64
|
+
diagnostic: spawning ? 'worker session not started yet' : status || 'unknown',
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function renderJob(job, includeResult = false) {
|
|
69
|
+
const meta = job.meta || {};
|
|
70
|
+
const head = jobHead(
|
|
71
|
+
{ ...job, type: job.operation },
|
|
72
|
+
meta,
|
|
73
|
+
meta.respawned === true
|
|
74
|
+
? {
|
|
75
|
+
respawned: true,
|
|
76
|
+
note: 'previous session reaped — fresh session, no prior context; re-supply anchors if needed',
|
|
77
|
+
}
|
|
78
|
+
: {}
|
|
79
|
+
);
|
|
80
|
+
const tail = includeResult && job.result !== undefined ? { result: job.result } : {};
|
|
81
|
+
// Frozen terminal view: never re-read the (possibly reused) live session.
|
|
82
|
+
if (isTerminalJobStatus(job.status)) {
|
|
83
|
+
return { ...head, ...terminalJobFrozenFields(job.status), ...tail };
|
|
84
|
+
}
|
|
85
|
+
let liveProgress = progress.sessionProgressExtras(meta.sessionId, meta.agent || null, Date.now(), job.status);
|
|
86
|
+
if (!meta.sessionId && (!liveProgress || Object.keys(liveProgress).length === 0)) {
|
|
87
|
+
liveProgress = spawningProgress(job.status);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
...head,
|
|
91
|
+
...progress.jobWorkerSnapshot(meta.sessionId),
|
|
92
|
+
...liveProgress,
|
|
93
|
+
...tail,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return { listJobs, renderJob };
|
|
98
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// job-views/session-progress.mjs
|
|
2
|
+
// Live progress of a worker session (stage, silence, watchdog, queued
|
|
3
|
+
// follow-ups) and the frozen fields a finished job reports instead.
|
|
4
|
+
import { resolveAgentWatchdogPolicy } from '../../../runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs';
|
|
5
|
+
import { buildAgentTaskProgressFields } from '../../agent-task-status.mjs';
|
|
6
|
+
import { getProgressWatchdogState } from '../../agent-watchdog-registry.mjs';
|
|
7
|
+
|
|
8
|
+
// Job statuses that can never progress again (mirrors TERMINAL_STATUSES in
|
|
9
|
+
// runtime/shared/background-tasks.mjs; 'canceled' accepted defensively).
|
|
10
|
+
const TERMINAL_JOB_STATUSES = new Set(['completed', 'failed', 'cancelled', 'canceled']);
|
|
11
|
+
|
|
12
|
+
export function isTerminalJobStatus(status) {
|
|
13
|
+
return TERMINAL_JOB_STATUSES.has(
|
|
14
|
+
String(status ?? '')
|
|
15
|
+
.trim()
|
|
16
|
+
.toLowerCase()
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// A finished job is frozen history. Tags are reused, so its meta.sessionId can
|
|
21
|
+
// point at a session that is NOW running a *different* job; reading live
|
|
22
|
+
// progress for it made every old completed row inherit the current worker's
|
|
23
|
+
// stage ("20 completed rows all reporting streaming/model active"). Terminal
|
|
24
|
+
// rows therefore report only their own recorded status: no live worker
|
|
25
|
+
// snapshot, no silent_for/watchdog/queued_followups.
|
|
26
|
+
export function terminalJobFrozenFields(status, now = Date.now()) {
|
|
27
|
+
const stage =
|
|
28
|
+
String(status ?? '')
|
|
29
|
+
.trim()
|
|
30
|
+
.toLowerCase() || 'unknown';
|
|
31
|
+
return {
|
|
32
|
+
workerStatus: stage,
|
|
33
|
+
stage,
|
|
34
|
+
clientHostPid: null,
|
|
35
|
+
lastStreamDeltaAt: null,
|
|
36
|
+
...buildAgentTaskProgressFields({ now, runtimeStage: stage, taskStatus: stage }),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function createSessionProgress({ mgr }) {
|
|
41
|
+
function sessionProgressExtras(sessionId, role, now = Date.now(), taskStatus = null) {
|
|
42
|
+
if (!sessionId) return {};
|
|
43
|
+
const session = mgr.getSession(sessionId);
|
|
44
|
+
const runtime = mgr.getSessionRuntime?.(sessionId) || null;
|
|
45
|
+
const snapshot =
|
|
46
|
+
typeof mgr.getSessionProgressSnapshot === 'function' ? mgr.getSessionProgressSnapshot(sessionId) : null;
|
|
47
|
+
const policy = role ? resolveAgentWatchdogPolicy(role) : null;
|
|
48
|
+
const queuedFollowups =
|
|
49
|
+
typeof mgr.getSessionPendingMessageDepth === 'function' ? mgr.getSessionPendingMessageDepth(sessionId) : null;
|
|
50
|
+
return buildAgentTaskProgressFields({
|
|
51
|
+
now,
|
|
52
|
+
sessionStatus: session?.status || null,
|
|
53
|
+
runtimeStage: runtime?.stage || snapshot?.stage || session?.status || null,
|
|
54
|
+
snapshot,
|
|
55
|
+
runtime,
|
|
56
|
+
policy,
|
|
57
|
+
watchdogState: getProgressWatchdogState(mgr, sessionId),
|
|
58
|
+
queuedFollowups,
|
|
59
|
+
taskStatus,
|
|
60
|
+
lastToolCall: runtime?.lastToolCall || null,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function jobWorkerSnapshot(sessionId) {
|
|
65
|
+
if (!sessionId) return null;
|
|
66
|
+
const session = mgr.getSession(sessionId);
|
|
67
|
+
if (!session) return null;
|
|
68
|
+
const runtime = mgr.getSessionRuntime?.(sessionId);
|
|
69
|
+
const status = session.closed === true ? 'closed' : session.status || 'idle';
|
|
70
|
+
const progress = sessionProgressExtras(sessionId, session.agent || null);
|
|
71
|
+
return {
|
|
72
|
+
workerStatus: status,
|
|
73
|
+
stage: progress.worker_stage || runtime?.stage || status,
|
|
74
|
+
clientHostPid: session.clientHostPid || null,
|
|
75
|
+
lastStreamDeltaAt: runtime?.lastStreamDeltaAt ? new Date(runtime.lastStreamDeltaAt).toISOString() : null,
|
|
76
|
+
...progress,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return { sessionProgressExtras, jobWorkerSnapshot };
|
|
81
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// job-views/spawn-meta.mjs
|
|
2
|
+
// The task meta a spawn carries: from a prepared spawn, from raw args while
|
|
3
|
+
// the spawn is still pending, and merging later updates into a job.
|
|
4
|
+
import { sanitizeTaskMeta } from '../../../runtime/shared/background-tasks.mjs';
|
|
5
|
+
import { clean, normalizeAgentName, presetKey } from '../helpers.mjs';
|
|
6
|
+
import { resolveAgentSpawnPreset } from '../spawn-preset.mjs';
|
|
7
|
+
|
|
8
|
+
export function preparedSpawnMeta(prepared, extras = {}) {
|
|
9
|
+
return sanitizeTaskMeta({
|
|
10
|
+
...(extras || {}),
|
|
11
|
+
tag: prepared.tag,
|
|
12
|
+
sessionId: prepared.session.id,
|
|
13
|
+
agent: prepared.agent,
|
|
14
|
+
preset: presetKey(prepared.preset) || prepared.presetName,
|
|
15
|
+
provider: prepared.preset.provider,
|
|
16
|
+
model: prepared.preset.model,
|
|
17
|
+
effort: prepared.preset.effort || null,
|
|
18
|
+
fast: prepared.preset.fast === true,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Best-effort resolve the default preset so the pending "Spawn …" card can
|
|
23
|
+
* already show the model (e.g. "Spawn Heavy Worker (Opus 4.8)") even when the
|
|
24
|
+
* caller did not pass an explicit provider/model. Never throws: falls back to
|
|
25
|
+
* whatever raw args carry. */
|
|
26
|
+
export function pendingSpawnMeta(cfgMod, args = {}, extras = {}) {
|
|
27
|
+
const agent = normalizeAgentName(args.agent);
|
|
28
|
+
let resolved = null;
|
|
29
|
+
if (!clean(args.model) || !clean(args.provider)) {
|
|
30
|
+
try {
|
|
31
|
+
resolved = resolveAgentSpawnPreset(cfgMod.loadConfig(), args)?.preset || null;
|
|
32
|
+
} catch {
|
|
33
|
+
resolved = null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return sanitizeTaskMeta({
|
|
37
|
+
...(extras || {}),
|
|
38
|
+
tag: clean(args.tag) || null,
|
|
39
|
+
sessionId: null,
|
|
40
|
+
agent: agent || null,
|
|
41
|
+
preset: clean(args.preset) || presetKey(resolved) || null,
|
|
42
|
+
provider: clean(args.provider) || clean(resolved?.provider) || null,
|
|
43
|
+
model: clean(args.model) || clean(resolved?.model) || null,
|
|
44
|
+
effort: clean(args.effort) || clean(resolved?.effort) || null,
|
|
45
|
+
fast: args.fast === true || resolved?.fast === true ? true : null,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function mergeJobMeta(job, meta = {}) {
|
|
50
|
+
if (!job || !meta || typeof meta !== 'object') return;
|
|
51
|
+
const next = sanitizeTaskMeta({ ...(job.meta || {}), ...meta });
|
|
52
|
+
job.meta = next;
|
|
53
|
+
if (job.input && typeof job.input === 'object') {
|
|
54
|
+
job.input = {
|
|
55
|
+
...job.input,
|
|
56
|
+
tag: next.tag || job.input.tag || null,
|
|
57
|
+
sessionId: next.sessionId || job.input.sessionId || null,
|
|
58
|
+
agent: next.agent || job.input.agent || null,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
job.label = next.tag || next.sessionId || job.label;
|
|
62
|
+
}
|