mixdog 0.9.63 → 0.9.65
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 +3 -0
- package/package.json +9 -2
- package/scripts/code-graph-description-contract.mjs +3 -3
- package/scripts/verify-release-assets.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +11 -14
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +6 -6
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +1 -0
- package/src/runtime/agent/orchestrator/config.mjs +19 -124
- package/src/runtime/agent/orchestrator/context/collect.mjs +6 -6
- package/src/runtime/agent/orchestrator/dispatch-persist.mjs +2 -2
- package/src/runtime/agent/orchestrator/internal-agents.mjs +2 -2
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +1 -1
- package/src/runtime/agent/orchestrator/mcp/client.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +333 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +3 -277
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +6 -6
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +196 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +460 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +14 -593
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +5 -280
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +357 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-headers.mjs +216 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +2 -188
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/provider-catalog-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/compact/budget.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/compact/file-reattach.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/compact/summary-schema.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/summary.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +4 -4
- package/src/runtime/agent/orchestrator/session/loop/deferred-call-through.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +17 -0
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +18 -26
- package/src/runtime/agent/orchestrator/session/loop/termination.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/delivered-completions.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/live-state.mjs +49 -0
- package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +49 -0
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +260 -0
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +72 -0
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +163 -0
- package/src/runtime/agent/orchestrator/session/store/write-guards.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/store.mjs +9 -561
- package/src/runtime/agent/orchestrator/session/tool-envelope.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +2 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +11 -11
- package/src/runtime/agent/orchestrator/tools/bash-policy-scan.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/bash-session.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +2 -154
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/cwd-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/fs-reachability.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/fuzzy-match.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/path-locks.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-open.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-process.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-spawn.mjs +519 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +5 -449
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-helpers.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +212 -0
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +1 -7
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +9 -36
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +15 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +429 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +2 -395
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-prewarm-worker.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/mutation-planner.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/next-call-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +7 -7
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +72 -9
- package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/result-compression.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +2 -444
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +505 -0
- package/src/runtime/agent/orchestrator/tools/shell-exec-policy.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +1 -1
- package/src/runtime/channels/lib/backend-dispatch.mjs +20 -5
- package/src/runtime/channels/lib/scheduler.mjs +1 -1
- package/src/runtime/channels/lib/telegram-format.mjs +1 -1
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +4 -4
- package/src/runtime/channels/tool-defs.mjs +2 -3
- package/src/runtime/memory/index.mjs +1 -5
- package/src/runtime/memory/lib/core-memory-candidates.mjs +357 -0
- package/src/runtime/memory/lib/core-memory-store.mjs +7 -357
- package/src/runtime/memory/lib/cycle-signatures.mjs +1 -1
- package/src/runtime/memory/lib/embedding-model-config.mjs +1 -1
- package/src/runtime/memory/lib/embedding-provider.mjs +1 -5
- package/src/runtime/memory/lib/embedding-worker.mjs +1 -5
- package/src/runtime/memory/lib/ko-morph.mjs +2 -2
- package/src/runtime/memory/lib/memory-config-flags.mjs +2 -5
- package/src/runtime/memory/lib/memory-cycle-requests.mjs +3 -7
- package/src/runtime/memory/lib/memory-cycle1.mjs +4 -8
- package/src/runtime/memory/lib/memory-cycle2-gate.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle2-shared.mjs +2 -5
- package/src/runtime/memory/lib/memory-cycle3.mjs +1 -5
- package/src/runtime/memory/lib/memory-embed.mjs +2 -6
- package/src/runtime/memory/lib/memory-log.mjs +8 -0
- package/src/runtime/memory/lib/memory-ops-policy.mjs +4 -8
- package/src/runtime/memory/lib/memory-recall-scope-filter.mjs +1 -1
- package/src/runtime/memory/lib/memory-recall-store.mjs +2 -193
- package/src/runtime/memory/lib/memory-score.mjs +1 -1
- package/src/runtime/memory/lib/memory-text-utils.mjs +2 -2
- package/src/runtime/memory/lib/memory.mjs +2 -6
- package/src/runtime/memory/lib/pg/adapter.mjs +2 -6
- package/src/runtime/memory/lib/pg/process.mjs +1 -5
- package/src/runtime/memory/lib/pg/supervisor.mjs +1 -5
- package/src/runtime/memory/lib/recall-format.mjs +2 -2
- package/src/runtime/memory/lib/recall-scoring.mjs +195 -0
- package/src/runtime/memory/lib/runtime-fetcher.mjs +1 -5
- package/src/runtime/memory/lib/trace-store.mjs +2 -6
- package/src/runtime/search/lib/http-fetch.mjs +6 -6
- package/src/runtime/search/lib/web-tools.mjs +2 -2
- package/src/runtime/shared/buffered-appender.mjs +1 -1
- package/src/runtime/shared/child-guardian.mjs +1 -1
- package/src/runtime/shared/child-spawn-gate.mjs +1 -1
- package/src/runtime/shared/config.mjs +4 -4
- package/src/runtime/shared/launcher-control.mjs +9 -10
- package/src/runtime/shared/llm/index.mjs +5 -20
- package/src/runtime/shared/markdown-frontmatter.mjs +1 -1
- package/src/runtime/shared/memory-snapshot.mjs +4 -4
- package/src/runtime/shared/pristine-execution.mjs +1 -1
- package/src/runtime/shared/process-lifecycle.mjs +0 -1
- package/src/runtime/shared/process-shutdown.mjs +1 -1
- package/src/runtime/shared/resource-admission.mjs +2 -2
- package/src/runtime/shared/schedule-session-run.mjs +1 -1
- package/src/runtime/shared/schedules-db.mjs +1 -1
- package/src/runtime/shared/service-discovery.mjs +2 -2
- package/src/runtime/shared/staged-update.mjs +6 -6
- package/src/runtime/shared/tool-execution-contract.mjs +1 -1
- package/src/runtime/shared/tool-primitives.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +2 -2
- package/src/runtime/shared/turn-snapshot.mjs +184 -0
- package/src/runtime/shared/update-checker.mjs +1 -1
- package/src/runtime/shared/user-cwd.mjs +3 -3
- package/src/runtime/shared/user-data-guard.mjs +4 -4
- package/src/runtime/shared/workspace-router.mjs +5 -5
- package/src/session-runtime/config-helpers.mjs +2 -3
- package/src/session-runtime/config-lifecycle.mjs +1 -1
- package/src/session-runtime/hitch-profile.mjs +1 -1
- package/src/session-runtime/lifecycle-api.mjs +6 -4
- package/src/session-runtime/model-recency.mjs +5 -5
- package/src/session-runtime/plugin-mcp.mjs +1 -1
- package/src/session-runtime/provider-request-snapshot.mjs +338 -0
- package/src/session-runtime/runtime-core.mjs +4 -0
- package/src/session-runtime/session-text.mjs +4 -4
- package/src/session-runtime/session-turn-api.mjs +7 -0
- package/src/session-runtime/tool-catalog-schema.mjs +197 -0
- package/src/session-runtime/tool-catalog.mjs +6 -483
- package/src/session-runtime/tool-defs.mjs +1 -1
- package/src/standalone/agent-task-status.mjs +1 -1
- package/src/standalone/agent-tool/helpers.mjs +2 -2
- package/src/standalone/channel-admin.mjs +4 -4
- package/src/standalone/explore-tool.mjs +3 -3
- package/src/standalone/hook-bus/config.mjs +1 -1
- package/src/standalone/hook-bus/constants.mjs +1 -1
- package/src/standalone/hook-bus/rules.mjs +1 -1
- package/src/standalone/projects.mjs +1 -1
- package/src/standalone/provider-admin.mjs +2 -2
- package/src/tui/App.jsx +1 -1
- package/src/tui/app/app-format.mjs +2 -2
- package/src/tui/app/clipboard.mjs +3 -3
- package/src/tui/app/input-parsers.mjs +1 -1
- package/src/tui/app/text-layout.mjs +1 -1
- package/src/tui/app/transcript-row-estimate.mjs +360 -0
- package/src/tui/app/transcript-window.mjs +5 -347
- package/src/tui/app/use-mouse-input.mjs +1 -1
- package/src/tui/app/use-prompt-handlers.mjs +1 -1
- package/src/tui/components/tool-execution/surface-detail.mjs +9 -9
- package/src/tui/components/tool-execution/text-format.mjs +2 -2
- package/src/tui/components/tool-output-format.mjs +7 -7
- package/src/tui/display-width.mjs +4 -4
- package/src/tui/dist/index.mjs +187 -99
- package/src/tui/engine/agent-envelope.mjs +5 -5
- package/src/tui/engine/live-share.mjs +100 -0
- package/src/tui/engine/notification-plan.mjs +1 -1
- package/src/tui/engine/queue-helpers.mjs +3 -3
- package/src/tui/engine/render-timing.mjs +4 -5
- package/src/tui/engine/session-api-ext.mjs +6 -3
- package/src/tui/engine/tool-result-status.mjs +5 -5
- package/src/tui/engine/tool-result-text.mjs +1 -1
- package/src/tui/engine/transcript-spill.mjs +585 -0
- package/src/tui/engine/tui-steering-persist.mjs +1 -1
- package/src/tui/engine.mjs +29 -474
- package/src/tui/lib/voice-setup.mjs +1 -1
- package/src/tui/markdown/format-token.mjs +1 -1
- package/src/tui/markdown/render-ansi.mjs +1 -1
- package/src/tui/markdown/table-layout.mjs +4 -4
- package/src/tui/paste-attachments.mjs +1 -1
- package/src/tui/prompt-history-store.mjs +3 -3
- package/src/tui/statusline-ansi-bridge.mjs +2 -2
- package/src/tui/theme.mjs +1 -1
- package/src/tui/transcript-tool-failures.mjs +2 -2
- package/src/ui/ansi.mjs +0 -9
- package/src/ui/statusline-format.mjs +2 -4
- package/scripts/_bench-cwc.json +0 -20
- package/scripts/_jitter-fuzz.jsx +0 -42
- package/scripts/_jitter-fuzz2.jsx +0 -30
- package/scripts/_jitter-probe.jsx +0 -35
- package/scripts/_jp2.jsx +0 -16
- package/scripts/_smoke_wd.mjs +0 -7
- package/scripts/abort-recovery-test.mjs +0 -175
- package/scripts/agent-dispatch-abort-compose-test.mjs +0 -31
- package/scripts/agent-live-arg-guard-smoke.mjs +0 -20
- package/scripts/agent-live-path-suffix-smoke.mjs +0 -34
- package/scripts/agent-live-toolcall-args-smoke.mjs +0 -45
- package/scripts/agent-loop-policy-test.mjs +0 -37
- package/scripts/agent-model-liveness-test.mjs +0 -763
- package/scripts/agent-parallel-smoke.mjs +0 -435
- package/scripts/agent-route-batch-test.mjs +0 -40
- package/scripts/agent-tag-reuse-smoke.mjs +0 -441
- package/scripts/agent-terminal-reap-test.mjs +0 -252
- package/scripts/agent-trace-io-test.mjs +0 -133
- package/scripts/ansi-color-capability-test.mjs +0 -90
- package/scripts/anthropic-admission-retry-integration-test.mjs +0 -119
- package/scripts/anthropic-maxtokens-test.mjs +0 -119
- package/scripts/anthropic-oauth-refresh-race-test.mjs +0 -397
- package/scripts/anthropic-transport-policy-test.mjs +0 -726
- package/scripts/apply-patch-edit-smoke.mjs +0 -71
- package/scripts/arg-guard-test.mjs +0 -93
- package/scripts/async-notify-settlement-test.mjs +0 -99
- package/scripts/atomic-lock-tryonce-test.mjs +0 -125
- package/scripts/background-task-meta-smoke.mjs +0 -38
- package/scripts/bench-run.mjs +0 -508
- package/scripts/boot-smoke.mjs +0 -137
- package/scripts/build-runtime-windows.ps1 +0 -242
- package/scripts/channel-daemon-smoke.mjs +0 -1103
- package/scripts/code-graph-aggregate-cwd-test.mjs +0 -158
- package/scripts/code-graph-disk-hit-test.mjs +0 -290
- package/scripts/code-graph-dispatch-test.mjs +0 -96
- package/scripts/code-graph-root-federation-test.mjs +0 -273
- package/scripts/compact-active-turn-test.mjs +0 -68
- package/scripts/compact-file-reattach-test.mjs +0 -88
- package/scripts/compact-pressure-test.mjs +0 -788
- package/scripts/compact-prior-context-flatten-test.mjs +0 -252
- package/scripts/compact-recall-digest-test.mjs +0 -57
- package/scripts/compact-smoke.mjs +0 -1017
- package/scripts/compact-trigger-migration-smoke.mjs +0 -261
- package/scripts/compacted-placeholder-scrub-test.mjs +0 -63
- package/scripts/context-mcp-metering-test.mjs +0 -1406
- package/scripts/debounced-skills-async-save-test.mjs +0 -57
- package/scripts/deferred-tool-loading-test.mjs +0 -250
- package/scripts/desktop-session-bridge-test.mjs +0 -1013
- package/scripts/dispatch-persist-recovery-test.mjs +0 -141
- package/scripts/embedding-worker-exit-test.mjs +0 -76
- package/scripts/execution-completion-dedup-test.mjs +0 -205
- package/scripts/execution-pending-resume-kick-test.mjs +0 -151
- package/scripts/execution-resume-esc-integration-test.mjs +0 -176
- package/scripts/explore-bench-tmp.mjs +0 -36
- package/scripts/explore-bench.mjs +0 -248
- package/scripts/explore-prompt-policy-test.mjs +0 -256
- package/scripts/explore-timeout-cancel-test.mjs +0 -345
- package/scripts/find-fuzzy-hidden-test.mjs +0 -267
- package/scripts/forwarder-rebind-tail-test.mjs +0 -67
- package/scripts/freevar-smoke.mjs +0 -98
- package/scripts/gemini-provider-test.mjs +0 -1448
- package/scripts/generate-oc-icons.mjs +0 -11
- package/scripts/grok-oauth-refresh-race-test.mjs +0 -273
- package/scripts/headless-pristine-execution-test.mjs +0 -614
- package/scripts/hook-bus-test.mjs +0 -552
- package/scripts/ingest-pure-conversation-smoke.mjs +0 -175
- package/scripts/internal-comms-bench-test.mjs +0 -226
- package/scripts/internal-comms-bench.mjs +0 -853
- package/scripts/internal-comms-smoke.mjs +0 -277
- package/scripts/internal-tools-normalization-test.mjs +0 -62
- package/scripts/interrupted-turn-history-test.mjs +0 -399
- package/scripts/lead-workflow-smoke.mjs +0 -592
- package/scripts/lifecycle-api-test.mjs +0 -137
- package/scripts/live-share-test.mjs +0 -148
- package/scripts/live-worker-smoke.mjs +0 -333
- package/scripts/log-writer-guard-smoke.mjs +0 -131
- package/scripts/maintenance-default-routes-test.mjs +0 -164
- package/scripts/max-output-recovery-persist-test.mjs +0 -81
- package/scripts/max-output-recovery-test.mjs +0 -368
- package/scripts/mcp-client-normalization-test.mjs +0 -45
- package/scripts/mcp-grace-deferred-test.mjs +0 -225
- package/scripts/memory-core-input-test.mjs +0 -167
- package/scripts/memory-cycle-routing-test.mjs +0 -111
- package/scripts/memory-meta-concurrency-test.mjs +0 -20
- package/scripts/memory-pg-recovery-test.mjs +0 -59
- package/scripts/memory-rule-contract-test.mjs +0 -93
- package/scripts/model-list-sanitize-test.mjs +0 -37
- package/scripts/mouse-tracking-restore-smoke.mjs +0 -107
- package/scripts/native-edit-wire-test.mjs +0 -152
- package/scripts/notify-completion-mirror-test.mjs +0 -73
- package/scripts/openai-oauth-refresh-race-test.mjs +0 -120
- package/scripts/openai-oauth-ws-1006-retry-test.mjs +0 -954
- package/scripts/openai-ws-early-settle-test.mjs +0 -216
- package/scripts/output-style-bench.mjs +0 -292
- package/scripts/output-style-smoke.mjs +0 -145
- package/scripts/parent-abort-link-test.mjs +0 -90
- package/scripts/patch-binary-cache-test.mjs +0 -181
- package/scripts/path-suffix-test.mjs +0 -57
- package/scripts/pending-completion-drop-test.mjs +0 -239
- package/scripts/pending-messages-lock-nonblocking-test.mjs +0 -62
- package/scripts/pretool-ask-runtime-test.mjs +0 -54
- package/scripts/process-lifecycle-test.mjs +0 -461
- package/scripts/prompt-immediate-render-test.mjs +0 -89
- package/scripts/prompt-input-parity-test.mjs +0 -145
- package/scripts/provider-admission-scheduler-test.mjs +0 -681
- package/scripts/provider-contract-test.mjs +0 -632
- package/scripts/provider-stream-stall-test.mjs +0 -276
- package/scripts/provider-toolcall-test.mjs +0 -3063
- package/scripts/reactive-compact-persist-smoke.mjs +0 -203
- package/scripts/recall-bench.mjs +0 -359
- package/scripts/resource-admission-test.mjs +0 -792
- package/scripts/result-classification-test.mjs +0 -75
- package/scripts/rg-runner-test.mjs +0 -240
- package/scripts/routing-corpus-test.mjs +0 -349
- package/scripts/sanitize-tool-pairs-test.mjs +0 -260
- package/scripts/session-bench-cache-break-test.mjs +0 -102
- package/scripts/session-bench.mjs +0 -1708
- package/scripts/session-context-bench.mjs +0 -344
- package/scripts/session-heartbeat-lifecycle-test.mjs +0 -68
- package/scripts/session-ingest-compaction-smoke.mjs +0 -279
- package/scripts/session-ingest-smoke.mjs +0 -177
- package/scripts/session-orphan-sweep-test.mjs +0 -109
- package/scripts/set-effort-config-test.mjs +0 -41
- package/scripts/shell-failure-diagnostics-test.mjs +0 -280
- package/scripts/shell-hardening-test.mjs +0 -209
- package/scripts/shell-jobs-windows-hide-test.mjs +0 -164
- package/scripts/ship-mode-test.mjs +0 -98
- package/scripts/smoke-loop-failure-summary-test.mjs +0 -38
- package/scripts/smoke-loop-failure-summary.mjs +0 -16
- package/scripts/smoke-loop-report.mjs +0 -221
- package/scripts/smoke-loop.mjs +0 -202
- package/scripts/smoke-runtime-negative.ps1 +0 -106
- package/scripts/statusline-quota-hysteresis-test.mjs +0 -62
- package/scripts/steering-drain-buckets-test.mjs +0 -467
- package/scripts/steering-fold-provenance-test.mjs +0 -71
- package/scripts/streaming-tail-window-test.mjs +0 -175
- package/scripts/submit-commandbusy-race-test.mjs +0 -257
- package/scripts/task-bench.mjs +0 -205
- package/scripts/terminal-bench-isolation-guards-test.mjs +0 -102
- package/scripts/termio-input-smoke.mjs +0 -199
- package/scripts/tool-result-hook-test.mjs +0 -48
- package/scripts/tool-smoke.mjs +0 -2453
- package/scripts/tool-tui-presentation-test.mjs +0 -286
- package/scripts/toolcall-args-test.mjs +0 -239
- package/scripts/tui-ambiguous-width-test.mjs +0 -113
- package/scripts/tui-background-failure-smoke.mjs +0 -73
- package/scripts/tui-perf-run.ps1 +0 -26
- package/scripts/tui-render-smoke.mjs +0 -90
- package/scripts/tui-runtime-load-bench-entry.jsx +0 -608
- package/scripts/tui-runtime-load-bench.mjs +0 -50
- package/scripts/tui-store-frame-batch-test.mjs +0 -99
- package/scripts/tui-transcript-jitter-harness-entry.jsx +0 -383
- package/scripts/tui-transcript-perf-test.mjs +0 -934
- package/scripts/usage-metrics-epoch-smoke.mjs +0 -114
- package/scripts/verify-release-assets-test.mjs +0 -281
- package/scripts/web-fetch-routing-test.mjs +0 -158
- package/scripts/webhook-smoke.mjs +0 -201
- package/scripts/windows-hide-spawn-options-test.mjs +0 -19
- package/scripts/worker-notify-rejection-test.mjs +0 -51
- package/scripts/write-backpressure-test.mjs +0 -147
package/src/ui/ansi.mjs
CHANGED
|
@@ -151,18 +151,9 @@ export const gray = sgr('38;2;198;198;198');
|
|
|
151
151
|
export const grey = gray;
|
|
152
152
|
|
|
153
153
|
// Bright variants (used sparingly for headings / accents).
|
|
154
|
-
export const brightRed = sgr('38;2;220;70;88');
|
|
155
154
|
export const brightGreen = sgr('38;2;0;185;88');
|
|
156
|
-
export const brightYellow = sgr('38;2;255;210;80');
|
|
157
|
-
export const brightBlue = sgr('38;2;93;173;255');
|
|
158
|
-
export const brightMagenta = sgr('38;2;190;150;230');
|
|
159
|
-
export const brightCyan = sgr('38;2;168;168;168');
|
|
160
|
-
export const brightWhite = sgr('38;2;220;220;220');
|
|
161
155
|
|
|
162
156
|
// --- Background colors ------------------------------------------------------
|
|
163
|
-
export const bgGray = sgr('100');
|
|
164
|
-
export const bgBlack = sgr('40');
|
|
165
|
-
export const bgBlue = sgr('44');
|
|
166
157
|
|
|
167
158
|
// --- RGB colors --------------------------------------------------------------
|
|
168
159
|
// Emit 24-bit SGR where supported, otherwise use the nearest 256-color entry.
|
|
@@ -15,7 +15,6 @@ import { getModelMetadataSync } from '../runtime/agent/orchestrator/providers/mo
|
|
|
15
15
|
export const FALLBACK_CONTEXT_WINDOW = 200000;
|
|
16
16
|
export const statusText = rgb(198, 198, 198);
|
|
17
17
|
export const statusSubtle = rgb(136, 136, 136);
|
|
18
|
-
export const statusAccent = rgb(215, 119, 87);
|
|
19
18
|
|
|
20
19
|
function sgr(code) {
|
|
21
20
|
return colorEnabled() ? `\x1b[${code}m` : '';
|
|
@@ -27,7 +26,6 @@ export const D = colorEnabled() ? rgbSgr(136, 136, 136) : '';
|
|
|
27
26
|
export const GRN = colorEnabled() ? rgbSgr(0, 170, 75) : '';
|
|
28
27
|
export const YLW = colorEnabled() ? rgbSgr(255, 193, 7) : '';
|
|
29
28
|
export const RED = colorEnabled() ? rgbSgr(220, 70, 88) : '';
|
|
30
|
-
export const CYN = colorEnabled() ? rgbSgr(136, 136, 136) : '';
|
|
31
29
|
export const GREY = colorEnabled() ? rgbSgr(136, 136, 136) : '';
|
|
32
30
|
|
|
33
31
|
export function terminalColumns() {
|
|
@@ -80,7 +78,7 @@ export function formatContextSegment(ctxPct, cols) {
|
|
|
80
78
|
return `${fill}${filled}${R}${D}${empty}${R} ${label}%`;
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
function makeBar(pct, cells) {
|
|
84
82
|
let filled = Math.floor((Number(pct) || 0) * cells / 100);
|
|
85
83
|
if (filled < 0) filled = 0;
|
|
86
84
|
if (filled > cells) filled = cells;
|
|
@@ -105,7 +103,7 @@ export function num(v) {
|
|
|
105
103
|
return Number.isFinite(n) ? n : 0;
|
|
106
104
|
}
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
function clampPct(v) {
|
|
109
107
|
const n = Number(v);
|
|
110
108
|
if (!Number.isFinite(n)) return 0;
|
|
111
109
|
return Math.max(0, Math.min(100, n));
|
package/scripts/_bench-cwc.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "cwc-hookflow",
|
|
4
|
-
"agent": "worker",
|
|
5
|
-
"prompt": "In this repo (mixdog), what happens to a tool call when no hooks are configured? Verify the default observer/bypass path: where beforeTool() is invoked, what it returns with no configured rules, and where a configured custom hook rule could instead deny the call. Give file paths and function names. Do not modify anything.",
|
|
6
|
-
"cwd": "."
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": "cwc-cacheusage",
|
|
10
|
-
"agent": "worker",
|
|
11
|
-
"prompt": "In this repo (mixdog), how are cached token counts recorded and surfaced in usage metrics? Find where cached_tokens comes from and how it flows into the usage record. Give file paths and function names. Do not modify anything.",
|
|
12
|
-
"cwd": "."
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"id": "cwc-compacttrigger",
|
|
16
|
-
"agent": "worker",
|
|
17
|
-
"prompt": "In this repo (mixdog), what triggers a context compaction and where is that threshold decided? Trace the trigger condition to the compaction entry point. Give file paths and function names. Do not modify anything.",
|
|
18
|
-
"cwd": "."
|
|
19
|
-
}
|
|
20
|
-
]
|
package/scripts/_jitter-fuzz.jsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box, renderToString } from 'ink';
|
|
3
|
-
import { ToolExecution } from '../src/tui/components/ToolExecution.jsx';
|
|
4
|
-
import { estimateTranscriptItemRowsCached } from '../src/tui/app/transcript-window.mjs';
|
|
5
|
-
function renderRows(item,COLUMNS){
|
|
6
|
-
const node=React.createElement(Box,{flexDirection:'column',flexShrink:0,width:COLUMNS},
|
|
7
|
-
React.createElement(ToolExecution,{name:item.name,args:item.args,result:item.result,rawResult:item.rawResult,isError:item.isError,errorCount:item.errorCount,expanded:!!item.expanded,columns:COLUMNS,attached:false,count:item.count,completedCount:item.completedCount,startedAt:item.startedAt,completedAt:item.completedAt,aggregate:item.aggregate,categories:item.categories,doneCategories:item.doneCategories,headerFinalized:item.headerFinalized,deferredDisplayReady:item.deferredDisplayReady}));
|
|
8
|
-
const out=renderToString(node,{columns:COLUMNS});
|
|
9
|
-
return out===''?0:out.split('\n').length;
|
|
10
|
-
}
|
|
11
|
-
const now=Date.now();
|
|
12
|
-
const longLine='x'.repeat(200);
|
|
13
|
-
const items=[];
|
|
14
|
-
const names=['read','grep','glob','shell','code_graph','explore','search','web_fetch','agent','Skill','view_image','recall','remember','task','list'];
|
|
15
|
-
const results=[null,'','ok','No matches','line1\nline2','line1\nline2\nline3',longLine, longLine+'\n'+longLine, '[status: cancelled]\nbody', 'Error: boom'];
|
|
16
|
-
let id=0;
|
|
17
|
-
for(const name of names){
|
|
18
|
-
for(const result of results){
|
|
19
|
-
for(const completed of [0,1]){
|
|
20
|
-
for(const isError of [false,true]){
|
|
21
|
-
for(const expanded of [false,true]){
|
|
22
|
-
items.push({name,args:{path:'a/b/c.js',pattern:'foo',command:'ls -la',mode:'search',symbols:'X',action:'spawn',status: completed?'completed':'',name:'setup'},result,count:1,completedCount:completed,isError,expanded,startedAt:now-2000,completedAt:completed?now:0,headerFinalized:completed===1,deferredDisplayReady:true,rawResult: expanded?(result||'raw body\nl2'):null,__id:id++});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const COLS=[40,60,80,100,120];
|
|
29
|
-
let bad=0,total=0;
|
|
30
|
-
const seen=new Set();
|
|
31
|
-
for(const COLUMNS of COLS){
|
|
32
|
-
for(const it of items){
|
|
33
|
-
total++;
|
|
34
|
-
const est=estimateTranscriptItemRowsCached({kind:'tool',...it},COLUMNS,false);
|
|
35
|
-
let ren; try{ren=renderRows(it,COLUMNS);}catch(e){ren='ERR:'+e.message;}
|
|
36
|
-
if(est!==ren){bad++;
|
|
37
|
-
const key=`${it.name}|res=${JSON.stringify(it.result)}|c=${it.completedCount}|e=${it.isError}|x=${it.expanded}|col=${COLUMNS}`;
|
|
38
|
-
if(bad<=40) console.log(`DIFF est=${est} ren=${ren} ${key}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
console.log('total',total,'mismatches',bad);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box, renderToString } from 'ink';
|
|
3
|
-
import { ToolExecution } from '../src/tui/components/ToolExecution.jsx';
|
|
4
|
-
import { estimateTranscriptItemRowsCached } from '../src/tui/app/transcript-window.mjs';
|
|
5
|
-
import { shouldSuppressFullyFailedToolItem } from '../src/tui/transcript-tool-failures.mjs';
|
|
6
|
-
function renderRows(item,COLUMNS){
|
|
7
|
-
const node=React.createElement(Box,{flexDirection:'column',flexShrink:0,width:COLUMNS},
|
|
8
|
-
React.createElement(ToolExecution,{name:item.name,args:item.args,result:item.result,rawResult:item.rawResult,isError:item.isError,errorCount:item.errorCount,expanded:!!item.expanded,columns:COLUMNS,attached:false,count:item.count,completedCount:item.completedCount,startedAt:item.startedAt,completedAt:item.completedAt,aggregate:item.aggregate,categories:item.categories,doneCategories:item.doneCategories,headerFinalized:item.headerFinalized,deferredDisplayReady:item.deferredDisplayReady}));
|
|
9
|
-
const out=renderToString(node,{columns:COLUMNS});
|
|
10
|
-
return out===''?0:out.split('\n').length;
|
|
11
|
-
}
|
|
12
|
-
const now=Date.now();
|
|
13
|
-
const names=['read','grep','glob','shell','code_graph','explore','search','web_fetch','agent','Skill','view_image','recall','list','fetch','load_tool'];
|
|
14
|
-
const results=['ok','No matches','line1\nline2','line1\nline2\nline3','done · 3 items','Failed', 'Read 40 lines'];
|
|
15
|
-
const cases=[];
|
|
16
|
-
let id=0;
|
|
17
|
-
for(const name of names) for(const result of results) for(const completed of [0,1]) for(const isError of [false,true]){
|
|
18
|
-
cases.push({name,args:{path:'a/b/c.js',pattern:'foo',command:'ls -la',mode:'search',symbols:'X',action:'response',status: completed?'completed':'',name:'setup'},result: completed?result:null,count:1,completedCount:completed,isError,expanded:false,startedAt:now-2000,completedAt:completed?now:0,headerFinalized:completed===1,deferredDisplayReady:true,rawResult:null,__id:id++});
|
|
19
|
-
}
|
|
20
|
-
const COLS=[60,80,100,120];
|
|
21
|
-
let bad=0,total=0;
|
|
22
|
-
for(const COLUMNS of COLS) for(const it of cases){
|
|
23
|
-
const full={kind:'tool',...it};
|
|
24
|
-
if(shouldSuppressFullyFailedToolItem(full)) continue; // real app renders nothing
|
|
25
|
-
total++;
|
|
26
|
-
const est=estimateTranscriptItemRowsCached(full,COLUMNS,false);
|
|
27
|
-
let ren; try{ren=renderRows(it,COLUMNS);}catch(e){ren='ERR:'+e.message;}
|
|
28
|
-
if(est!==ren){bad++; if(bad<=60) console.log(`DIFF est=${est} ren=${ren} ${it.name}|res=${JSON.stringify(it.result)}|c=${it.completedCount}|e=${it.isError}|col=${COLUMNS}`);}
|
|
29
|
-
}
|
|
30
|
-
console.log('total',total,'mismatches',bad);
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box, renderToString } from 'ink';
|
|
3
|
-
import { ToolExecution } from '../src/tui/components/ToolExecution.jsx';
|
|
4
|
-
import { estimateTranscriptItemRowsCached } from '../src/tui/app/transcript-window.mjs';
|
|
5
|
-
const COLUMNS=80;
|
|
6
|
-
function renderRows(item){
|
|
7
|
-
const node=React.createElement(Box,{flexDirection:'column',flexShrink:0,width:COLUMNS},
|
|
8
|
-
React.createElement(ToolExecution,{name:item.name,args:item.args,result:item.result,rawResult:item.rawResult,isError:item.isError,errorCount:item.errorCount,expanded:!!item.expanded,columns:COLUMNS,attached:false,count:item.count,completedCount:item.completedCount,startedAt:item.startedAt,completedAt:item.completedAt,aggregate:item.aggregate,categories:item.categories,doneCategories:item.doneCategories,headerFinalized:item.headerFinalized,deferredDisplayReady:item.deferredDisplayReady}));
|
|
9
|
-
const out=renderToString(node,{columns:COLUMNS});
|
|
10
|
-
return out===''?0:out.split('\n').length;
|
|
11
|
-
}
|
|
12
|
-
const now=Date.now();
|
|
13
|
-
const F=[
|
|
14
|
-
['read pending',{name:'read',args:{path:'a.js'},result:null,count:1,completedCount:0,startedAt:now-2000,deferredDisplayReady:true,headerFinalized:false}],
|
|
15
|
-
['read settled',{name:'read',args:{path:'a.js'},result:'Read 40 lines',count:1,completedCount:1,startedAt:now-2000,completedAt:now,deferredDisplayReady:true,headerFinalized:true}],
|
|
16
|
-
['grep settled 0',{name:'grep',args:{pattern:'foo'},result:'No matches',count:1,completedCount:1,startedAt:now-1000,completedAt:now,headerFinalized:true}],
|
|
17
|
-
['shell pending',{name:'shell',args:{command:'ls'},result:null,count:1,completedCount:0,startedAt:now-2000,deferredDisplayReady:true}],
|
|
18
|
-
['shell settled',{name:'shell',args:{command:'ls'},result:'file1\nfile2',count:1,completedCount:1,startedAt:now-2000,completedAt:now,headerFinalized:true}],
|
|
19
|
-
['shell settled empty',{name:'shell',args:{command:'ls'},result:'',count:1,completedCount:1,startedAt:now,completedAt:now,headerFinalized:true}],
|
|
20
|
-
['agent pending',{name:'agent',args:{action:'spawn'},result:null,count:1,completedCount:0,startedAt:now-2000,deferredDisplayReady:true}],
|
|
21
|
-
['agent settled resp',{name:'agent',args:{action:'response',status:'completed'},result:'Agent reply body here',count:1,completedCount:1,startedAt:now,completedAt:now,headerFinalized:true}],
|
|
22
|
-
['skill settled',{name:'Skill',args:{name:'setup'},result:'loaded body\nmore',count:1,completedCount:1,startedAt:now,completedAt:now,headerFinalized:true}],
|
|
23
|
-
['code_graph settled',{name:'code_graph',args:{mode:'search',symbols:'x'},result:'3 results',count:1,completedCount:1,startedAt:now,completedAt:now,headerFinalized:true}],
|
|
24
|
-
['aggregate pending',{name:'read',args:{categoryOrder:['read']},aggregate:true,result:null,count:3,completedCount:0,startedAt:now-2000,categories:{read:{count:3}},deferredDisplayReady:true}],
|
|
25
|
-
['aggregate settled',{name:'read',args:{categoryOrder:['read']},aggregate:true,result:'Read 3 files',count:3,completedCount:3,startedAt:now-2000,completedAt:now,categories:{read:{count:3}},doneCategories:{read:{count:3}},headerFinalized:true}],
|
|
26
|
-
];
|
|
27
|
-
let bad=0;
|
|
28
|
-
for(const [label,item] of F){
|
|
29
|
-
const est=estimateTranscriptItemRowsCached({kind:'tool',...item},COLUMNS,false);
|
|
30
|
-
const ren=renderRows(item);
|
|
31
|
-
const m=est===ren?'ok ':'DIFF';
|
|
32
|
-
if(est!==ren)bad++;
|
|
33
|
-
console.log(`${m} est=${est} render=${ren} ${label}`);
|
|
34
|
-
}
|
|
35
|
-
console.log('mismatches:',bad);
|
package/scripts/_jp2.jsx
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box } from 'ink';
|
|
3
|
-
import { render } from 'ink';
|
|
4
|
-
import stripAnsi from 'strip-ansi';
|
|
5
|
-
import { ToolExecution } from '../src/tui/components/ToolExecution.jsx';
|
|
6
|
-
const COLUMNS=80;
|
|
7
|
-
let buf='';
|
|
8
|
-
const stdout={columns:COLUMNS,rows:200,write:(s)=>{buf+=s;return true;},on(){},off(){},removeListener(){}};
|
|
9
|
-
const item={ name:'read', args:{path:'a.js'}, result:'Read 40 lines', count:1, completedCount:1, startedAt:Date.now()-2000, completedAt:Date.now(), deferredDisplayReady:true, headerFinalized:true };
|
|
10
|
-
const node=React.createElement(Box,{flexDirection:'column',flexShrink:0,width:COLUMNS},React.createElement(ToolExecution,{name:item.name,args:item.args,result:item.result,columns:COLUMNS,count:1,completedCount:1,startedAt:item.startedAt,completedAt:item.completedAt,headerFinalized:true,deferredDisplayReady:true}));
|
|
11
|
-
const inst=render(node,{stdout,patchConsole:false});
|
|
12
|
-
await new Promise(r=>setTimeout(r,60));
|
|
13
|
-
console.log('RAW len',buf.length);
|
|
14
|
-
console.log(JSON.stringify(buf));
|
|
15
|
-
inst.unmount();
|
|
16
|
-
process.exit(0);
|
package/scripts/_smoke_wd.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const wd = setTimeout(() => {
|
|
2
|
-
console.error('=== WATCHDOG 45s: active resources:', JSON.stringify(process.getActiveResourcesInfo()));
|
|
3
|
-
process.exit(99);
|
|
4
|
-
}, 45000);
|
|
5
|
-
await import('./compact-smoke.mjs');
|
|
6
|
-
clearTimeout(wd);
|
|
7
|
-
console.error('=== script import completed normally');
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Regression: bounded manual-abort recovery. Esc calls runtime.abort(), which
|
|
3
|
-
// normally rejects the in-flight runtime.ask() so the turn's finally clears
|
|
4
|
-
// busy. If that unwind is STARVED (provider abort never settles after a
|
|
5
|
-
// post-tool fetch stall), busy must not stay true forever — a short grace timer
|
|
6
|
-
// hard-releases the store and re-kicks drain. A normal abort that settles in
|
|
7
|
-
// time must NOT be masked by the recovery.
|
|
8
|
-
import test from 'node:test';
|
|
9
|
-
import assert from 'node:assert/strict';
|
|
10
|
-
import { createSessionFlow } from '../src/tui/engine/session-flow.mjs';
|
|
11
|
-
import { createEngineApiA } from '../src/tui/engine/session-api.mjs';
|
|
12
|
-
|
|
13
|
-
const wait = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
14
|
-
|
|
15
|
-
// Minimal engine bag exercising only the abort() recovery path. `abortSettles`
|
|
16
|
-
// models whether runtime.abort() actually unwinds the turn (clears busy) — the
|
|
17
|
-
// starved case leaves busy=true so the recovery timer must fire.
|
|
18
|
-
function makeEngine({ abortSettles = false, recoveryMs = 30 } = {}) {
|
|
19
|
-
let seq = 0;
|
|
20
|
-
const notices = [];
|
|
21
|
-
const requeued = [];
|
|
22
|
-
const discardedCompletionKeys = [];
|
|
23
|
-
const abortReasons = [];
|
|
24
|
-
let drainCount = 0;
|
|
25
|
-
let state = { items: [], queued: [], busy: false, commandBusy: false, spinner: null, thinking: null, lastTurn: null };
|
|
26
|
-
const bag = {
|
|
27
|
-
runtime: {
|
|
28
|
-
id: null,
|
|
29
|
-
consumePendingSessionReset: () => null,
|
|
30
|
-
abort: (reason) => {
|
|
31
|
-
abortReasons.push(reason);
|
|
32
|
-
if (abortSettles) bag.set({ busy: false, spinner: null, thinking: null, lastTurn: null });
|
|
33
|
-
return true;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
nextId: () => `id_${++seq}`,
|
|
37
|
-
tuiDebug: () => {},
|
|
38
|
-
flags: { leadTurnEpoch: 1, disposed: false, draining: false, activePromptRestore: null, manualAbortRecoveryMs: recoveryMs },
|
|
39
|
-
pending: [],
|
|
40
|
-
listeners: new Set(),
|
|
41
|
-
getState: () => state,
|
|
42
|
-
set: (patch) => {
|
|
43
|
-
if (!patch || typeof patch !== 'object') return false;
|
|
44
|
-
state = { ...state, ...patch };
|
|
45
|
-
return true;
|
|
46
|
-
},
|
|
47
|
-
pushItem: () => {},
|
|
48
|
-
patchItem: () => {},
|
|
49
|
-
replaceItems: (x) => x,
|
|
50
|
-
pushNotice: (text, level) => { notices.push({ text, level }); },
|
|
51
|
-
pushUserOrSyntheticItem: () => {},
|
|
52
|
-
autoClearState: () => ({ enabled: false }),
|
|
53
|
-
agentStatusState: () => ({}),
|
|
54
|
-
routeState: () => ({}),
|
|
55
|
-
syncContextStats: () => {},
|
|
56
|
-
denyAllToolApprovals: () => {},
|
|
57
|
-
updateAgentJobCard: () => {},
|
|
58
|
-
requeueEntriesFront: (entries) => { requeued.push(...entries); },
|
|
59
|
-
resetStatsAndSyncContext: () => {},
|
|
60
|
-
flushDeferredExecutionPendingResumeKick: () => {},
|
|
61
|
-
discardExecutionPendingResume: (keys) => { discardedCompletionKeys.push(...keys); },
|
|
62
|
-
drain: async () => { drainCount += 1; },
|
|
63
|
-
runTurn: async () => 'ok',
|
|
64
|
-
};
|
|
65
|
-
Object.assign(bag, createSessionFlow(bag));
|
|
66
|
-
bag.drain = async () => { drainCount += 1; };
|
|
67
|
-
const api = createEngineApiA(bag);
|
|
68
|
-
return {
|
|
69
|
-
api,
|
|
70
|
-
bag,
|
|
71
|
-
getNotices: () => notices,
|
|
72
|
-
getDrainCount: () => drainCount,
|
|
73
|
-
getRequeued: () => requeued,
|
|
74
|
-
getDiscardedCompletionKeys: () => discardedCompletionKeys,
|
|
75
|
-
getAbortReasons: () => abortReasons,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
test('Esc uses Claude-compatible user-cancel and queued interrupt reasons', () => {
|
|
80
|
-
const normal = makeEngine({ abortSettles: true });
|
|
81
|
-
normal.bag.set({ busy: true });
|
|
82
|
-
normal.api.abort();
|
|
83
|
-
assert.deepEqual(normal.getAbortReasons(), ['user-cancel']);
|
|
84
|
-
|
|
85
|
-
const queued = makeEngine({ abortSettles: true });
|
|
86
|
-
queued.bag.set({ busy: true });
|
|
87
|
-
queued.bag.pending.push({ kind: 'prompt', text: 'queued redirect' });
|
|
88
|
-
queued.api.abort();
|
|
89
|
-
assert.deepEqual(queued.getAbortReasons(), ['interrupt']);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
test('starved abort → bounded recovery hard-releases busy and re-kicks drain', async () => {
|
|
93
|
-
const { api, bag, getNotices, getDrainCount } = makeEngine({ abortSettles: false, recoveryMs: 25 });
|
|
94
|
-
bag.set({ busy: true, spinner: { active: true } });
|
|
95
|
-
bag.pending.push({ kind: 'prompt', text: 'queued next' });
|
|
96
|
-
const res = api.abort();
|
|
97
|
-
assert.equal(res.aborted, true, 'abort dispatched to runtime');
|
|
98
|
-
assert.equal(bag.getState().busy, true, 'still busy immediately after abort (unwind pending)');
|
|
99
|
-
await wait(60);
|
|
100
|
-
assert.equal(bag.getState().busy, false, 'recovery timer force-releases busy');
|
|
101
|
-
assert.equal(bag.getState().spinner, null, 'spinner cleared on recovery');
|
|
102
|
-
assert.equal(bag.flags.leadTurnEpoch, 2, 'epoch bumped so stuck turn finally becomes a no-op');
|
|
103
|
-
assert.equal(getDrainCount() >= 1, true, 'drain re-kicked so queued prompt runs');
|
|
104
|
-
assert.equal(getNotices().some((n) => /did not settle/i.test(n.text)), true, 'user told input was restored');
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
test('starved abort abandons old drain owner before re-kicking drain', async () => {
|
|
108
|
-
const { api, bag, getDrainCount } = makeEngine({ abortSettles: false, recoveryMs: 25 });
|
|
109
|
-
bag.flags.draining = true;
|
|
110
|
-
bag.flags.drainEpoch = 10;
|
|
111
|
-
bag.set({ busy: true, spinner: { active: true } });
|
|
112
|
-
bag.pending.push({ kind: 'prompt', text: 'queued next' });
|
|
113
|
-
|
|
114
|
-
api.abort();
|
|
115
|
-
await wait(60);
|
|
116
|
-
|
|
117
|
-
assert.equal(bag.getState().busy, false);
|
|
118
|
-
assert.equal(bag.flags.draining, false, 'stuck drain lock was released only after epoch abandonment');
|
|
119
|
-
assert.equal(bag.flags.drainEpoch > 10, true, 'old drain owner invalidated');
|
|
120
|
-
assert.equal(getDrainCount() >= 1, true, 'new drain kick requested for pending work');
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test('abort that settles in time is NOT masked by recovery', async () => {
|
|
124
|
-
const { api, bag, getNotices } = makeEngine({ abortSettles: true, recoveryMs: 25 });
|
|
125
|
-
bag.set({ busy: true, spinner: { active: true } });
|
|
126
|
-
const res = api.abort();
|
|
127
|
-
assert.equal(res.aborted, true);
|
|
128
|
-
assert.equal(bag.getState().busy, false, 'settled abort cleared busy synchronously');
|
|
129
|
-
const epochAfter = bag.flags.leadTurnEpoch;
|
|
130
|
-
await wait(60);
|
|
131
|
-
assert.equal(bag.flags.leadTurnEpoch, epochAfter, 'recovery no-ops (no epoch bump) when busy already cleared');
|
|
132
|
-
assert.equal(getNotices().some((n) => /did not settle/i.test(n.text)), false, 'no spurious recovery notice');
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
test('recovery no-ops if a newer turn already owns the store', async () => {
|
|
136
|
-
const { api, bag } = makeEngine({ abortSettles: false, recoveryMs: 25 });
|
|
137
|
-
bag.set({ busy: true });
|
|
138
|
-
api.abort();
|
|
139
|
-
bag.flags.leadTurnEpoch = 5;
|
|
140
|
-
bag.set({ busy: true, spinner: { active: true, verb: 'new turn' } });
|
|
141
|
-
await wait(60);
|
|
142
|
-
assert.equal(bag.flags.leadTurnEpoch, 5, 'recovery must not touch a newer turn epoch');
|
|
143
|
-
assert.equal(bag.getState().busy, true, 'newer turn stays busy — not force-released');
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
for (const phase of ['before first delta', 'after response progress']) {
|
|
147
|
-
test(`Esc ${phase} abandons the active completion resume`, () => {
|
|
148
|
-
const {
|
|
149
|
-
api, bag, getRequeued, getDiscardedCompletionKeys,
|
|
150
|
-
} = makeEngine({ abortSettles: true });
|
|
151
|
-
bag.flags.activePromptRestore = {
|
|
152
|
-
text: 'completion response',
|
|
153
|
-
restorable: false,
|
|
154
|
-
committed: false,
|
|
155
|
-
requeueEntries: [{
|
|
156
|
-
mode: 'pending-resume',
|
|
157
|
-
text: 'completion response',
|
|
158
|
-
abortDiscardOnAbort: true,
|
|
159
|
-
}],
|
|
160
|
-
discardExecutionPendingResumeKeys: ['execution_A'],
|
|
161
|
-
};
|
|
162
|
-
bag.set({
|
|
163
|
-
busy: true,
|
|
164
|
-
spinner: { active: true, responseLength: phase === 'after response progress' ? 24 : 0 },
|
|
165
|
-
thinking: phase === 'after response progress' ? { text: 'working' } : null,
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
assert.equal(api.abort().aborted, true);
|
|
169
|
-
assert.equal(bag.getState().busy, false, 'Esc releases the active completion turn');
|
|
170
|
-
assert.equal(bag.getState().spinner, null, 'spinner is cleared');
|
|
171
|
-
assert.equal(bag.getState().thinking, null, 'thinking is cleared');
|
|
172
|
-
assert.deepEqual(getRequeued(), [], 'the completion resume is not requeued');
|
|
173
|
-
assert.deepEqual(getDiscardedCompletionKeys(), ['execution_A'], 'its completion ownership is retired');
|
|
174
|
-
});
|
|
175
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import assert from 'node:assert/strict';
|
|
4
|
-
import { composeAgentDispatchAbortSignal } from '../src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs';
|
|
5
|
-
|
|
6
|
-
test('explore cancellation survives an active idle watchdog composite link', () => {
|
|
7
|
-
const factory = new AbortController();
|
|
8
|
-
const explore = new AbortController();
|
|
9
|
-
const idleWatchdog = new AbortController();
|
|
10
|
-
const linked = composeAgentDispatchAbortSignal([
|
|
11
|
-
factory.signal,
|
|
12
|
-
explore.signal,
|
|
13
|
-
idleWatchdog.signal,
|
|
14
|
-
]);
|
|
15
|
-
const reason = new Error('explore ESC');
|
|
16
|
-
explore.abort(reason);
|
|
17
|
-
assert.equal(linked.signal.aborted, true);
|
|
18
|
-
assert.equal(linked.signal.reason, reason, 'per-call explore reason reaches the one session link');
|
|
19
|
-
assert.equal(idleWatchdog.signal.aborted, false, 'watchdog remains independently active');
|
|
20
|
-
linked.dispose();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('an already-aborted parent reason is retained before the askSession controller swap', () => {
|
|
24
|
-
const factory = new AbortController();
|
|
25
|
-
const reason = new Error('factory canceled first');
|
|
26
|
-
factory.abort(reason);
|
|
27
|
-
const linked = composeAgentDispatchAbortSignal([factory.signal, new AbortController().signal]);
|
|
28
|
-
assert.equal(linked.signal.aborted, true);
|
|
29
|
-
assert.equal(linked.signal.reason, reason);
|
|
30
|
-
linked.dispose();
|
|
31
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Standalone regression smoke for validateBuiltinArgs guard behavior.
|
|
2
|
-
// Mirrors arg-guard-test.mjs style; runs with `node --test`.
|
|
3
|
-
import test from 'node:test';
|
|
4
|
-
import assert from 'node:assert/strict';
|
|
5
|
-
import { validateBuiltinArgs } from '../src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs';
|
|
6
|
-
|
|
7
|
-
test('smoke: valid read args pass and numeric strings coerce', () => {
|
|
8
|
-
const a = { path: 'x.mjs', offset: '2', limit: '10' };
|
|
9
|
-
assert.equal(validateBuiltinArgs('read', a), null);
|
|
10
|
-
assert.equal(a.offset, 2);
|
|
11
|
-
assert.equal(a.limit, 10);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('smoke: non-numeric arg still errors', () => {
|
|
15
|
-
assert.match(validateBuiltinArgs('read', { path: 'x.mjs', limit: 'nope' }), /must be an integer/);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('smoke: below-min arg still errors', () => {
|
|
19
|
-
assert.match(validateBuiltinArgs('read', { path: 'x.mjs', offset: -1 }), /must be >= 0/);
|
|
20
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import test from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
|
-
import { findBySuffixStrip } from '../src/runtime/agent/orchestrator/tools/builtin/path-diagnostics.mjs';
|
|
7
|
-
|
|
8
|
-
function makeRepo() {
|
|
9
|
-
const root = mkdtempSync(join(tmpdir(), 'mixdog-suffix-smoke-'));
|
|
10
|
-
mkdirSync(join(root, 'src', 'tui'), { recursive: true });
|
|
11
|
-
writeFileSync(join(root, 'src', 'tui', 'input-editing.mjs'), '// real file\n');
|
|
12
|
-
return root;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
test('smoke: hallucinated absolute prefix resolves to the real repo-relative file', () => {
|
|
16
|
-
const root = makeRepo();
|
|
17
|
-
try {
|
|
18
|
-
const hallucinated = '/Users/nobody/Elsewhere/Project/ink/src/tui/input-editing.mjs';
|
|
19
|
-
const hit = findBySuffixStrip(root, hallucinated);
|
|
20
|
-
assert.equal(hit, 'src/tui/input-editing.mjs');
|
|
21
|
-
} finally {
|
|
22
|
-
rmSync(root, { recursive: true, force: true });
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('smoke: a non-existent tail resolves to null', () => {
|
|
27
|
-
const root = makeRepo();
|
|
28
|
-
try {
|
|
29
|
-
const hit = findBySuffixStrip(root, '/Users/nobody/Elsewhere/Project/does/not/here.mjs');
|
|
30
|
-
assert.equal(hit, null);
|
|
31
|
-
} finally {
|
|
32
|
-
rmSync(root, { recursive: true, force: true });
|
|
33
|
-
}
|
|
34
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Standalone regression smoke pinning the tool_call arguments contract used by
|
|
3
|
-
// the native providers (see scripts/toolcall-args-test.mjs for the full suite).
|
|
4
|
-
// Same unit-test style: synthetic inputs fed to the exported parser, asserting
|
|
5
|
-
// the outcome — no network, no model. Kept minimal so it can run in isolation
|
|
6
|
-
// via `node --test scripts/agent-live-toolcall-args-smoke.mjs`.
|
|
7
|
-
import test from 'node:test';
|
|
8
|
-
import assert from 'node:assert/strict';
|
|
9
|
-
import {
|
|
10
|
-
parseCompletedToolCallArgumentsJson,
|
|
11
|
-
isInvalidToolArgsMarker,
|
|
12
|
-
formatInvalidToolArgsResult,
|
|
13
|
-
} from '../src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs';
|
|
14
|
-
|
|
15
|
-
test('smoke: valid arguments JSON parses to the intended object', () => {
|
|
16
|
-
const out = parseCompletedToolCallArgumentsJson(
|
|
17
|
-
'{"pattern":"x","path":"src"}', 'smoke', { finishReason: 'stop' });
|
|
18
|
-
assert.deepEqual(out, { pattern: 'x', path: 'src' });
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test('smoke: empty/missing arguments default to {}', () => {
|
|
22
|
-
assert.deepEqual(parseCompletedToolCallArgumentsJson('', 'smoke', { finishReason: 'stop' }), {});
|
|
23
|
-
assert.deepEqual(parseCompletedToolCallArgumentsJson(undefined, 'smoke'), {});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('smoke: malformed args with finishReason → invalid-args marker (no throw)', () => {
|
|
27
|
-
const bareword = '{"pattern": dispatchAiWrapped, "path": "src/agent"}';
|
|
28
|
-
const out = parseCompletedToolCallArgumentsJson(bareword, 'smoke', { finishReason: 'stop' });
|
|
29
|
-
assert.equal(isInvalidToolArgsMarker(out), true);
|
|
30
|
-
assert.equal(out.__rawArguments, bareword);
|
|
31
|
-
const msg = formatInvalidToolArgsResult({ name: 'grep', arguments: out });
|
|
32
|
-
assert.match(msg, /Re-issue this tool call with valid JSON arguments/);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test('smoke: malformed args without finishReason → retryable TruncatedStreamError', () => {
|
|
36
|
-
let threw;
|
|
37
|
-
try {
|
|
38
|
-
parseCompletedToolCallArgumentsJson('{', 'smoke');
|
|
39
|
-
} catch (err) {
|
|
40
|
-
threw = err;
|
|
41
|
-
}
|
|
42
|
-
assert.ok(threw instanceof Error, 'must throw on mid-stream truncation');
|
|
43
|
-
assert.equal(threw.code, 'TRUNCATED_STREAM');
|
|
44
|
-
assert.equal(threw.truncatedStream, true);
|
|
45
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import assert from 'node:assert/strict';
|
|
4
|
-
import {
|
|
5
|
-
resolveSessionMaxLoopIterations,
|
|
6
|
-
LEAD_MAX_LOOP_ITERATIONS,
|
|
7
|
-
} from '../src/runtime/agent/orchestrator/agent-runtime/agent-loop-policy.mjs';
|
|
8
|
-
|
|
9
|
-
// No low per-agent caps: every public/delegated agent shares the single high
|
|
10
|
-
// runaway guard (LEAD_MAX_LOOP_ITERATIONS) unless a session pins its own value.
|
|
11
|
-
test('agent owner session falls through to the shared runaway guard when unset', () => {
|
|
12
|
-
const cap = resolveSessionMaxLoopIterations({
|
|
13
|
-
owner: 'agent',
|
|
14
|
-
agent: 'heavy-worker',
|
|
15
|
-
permission: 'read-write',
|
|
16
|
-
maxLoopIterations: null,
|
|
17
|
-
});
|
|
18
|
-
assert.equal(cap, LEAD_MAX_LOOP_ITERATIONS);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test('lead session keeps the same shared ceiling when unset', () => {
|
|
22
|
-
assert.equal(resolveSessionMaxLoopIterations({ owner: 'user', agent: null }), LEAD_MAX_LOOP_ITERATIONS);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test('a session-pinned maxLoopIterations is honored', () => {
|
|
26
|
-
assert.equal(
|
|
27
|
-
resolveSessionMaxLoopIterations({ owner: 'agent', agent: 'heavy-worker', maxLoopIterations: 4 }),
|
|
28
|
-
4,
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
test('explicit override wins over everything', () => {
|
|
33
|
-
assert.equal(
|
|
34
|
-
resolveSessionMaxLoopIterations({ owner: 'agent', agent: 'heavy-worker', maxLoopIterations: 4 }, 50),
|
|
35
|
-
50,
|
|
36
|
-
);
|
|
37
|
-
});
|