mixdog 0.9.174 → 1.0.0
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/README.md +11 -12
- package/package.json +2 -2
- package/scripts/agent-turn-trace-probe.mjs +1 -1
- package/scripts/build-ffmpeg-runtime.sh +16 -0
- package/scripts/build-runtime-linux.sh +8 -2
- package/scripts/build-runtime-macos.sh +8 -2
- package/scripts/computer-task-cost-report.mjs +1 -9
- package/scripts/context-renewal-live-check.mjs +2 -1
- package/scripts/graph-parity.mjs +78 -55
- package/scripts/lib/bench-sandbox.mjs +67 -0
- package/scripts/lib/bench-sandbox.test.mjs +54 -0
- package/scripts/lib/coverage.mjs +2 -4
- package/scripts/lib/run-node-tests.mjs +24 -1
- package/scripts/lib/session-bench-fmt.mjs +65 -0
- package/scripts/lib/session-bench-render.mjs +394 -0
- package/scripts/lib/smoke-loop-shared.mjs +28 -0
- package/scripts/lib/smoke-loop-shared.test.mjs +22 -0
- package/scripts/lib/trace-row.mjs +40 -0
- package/scripts/lib/trace-row.test.mjs +47 -0
- package/scripts/lib/trace-stats.mjs +7 -0
- package/scripts/lib/trace-stats.test.mjs +7 -1
- package/scripts/llm-trace-summary.mjs +2 -44
- package/scripts/memory-chunk-quality.mjs +1 -1
- package/scripts/memory-layer2-check.mjs +1 -1
- package/scripts/pg-memory-diet.mjs +1 -1
- package/scripts/plan-runtime-release-tag.mjs +57 -0
- package/scripts/prepare-native-assets.mjs +1 -1
- package/scripts/provider-contract-test-env.mjs +21 -0
- package/scripts/release-paths.mjs +1 -0
- package/scripts/routing-corpus.mjs +1 -11
- package/scripts/session-diag.mjs +2 -44
- package/scripts/smoke-runtime-negative.sh +7 -1
- package/scripts/test-data-dir.mjs +19 -0
- package/scripts/tidy/sync-engines-manifest.mjs +8 -10
- package/scripts/tool-efficiency-diag.mjs +1 -4
- package/scripts/voice-runtime-config.json +1 -1
- package/src/app.mjs +1 -1
- package/src/defaults/skills/code-tidy/SKILL.md +5 -2
- package/src/defaults/skills/pptx/SKILL.md +1 -1
- package/src/defaults/skills/pptx/references/pictures.md +1 -1
- package/src/defaults/skills/pptx/scripts/review-deck.mjs +13 -4
- package/src/defaults/skills/skill-creator/scripts/validate-skill.mjs +40 -40
- package/src/defaults/skills/xlsx/SKILL.md +1 -0
- package/src/headless-exec.mjs +4 -2
- package/src/headless-role.mjs +81 -68
- package/src/lib/keychain-cjs.cjs +26 -49
- package/src/lib/mixdog-debug.cjs +1 -1
- package/src/lib/rules-builder.cjs +4 -3
- package/src/mixdog-session-runtime.mjs +2 -2
- package/src/repl/slash-commands.mjs +1 -1
- package/src/repl/stream-sink.mjs +1 -1
- package/src/repl/turn-output.mjs +2 -2
- package/src/repl.mjs +1 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/session-prep.mjs +1 -1
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +20 -16
- package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +0 -3
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +23 -22
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +2 -2
- package/src/runtime/{shared/llm/index.mjs → agent/orchestrator/maintenance-preset.mjs} +2 -2
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +2 -1
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +7 -36
- package/src/runtime/agent/orchestrator/mcp/client.mjs +28 -2
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-api-transport.mjs +6 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +1 -47
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +1 -383
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +2 -59
- package/src/runtime/agent/orchestrator/providers/anthropic-midstream-recovery.mjs +32 -31
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +10 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +12 -61
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/gzip-post.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +30 -67
- package/src/runtime/agent/orchestrator/providers/anthropic-recovery-guards.mjs +9 -12
- package/src/runtime/agent/orchestrator/providers/anthropic-server-fallback.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/leak-guard.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events/content-block-stop.mjs +20 -12
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-events.mjs +12 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn/turn-outcome.mjs +4 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-turn.mjs +5 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-sse-watchdogs.mjs +18 -10
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +20 -16
- package/src/runtime/agent/orchestrator/providers/anthropic-thinking-contract.mjs +1 -26
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +9 -13
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +8 -3
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +4 -8
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +21 -30
- package/src/runtime/agent/orchestrator/providers/antigravity-response.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-stream.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/api-usage.mjs +10 -8
- package/src/runtime/agent/orchestrator/providers/cursor-auth.mjs +13 -10
- package/src/runtime/agent/orchestrator/providers/cursor-client-version.mjs +29 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-guards.mjs +0 -1
- package/src/runtime/agent/orchestrator/providers/cursor-wire-protobuf.mjs +10 -26
- package/src/runtime/agent/orchestrator/providers/cursor-wire-stream-bridge.mjs +2 -3
- package/src/runtime/agent/orchestrator/providers/cursor-wire-transport.mjs +7 -3
- package/src/runtime/agent/orchestrator/providers/cursor-wire.mjs +9 -15
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +31 -5
- package/src/runtime/agent/orchestrator/providers/gemini-cache-policy.mjs +1 -2
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +1 -4
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +48 -46
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +18 -19
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +3 -26
- package/src/runtime/agent/orchestrator/providers/grok-client-version.mjs +41 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +5 -19
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +16 -83
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +26 -8
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-models.mjs +8 -0
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +30 -1
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-stream-labels.mjs +6 -0
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-system-blocks.mjs +17 -0
- package/src/runtime/agent/orchestrator/providers/{anthropic-leaked-toolcall.mjs → lib/leaked-toolcall.mjs} +7 -7
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +44 -0
- package/src/runtime/agent/orchestrator/providers/lib/send-callbacks.mjs +12 -0
- package/src/runtime/agent/orchestrator/providers/lib/sse-framing.mjs +9 -8
- package/src/runtime/agent/orchestrator/providers/lib/transport-fallback-trace.mjs +25 -0
- package/src/runtime/agent/orchestrator/providers/model-catalog-projection.mjs +1 -181
- package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +1 -796
- package/src/runtime/agent/orchestrator/providers/model-pricing-rates.mjs +1 -71
- package/src/runtime/agent/orchestrator/providers/npm-cli-version.mjs +87 -0
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +4 -5
- package/src/runtime/agent/orchestrator/providers/openai-codex-metadata.mjs +4 -5
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +2 -21
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-result.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +2 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/tool-call-acc.mjs +1 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-options.mjs +4 -8
- package/src/runtime/agent/orchestrator/providers/openai-compat-response-normalization.mjs +45 -32
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-events.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-state.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +6 -12
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream-common.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-trace.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +14 -22
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +25 -34
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +14 -14
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-request.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/terminal-frames.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-items.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-outcome.mjs +2 -13
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-state.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/text-relay.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +2 -44
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +2 -16
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +6 -5
- package/src/runtime/agent/orchestrator/providers/openai-responses-input.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws-response-state/tool-calls.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws-text-relay.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +6 -4
- package/src/runtime/agent/orchestrator/providers/opencode-go-usage.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/provider-catalog-cache.mjs +1 -130
- package/src/runtime/agent/orchestrator/providers/registry.mjs +20 -16
- package/src/runtime/agent/orchestrator/providers/retry-classification.mjs +21 -20
- package/src/runtime/agent/orchestrator/providers/retry-executor.mjs +17 -17
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +193 -0
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +421 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/context-inspection.mjs +17 -17
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/context-status-inspection.mjs +1 -1
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/context-status-shape.mjs +3 -3
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/context-status.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-delta.mjs +101 -0
- package/src/runtime/agent/orchestrator/runtime-core/effort.mjs +145 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/extension-scopes.mjs +5 -5
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/fs-utils.mjs +1 -1
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-control.mjs +2 -2
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-mutations.mjs +2 -2
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-reminder.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/goal-state.mjs +326 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-storage.mjs +2 -2
- package/src/runtime/agent/orchestrator/runtime-core/goal-tasks.mjs +148 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-title.mjs +2 -2
- package/src/runtime/agent/orchestrator/runtime-core/goal-tool-defs.mjs +140 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-turns.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/model-capabilities.mjs +140 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/orchestration.mjs +1 -1
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/plugin-mcp.mjs +2 -2
- package/src/runtime/agent/orchestrator/runtime-core/session-id.mjs +2 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/session-route-policy.mjs +2 -2
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/session-text.mjs +3 -3
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/session-title.mjs +1 -2
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/skill-tool-loading.mjs +1 -1
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/tool-catalog-schema.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +747 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +149 -0
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/workflow/agents.mjs +11 -7
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/workflow/context.mjs +6 -4
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/workflow/packs.mjs +2 -3
- package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/workflow-ids.mjs +1 -1
- package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +255 -0
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +3 -4
- package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +2 -4
- package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/context-identity-writer.mjs +162 -0
- package/src/runtime/agent/orchestrator/session/context-tool-pairs.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/context-tool-schema.mjs +87 -0
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +3 -245
- package/src/runtime/agent/orchestrator/session/eager-dispatch/admission.mjs +2 -3
- package/src/runtime/agent/orchestrator/session/eager-dispatch/mutation-paths.mjs +54 -0
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/lifecycle-scan.mjs +1 -16
- package/src/runtime/agent/orchestrator/session/loop/arg-schema-coerce.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/loop/deferred-call-through.mjs +4 -4
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/continuation.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +2 -3
- package/src/runtime/agent/orchestrator/session/loop/request-boundary.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +6 -3
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/call-prep.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +6 -10
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop.mjs +5 -6
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-commit.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-prepare.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +5 -5
- package/src/runtime/agent/orchestrator/session/manager/foreign-pending-messages.mjs +40 -64
- package/src/runtime/agent/orchestrator/session/manager/pending-lifecycle-epoch.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +24 -16
- package/src/runtime/agent/orchestrator/session/manager/pending-persist-queue.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-file.mjs +7 -13
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-path.mjs +17 -2
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-shard.mjs +139 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-sweep.mjs +34 -14
- package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge/file-prefetch.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +4 -18
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +10 -18
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +6 -10
- package/src/runtime/agent/orchestrator/session/manager.mjs +1 -2
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +11 -6
- package/src/runtime/agent/orchestrator/session/result-classification.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/send-instrumentation.mjs +194 -0
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +6 -198
- package/src/runtime/agent/orchestrator/session/store/canonical-reader.mjs +7 -7
- package/src/runtime/agent/orchestrator/session/store/fs-probe.mjs +0 -19
- package/src/runtime/agent/orchestrator/session/store/lifecycle-barriers.mjs +15 -8
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +18 -29
- package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +6 -36
- package/src/runtime/agent/orchestrator/session/store/save-delta.mjs +148 -0
- package/src/runtime/agent/orchestrator/session/store/save-fault.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +15 -142
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/store/sweep/stale-sweep.mjs +4 -2
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-finish.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-row.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/store/write-admission.mjs +9 -22
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +14 -6
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +200 -52
- package/src/runtime/agent/orchestrator/session/store-summary-log.mjs +81 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +38 -4
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +5 -2
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +3 -5
- package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +54 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +5 -9
- package/src/runtime/agent/orchestrator/session/tool-batch/execute-call.mjs +19 -8
- package/src/runtime/agent/orchestrator/session/tool-batch/flush.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/tool-batch/record-outcome.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/agent-envelope.mjs +489 -0
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +419 -0
- package/src/runtime/agent/orchestrator/session/transcript-restore/tool-result-status.mjs +358 -0
- package/src/runtime/agent/orchestrator/session/transcript-restore/tool-result-text.mjs +157 -0
- package/src/runtime/agent/orchestrator/tools/bash-policy-scan.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +32 -11
- package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +1 -31
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/benign-exit.mjs +7 -3
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/deadline-plan.mjs +11 -3
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +4 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +13 -7
- package/src/runtime/agent/orchestrator/tools/builtin/binary-file.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +11 -5
- package/src/runtime/agent/orchestrator/tools/builtin/device-paths.mjs +1 -206
- package/src/runtime/agent/orchestrator/tools/builtin/find-files-tool.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +39 -3
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-path-fanout.mjs +5 -7
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-request.mjs +7 -25
- package/src/runtime/agent/orchestrator/tools/builtin/lib/list-helpers.mjs +27 -1
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-input-helpers.mjs +37 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-insights.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +28 -18
- package/src/runtime/agent/orchestrator/tools/builtin/native-search-client.mjs +6 -10
- package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +15 -17
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +1 -399
- package/src/runtime/agent/orchestrator/tools/builtin/read-line-collector.mjs +3 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-office-files.mjs +8 -15
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +5 -8
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-render.mjs +3 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-source-windows.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +6 -5
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +50 -5
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-render.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-snapshot.mjs +2 -5
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +11 -1
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +3 -35
- package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +0 -12
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +50 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +9 -26
- package/src/runtime/agent/orchestrator/tools/builtin/shell-lossless-compact.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-output.mjs +6 -5
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-helpers.mjs +8 -3
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-store.mjs +6 -14
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-validation.mjs +3 -9
- package/src/runtime/agent/orchestrator/tools/builtin/tool-output-limit.mjs +1 -60
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +10 -32
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/calls.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/project-root.mjs +3 -7
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +15 -10
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +6 -10
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +4 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/text-columns.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +3 -7
- package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +1 -84
- package/src/runtime/agent/orchestrator/tools/destructive-warning.mjs +11 -11
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- package/src/runtime/agent/orchestrator/tools/io-trace.mjs +28 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +38 -5
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +10 -4
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/codex-batch.mjs +6 -26
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/request.mjs +0 -3
- package/src/runtime/agent/orchestrator/tools/patch/dispatch/native-report.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +3 -10
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/mutation-output.mjs +6 -19
- package/src/runtime/agent/orchestrator/tools/patch/native-server.mjs +5 -15
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +1 -3
- package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +4 -0
- package/src/runtime/agent/orchestrator/tools/patch/sequence/run.mjs +1 -3
- package/src/runtime/agent/orchestrator/tools/patch/sequence/units.mjs +4 -10
- package/src/runtime/agent/orchestrator/tools/patch/sequence.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +5 -11
- package/src/runtime/agent/orchestrator/tools/patch-binary-fetcher.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/patch-manifest-path.mjs +3 -0
- package/src/runtime/agent/orchestrator/tools/patch-manifest.json +12 -12
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +87 -12
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/shell-exec-policy.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/shell-policy.mjs +15 -25
- package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +13 -13
- package/src/runtime/{shared/llm → agent/orchestrator}/usage-log.mjs +1 -1
- package/src/runtime/attachments/pdf-extract.mjs +32 -29
- package/src/runtime/attachments/store.mjs +2 -1
- package/src/runtime/browser-bridge/browser-action-contract.d.mts +0 -2
- package/src/runtime/browser-bridge/client.mjs +30 -9
- package/src/runtime/channels/data/voice-runtime-manifest.json +21 -21
- package/src/runtime/channels/lib/config.mjs +4 -4
- package/src/runtime/channels/lib/event-pipeline.mjs +3 -3
- package/src/runtime/channels/lib/event-queue.mjs +1 -0
- package/src/runtime/channels/lib/executor.mjs +3 -25
- package/src/runtime/channels/lib/runtime-paths.mjs +36 -41
- package/src/runtime/channels/lib/scheduler.mjs +28 -44
- package/src/runtime/{shared → channels/lib}/schedules-db.mjs +3 -3
- package/src/runtime/channels/lib/tool-dispatch.mjs +3 -8
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +19 -23
- package/src/runtime/channels/lib/voice-transcription.mjs +13 -9
- package/src/runtime/channels/lib/webhook/log.mjs +2 -29
- package/src/runtime/channels/lib/webhook/request-handler.mjs +4 -5
- package/src/runtime/channels/lib/webhook/session-dispatch.mjs +8 -12
- package/src/runtime/channels/lib/webhook/signature.mjs +15 -19
- package/src/runtime/channels/lib/webhook/untrusted-fence.mjs +9 -0
- package/src/runtime/channels/lib/webhook.mjs +1 -1
- package/src/runtime/{shared → channels/lib}/webhooks-db.mjs +3 -3
- package/src/runtime/channels/lib/whisper-server.mjs +3 -2
- package/src/runtime/channels/lib/worker-bootstrap.mjs +19 -21
- package/src/runtime/channels/lib/worker-main.mjs +49 -58
- package/src/runtime/computer-bridge/client.mjs +7 -10
- package/src/runtime/computer-bridge/core-actions.mjs +1 -1
- package/src/runtime/computer-bridge/limits.d.mts +0 -1
- package/src/runtime/github/client.mjs +11 -6
- package/src/runtime/github/commands.mjs +4 -2
- package/src/runtime/github/contract.mjs +3 -1
- package/src/runtime/local-provider/hugging-face.mjs +3 -3
- package/src/runtime/local-provider/registered-models.mjs +3 -1
- package/src/runtime/local-provider/request-queue.mjs +24 -29
- package/src/runtime/local-provider/serial-chain.mjs +19 -0
- package/src/runtime/local-provider/server-process.mjs +2 -10
- package/src/runtime/media/adapters/antigravity-image.mjs +2 -2
- package/src/runtime/media/adapters/codex-image.mjs +2 -2
- package/src/runtime/media/adapters/gemini-image.mjs +2 -1
- package/src/runtime/media/adapters/gemini-video.mjs +3 -7
- package/src/runtime/media/adapters/xai-media.mjs +3 -7
- package/src/runtime/media/bounded-signal.mjs +13 -0
- package/src/runtime/media/store.mjs +9 -3
- package/src/runtime/memory/data/runtime-manifest.json +11 -11
- package/src/runtime/memory/index.mjs +6 -21
- package/src/runtime/memory/lib/core-memory-file.mjs +1 -1
- package/src/runtime/memory/lib/cycle-scheduler/backlog-probe.mjs +2 -1
- package/src/runtime/memory/lib/cycle1/cycle1-plan.mjs +1 -1
- package/src/runtime/memory/lib/embedding-idle-lease.mjs +18 -0
- package/src/runtime/memory/lib/embedding-provider.mjs +13 -0
- package/src/runtime/memory/lib/embedding-worker.mjs +12 -1
- package/src/runtime/memory/lib/http-router/ingest-routes.mjs +1 -1
- package/src/runtime/memory/lib/http-router/session-routes.mjs +1 -1
- package/src/runtime/memory/lib/ingest/transcript-discovery.mjs +1 -1
- package/src/runtime/memory/lib/memory-action-handlers/manage-actions.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle1.mjs +24 -1
- package/src/runtime/memory/lib/memory-cycle2-quarantine.mjs +99 -0
- package/src/runtime/memory/lib/memory-cycle2-review.mjs +8 -2
- package/src/runtime/memory/lib/memory-cycle2.mjs +49 -9
- package/src/runtime/memory/lib/memory-embed.mjs +3 -2
- package/src/runtime/memory/lib/memory-extraction.mjs +1 -2
- package/src/runtime/memory/lib/memory-fingerprint.mjs +1 -1
- package/src/runtime/memory/lib/memory-ops-policy.mjs +18 -2
- package/src/runtime/memory/lib/memory-retrievers.mjs +2 -2
- package/src/runtime/memory/lib/memory-text-utils.mjs +1 -1
- package/src/runtime/memory/lib/pg/adapter.mjs +3 -3
- package/src/runtime/memory/lib/pg/process.mjs +2 -2
- package/src/runtime/memory/lib/pg/supervisor.mjs +1 -2
- package/src/runtime/memory/lib/query-ranking.mjs +2 -2
- package/src/runtime/memory/lib/query-search-plan.mjs +1 -1
- package/src/runtime/memory/lib/recall-format.mjs +3 -4
- package/src/runtime/memory/lib/runtime-fetcher.mjs +94 -23
- package/src/runtime/memory/lib/session-ingest-runtime.mjs +1 -1
- package/src/runtime/memory/lib/trace-store.mjs +6 -2
- package/src/runtime/office/authoring/pptx-author-action.mjs +8 -3
- package/src/runtime/office/authoring/pptx-brief.mjs +3 -3
- package/src/runtime/office/authoring/pptx-html-build.mjs +109 -37
- package/src/runtime/office/authoring/pptx-html-geometry.mjs +188 -46
- package/src/runtime/office/authoring/pptx-html-measure.mjs +60 -21
- package/src/runtime/office/authoring/pptx-html-runner.mjs +83 -29
- package/src/runtime/office/authoring/pptx-script-normalize.mjs +156 -16
- package/src/runtime/office/bench/polish-benchmark.mjs +204 -201
- package/src/runtime/office/bench/quality-live-benchmark.mjs +8 -4
- package/src/runtime/office/capabilities-catalog.mjs +12 -1
- package/src/runtime/office/capabilities-signatures.mjs +31 -11
- package/src/runtime/office/capabilities.mjs +39 -20
- package/src/runtime/office/com/com-adapter.mjs +16 -14
- package/src/runtime/office/com/office-com-host.ps1 +118 -140
- package/src/runtime/office/core/excel-snapshot-normalize.mjs +149 -0
- package/src/runtime/office/core/office-actions-batch.mjs +4 -7
- package/src/runtime/office/core/office-actions-inspect.mjs +17 -14
- package/src/runtime/office/core/office-actions-open.mjs +1 -6
- package/src/runtime/office/core/office-core.mjs +107 -49
- package/src/runtime/office/core/office-finalize/review-stage.mjs +4 -1
- package/src/runtime/office/core/office-qa/design-review-stage.mjs +2 -9
- package/src/runtime/office/core/office-qa/review-assembly.mjs +9 -7
- package/src/runtime/office/core/office-sessions.mjs +10 -149
- package/src/runtime/office/design/composition-system.mjs +5 -10
- package/src/runtime/office/design/design-system.mjs +1 -2
- package/src/runtime/office/design/docx/design-docx/section.mjs +1 -1
- package/src/runtime/office/design/docx/design-docx-components.mjs +2 -1
- package/src/runtime/office/design/docx/design-docx.mjs +2 -2
- package/src/runtime/office/design/xlsx/design-xlsx.mjs +6 -2
- package/src/runtime/office/pdf/pdf-analysis.mjs +39 -32
- package/src/runtime/office/pdf/pdf-batch-content.mjs +1 -1
- package/src/runtime/office/pdf/pdf-writer.mjs +26 -22
- package/src/runtime/office/portable/docx-tracked-edits.mjs +6 -6
- package/src/runtime/office/portable/font-provisioner.mjs +37 -11
- package/src/runtime/office/portable/portable-cells.mjs +2 -6
- package/src/runtime/office/portable/portable-chart.mjs +6 -6
- package/src/runtime/office/portable/portable-docx-edits.mjs +4 -9
- package/src/runtime/office/portable/portable-docx-operations.mjs +16 -13
- package/src/runtime/office/portable/portable-docx-parts.mjs +7 -2
- package/src/runtime/office/portable/portable-docx-xml.mjs +36 -28
- package/src/runtime/office/portable/portable-opc.mjs +11 -13
- package/src/runtime/office/portable/portable-package.mjs +3 -4
- package/src/runtime/office/portable/portable-pivot.mjs +7 -3
- package/src/runtime/office/portable/portable-pptx-charts.mjs +59 -42
- package/src/runtime/office/portable/portable-pptx-core.mjs +14 -4
- package/src/runtime/office/portable/portable-pptx-package.mjs +5 -4
- package/src/runtime/office/portable/portable-pptx-shapes.mjs +25 -8
- package/src/runtime/office/portable/portable-sheet-audits.mjs +4 -8
- package/src/runtime/office/portable/portable-sheet-page.mjs +2 -2
- package/src/runtime/office/portable/portable-sheet-xml.mjs +1 -1
- package/src/runtime/office/portable/portable-snapshot-docx.mjs +2 -3
- package/src/runtime/office/portable/portable-snapshot-pptx.mjs +3 -1
- package/src/runtime/office/portable/portable-soffice.mjs +27 -22
- package/src/runtime/office/portable/portable-validation-package.mjs +1 -2
- package/src/runtime/office/portable/portable-validation.mjs +9 -3
- package/src/runtime/office/portable/portable-xlsx-operations.mjs +2 -49
- package/src/runtime/office/portable/portable-xlsx-pivot-ops.mjs +10 -5
- package/src/runtime/office/portable/portable-xlsx-range-layout.mjs +3 -2
- package/src/runtime/office/portable/portable-xlsx-reference-shift.mjs +189 -98
- package/src/runtime/office/portable/portable-xlsx-sheet-edits.mjs +26 -6
- package/src/runtime/office/portable/portable-xml.mjs +1 -4
- package/src/runtime/office/portable/text-metrics.mjs +14 -17
- package/src/runtime/office/portable/xlsx-contract.mjs +37 -3
- package/src/runtime/office/portable/xlsx-formula-engine.mjs +7 -1
- package/src/runtime/office/quality/assurance-checklist.mjs +1 -1
- package/src/runtime/office/quality/assurance-rendered.mjs +1 -1
- package/src/runtime/office/quality/assurance-structure-pptx.mjs +17 -8
- package/src/runtime/office/quality/assurance-structure.mjs +0 -2
- package/src/runtime/office/quality/design-aesthetics.mjs +2 -9
- package/src/runtime/office/quality/design-deck-diversity.mjs +2 -9
- package/src/runtime/office/quality/design-review.mjs +3 -3
- package/src/runtime/office/quality/pptx-slide-roles.mjs +3 -3
- package/src/runtime/office/shared/line-breaks.mjs +3 -1
- package/src/runtime/office/tool-defs.mjs +2 -2
- package/src/runtime/shared/async-log-appender.mjs +83 -0
- package/src/runtime/shared/automation-presence.mjs +9 -0
- package/src/runtime/shared/buffered-appender.mjs +10 -7
- package/src/runtime/shared/child-spawn-gate.mjs +2 -37
- package/src/runtime/shared/code-graph-state.mjs +84 -0
- package/src/runtime/shared/config.mjs +71 -89
- package/src/runtime/shared/context-inspection.mjs +56 -0
- package/src/runtime/shared/context-measurement.mjs +83 -0
- package/src/runtime/shared/device-paths.mjs +206 -0
- package/src/{standalone → runtime/shared}/fair-call-scheduler/owner-groups.mjs +1 -1
- package/src/runtime/shared/fair-call-scheduler.mjs +198 -0
- package/src/runtime/shared/file-lock.mjs +85 -55
- package/src/runtime/shared/http-request-body.mjs +3 -1
- package/src/runtime/shared/llm/anthropic-betas.mjs +46 -0
- package/src/runtime/shared/llm/anthropic-effort.mjs +378 -0
- package/src/runtime/shared/llm/anthropic-thinking-contract.mjs +29 -0
- package/src/runtime/shared/llm/cost.mjs +19 -10
- package/src/runtime/shared/llm/model-catalog-projection.mjs +182 -0
- package/src/runtime/shared/llm/model-catalog.mjs +799 -0
- package/src/runtime/shared/llm/model-pricing-rates.mjs +78 -0
- package/src/runtime/shared/llm/provider-catalog-cache.mjs +130 -0
- package/src/runtime/shared/llm/usage-accounting.mjs +12 -11
- package/src/runtime/shared/llm/usage-context.mjs +7 -0
- package/src/runtime/shared/llm/usage-ledger-import.mjs +14 -3
- package/src/runtime/shared/llm/usage-ledger-quota.mjs +97 -37
- package/src/runtime/shared/llm/usage-ledger-repair.mjs +3 -1
- package/src/runtime/shared/llm/usage-ledger-rollup.mjs +6 -10
- package/src/runtime/shared/llm/usage-ledger.mjs +6 -7
- package/src/runtime/shared/llm/usage-pricing-refresh.mjs +1 -1
- package/src/runtime/shared/llm/usage-rollup.mjs +0 -1
- package/src/runtime/shared/model-display.mjs +178 -0
- package/src/runtime/shared/notify-trace.mjs +14 -3
- package/src/runtime/shared/owner-fair-gate.mjs +1 -1
- package/src/runtime/shared/pending-json-projection.mjs +17 -0
- package/src/runtime/shared/pristine-execution.mjs +4 -3
- package/src/runtime/shared/process-lifecycle.mjs +18 -7
- package/src/runtime/shared/read-image-resize.mjs +399 -0
- package/src/runtime/shared/schedule-model-ref.mjs +2 -2
- package/src/runtime/shared/staged-update.mjs +7 -36
- package/src/runtime/shared/statusline/ansi.mjs +161 -0
- package/src/{ui → runtime/shared/statusline}/statusline-format.mjs +5 -5
- package/src/{ui → runtime/shared/statusline}/statusline-segments.mjs +54 -50
- package/src/runtime/shared/tool-card-model/background-task.mjs +1 -1
- package/src/runtime/shared/tool-card-model/card-detail.mjs +2 -2
- package/src/runtime/shared/tool-card-model/card-status.mjs +7 -5
- package/src/runtime/shared/tool-card-model/git-result.mjs +10 -0
- package/src/runtime/shared/tool-card-model/terminal-status.mjs +6 -2
- package/src/runtime/shared/tool-card-model.golden-cases.mjs +2 -1
- package/src/runtime/shared/tool-output-limit.mjs +60 -0
- package/src/runtime/shared/tool-primitives.mjs +1 -1
- package/src/runtime/shared/tool-result-summary.mjs +1 -0
- package/src/runtime/shared/tool-status.mjs +35 -2
- package/src/runtime/shared/transcript-metadata.mjs +1 -1
- package/src/runtime/shared/transcript-writer/transcript-file.mjs +1 -2
- package/src/runtime/shared/turn-snapshot-store.mjs +23 -17
- package/src/runtime/shared/turn-worktree-snapshot.mjs +8 -4
- package/src/runtime/shared/update-checker.mjs +1 -3
- package/src/runtime/tidy/apply.mjs +2 -2
- package/src/runtime/tidy/function-length.mjs +63 -0
- package/src/runtime/tidy/report.mjs +6 -3
- package/src/runtime/tidy/runners/shared.mjs +1 -0
- package/src/runtime/tidy/runners/shellcheck.mjs +1 -1
- package/src/runtime/tidy/tool.mjs +10 -3
- package/src/runtime/web-search/index.mjs +6 -17
- package/src/runtime/web-search/lib/cache.mjs +8 -54
- package/src/runtime/web-search/lib/config.mjs +2 -6
- package/src/runtime/web-search/lib/debounced-json-writer.mjs +62 -0
- package/src/runtime/web-search/lib/http-fetch.mjs +24 -112
- package/src/runtime/web-search/lib/package-version.mjs +10 -0
- package/src/runtime/web-search/lib/ssrf-guard.mjs +34 -28
- package/src/runtime/web-search/lib/state.mjs +8 -53
- package/src/runtime/web-search/lib/web-tools.mjs +5 -5
- package/src/session-runtime/agent-tool-routing.mjs +3 -9
- package/src/{runtime/shared → session-runtime}/automation-workflow.mjs +4 -4
- package/src/session-runtime/boot/apis.mjs +4 -5
- package/src/session-runtime/boot/begin.mjs +1 -1
- package/src/session-runtime/boot/config.mjs +2 -2
- package/src/session-runtime/boot/facade.mjs +2 -2
- package/src/session-runtime/boot/infrastructure.mjs +4 -4
- package/src/session-runtime/boot/providers.mjs +6 -6
- package/src/session-runtime/boot/session.mjs +1 -1
- package/src/session-runtime/boot/shared.mjs +5 -7
- package/src/session-runtime/boot/tools.mjs +6 -6
- package/src/session-runtime/bridge-first-use-gate.mjs +1 -1
- package/src/session-runtime/builtin-features.mjs +1 -193
- package/src/session-runtime/channel-config-api.mjs +3 -3
- package/src/session-runtime/config-helpers.mjs +1 -420
- package/src/session-runtime/config-lifecycle.mjs +2 -2
- package/src/session-runtime/cwd-plugins/core-memory-context.mjs +2 -2
- package/src/session-runtime/cwd-plugins/plugin-status.mjs +1 -1
- package/src/session-runtime/deferred-tool-delta.mjs +1 -101
- package/src/session-runtime/effort.mjs +1 -145
- package/src/session-runtime/goal-facade-api.mjs +1 -1
- package/src/session-runtime/goal-state.mjs +1 -325
- package/src/session-runtime/goal-tasks.mjs +1 -137
- package/src/session-runtime/goal-tool-defs.mjs +1 -140
- package/src/session-runtime/hook-payload.mjs +4 -5
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +3 -3
- package/src/session-runtime/internal-tool-executor/caller-context.mjs +8 -0
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +3 -2
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +4 -6
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +2 -2
- package/src/session-runtime/internal-tool-executor.mjs +1 -1
- package/src/session-runtime/lifecycle/inheritance.mjs +1 -1
- package/src/session-runtime/lifecycle/session-catalog.mjs +3 -3
- package/src/session-runtime/lifecycle/session-switch/resume.mjs +2 -2
- package/src/session-runtime/lifecycle/session-switch/session-delete.mjs +1 -1
- package/src/session-runtime/lifecycle/session-switch.mjs +1 -1
- package/src/session-runtime/lifecycle/shared.mjs +1 -1
- package/src/session-runtime/mcp-glue/connect.mjs +1 -1
- package/src/session-runtime/mcp-glue/server-catalog.mjs +1 -1
- package/src/session-runtime/mcp-glue/server-input.mjs +1 -1
- package/src/session-runtime/model-capabilities.mjs +1 -140
- package/src/session-runtime/model-recency.mjs +1 -1
- package/src/session-runtime/model-route/route-persist.mjs +2 -2
- package/src/session-runtime/model-route/route-tuning.mjs +3 -3
- package/src/session-runtime/model-route/set-route.mjs +6 -6
- package/src/session-runtime/model-route/web-search-route.mjs +5 -5
- package/src/session-runtime/model-route-api.mjs +1 -1
- package/src/session-runtime/native-web-search/routes.mjs +1 -1
- package/src/session-runtime/native-web-search/tool-shape.mjs +2 -2
- package/src/session-runtime/output-styles.mjs +2 -2
- package/src/session-runtime/prewarm/channel-start.mjs +1 -0
- package/src/session-runtime/provider-auth/accounts.mjs +7 -2
- package/src/session-runtime/provider-auth/login.mjs +1 -1
- package/src/session-runtime/provider-auth-api.mjs +1 -1
- package/src/session-runtime/provider-models/model-meta.mjs +1 -1
- package/src/session-runtime/provider-models/row-hydration.mjs +3 -3
- package/src/session-runtime/provider-usage.mjs +2 -2
- package/src/session-runtime/quick-model-rows/model-meta.mjs +1 -1
- package/src/session-runtime/quick-model-rows/provider-rows.mjs +1 -1
- package/src/session-runtime/quick-model-rows/web-search-rows.mjs +2 -2
- package/src/session-runtime/resource-api.mjs +2 -2
- package/src/session-runtime/resource-mcp-api.mjs +3 -3
- package/src/session-runtime/resource-plugins-api.mjs +3 -3
- package/src/session-runtime/resource-recall-api.mjs +2 -2
- package/src/session-runtime/resource-scope-decorate.mjs +2 -2
- package/src/session-runtime/route-resolution.mjs +3 -3
- package/src/session-runtime/route-state.mjs +4 -4
- package/src/session-runtime/runtime-bootstrap.mjs +1 -1
- package/src/session-runtime/runtime-facade.mjs +1 -1
- package/src/session-runtime/runtime-feature-gates.mjs +2 -2
- package/src/session-runtime/runtime-modules.mjs +3 -3
- package/src/session-runtime/runtime-paths.mjs +6 -2
- package/src/session-runtime/runtime-tool-routing.mjs +2 -2
- package/src/{runtime/shared → session-runtime}/schedule-session-run.mjs +5 -5
- package/src/{standalone → session-runtime/services}/agent-task-status.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/close-flow/close-all.mjs +2 -2
- package/src/{standalone → session-runtime/services}/agent-tool/close-flow.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/execute.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/helpers.mjs +6 -6
- package/src/session-runtime/services/agent-tool/index-write-queue.mjs +209 -0
- package/src/{standalone → session-runtime/services}/agent-tool/job-task-reconcile.mjs +2 -2
- package/src/{standalone → session-runtime/services}/agent-tool/job-views/job-lookup.mjs +5 -1
- package/src/{standalone → session-runtime/services}/agent-tool/job-views/job-render.mjs +1 -1
- package/src/session-runtime/services/agent-tool/job-views/session-progress.mjs +101 -0
- package/src/{standalone → session-runtime/services}/agent-tool/job-views/spawn-meta.mjs +1 -1
- package/src/session-runtime/services/agent-tool/job-views.mjs +59 -0
- package/src/session-runtime/services/agent-tool/lead-worker-index/index-file.mjs +48 -0
- package/src/{standalone → session-runtime/services}/agent-tool/lead-worker-index/row-settlement.mjs +3 -3
- package/src/{standalone → session-runtime/services}/agent-tool/lead-worker-index.mjs +10 -2
- package/src/{standalone → session-runtime/services}/agent-tool/notify/early-completion.mjs +2 -2
- package/src/{standalone → session-runtime/services}/agent-tool/notify.mjs +4 -4
- package/src/{standalone → session-runtime/services}/agent-tool/render.mjs +2 -2
- package/src/{standalone → session-runtime/services}/agent-tool/send-flow.mjs +6 -2
- package/src/{standalone → session-runtime/services}/agent-tool/spawn-flow/job-start.mjs +2 -2
- package/src/{standalone → session-runtime/services}/agent-tool/spawn-flow/spawn-plan.mjs +3 -3
- package/src/{standalone → session-runtime/services}/agent-tool/spawn-flow/spawn-prep.mjs +3 -3
- package/src/{standalone → session-runtime/services}/agent-tool/spawn-flow/spawn-run.mjs +3 -3
- package/src/{standalone → session-runtime/services}/agent-tool/spawn-preset.mjs +1 -1
- package/src/session-runtime/services/agent-tool/tag-registry.mjs +121 -0
- package/src/{standalone → session-runtime/services}/agent-tool/terminal-reaper/reap-timers.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/terminal-reaper/scan-admission.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/terminal-reaper/stale-rows.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/terminal-reaper/tombstones.mjs +5 -2
- package/src/session-runtime/services/agent-tool/tool-def.mjs +60 -0
- package/src/{standalone → session-runtime/services}/agent-tool/turn-review.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/worker-index/row-liveness.mjs +1 -1
- package/src/{standalone → session-runtime/services}/agent-tool/worker-index/row-store.mjs +46 -20
- package/src/{standalone → session-runtime/services}/agent-tool/worker-index.mjs +8 -1
- package/src/{standalone → session-runtime/services}/agent-tool/worker-rows.mjs +1 -1
- package/src/session-runtime/services/agent-tool.mjs +151 -0
- package/src/{standalone → session-runtime/services}/agent-watchdog-registry.mjs +1 -1
- package/src/{standalone → session-runtime/services}/channel-admin.mjs +8 -10
- package/src/{standalone → session-runtime/services}/channel-client.mjs +1 -1
- package/src/{standalone → session-runtime/services}/channel-session-router.mjs +1 -1
- package/src/{standalone → session-runtime/services}/channel-worker/client-heartbeat.mjs +1 -1
- package/src/{standalone → session-runtime/services}/channel-worker/daemon-attach.mjs +1 -1
- package/src/{standalone → session-runtime/services}/channel-worker/daemon-spawn.mjs +5 -5
- package/src/session-runtime/services/channel-worker.mjs +140 -0
- package/src/session-runtime/services/daemon-crash-capture/daemon-exit-record.mjs +189 -0
- package/src/{standalone → session-runtime/services}/daemon-crash-capture/retention.mjs +1 -1
- package/src/{standalone → session-runtime/services}/daemon-crash-capture/spawn-capture.mjs +12 -1
- package/src/{standalone → session-runtime/services}/daemon-crash-capture.mjs +6 -0
- package/src/{standalone → session-runtime/services}/hook-bus/command-handler.mjs +1 -1
- package/src/{standalone → session-runtime/services}/hook-bus/event-runner.mjs +1 -1
- package/src/{standalone → session-runtime/services}/hook-bus/handler-dispatch.mjs +1 -1
- package/src/{standalone → session-runtime/services}/hook-bus/handlers.mjs +5 -4
- package/src/{standalone → session-runtime/services}/hook-bus/rule-file.mjs +2 -2
- package/src/{standalone → session-runtime/services}/hook-bus/tool-gate.mjs +1 -1
- package/src/{standalone → session-runtime/services}/memory-runtime-proxy/client-registry.mjs +1 -1
- package/src/{standalone → session-runtime/services}/memory-runtime-proxy/daemon-spawn.mjs +4 -4
- package/src/{standalone → session-runtime/services}/memory-runtime-proxy/discovery.mjs +5 -5
- package/src/{standalone → session-runtime/services}/memory-runtime-proxy/owner-claim.mjs +2 -2
- package/src/{standalone → session-runtime/services}/memory-runtime-proxy/rpc.mjs +0 -4
- package/src/{standalone → session-runtime/services}/memory-runtime-proxy/start.mjs +1 -1
- package/src/{standalone → session-runtime/services}/memory-runtime-proxy/tool-wire.mjs +1 -1
- package/src/session-runtime/services/memory-runtime-proxy.mjs +130 -0
- package/src/{standalone → session-runtime/services}/plugin-admin.mjs +6 -6
- package/src/session-runtime/services/provider-admin.mjs +576 -0
- package/src/{standalone → session-runtime/services}/seeds.mjs +3 -3
- package/src/{standalone → session-runtime/services}/usage-dashboard-model.mjs +1 -1
- package/src/session-runtime/services/usage-dashboard.mjs +278 -0
- package/src/{standalone → session-runtime/services}/usage-stats-hours.mjs +1 -1
- package/src/session-runtime/services/usage-stats-model.mjs +657 -0
- package/src/session-runtime/services/usage-stats-period.mjs +178 -0
- package/src/session-runtime/session-create/materialize.mjs +3 -3
- package/src/session-runtime/session-create/session-options.mjs +14 -7
- package/src/session-runtime/session-lifecycle.mjs +2 -2
- package/src/session-runtime/settings-builtin-tools-api.mjs +1 -1
- package/src/session-runtime/setup-tool/executor.mjs +2 -2
- package/src/session-runtime/skills-api.mjs +2 -2
- package/src/session-runtime/statusline-route.mjs +1 -1
- package/src/session-runtime/tool-catalog.mjs +1 -753
- package/src/session-runtime/tool-defs.mjs +1 -149
- package/src/session-runtime/tool-policy-refresh.mjs +7 -5
- package/src/session-runtime/tool-surface.mjs +5 -5
- package/src/session-runtime/turn/agent-ops.mjs +2 -2
- package/src/session-runtime/turn/session-ops.mjs +2 -2
- package/src/session-runtime/turn/share-ops.mjs +4 -3
- package/src/session-runtime/turn/turn-run/turn-prepare.mjs +1 -1
- package/src/session-runtime/turn/turn-run/turn-settle.mjs +4 -4
- package/src/session-runtime/usage-stats-api.mjs +18 -2
- package/src/session-runtime/warmup/statusline-usage-warmup.mjs +2 -2
- package/src/{runtime/shared → session-runtime}/webhook-session-run.mjs +5 -5
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +2 -2
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +4 -4
- package/src/session-runtime/workflow-agents-api/onboarding.mjs +2 -2
- package/src/session-runtime/workflow-agents-api/shared.mjs +4 -6
- package/src/session-runtime/workflow-agents-api/workflow-packs.mjs +1 -1
- package/src/session-runtime/workflow.mjs +1 -255
- package/src/standalone/agent-tool/job-views/session-progress.mjs +1 -101
- package/src/standalone/agent-tool/job-views.mjs +1 -59
- package/src/standalone/agent-tool/tag-registry.mjs +1 -121
- package/src/standalone/agent-tool/tool-def.mjs +1 -60
- package/src/standalone/agent-tool.mjs +1 -151
- package/src/standalone/channel-worker.mjs +1 -140
- package/src/standalone/daemon-agent-control.mjs +1 -1
- package/src/standalone/daemon-desktop-runtime.mjs +2 -2
- package/src/standalone/daemon-stored-session-views.mjs +1 -1
- package/src/standalone/daemon.mjs +38 -5
- package/src/standalone/fair-call-scheduler.mjs +1 -198
- package/src/standalone/folder-dialog.mjs +12 -8
- package/src/standalone/memory-runtime-proxy.mjs +1 -130
- package/src/standalone/provider-admin.mjs +1 -576
- package/src/standalone/session-client/frame-stream.mjs +1 -1
- package/src/standalone/session-client.mjs +2 -2
- package/src/standalone/session-service/agent-tree/agent-child.mjs +1 -1
- package/src/standalone/session-service/projection/transcript-window.mjs +2 -2
- package/src/standalone/usage-dashboard.mjs +1 -278
- package/src/standalone/usage-stats-model.mjs +1 -653
- package/src/standalone/usage-stats-period.mjs +1 -178
- package/src/tui/App.jsx +107 -256
- package/src/tui/app/app-view/floating-panel.jsx +3 -12
- package/src/tui/app/app-view/welcome-banner.jsx +36 -0
- package/src/tui/app/app-view.jsx +18 -45
- package/src/tui/app/create-app-pickers.mjs +1 -1
- package/src/tui/app/doctor.mjs +15 -1
- package/src/tui/app/extension-pickers/mcp-servers-picker.mjs +7 -3
- package/src/tui/app/maintenance-pickers/auto-clear-picker.mjs +5 -8
- package/src/tui/app/model-options.mjs +2 -3
- package/src/tui/app/model-picker/model-footer.mjs +1 -1
- package/src/tui/app/model-picker/route-selection.mjs +1 -3
- package/src/tui/app/mouse-input/button-gestures.mjs +13 -31
- package/src/tui/app/mouse-input/wheel-router.mjs +22 -32
- package/src/tui/app/picker-enter-latch.mjs +21 -0
- package/src/tui/app/picker-index-mode.mjs +34 -0
- package/src/tui/app/shell-layout/panel-transition.mjs +7 -12
- package/src/tui/app/shell-layout/row-budgets.mjs +4 -9
- package/src/tui/app/slash-palette.mjs +31 -0
- package/src/tui/app/text-layout.mjs +1 -1
- package/src/tui/app/theme-effort-pickers.mjs +1 -1
- package/src/tui/app/transcript-window.mjs +1 -5
- package/src/tui/app/usage-context-panels/context-model.mjs +1 -1
- package/src/tui/app/use-global-key-input.mjs +0 -1
- package/src/tui/app/use-interaction-refs.mjs +55 -0
- package/src/tui/app/use-onboarding-start.mjs +45 -0
- package/src/tui/app/use-panel-transition.mjs +40 -0
- package/src/tui/app/use-prompt-draft-flow.mjs +4 -13
- package/src/tui/app/use-prompt-layout-rows.mjs +39 -0
- package/src/tui/app/use-prompt-queue-history/prompt-history.mjs +1 -1
- package/src/tui/app/use-prompt-state.mjs +40 -0
- package/src/tui/app/use-selection-paint.mjs +9 -5
- package/src/tui/app/use-transcript-scroll-state.mjs +61 -0
- package/src/tui/app/use-transcript-window.mjs +0 -1
- package/src/tui/app/use-ui-open-request.mjs +18 -0
- package/src/tui/app/use-workflow-tab-cycle.mjs +39 -0
- package/src/tui/components/ContextInspector.jsx +1 -1
- package/src/tui/components/ContextPanel.jsx +1 -1
- package/src/tui/components/Picker.jsx +41 -322
- package/src/tui/components/PromptInput.jsx +34 -468
- package/src/tui/components/StatusLine.jsx +8 -555
- package/src/tui/components/TextEntryPanel.jsx +25 -211
- package/src/tui/components/ToolExecution.jsx +43 -328
- package/src/tui/components/UsagePanel.jsx +1 -1
- package/src/tui/components/picker/PickerItemRow.jsx +85 -0
- package/src/tui/components/picker/picker-layout.mjs +46 -0
- package/src/tui/components/picker/use-picker-input.mjs +165 -0
- package/src/tui/components/picker/use-picker-selection.mjs +67 -0
- package/src/tui/components/prompt-input/edit-chords.mjs +87 -0
- package/src/tui/components/prompt-input/edit-helpers.mjs +15 -12
- package/src/tui/components/prompt-input/escape-key.mjs +87 -0
- package/src/tui/components/prompt-input/key-handler.mjs +364 -0
- package/src/tui/components/status-line/boot-schedule.mjs +83 -0
- package/src/tui/components/status-line/local-line.mjs +213 -0
- package/src/tui/components/status-line/use-statusline-text.mjs +319 -0
- package/src/tui/components/statusline-module-loader.mjs +21 -0
- package/src/tui/components/text-entry-layout.mjs +104 -0
- package/src/tui/components/text-entry-value.jsx +47 -0
- package/src/tui/components/tool-execution/aggregate-card.jsx +141 -0
- package/src/tui/components/tool-execution/pending-placeholder.jsx +24 -0
- package/src/tui/components/tool-execution/standard-card.jsx +229 -0
- package/src/tui/components/tool-output-format.mjs +3 -5
- package/src/tui/dist/index.mjs +3616 -3022
- package/src/tui/index.jsx +85 -66
- package/src/tui/markdown/format-token.mjs +3 -3
- package/src/tui/paste-attachments.mjs +1 -1
- package/src/tui/prompt-history-store.mjs +17 -6
- package/src/tui/session/agent-envelope.mjs +1 -489
- package/src/tui/session/context-state.mjs +2 -2
- package/src/tui/session/goal-continuation/continuation-queue.mjs +1 -1
- package/src/tui/session/goal-continuation/deadline-delivery.mjs +1 -1
- package/src/tui/session/goal-continuation/goal-visibility.mjs +1 -1
- package/src/tui/session/initial-state.mjs +1 -1
- package/src/tui/session/live-share/wire.mjs +3 -0
- package/src/tui/session/oauth-flows.mjs +1 -7
- package/src/tui/session/session-api/commands.mjs +5 -3
- package/src/tui/session/session-api/controls.mjs +1 -1
- package/src/tui/session/session-api/intake/submission.mjs +8 -3
- package/src/tui/session/session-api/integrations.mjs +1 -1
- package/src/tui/session/session-api/routes.mjs +9 -8
- package/src/tui/session/session-api/settings.mjs +24 -23
- package/src/tui/session/session-api/shared.mjs +13 -2
- package/src/tui/session/session-api-ext.mjs +7 -415
- package/src/tui/session/session-flow/drain.mjs +86 -82
- package/src/tui/session/session-flow/queue.mjs +3 -1
- package/src/tui/session/tool-result-status.mjs +1 -354
- package/src/tui/session/tool-result-text.mjs +1 -157
- package/src/tui/session/transcript-intake.mjs +1 -1
- package/src/tui/session/transcript-spill/spill-dir.mjs +4 -1
- package/src/tui/session/transcript-spill/spill-writer.mjs +1 -1
- package/src/tui/session/tui-steering-persist.mjs +44 -86
- package/src/tui/session-local.mjs +8 -5
- package/src/tui/statusline-ansi-bridge.mjs +1 -1
- package/src/tui/theme.mjs +1 -1
- package/src/ui/ansi.mjs +1 -161
- package/src/ui/context-inspection.mjs +1 -56
- package/src/ui/context-measurement.mjs +1 -83
- package/src/ui/markdown.mjs +3 -3
- package/src/ui/model-display.mjs +1 -173
- package/src/ui/statusline-agents.mjs +22 -21
- package/src/ui/statusline.mjs +21 -24
- package/src/ui/stream-finalize.mjs +1 -1
- package/src/ui/tool-card.mjs +1 -1
- package/src/vendor/statusline/src/gateway/route-meta.mjs +157 -29
- package/scripts/fixtures/spawn-lease-child-harness.mjs +0 -8
- package/scripts/fixtures/spawn-lease-fixture-worker.mjs +0 -37
- package/src/runtime/agent/orchestrator/activity-bus.mjs +0 -31
- package/src/runtime/shared/child-spawn-remote.mjs +0 -210
- package/src/runtime/shared/session-runtime-health.mjs +0 -201
- package/src/standalone/agent-tool/lead-worker-index/index-file.mjs +0 -45
- package/src/standalone/session-runtime-agent-control-client.mjs +0 -117
- package/src/standalone/session-runtime-agent-control.mjs +0 -85
- package/src/standalone/session-runtime-host-factory.mjs +0 -22
- package/src/standalone/session-runtime-host.mjs +0 -742
- package/src/standalone/session-runtime-provider-cooldown.mjs +0 -78
- package/src/standalone/session-runtime-proxy.mjs +0 -164
- package/src/standalone/session-runtime-record.mjs +0 -18
- package/src/standalone/session-runtime-shard-router.mjs +0 -151
- package/src/standalone/session-runtime-spawn-leases.mjs +0 -82
- package/src/standalone/session-runtime-worker.mjs +0 -678
- package/src/standalone/session-runtime-workload.mjs +0 -98
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/context-status-cache.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/deferred-tool-availability.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-deadlines.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-runtime.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-store.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-text.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/goal-tool-exec.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/provider-request-snapshot.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/provider-request-tools.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/tool-catalog-data.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/tool-profile.mjs +0 -0
- /package/src/{session-runtime → runtime/agent/orchestrator/runtime-core}/workflow/shared-scan-cache.mjs +0 -0
- /package/src/{standalone → runtime/shared}/fair-call-scheduler/queue-item.mjs +0 -0
- /package/src/runtime/{agent/orchestrator/providers → shared/llm}/provider-model-identities.mjs +0 -0
- /package/src/{standalone → runtime/shared}/projects.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/execute-send.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/execute-spawn.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/job-views/agent-list.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/lead-worker-index/lead-rows.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/lead-worker-index/reap-timers.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/provider-init.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/spawn-flow/deferred-spawn.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/spawn-flow.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/tag-maps.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/tag-registry/tag-lookup.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/tag-registry/tag-refresh.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/terminal-reaper/row-helpers.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/terminal-reaper.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/terminal-trace.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/worker-index/mutation-batch.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/agent-tool/worker-index/row-shape.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/channel-client/daemon-request.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/channel-client/notify-stream.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/channel-client/reconnect.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/channel-client/registration.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/daemon-candidate.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/daemon-crash-capture/paths.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/config-loader.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/config.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/constants.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/event-log.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/handler-timeout.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/payload.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/rule-store.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus/rules.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/hook-bus.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/memory-runtime-proxy/calls.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/memory-runtime-proxy/state.mjs +0 -0
- /package/src/{standalone → session-runtime/services}/sse-frames.mjs +0 -0
|
@@ -33,14 +33,7 @@ import { applyParsedWave, isPatchErrorText } from '../wave.mjs';
|
|
|
33
33
|
// Convert the body to a unified patch (V4A / bare-@@ / counted-unified
|
|
34
34
|
// fallback), split it into unique-target waves and pre-validate each. Returns
|
|
35
35
|
// { error } for the outcomes the tool reports as text; parse failures throw.
|
|
36
|
-
export async function prepareCodexBatch({
|
|
37
|
-
patchStr,
|
|
38
|
-
requestedFormat,
|
|
39
|
-
basePath,
|
|
40
|
-
preParsedV4ASections,
|
|
41
|
-
v4aConvertOpts,
|
|
42
|
-
mutationPlan,
|
|
43
|
-
}) {
|
|
36
|
+
export async function prepareCodexBatch({ patchStr, requestedFormat, basePath, preParsedV4ASections, v4aConvertOpts }) {
|
|
44
37
|
let inputPatchStr = patchStr;
|
|
45
38
|
let v4aRenamePlan = null;
|
|
46
39
|
if (isV4APatchInput(patchStr, requestedFormat)) {
|
|
@@ -49,12 +42,6 @@ export async function prepareCodexBatch({
|
|
|
49
42
|
const allSections = coalesceCompatibleV4ASections(parsedSections, basePath);
|
|
50
43
|
v4aRenamePlan = await planV4ARenameSections(allSections, basePath);
|
|
51
44
|
inputPatchStr = await convertV4ASectionsToUnifiedPatch(v4aRenamePlan.remainingSections, basePath, v4aConvertOpts);
|
|
52
|
-
if (v4aRenamePlan.renameSections.length > 0) {
|
|
53
|
-
mutationPlan =
|
|
54
|
-
v4aRenamePlan.remainingSections.length > 0
|
|
55
|
-
? { sourceTool: 'apply_patch', engine: 'v4a-patch', reason: 'v4a-mixed' }
|
|
56
|
-
: { sourceTool: 'apply_patch', engine: 'v4a-rename', reason: 'v4a-move' };
|
|
57
|
-
}
|
|
58
45
|
} catch (err) {
|
|
59
46
|
throw new Error(`apply_patch: V4A parse failed — ${err?.message || String(err)}`);
|
|
60
47
|
}
|
|
@@ -72,7 +59,6 @@ export async function prepareCodexBatch({
|
|
|
72
59
|
waveDispatch: [],
|
|
73
60
|
v4aRenamePlan,
|
|
74
61
|
v4aRenameOnly,
|
|
75
|
-
mutationPlan,
|
|
76
62
|
lockPaths: renameLockPaths(v4aRenamePlan, basePath),
|
|
77
63
|
};
|
|
78
64
|
}
|
|
@@ -90,11 +76,6 @@ export async function prepareCodexBatch({
|
|
|
90
76
|
const sections = rewriteV4AReadRedirects(parseUnifiedCountedAsV4APatch(patchStr), basePath);
|
|
91
77
|
inputPatchStr = await convertV4ASectionsToUnifiedPatch(sections, basePath, v4aConvertOpts);
|
|
92
78
|
parsed = parsePatch(prepareInput(inputPatchStr));
|
|
93
|
-
mutationPlan = {
|
|
94
|
-
sourceTool: 'apply_patch',
|
|
95
|
-
engine: 'v4a-patch',
|
|
96
|
-
reason: 'unified-count-fallback',
|
|
97
|
-
};
|
|
98
79
|
} catch (fallbackErr) {
|
|
99
80
|
throw new Error(
|
|
100
81
|
`apply_patch: parse failed — ${err?.message || String(err)}; V4A fallback failed — ${fallbackErr?.message || String(fallbackErr)}`
|
|
@@ -134,7 +115,7 @@ export async function prepareCodexBatch({
|
|
|
134
115
|
...new Set(waveDispatch.flatMap((wd) => wd.entries.map((entry) => entry.fullPath))),
|
|
135
116
|
...renameLockPaths(v4aRenamePlan, basePath),
|
|
136
117
|
];
|
|
137
|
-
return { waveDispatch, v4aRenamePlan, v4aRenameOnly,
|
|
118
|
+
return { waveDispatch, v4aRenamePlan, v4aRenameOnly, lockPaths };
|
|
138
119
|
}
|
|
139
120
|
|
|
140
121
|
function renameLockPaths(v4aRenamePlan, basePath) {
|
|
@@ -147,7 +128,7 @@ function renameLockPaths(v4aRenamePlan, basePath) {
|
|
|
147
128
|
// Apply the validated batch in one shot: renames first, then the single wave
|
|
148
129
|
// via applyParsedWave (native + JS split). Returns the model-surface text.
|
|
149
130
|
export async function runCodexBatch({ batch, basePath, v4aConvertOpts, rejectedV4AHunks, waveOpts }) {
|
|
150
|
-
const { waveDispatch, v4aRenamePlan, v4aRenameOnly
|
|
131
|
+
const { waveDispatch, v4aRenamePlan, v4aRenameOnly } = batch;
|
|
151
132
|
let v4aRenameResults = [];
|
|
152
133
|
if (v4aRenamePlan?.renameSections?.length) {
|
|
153
134
|
v4aRenameResults = await applyV4ARenameSections(v4aRenamePlan.renameSections, basePath, v4aConvertOpts);
|
|
@@ -155,18 +136,17 @@ export async function runCodexBatch({ batch, basePath, v4aConvertOpts, rejectedV
|
|
|
155
136
|
if (v4aRenameOnly) {
|
|
156
137
|
const lines = formatV4ARenameSuccessLines(v4aRenameResults);
|
|
157
138
|
if (lines.length === 0) return 'Error: patch contained no applicable file sections';
|
|
158
|
-
return wrapPatchMutationOutput(`${lines.join('\n')}\n
|
|
139
|
+
return wrapPatchMutationOutput(`${lines.join('\n')}\n`);
|
|
159
140
|
}
|
|
160
141
|
const res = await applyParsedWave(waveDispatch[0], basePath, waveOpts);
|
|
161
|
-
|
|
162
|
-
if (res.error) return wrapPatchMutationOutput(res.error, mutationPlan, { executor });
|
|
142
|
+
if (res.error) return wrapPatchMutationOutput(res.error);
|
|
163
143
|
let combined = res.text;
|
|
164
144
|
if (!isPatchErrorText(combined)) {
|
|
165
145
|
const renameLines = formatV4ARenameSuccessLines(v4aRenameResults);
|
|
166
146
|
if (renameLines.length > 0) combined = `${renameLines.join('\n')}\n${combined}`;
|
|
167
147
|
combined += rejectedHunkTail(rejectedV4AHunks);
|
|
168
148
|
}
|
|
169
|
-
return wrapPatchMutationOutput(combined
|
|
149
|
+
return wrapPatchMutationOutput(combined);
|
|
170
150
|
}
|
|
171
151
|
|
|
172
152
|
// Codex mode applies the validated batch in one shot. A batch that mixes
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// apply_patch request intake: argument salvage, body/format validation, the
|
|
2
2
|
// abort signal, base path and the option flags every execution path shares.
|
|
3
3
|
import { getAbortSignalForSession } from '../../../session/abort-lookup.mjs';
|
|
4
|
-
import { planApplyPatchMutationRoute } from '../mutation-output.mjs';
|
|
5
4
|
import { isCompactedPlaceholderPatch, salvageV4AOpening } from '../parsing.mjs';
|
|
6
5
|
import { resolveBasePath } from '../paths.mjs';
|
|
7
6
|
|
|
@@ -65,7 +64,6 @@ export async function resolveApplyPatchRequest(rawArgs, cwd, options = {}) {
|
|
|
65
64
|
if (requestedFormat && requestedFormat !== 'unified' && requestedFormat !== 'v4a') {
|
|
66
65
|
throw new Error('apply_patch: "format" must be "unified" or "v4a"');
|
|
67
66
|
}
|
|
68
|
-
const mutationPlan = options?.mutationPlan || planApplyPatchMutationRoute(args, patchStr, requestedFormat);
|
|
69
67
|
const readStateScope = options?.readStateScope ?? options?.sessionId ?? null;
|
|
70
68
|
let abortSignal = options?.signal || options?.abortSignal || null;
|
|
71
69
|
if (!abortSignal && options?.sessionId) {
|
|
@@ -84,7 +82,6 @@ export async function resolveApplyPatchRequest(rawArgs, cwd, options = {}) {
|
|
|
84
82
|
args,
|
|
85
83
|
patchStr,
|
|
86
84
|
requestedFormat,
|
|
87
|
-
mutationPlan,
|
|
88
85
|
readStateScope,
|
|
89
86
|
abortSignal,
|
|
90
87
|
basePath,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// What a native apply reports: the io/patch trace lines and the human-readable
|
|
2
2
|
// summary the model receives.
|
|
3
|
-
import { ioTrace
|
|
3
|
+
import { ioTrace } from '../../io-trace.mjs';
|
|
4
|
+
import { nativePatchTraceEnabled, patchTraceEnabled } from '../native-server.mjs';
|
|
4
5
|
|
|
5
6
|
const ms = (value) => Number(value.toFixed(3));
|
|
6
7
|
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
parsedEntryResolvedPath,
|
|
27
27
|
countHunkChanges,
|
|
28
28
|
pathKey,
|
|
29
|
+
specialFilePatchMessage,
|
|
29
30
|
} from './paths.mjs';
|
|
30
31
|
import { NATIVE_PATCH_TRANSPORT_DEAD, runServerApply, scheduleNativePatchIdleClose } from './native-server.mjs';
|
|
31
32
|
import {
|
|
@@ -270,11 +271,7 @@ function applyUnifiedHunksToLines(sourceLines, hunks, { fuzz, displayPath, eol }
|
|
|
270
271
|
|
|
271
272
|
function lstatRegularPatchFile(fullPath, displayPath) {
|
|
272
273
|
const st = lstatSync(fullPath);
|
|
273
|
-
if (isSpecialFileStat(st))
|
|
274
|
-
throw new Error(
|
|
275
|
-
`apply_patch: cannot patch special file (FIFO / character / block device / socket): ${normalizeOutputPath(displayPath)}`
|
|
276
|
-
);
|
|
277
|
-
}
|
|
274
|
+
if (isSpecialFileStat(st)) throw new Error(specialFilePatchMessage(displayPath));
|
|
278
275
|
return st;
|
|
279
276
|
}
|
|
280
277
|
|
|
@@ -299,11 +296,7 @@ function resolvePatchWriteTarget(fullPath, displayPath, lst) {
|
|
|
299
296
|
` (${err?.code || err?.message || String(err)})`
|
|
300
297
|
);
|
|
301
298
|
}
|
|
302
|
-
if (isSpecialFileStat(snapshotStat))
|
|
303
|
-
throw new Error(
|
|
304
|
-
`apply_patch: cannot patch special file (FIFO / character / block device / socket): ${normalizeOutputPath(displayPath)}`
|
|
305
|
-
);
|
|
306
|
-
}
|
|
299
|
+
if (isSpecialFileStat(snapshotStat)) throw new Error(specialFilePatchMessage(displayPath));
|
|
307
300
|
if (!snapshotStat.isFile()) {
|
|
308
301
|
throw new Error(`apply_patch: symlink target is not a regular file: ${normalizeOutputPath(displayPath)}`);
|
|
309
302
|
}
|
|
@@ -658,7 +658,7 @@ function escapeNonAsciiForPatch(line) {
|
|
|
658
658
|
return out;
|
|
659
659
|
}
|
|
660
660
|
|
|
661
|
-
export function findLineSequenceEscapeEquiv(sourceLines, pattern, minStart
|
|
661
|
+
export function findLineSequenceEscapeEquiv(sourceLines, pattern, minStart) {
|
|
662
662
|
if (!pattern || pattern.length === 0) return -1;
|
|
663
663
|
const starts = [];
|
|
664
664
|
const from = Math.max(0, Number.isFinite(minStart) ? minStart : 0);
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
import { hasUnifiedBareV4AHunk, isV4APatchInput } from './parsing.mjs';
|
|
1
|
+
// Model-surface output wrapper shared by the Codex batch and the ordered
|
|
2
|
+
// sequence.
|
|
4
3
|
import { drainV4AAmbiguityNotices } from './v4a-convert.mjs';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
sourceTool: 'apply_patch',
|
|
11
|
-
engine: v4aInput ? 'v4a-patch' : 'unified-patch',
|
|
12
|
-
reason: 'direct',
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Model-surface success outputs deliberately DROP the `mutation_route:`
|
|
17
|
-
// diagnostic header (the surface stays `Success. Updated the following files:`).
|
|
18
|
-
// Errors were never wrapped, the UI diff side-channel is independent, and no
|
|
19
|
-
// script/UI parses the header — measured saving ~30 tokens x ~125 successful
|
|
20
|
-
// patch calls/day. Route diagnostics stay available via plan/extras callers.
|
|
21
|
-
export function wrapPatchMutationOutput(text, _plan, _extras = {}) {
|
|
5
|
+
// Model-surface success outputs deliberately carry no `mutation_route:`
|
|
6
|
+
// diagnostic header (the surface stays `Success. Updated the following files:`);
|
|
7
|
+
// no script/UI parses one, and dropping it saves ~30 tokens per successful patch call.
|
|
8
|
+
export function wrapPatchMutationOutput(text) {
|
|
22
9
|
// Per-file success rows already identify the edits; retain warnings/errors.
|
|
23
10
|
text = text.replace(/^Applied \d+ Files? \((?:Native|JS)\)\r?\n(?= {2}OK )/gm, '');
|
|
24
11
|
// Non-fatal duplicate-context notices ride the success output: the edit
|
|
@@ -17,7 +17,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
17
17
|
import { packageNativeToolPath } from '../../../../shared/native-tool-paths.mjs';
|
|
18
18
|
import { getPluginData } from '../../config.mjs';
|
|
19
19
|
import { ensurePatchBinary, findCachedPatchBinary } from '../patch-binary-fetcher.mjs';
|
|
20
|
-
import {
|
|
20
|
+
import { ioTraceEnabled } from '../io-trace.mjs';
|
|
21
21
|
|
|
22
22
|
const PLUGIN_ROOT =
|
|
23
23
|
process.env.MIXDOG_ROOT ||
|
|
@@ -54,17 +54,6 @@ export function nativePatchTraceEnabled() {
|
|
|
54
54
|
return /^(1|true|yes)$/i.test(process.env.MIXDOG_PATCH_NATIVE_TRACE || '');
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function ioTraceEnabled() {
|
|
58
|
-
return envFlag('MIXDOG_IO_TRACE');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function ioTrace(event, fields = {}) {
|
|
62
|
-
if (!ioTraceEnabled()) return;
|
|
63
|
-
try {
|
|
64
|
-
process.stderr.write(`[io-trace] ${JSON.stringify({ event, ts: Date.now(), ...fields })}\n`);
|
|
65
|
-
} catch {}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
57
|
export function patchTraceEnabled() {
|
|
69
58
|
return (
|
|
70
59
|
ioTraceEnabled() ||
|
|
@@ -92,9 +81,10 @@ function nativePatchPersistent() {
|
|
|
92
81
|
// The engine contract is proven by the RUNNING SESSION, never by a separate
|
|
93
82
|
// probe of a path: the process that will execute the work ANSWERS `CONTRACT`
|
|
94
83
|
// over the real protocol — bytes that merely appear (a startup printer) are
|
|
95
|
-
// not an answer, and the artifact judged is always the one about to run. A
|
|
96
|
-
//
|
|
97
|
-
// running, and one session means one
|
|
84
|
+
// not an answer, and the artifact judged is always the one about to run. A
|
|
85
|
+
// wrapper that prints the marker cannot serve the protocol, a swapped artifact
|
|
86
|
+
// cannot change a process that is already running, and one session means one
|
|
87
|
+
// verification for any number of callers.
|
|
98
88
|
// The marker search below is only a negative pre-filter (skip spawning an
|
|
99
89
|
// artifact that cannot possibly answer); it is never the proof.
|
|
100
90
|
export const NATIVE_PATCH_ENGINE_CONTRACT = 'mixdog-patch-engine-contract:3';
|
|
@@ -34,7 +34,7 @@ async function apply_patch(rawArgs, cwd, options = {}) {
|
|
|
34
34
|
}
|
|
35
35
|
const rejectedV4AHunks = [];
|
|
36
36
|
const v4aConvertOpts = { rejectPartial, rejectedHunks: rejectedV4AHunks, fuzzy, dryRun, readStateScope };
|
|
37
|
-
const route = selectApplyPatchRoute({ args, patchStr, requestedFormat, basePath
|
|
37
|
+
const route = selectApplyPatchRoute({ args, patchStr, requestedFormat, basePath });
|
|
38
38
|
if (route.useSequence) {
|
|
39
39
|
const seqOut = await applyPatchSequence(patchStr, requestedFormat, basePath, {
|
|
40
40
|
v4aConvertOpts,
|
|
@@ -44,7 +44,6 @@ async function apply_patch(rawArgs, cwd, options = {}) {
|
|
|
44
44
|
rejectPartial,
|
|
45
45
|
readStateScope,
|
|
46
46
|
abortSignal,
|
|
47
|
-
mutationPlan: request.mutationPlan,
|
|
48
47
|
toolCallId: options?.toolCallId || null,
|
|
49
48
|
sessionId: options?.sessionId || null,
|
|
50
49
|
replayCapture: options?.replayCapture || null,
|
|
@@ -60,7 +59,6 @@ async function apply_patch(rawArgs, cwd, options = {}) {
|
|
|
60
59
|
readStateScope,
|
|
61
60
|
preParsedV4ASections: route.preParsedV4ASections,
|
|
62
61
|
v4aConvertOpts,
|
|
63
|
-
mutationPlan: request.mutationPlan,
|
|
64
62
|
});
|
|
65
63
|
if (batch.error) return batch.error;
|
|
66
64
|
return applyCodexBatchWithRollback({
|
|
@@ -18,6 +18,10 @@ export function stripDiffPrefix(name) {
|
|
|
18
18
|
return m ? m[1] : name;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
export function specialFilePatchMessage(displayPath) {
|
|
22
|
+
return `apply_patch: cannot patch special file (FIFO / character / block device / socket): ${normalizeOutputPath(displayPath)}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
export function resolveEntryPath(basePath, rawName) {
|
|
22
26
|
// A parsed entry without a header path (jsdiff parses arbitrary non-diff
|
|
23
27
|
// text into a headerless entry) must fail as a patch-format error, not as a
|
|
@@ -10,7 +10,6 @@ export async function runPatchUnits(units, basePath, { waveOpts, abortSignal, co
|
|
|
10
10
|
const failures = [];
|
|
11
11
|
let failed = null;
|
|
12
12
|
let failedIndex = -1;
|
|
13
|
-
let executor = 'native-patch';
|
|
14
13
|
const noteFailure = (unit, index, error) => {
|
|
15
14
|
const row = { displayPath: unit.displayPath, error, index };
|
|
16
15
|
failures.push(row);
|
|
@@ -59,12 +58,11 @@ export async function runPatchUnits(units, basePath, { waveOpts, abortSignal, co
|
|
|
59
58
|
continue;
|
|
60
59
|
}
|
|
61
60
|
const res = await applyParsedWave(wave, basePath, waveOpts);
|
|
62
|
-
executor = res.executor;
|
|
63
61
|
if (res.error) {
|
|
64
62
|
noteFailure(unit, i, res.error);
|
|
65
63
|
continue;
|
|
66
64
|
}
|
|
67
65
|
applied.push({ displayPath: unit.displayPath, text: res.text });
|
|
68
66
|
}
|
|
69
|
-
return { applied, skipped, failures, failed, failedIndex
|
|
67
|
+
return { applied, skipped, failures, failed, failedIndex };
|
|
70
68
|
}
|
|
@@ -64,17 +64,11 @@ function sectionUnit(section, basePath, { v4aConvertOpts, readStateScope, dryRun
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function parsedEntryUnit(entry, basePath) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
throw new Error(
|
|
70
|
-
'apply_patch: a file section header could not be parsed (no target path) — the patch body is not a valid diff. ' +
|
|
71
|
-
'Each section must start with `*** Update File: <path>` / `*** Add File: <path>` / `*** Delete File: <path>` ' +
|
|
72
|
-
'(V4A, wrapped in `*** Begin Patch` / `*** End Patch`), or a `--- a/<path>` + `+++ b/<path>` pair (unified).'
|
|
73
|
-
);
|
|
74
|
-
}
|
|
67
|
+
// Throws the "header could not be parsed (no target path)" error for a headerless entry.
|
|
68
|
+
const fullPath = parsedEntryResolvedPath(entry, basePath);
|
|
75
69
|
return {
|
|
76
|
-
displayPath: normalizeOutputPath(stripDiffPrefix(
|
|
77
|
-
fullPath
|
|
70
|
+
displayPath: normalizeOutputPath(stripDiffPrefix(entryHeaderName(entry))),
|
|
71
|
+
fullPath,
|
|
78
72
|
buildParsed: async () => [entry],
|
|
79
73
|
};
|
|
80
74
|
}
|
|
@@ -23,7 +23,6 @@ export async function applyPatchSequence(patchStr, requestedFormat, basePath, ct
|
|
|
23
23
|
rejectPartial,
|
|
24
24
|
readStateScope,
|
|
25
25
|
abortSignal,
|
|
26
|
-
mutationPlan,
|
|
27
26
|
toolCallId,
|
|
28
27
|
sessionId,
|
|
29
28
|
replayCapture = null,
|
|
@@ -78,7 +77,7 @@ export async function applyPatchSequence(patchStr, requestedFormat, basePath, ct
|
|
|
78
77
|
rejectedHunks: v4aConvertOpts?.rejectedHunks,
|
|
79
78
|
continueAfterFailure,
|
|
80
79
|
});
|
|
81
|
-
return wrapPatchMutationOutput(report
|
|
80
|
+
return wrapPatchMutationOutput(report);
|
|
82
81
|
})
|
|
83
82
|
);
|
|
84
83
|
}
|
|
@@ -10,7 +10,7 @@ import { atomicWrite } from '../builtin/atomic-write.mjs';
|
|
|
10
10
|
import { assertPathReachable, assertPathsReachable } from '../builtin/fs-reachability.mjs';
|
|
11
11
|
import { markCodeGraphDirtyPaths } from '../code-graph-state.mjs';
|
|
12
12
|
import { isSpecialFileStat } from '../builtin/device-paths.mjs';
|
|
13
|
-
import { pathKey, resolveV4AEntryPath } from './paths.mjs';
|
|
13
|
+
import { pathKey, resolveV4AEntryPath, specialFilePatchMessage } from './paths.mjs';
|
|
14
14
|
import { isV4AEndOfFileMarker } from './parsing.mjs';
|
|
15
15
|
import {
|
|
16
16
|
findLineSequence,
|
|
@@ -262,7 +262,7 @@ function recoverHunkWindow(sourceLines, hunk, stats, anchorLine, window, eof) {
|
|
|
262
262
|
if (windowUnlocated(window)) {
|
|
263
263
|
if (eof) window.eofSignalIgnored = true;
|
|
264
264
|
const from = Math.max(0, anchorLine - 1);
|
|
265
|
-
const alt = findLineSequenceEscapeEquiv(sourceLines, window.oldLinesPattern, from
|
|
265
|
+
const alt = findLineSequenceEscapeEquiv(sourceLines, window.oldLinesPattern, from);
|
|
266
266
|
if (alt >= 0) adoptRemappedWindow(sourceLines, window, alt);
|
|
267
267
|
}
|
|
268
268
|
// Context-tolerance tier: see findContextTolerantWindow. Tolerated context
|
|
@@ -494,15 +494,9 @@ function renameTargetsSamePhysicalFile(srcFull, destFull) {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
function v4aSpecialFileStatMessage(displayPath) {
|
|
498
|
-
return `apply_patch: cannot patch special file (FIFO / character / block device / socket): ${normalizeOutputPath(displayPath)}`;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
497
|
function lstatV4APatchTarget(fullPath, displayPath) {
|
|
502
498
|
const st = lstatSync(fullPath);
|
|
503
|
-
if (isSpecialFileStat(st))
|
|
504
|
-
throw new Error(v4aSpecialFileStatMessage(displayPath));
|
|
505
|
-
}
|
|
499
|
+
if (isSpecialFileStat(st)) throw new Error(specialFilePatchMessage(displayPath));
|
|
506
500
|
return st;
|
|
507
501
|
}
|
|
508
502
|
|
|
@@ -537,7 +531,7 @@ export function validateV4ARenameSection(section, basePath, seenDestKeys) {
|
|
|
537
531
|
function v4aRenameSourceIssue(srcFull, displayPath) {
|
|
538
532
|
try {
|
|
539
533
|
const st = lstatSync(srcFull);
|
|
540
|
-
if (isSpecialFileStat(st)) return
|
|
534
|
+
if (isSpecialFileStat(st)) return specialFilePatchMessage(displayPath);
|
|
541
535
|
if (!st.isFile())
|
|
542
536
|
return `apply_patch: V4A rename source is not a regular file: ${normalizeOutputPath(displayPath)}`;
|
|
543
537
|
} catch (err) {
|
|
@@ -549,7 +543,7 @@ function v4aRenameSourceIssue(srcFull, displayPath) {
|
|
|
549
543
|
function v4aRenameDestinationIssue(srcFull, destFull, displayPath, caseOnlyRename) {
|
|
550
544
|
try {
|
|
551
545
|
const destSt = lstatSync(destFull);
|
|
552
|
-
if (isSpecialFileStat(destSt)) return
|
|
546
|
+
if (isSpecialFileStat(destSt)) return specialFilePatchMessage(displayPath);
|
|
553
547
|
if (destSt.isDirectory()) {
|
|
554
548
|
return `apply_patch: V4A rename destination is a directory: ${normalizeOutputPath(displayPath)}`;
|
|
555
549
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// { bundledManifest, download }.
|
|
12
12
|
|
|
13
13
|
import { join } from 'node:path';
|
|
14
|
-
import {
|
|
14
|
+
import { BUNDLED_PATCH_MANIFEST_PATH as BUNDLED_MANIFEST_PATH } from './patch-manifest-path.mjs';
|
|
15
15
|
import {
|
|
16
16
|
binSuffix,
|
|
17
17
|
createBinaryDownloader,
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
validSha256,
|
|
29
29
|
} from '../../../shared/native-asset.mjs';
|
|
30
30
|
|
|
31
|
-
const BUNDLED_MANIFEST_PATH = fileURLToPath(new URL('./patch-manifest.json', import.meta.url));
|
|
32
31
|
const MANIFEST_URL =
|
|
33
32
|
'https://raw.githubusercontent.com/tribgames/mixdog/main/src/runtime/agent/orchestrator/tools/patch-manifest.json';
|
|
34
33
|
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
2
|
+
"version": "0.7.33",
|
|
3
3
|
"_comment": "Rewritten by .github/workflows/patch-release.yml on each tagged release. assets maps platformKey (process.platform-process.arch, e.g. win32-x64, linux-x64, darwin-arm64) to { url, sha256 } of the mixdog-patch binary on the GitHub release. A local cargo build under native/mixdog-patch/target/release always takes precedence; otherwise the binary is fetched per this manifest into the data dir (apply is native-only — no JS apply engine).",
|
|
4
4
|
"assets": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.
|
|
7
|
-
"sha256": "
|
|
6
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.33/mixdog-patch-darwin-arm64",
|
|
7
|
+
"sha256": "c2cb3b4a7e519aa9ddf97537578cf31eae48c371453f46b4501f46b16311c0a5"
|
|
8
8
|
},
|
|
9
9
|
"darwin-x64": {
|
|
10
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.
|
|
11
|
-
"sha256": "
|
|
10
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.33/mixdog-patch-darwin-x64",
|
|
11
|
+
"sha256": "a4a138765dfc76b39fa3ea20638c0526eb857a19f6d8ea59b0e02f3f552bbaf8"
|
|
12
12
|
},
|
|
13
13
|
"linux-arm64": {
|
|
14
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.
|
|
14
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.33/mixdog-patch-linux-arm64",
|
|
15
15
|
"sha256": "8ba081125ab7658a3353ced9dd487d393dc8b252ac98636da3b8745724798e68"
|
|
16
16
|
},
|
|
17
17
|
"linux-x64": {
|
|
18
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.
|
|
19
|
-
"sha256": "
|
|
18
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.33/mixdog-patch-linux-x64",
|
|
19
|
+
"sha256": "bec7bdfc1129d5e99d15c7bc961a2b865868a68e0163a65b506be2aa70ad0bff"
|
|
20
20
|
},
|
|
21
21
|
"win32-arm64": {
|
|
22
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.
|
|
23
|
-
"sha256": "
|
|
22
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.33/mixdog-patch-win32-arm64.exe",
|
|
23
|
+
"sha256": "85374d85f5e966f9ba82f52ed58c799339d591a1afa32a4902ae0c8715506cb5"
|
|
24
24
|
},
|
|
25
25
|
"win32-x64": {
|
|
26
|
-
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.
|
|
27
|
-
"sha256": "
|
|
26
|
+
"url": "https://github.com/tribgames/mixdog/releases/download/patch-v0.7.33/mixdog-patch-win32-x64.exe",
|
|
27
|
+
"sha256": "b0826bb2e7462d072fdc2250fc42662d7da80589d0589a4c4781decc1fd5f008"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
// (lib/shell-run-settle.mjs) and the auto-background promotion
|
|
16
16
|
// (lib/shell-run-background.mjs). This module owns admission, preflight and
|
|
17
17
|
// the wiring between those phases.
|
|
18
|
+
import { startBackgroundTask } from '../../../shared/background-tasks.mjs';
|
|
18
19
|
import { resourceAdmission } from '../../../shared/resource-admission.mjs';
|
|
19
20
|
import { ExecResult, treeKill } from './shell-exec-output.mjs';
|
|
20
21
|
import {
|
|
@@ -70,6 +71,7 @@ function _admissionSaturationError(admission, waitMs) {
|
|
|
70
71
|
'check task list, cancel stale tasks, kill lingering child processes, or restart the CLI.'
|
|
71
72
|
);
|
|
72
73
|
error.code = 'ERESOURCEPRESSURE';
|
|
74
|
+
error.admissionSaturated = true;
|
|
73
75
|
return error;
|
|
74
76
|
}
|
|
75
77
|
|
|
@@ -119,7 +121,7 @@ function _abortableDelay(ms, signal) {
|
|
|
119
121
|
* guess. (A union of "plausible" families was worse than the ambiguity: it
|
|
120
122
|
* rewrote a valid CMD `echo literal ^&` into `echo literal ^`.) */
|
|
121
123
|
// Arguments are accepted for call-site convenience but never classify.
|
|
122
|
-
export function _shellFamilyForSpawn({ shell = ''
|
|
124
|
+
export function _shellFamilyForSpawn({ shell = '' } = {}) {
|
|
123
125
|
const name = String(shell || '')
|
|
124
126
|
.toLowerCase()
|
|
125
127
|
.replace(/\.exe$/, '')
|
|
@@ -139,9 +141,9 @@ export function _shellFamilyForSpawn({ shell = '', shellArg: _shellArg = '', she
|
|
|
139
141
|
|
|
140
142
|
async function acquireShellLeaseBounded(
|
|
141
143
|
admission,
|
|
142
|
-
{ abortSignal, label, dependency = 'scoped', ownerKey = null } = {}
|
|
144
|
+
{ abortSignal, label, dependency = 'scoped', ownerKey = null, waitMs = SHELL_ADMISSION_WAIT_MS } = {}
|
|
143
145
|
) {
|
|
144
|
-
if (!(
|
|
146
|
+
if (!(waitMs > 0)) {
|
|
145
147
|
return admission.acquire('shell', {
|
|
146
148
|
signal: abortSignal || null,
|
|
147
149
|
label,
|
|
@@ -163,12 +165,12 @@ async function acquireShellLeaseBounded(
|
|
|
163
165
|
if (abortSignal.aborted) onAbort();
|
|
164
166
|
else abortSignal.addEventListener('abort', onAbort, { once: true });
|
|
165
167
|
}
|
|
166
|
-
const deadlineAt = Date.now() +
|
|
168
|
+
const deadlineAt = Date.now() + waitMs;
|
|
167
169
|
const deadline = setTimeout(() => {
|
|
168
170
|
try {
|
|
169
|
-
ctl.abort(_admissionSaturationError(admission,
|
|
171
|
+
ctl.abort(_admissionSaturationError(admission, waitMs));
|
|
170
172
|
} catch {}
|
|
171
|
-
},
|
|
173
|
+
}, waitMs);
|
|
172
174
|
if (deadline.unref) deadline.unref();
|
|
173
175
|
try {
|
|
174
176
|
for (;;) {
|
|
@@ -215,11 +217,12 @@ const failedResult = (run, stderr, failureReason) =>
|
|
|
215
217
|
|
|
216
218
|
// Admission lease, policy preflight, then the spawn. Resolves the run with a
|
|
217
219
|
// tool-phase failure and returns false when the command never reaches a shell.
|
|
218
|
-
async function admitAndSpawn(run, params) {
|
|
220
|
+
async function admitAndSpawn(run, params, { admissionWaitMs, onSaturated }) {
|
|
219
221
|
const { admission, command, ownerSessionId, abortSignal } = params;
|
|
220
222
|
try {
|
|
221
223
|
run.resourceLease = await acquireShellLeaseBounded(admission, {
|
|
222
224
|
abortSignal,
|
|
225
|
+
waitMs: admissionWaitMs,
|
|
223
226
|
label: String(command || '').slice(0, 120),
|
|
224
227
|
ownerKey: ownerSessionId,
|
|
225
228
|
});
|
|
@@ -232,6 +235,7 @@ async function admitAndSpawn(run, params) {
|
|
|
232
235
|
await spawnShellChild({ run, ...params });
|
|
233
236
|
return true;
|
|
234
237
|
} catch (err) {
|
|
238
|
+
if (err?.admissionSaturated && !abortSignal?.aborted && onSaturated(err)) return false;
|
|
235
239
|
const cleanupError = await releaseResourceLease(run);
|
|
236
240
|
const spawnText = String(err?.message || err);
|
|
237
241
|
const cleanupText = cleanupError
|
|
@@ -248,6 +252,61 @@ async function admitAndSpawn(run, params) {
|
|
|
248
252
|
}
|
|
249
253
|
}
|
|
250
254
|
|
|
255
|
+
// A saturated shell lane must not fail the call: the command becomes a tracked
|
|
256
|
+
// background task that waits (no admission ceiling) for a lease, runs, and
|
|
257
|
+
// completes like any other task. The call returns its task_id immediately.
|
|
258
|
+
function queueSaturatedAsTask(run, saturation, spec) {
|
|
259
|
+
const queuedAbort = new AbortController();
|
|
260
|
+
let task;
|
|
261
|
+
try {
|
|
262
|
+
task = startBackgroundTask({
|
|
263
|
+
taskId: run.taskId,
|
|
264
|
+
surface: 'shell',
|
|
265
|
+
operation: 'shell',
|
|
266
|
+
label: String(spec.command || '').replace(/\s+/g, ' ').slice(0, 120),
|
|
267
|
+
context: { callerSessionId: spec.ownerSessionId, clientHostPid: spec.clientHostPid },
|
|
268
|
+
input: { command: spec.command, cwd: spec.cwd },
|
|
269
|
+
meta: { task_id: run.taskId, stdout: null, stderr: null, cwd: spec.cwd, timeoutMs: spec.timeoutMs },
|
|
270
|
+
resultType: 'shell_task_result',
|
|
271
|
+
cancel: () => queuedAbort.abort(),
|
|
272
|
+
run: async () => {
|
|
273
|
+
const result = await execShellCommand({
|
|
274
|
+
...spec,
|
|
275
|
+
abortSignal: queuedAbort.signal,
|
|
276
|
+
autoBackgroundMs: 0,
|
|
277
|
+
backgroundOnTimeout: false,
|
|
278
|
+
admissionWaitMs: 0,
|
|
279
|
+
});
|
|
280
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
281
|
+
if (result.exitCode !== 0) {
|
|
282
|
+
throw new Error(`exit code ${result.exitCode ?? result.signal ?? 'unknown'}${output ? `\n${output}` : ''}`);
|
|
283
|
+
}
|
|
284
|
+
return { task_id: run.taskId, status: 'completed', exit_code: 0, output };
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
} catch {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
detachAbortHandler(run);
|
|
291
|
+
const reason = String(saturation.message || '').split(' —')[0];
|
|
292
|
+
run.resolveResult(
|
|
293
|
+
new ExecResult({
|
|
294
|
+
stdout: '',
|
|
295
|
+
stderr: '',
|
|
296
|
+
exitCode: null,
|
|
297
|
+
signal: null,
|
|
298
|
+
taskId: run.taskId,
|
|
299
|
+
backgrounded: true,
|
|
300
|
+
partialOutput: true,
|
|
301
|
+
settled: task.promise,
|
|
302
|
+
backgroundMessage:
|
|
303
|
+
`${reason}; queued as background task [task_id: ${task.taskId}] that starts when an execution slot frees. ` +
|
|
304
|
+
'Completion arrives automatically; call task wait (not task read polling) when the result is due.',
|
|
305
|
+
})
|
|
306
|
+
);
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
|
|
251
310
|
// A fault in the wiring BELOW admitAndSpawn (capture, settle, deadlines) has
|
|
252
311
|
// no phase of its own to report it: nothing is armed yet, so no timer, exit
|
|
253
312
|
// handler or settle() can ever resolve the run. Tear the half-built run down
|
|
@@ -413,11 +472,8 @@ function armDeadlines(run, { timeoutMs, autoBackgroundMs, backgroundOnTimeout, a
|
|
|
413
472
|
}
|
|
414
473
|
}
|
|
415
474
|
|
|
416
|
-
//
|
|
417
|
-
//
|
|
418
|
-
// note). The failure is at spawn() time — before any stdio/side effect — so a
|
|
419
|
-
// short bounded retry is safe and never re-runs a command that already ran
|
|
420
|
-
// (lib/shell-spawn-retry.mjs).
|
|
475
|
+
// Run one command to a terminal ExecResult. Spawn-time EPERM retries (Windows
|
|
476
|
+
// Defender scanning the child image) live in lib/shell-spawn-retry.mjs.
|
|
421
477
|
export function execShellCommand({
|
|
422
478
|
shell,
|
|
423
479
|
shellArg,
|
|
@@ -435,6 +491,7 @@ export function execShellCommand({
|
|
|
435
491
|
backgroundOnTimeout,
|
|
436
492
|
promotedTimeoutMs = 0,
|
|
437
493
|
backgroundDeadlineMs = 0,
|
|
494
|
+
admissionWaitMs = SHELL_ADMISSION_WAIT_MS,
|
|
438
495
|
admission = resourceAdmission,
|
|
439
496
|
directArgv = null,
|
|
440
497
|
// What the shell PARSES, when that must differ from what the caller shows.
|
|
@@ -464,6 +521,24 @@ export function execShellCommand({
|
|
|
464
521
|
execScript,
|
|
465
522
|
ownerSessionId,
|
|
466
523
|
clientHostPid,
|
|
524
|
+
}, {
|
|
525
|
+
admissionWaitMs,
|
|
526
|
+
onSaturated: (err) =>
|
|
527
|
+
backgroundOnTimeout &&
|
|
528
|
+
queueSaturatedAsTask(run, err, {
|
|
529
|
+
shell,
|
|
530
|
+
shellArg,
|
|
531
|
+
shellArgs,
|
|
532
|
+
command,
|
|
533
|
+
env,
|
|
534
|
+
cwd,
|
|
535
|
+
timeoutMs: backgroundDeadlineMs,
|
|
536
|
+
clientHostPid,
|
|
537
|
+
ownerSessionId,
|
|
538
|
+
admission,
|
|
539
|
+
directArgv,
|
|
540
|
+
execScript,
|
|
541
|
+
}),
|
|
467
542
|
});
|
|
468
543
|
if (!spawned) return;
|
|
469
544
|
|