muonroi-cli 1.8.0 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/agent-harness/mock-model.js +112 -4
- package/dist/src/cli/cost-forensics.js +7 -4
- package/dist/src/flow/compaction/index.d.ts +1 -0
- package/dist/src/flow/compaction/index.js +4 -0
- package/dist/src/generated/version.d.ts +1 -1
- package/dist/src/generated/version.js +1 -1
- package/dist/src/index.js +4 -2
- package/dist/src/lsp/manager.js +11 -3
- package/dist/src/mcp/auto-setup.js +0 -8
- package/dist/src/mcp/self-verify-jobs.d.ts +1 -0
- package/dist/src/mcp/self-verify-runner.js +1 -1
- package/dist/src/mcp/setup-guide-text.d.ts +1 -1
- package/dist/src/mcp/setup-guide-text.js +3 -1
- package/dist/src/orchestrator/auto-commit.js +9 -7
- package/dist/src/orchestrator/message-processor.d.ts +2 -0
- package/dist/src/orchestrator/message-processor.js +7 -0
- package/dist/src/orchestrator/orchestrator.d.ts +3 -0
- package/dist/src/orchestrator/orchestrator.js +371 -28
- package/dist/src/orchestrator/pending-calls.js +2 -1
- package/dist/src/orchestrator/preprocessor.js +3 -2
- package/dist/src/orchestrator/prompts.d.ts +8 -0
- package/dist/src/orchestrator/prompts.js +224 -177
- package/dist/src/orchestrator/sub-agent-cap.d.ts +2 -0
- package/dist/src/orchestrator/sub-agent-cap.js +12 -4
- package/dist/src/orchestrator/subagent-compactor.d.ts +7 -0
- package/dist/src/orchestrator/subagent-compactor.js +65 -14
- package/dist/src/orchestrator/tool-engine.d.ts +2 -0
- package/dist/src/orchestrator/tool-engine.js +80 -21
- package/dist/src/orchestrator/turn-runner-deps.d.ts +2 -0
- package/dist/src/pil/llm-classify.d.ts +11 -0
- package/dist/src/pil/llm-classify.js +193 -0
- package/dist/src/self-qa/agentic-loop.js +30 -21
- package/dist/src/storage/index.d.ts +1 -1
- package/dist/src/storage/index.js +1 -1
- package/dist/src/storage/migrations.js +13 -1
- package/dist/src/storage/transcript.d.ts +2 -0
- package/dist/src/storage/transcript.js +304 -178
- package/dist/src/storage/usage.js +22 -5
- package/dist/src/tools/native-tools.js +10 -1
- package/dist/src/tools/registry.d.ts +1 -0
- package/dist/src/tools/registry.js +30 -2
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/ui/app.js +0 -0
- package/dist/src/ui/slash/expand.js +14 -1
- package/dist/src/ui/use-app-logic.js +0 -0
- package/dist/src/utils/install-manager.d.ts +2 -0
- package/dist/src/utils/install-manager.js +105 -7
- package/dist/src/utils/logger.d.ts +28 -0
- package/dist/src/utils/logger.js +171 -0
- package/dist/src/utils/settings.d.ts +9 -1
- package/dist/src/utils/settings.js +59 -22
- package/dist/src/utils/update-checker.js +12 -2
- package/package.json +8 -1
- package/dist/src/__test-helpers__/catalog-fixtures.d.ts +0 -22
- package/dist/src/__test-helpers__/catalog-fixtures.js +0 -55
- package/dist/src/__test-stubs__/ee-server.d.ts +0 -27
- package/dist/src/__test-stubs__/ee-server.js +0 -138
- package/dist/src/__test-stubs__/vitest-setup.d.ts +0 -1
- package/dist/src/__test-stubs__/vitest-setup.js +0 -38
- package/dist/src/__tests__/council/bubble-layout.test.d.ts +0 -1
- package/dist/src/__tests__/council/bubble-layout.test.js +0 -39
- package/dist/src/__tests__/council/code-block-truncate.test.d.ts +0 -1
- package/dist/src/__tests__/council/code-block-truncate.test.js +0 -45
- package/dist/src/__tests__/council/role-palette.test.d.ts +0 -1
- package/dist/src/__tests__/council/role-palette.test.js +0 -59
- package/dist/src/__tests__/first-run-wizard.test.d.ts +0 -1
- package/dist/src/__tests__/first-run-wizard.test.js +0 -9
- package/dist/src/agent-harness/__tests__/cli-flags.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/cli-flags.spec.js +0 -33
- package/dist/src/agent-harness/__tests__/driver.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/driver.spec.js +0 -141
- package/dist/src/agent-harness/__tests__/idle.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/idle.spec.js +0 -84
- package/dist/src/agent-harness/__tests__/mock-llm.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/mock-llm.spec.js +0 -91
- package/dist/src/agent-harness/__tests__/mock-model.spec.d.ts +0 -5
- package/dist/src/agent-harness/__tests__/mock-model.spec.js +0 -270
- package/dist/src/agent-harness/__tests__/predicate.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/predicate.spec.js +0 -27
- package/dist/src/agent-harness/__tests__/protocol.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/protocol.spec.js +0 -56
- package/dist/src/agent-harness/__tests__/schema.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/schema.spec.js +0 -76
- package/dist/src/agent-harness/__tests__/selector.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/selector.spec.js +0 -70
- package/dist/src/agent-harness/__tests__/sidechannel.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/sidechannel.spec.js +0 -29
- package/dist/src/agent-harness/__tests__/spec-helpers.spec.d.ts +0 -1
- package/dist/src/agent-harness/__tests__/spec-helpers.spec.js +0 -68
- package/dist/src/chat/__tests__/broadcast-bus.test.d.ts +0 -1
- package/dist/src/chat/__tests__/broadcast-bus.test.js +0 -81
- package/dist/src/chat/__tests__/channel-manager.test.d.ts +0 -1
- package/dist/src/chat/__tests__/channel-manager.test.js +0 -133
- package/dist/src/chat/__tests__/client.test.d.ts +0 -1
- package/dist/src/chat/__tests__/client.test.js +0 -109
- package/dist/src/chat/__tests__/discord-integration.test.d.ts +0 -1
- package/dist/src/chat/__tests__/discord-integration.test.js +0 -153
- package/dist/src/chat/__tests__/intent-prompt.test.d.ts +0 -1
- package/dist/src/chat/__tests__/intent-prompt.test.js +0 -80
- package/dist/src/chat/__tests__/verdict-resolver.test.d.ts +0 -1
- package/dist/src/chat/__tests__/verdict-resolver.test.js +0 -308
- package/dist/src/cli/__tests__/bw-vault.test.d.ts +0 -1
- package/dist/src/cli/__tests__/bw-vault.test.js +0 -87
- package/dist/src/cli/__tests__/keys-bundle.test.d.ts +0 -1
- package/dist/src/cli/__tests__/keys-bundle.test.js +0 -40
- package/dist/src/cli/__tests__/share-cmd.test.d.ts +0 -1
- package/dist/src/cli/__tests__/share-cmd.test.js +0 -175
- package/dist/src/cli/config/__tests__/model-picker.test.d.ts +0 -1
- package/dist/src/cli/config/__tests__/model-picker.test.js +0 -56
- package/dist/src/cli/config/__tests__/provider-fetch.test.d.ts +0 -1
- package/dist/src/cli/config/__tests__/provider-fetch.test.js +0 -38
- package/dist/src/cli/cost-forensics.test.d.ts +0 -1
- package/dist/src/cli/cost-forensics.test.js +0 -223
- package/dist/src/cli/experience-report.test.d.ts +0 -5
- package/dist/src/cli/experience-report.test.js +0 -63
- package/dist/src/cli/keys.test.d.ts +0 -1
- package/dist/src/cli/keys.test.js +0 -86
- package/dist/src/council/__tests__/abort-threading.test.d.ts +0 -1
- package/dist/src/council/__tests__/abort-threading.test.js +0 -193
- package/dist/src/council/__tests__/accounting.test.d.ts +0 -1
- package/dist/src/council/__tests__/accounting.test.js +0 -66
- package/dist/src/council/__tests__/audit-replay.test.d.ts +0 -1
- package/dist/src/council/__tests__/audit-replay.test.js +0 -241
- package/dist/src/council/__tests__/clarification-prompt.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarification-prompt.test.js +0 -71
- package/dist/src/council/__tests__/clarifier-max-rounds.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarifier-max-rounds.test.js +0 -46
- package/dist/src/council/__tests__/clarifier-options.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarifier-options.test.js +0 -54
- package/dist/src/council/__tests__/clarifier-ready-gate.test.d.ts +0 -1
- package/dist/src/council/__tests__/clarifier-ready-gate.test.js +0 -265
- package/dist/src/council/__tests__/cost-aware.test.d.ts +0 -1
- package/dist/src/council/__tests__/cost-aware.test.js +0 -49
- package/dist/src/council/__tests__/council-turn-length-emit.test.d.ts +0 -1
- package/dist/src/council/__tests__/council-turn-length-emit.test.js +0 -130
- package/dist/src/council/__tests__/debate-planner-structured.test.d.ts +0 -1
- package/dist/src/council/__tests__/debate-planner-structured.test.js +0 -209
- package/dist/src/council/__tests__/debate-round-budget.test.d.ts +0 -1
- package/dist/src/council/__tests__/debate-round-budget.test.js +0 -45
- package/dist/src/council/__tests__/decisions-lock.test.d.ts +0 -6
- package/dist/src/council/__tests__/decisions-lock.test.js +0 -352
- package/dist/src/council/__tests__/evaluator-metrics.test.d.ts +0 -1
- package/dist/src/council/__tests__/evaluator-metrics.test.js +0 -463
- package/dist/src/council/__tests__/oauth-reachable.test.d.ts +0 -1
- package/dist/src/council/__tests__/oauth-reachable.test.js +0 -31
- package/dist/src/council/__tests__/parse-outcome-fallback.test.d.ts +0 -1
- package/dist/src/council/__tests__/parse-outcome-fallback.test.js +0 -114
- package/dist/src/council/__tests__/post-debate-recommendation.test.d.ts +0 -1
- package/dist/src/council/__tests__/post-debate-recommendation.test.js +0 -58
- package/dist/src/council/__tests__/research-tools.test.d.ts +0 -1
- package/dist/src/council/__tests__/research-tools.test.js +0 -214
- package/dist/src/council/__tests__/round-tools.test.d.ts +0 -1
- package/dist/src/council/__tests__/round-tools.test.js +0 -306
- package/dist/src/council/__tests__/tool-trace.test.d.ts +0 -1
- package/dist/src/council/__tests__/tool-trace.test.js +0 -131
- package/dist/src/council/__tests__/types-contract.test.d.ts +0 -9
- package/dist/src/council/__tests__/types-contract.test.js +0 -82
- package/dist/src/council/clarifier-question-cap.test.d.ts +0 -12
- package/dist/src/council/clarifier-question-cap.test.js +0 -73
- package/dist/src/daemon/scheduler.test.d.ts +0 -1
- package/dist/src/daemon/scheduler.test.js +0 -103
- package/dist/src/ee/__tests__/bb-design.test.d.ts +0 -14
- package/dist/src/ee/__tests__/bb-design.test.js +0 -180
- package/dist/src/ee/__tests__/ee-onboarding.test.d.ts +0 -1
- package/dist/src/ee/__tests__/ee-onboarding.test.js +0 -32
- package/dist/src/ee/__tests__/export-transcripts.test.d.ts +0 -11
- package/dist/src/ee/__tests__/export-transcripts.test.js +0 -200
- package/dist/src/ee/__tests__/pil-context-bridge.test.d.ts +0 -1
- package/dist/src/ee/__tests__/pil-context-bridge.test.js +0 -54
- package/dist/src/ee/__tests__/pipeline.integration.test.d.ts +0 -14
- package/dist/src/ee/__tests__/pipeline.integration.test.js +0 -151
- package/dist/src/ee/__tests__/recall-format.test.d.ts +0 -10
- package/dist/src/ee/__tests__/recall-format.test.js +0 -57
- package/dist/src/ee/__tests__/recall-ledger.test.d.ts +0 -1
- package/dist/src/ee/__tests__/recall-ledger.test.js +0 -45
- package/dist/src/ee/__tests__/render-sink-wiring.test.d.ts +0 -1
- package/dist/src/ee/__tests__/render-sink-wiring.test.js +0 -74
- package/dist/src/ee/artifact-cache.test.d.ts +0 -1
- package/dist/src/ee/artifact-cache.test.js +0 -69
- package/dist/src/ee/auth.test.d.ts +0 -1
- package/dist/src/ee/auth.test.js +0 -59
- package/dist/src/ee/bridge.test.d.ts +0 -1
- package/dist/src/ee/bridge.test.js +0 -230
- package/dist/src/ee/client.test.d.ts +0 -1
- package/dist/src/ee/client.test.js +0 -181
- package/dist/src/ee/extract-session.test.d.ts +0 -1
- package/dist/src/ee/extract-session.test.js +0 -192
- package/dist/src/ee/intercept.test.d.ts +0 -1
- package/dist/src/ee/intercept.test.js +0 -171
- package/dist/src/ee/judge.test.d.ts +0 -1
- package/dist/src/ee/judge.test.js +0 -190
- package/dist/src/ee/mistake-detector.test.d.ts +0 -1
- package/dist/src/ee/mistake-detector.test.js +0 -221
- package/dist/src/ee/offline-queue.test.d.ts +0 -1
- package/dist/src/ee/offline-queue.test.js +0 -246
- package/dist/src/ee/phase-outcome.test.d.ts +0 -1
- package/dist/src/ee/phase-outcome.test.js +0 -94
- package/dist/src/ee/phase-tracker.test.d.ts +0 -1
- package/dist/src/ee/phase-tracker.test.js +0 -142
- package/dist/src/ee/posttool.test.d.ts +0 -1
- package/dist/src/ee/posttool.test.js +0 -70
- package/dist/src/ee/prompt-stale.test.d.ts +0 -8
- package/dist/src/ee/prompt-stale.test.js +0 -76
- package/dist/src/ee/recall-mirror.test.d.ts +0 -1
- package/dist/src/ee/recall-mirror.test.js +0 -65
- package/dist/src/ee/render.test.d.ts +0 -1
- package/dist/src/ee/render.test.js +0 -63
- package/dist/src/ee/scope.test.d.ts +0 -1
- package/dist/src/ee/scope.test.js +0 -97
- package/dist/src/ee/search.test.d.ts +0 -1
- package/dist/src/ee/search.test.js +0 -23
- package/dist/src/ee/session-trajectory.test.d.ts +0 -1
- package/dist/src/ee/session-trajectory.test.js +0 -120
- package/dist/src/ee/touch.test.d.ts +0 -1
- package/dist/src/ee/touch.test.js +0 -62
- package/dist/src/ee/who-am-i.test.d.ts +0 -1
- package/dist/src/ee/who-am-i.test.js +0 -101
- package/dist/src/flow/__tests__/migration.test.d.ts +0 -1
- package/dist/src/flow/__tests__/migration.test.js +0 -105
- package/dist/src/flow/__tests__/parser.test.d.ts +0 -1
- package/dist/src/flow/__tests__/parser.test.js +0 -68
- package/dist/src/flow/__tests__/run-manager-product.test.d.ts +0 -1
- package/dist/src/flow/__tests__/run-manager-product.test.js +0 -49
- package/dist/src/flow/__tests__/run-manager.test.d.ts +0 -1
- package/dist/src/flow/__tests__/run-manager.test.js +0 -83
- package/dist/src/flow/__tests__/scaffold-checkpoint.test.d.ts +0 -1
- package/dist/src/flow/__tests__/scaffold-checkpoint.test.js +0 -93
- package/dist/src/flow/__tests__/scaffold.test.d.ts +0 -1
- package/dist/src/flow/__tests__/scaffold.test.js +0 -47
- package/dist/src/flow/__tests__/warning-persist.test.d.ts +0 -5
- package/dist/src/flow/__tests__/warning-persist.test.js +0 -96
- package/dist/src/flow/compaction/__tests__/compress.test.d.ts +0 -1
- package/dist/src/flow/compaction/__tests__/compress.test.js +0 -63
- package/dist/src/flow/compaction/__tests__/extract.test.d.ts +0 -1
- package/dist/src/flow/compaction/__tests__/extract.test.js +0 -66
- package/dist/src/flow/compaction/__tests__/preserve.test.d.ts +0 -1
- package/dist/src/flow/compaction/__tests__/preserve.test.js +0 -62
- package/dist/src/gsd/__tests__/gray-areas.test.d.ts +0 -1
- package/dist/src/gsd/__tests__/gray-areas.test.js +0 -29
- package/dist/src/gsd/__tests__/types.test.d.ts +0 -1
- package/dist/src/gsd/__tests__/types.test.js +0 -78
- package/dist/src/headless/__tests__/council-answers.test.d.ts +0 -1
- package/dist/src/headless/__tests__/council-answers.test.js +0 -251
- package/dist/src/headless/output.test.d.ts +0 -1
- package/dist/src/headless/output.test.js +0 -239
- package/dist/src/lsp/builtins.test.d.ts +0 -1
- package/dist/src/lsp/builtins.test.js +0 -112
- package/dist/src/lsp/client-normalize.test.d.ts +0 -12
- package/dist/src/lsp/client-normalize.test.js +0 -34
- package/dist/src/lsp/manager.test.d.ts +0 -1
- package/dist/src/lsp/manager.test.js +0 -155
- package/dist/src/lsp/npm-cache.test.d.ts +0 -1
- package/dist/src/lsp/npm-cache.test.js +0 -53
- package/dist/src/lsp/smoke.test.d.ts +0 -1
- package/dist/src/lsp/smoke.test.js +0 -56
- package/dist/src/maintain/__tests__/codebase-intel.test.d.ts +0 -5
- package/dist/src/maintain/__tests__/codebase-intel.test.js +0 -237
- package/dist/src/maintain/__tests__/gh-create-pr.test.d.ts +0 -11
- package/dist/src/maintain/__tests__/gh-create-pr.test.js +0 -160
- package/dist/src/maintain/__tests__/pr-builder.test.d.ts +0 -10
- package/dist/src/maintain/__tests__/pr-builder.test.js +0 -229
- package/dist/src/maintain/__tests__/repo-map.test.d.ts +0 -5
- package/dist/src/maintain/__tests__/repo-map.test.js +0 -90
- package/dist/src/maintain/__tests__/task-runner.test.d.ts +0 -11
- package/dist/src/maintain/__tests__/task-runner.test.js +0 -281
- package/dist/src/mcp/__tests__/auto-setup.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/auto-setup.test.js +0 -155
- package/dist/src/mcp/__tests__/cap-tool-result.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/cap-tool-result.test.js +0 -58
- package/dist/src/mcp/__tests__/client-pool.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/client-pool.spec.js +0 -169
- package/dist/src/mcp/__tests__/ee-tools.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/ee-tools.test.js +0 -226
- package/dist/src/mcp/__tests__/forensics-tools.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/forensics-tools.test.js +0 -54
- package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.js +0 -103
- package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.js +0 -112
- package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.js +0 -124
- package/dist/src/mcp/__tests__/harness-driver-security.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver-security.spec.js +0 -61
- package/dist/src/mcp/__tests__/harness-driver.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/harness-driver.spec.js +0 -20
- package/dist/src/mcp/__tests__/lazy-schema.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/lazy-schema.spec.js +0 -152
- package/dist/src/mcp/__tests__/lsp-tools.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/lsp-tools.test.js +0 -56
- package/dist/src/mcp/__tests__/mcp-keychain.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/mcp-keychain.test.js +0 -40
- package/dist/src/mcp/__tests__/parallel-build.spec.d.ts +0 -1
- package/dist/src/mcp/__tests__/parallel-build.spec.js +0 -67
- package/dist/src/mcp/__tests__/research-onboarding.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/research-onboarding.test.js +0 -148
- package/dist/src/mcp/__tests__/runtime-hydration.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/runtime-hydration.test.js +0 -78
- package/dist/src/mcp/__tests__/runtime-output-cap.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/runtime-output-cap.test.js +0 -42
- package/dist/src/mcp/__tests__/runtime-sanitize.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/runtime-sanitize.test.js +0 -40
- package/dist/src/mcp/__tests__/self-verify-jobs.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/self-verify-jobs.test.js +0 -92
- package/dist/src/mcp/__tests__/smart-filter.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/smart-filter.test.js +0 -177
- package/dist/src/mcp/__tests__/tools-server.smoke.test.d.ts +0 -1
- package/dist/src/mcp/__tests__/tools-server.smoke.test.js +0 -42
- package/dist/src/mcp/parse-headers.test.d.ts +0 -1
- package/dist/src/mcp/parse-headers.test.js +0 -43
- package/dist/src/mcp/smoke.test.d.ts +0 -1
- package/dist/src/mcp/smoke.test.js +0 -159
- package/dist/src/models/__tests__/registry.test.d.ts +0 -1
- package/dist/src/models/__tests__/registry.test.js +0 -74
- package/dist/src/models/catalog-gemini.test.d.ts +0 -1
- package/dist/src/models/catalog-gemini.test.js +0 -48
- package/dist/src/models/catalog-url.test.d.ts +0 -1
- package/dist/src/models/catalog-url.test.js +0 -26
- package/dist/src/models/catalog-validation.test.d.ts +0 -1
- package/dist/src/models/catalog-validation.test.js +0 -63
- package/dist/src/ops/__tests__/doctor-council-mcp.test.d.ts +0 -1
- package/dist/src/ops/__tests__/doctor-council-mcp.test.js +0 -139
- package/dist/src/ops/__tests__/doctor-ee-health.test.d.ts +0 -1
- package/dist/src/ops/__tests__/doctor-ee-health.test.js +0 -134
- package/dist/src/ops/bug-report.test.d.ts +0 -1
- package/dist/src/ops/bug-report.test.js +0 -148
- package/dist/src/ops/doctor.test.d.ts +0 -1
- package/dist/src/ops/doctor.test.js +0 -97
- package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.js +0 -77
- package/dist/src/orchestrator/__tests__/auto-commit.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/auto-commit.test.js +0 -142
- package/dist/src/orchestrator/__tests__/batch-turn-runner.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/batch-turn-runner.test.js +0 -163
- package/dist/src/orchestrator/__tests__/council-manager.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/council-manager.test.js +0 -148
- package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.js +0 -175
- package/dist/src/orchestrator/__tests__/current-call-id.test.d.ts +0 -16
- package/dist/src/orchestrator/__tests__/current-call-id.test.js +0 -138
- package/dist/src/orchestrator/__tests__/delegations.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/delegations.test.js +0 -96
- package/dist/src/orchestrator/__tests__/error-forensics.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/error-forensics.test.js +0 -93
- package/dist/src/orchestrator/__tests__/flow-resume.test.d.ts +0 -5
- package/dist/src/orchestrator/__tests__/flow-resume.test.js +0 -61
- package/dist/src/orchestrator/__tests__/humanize-api-error.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/humanize-api-error.test.js +0 -68
- package/dist/src/orchestrator/__tests__/mcp-capability-block.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/mcp-capability-block.test.js +0 -39
- package/dist/src/orchestrator/__tests__/message-processor.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/message-processor.test.js +0 -188
- package/dist/src/orchestrator/__tests__/message-write-ahead.test.d.ts +0 -22
- package/dist/src/orchestrator/__tests__/message-write-ahead.test.js +0 -149
- package/dist/src/orchestrator/__tests__/project-stack.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/project-stack.test.js +0 -65
- package/dist/src/orchestrator/__tests__/read-path-budget.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/read-path-budget.test.js +0 -156
- package/dist/src/orchestrator/__tests__/retry-classifier.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/retry-classifier.test.js +0 -112
- package/dist/src/orchestrator/__tests__/retry-stream.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/retry-stream.test.js +0 -151
- package/dist/src/orchestrator/__tests__/route-feedback.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/route-feedback.test.js +0 -47
- package/dist/src/orchestrator/__tests__/stream-runner.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/stream-runner.test.js +0 -202
- package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.js +0 -45
- package/dist/src/orchestrator/__tests__/usage-events-shape.test.d.ts +0 -8
- package/dist/src/orchestrator/__tests__/usage-events-shape.test.js +0 -58
- package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.d.ts +0 -21
- package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.js +0 -155
- package/dist/src/orchestrator/__tests__/usage-shape-threading.test.d.ts +0 -1
- package/dist/src/orchestrator/__tests__/usage-shape-threading.test.js +0 -98
- package/dist/src/orchestrator/__tests__/write-ahead.test.d.ts +0 -20
- package/dist/src/orchestrator/__tests__/write-ahead.test.js +0 -134
- package/dist/src/orchestrator/abort.test.d.ts +0 -1
- package/dist/src/orchestrator/abort.test.js +0 -34
- package/dist/src/orchestrator/agent.test.d.ts +0 -1
- package/dist/src/orchestrator/agent.test.js +0 -178
- package/dist/src/orchestrator/cleanup.test.d.ts +0 -1
- package/dist/src/orchestrator/cleanup.test.js +0 -67
- package/dist/src/orchestrator/compaction.test.d.ts +0 -1
- package/dist/src/orchestrator/compaction.test.js +0 -187
- package/dist/src/orchestrator/delegations.test.d.ts +0 -1
- package/dist/src/orchestrator/delegations.test.js +0 -107
- package/dist/src/orchestrator/grounding-check.test.d.ts +0 -1
- package/dist/src/orchestrator/grounding-check.test.js +0 -94
- package/dist/src/orchestrator/interrupted-turn.test.d.ts +0 -1
- package/dist/src/orchestrator/interrupted-turn.test.js +0 -34
- package/dist/src/orchestrator/message-seq.test.d.ts +0 -1
- package/dist/src/orchestrator/message-seq.test.js +0 -24
- package/dist/src/orchestrator/pending-calls.test.d.ts +0 -1
- package/dist/src/orchestrator/pending-calls.test.js +0 -188
- package/dist/src/orchestrator/provider-options-shape.spec.d.ts +0 -1
- package/dist/src/orchestrator/provider-options-shape.spec.js +0 -63
- package/dist/src/orchestrator/reasoning.test.d.ts +0 -1
- package/dist/src/orchestrator/reasoning.test.js +0 -101
- package/dist/src/orchestrator/repetition-detector.test.d.ts +0 -1
- package/dist/src/orchestrator/repetition-detector.test.js +0 -103
- package/dist/src/orchestrator/sandbox.test.d.ts +0 -1
- package/dist/src/orchestrator/sandbox.test.js +0 -99
- package/dist/src/orchestrator/scope-ceiling.test.d.ts +0 -13
- package/dist/src/orchestrator/scope-ceiling.test.js +0 -181
- package/dist/src/orchestrator/scope-reminder.test.d.ts +0 -15
- package/dist/src/orchestrator/scope-reminder.test.js +0 -225
- package/dist/src/orchestrator/session-experience.test.d.ts +0 -6
- package/dist/src/orchestrator/session-experience.test.js +0 -72
- package/dist/src/orchestrator/stall-rescue.test.d.ts +0 -1
- package/dist/src/orchestrator/stall-rescue.test.js +0 -117
- package/dist/src/orchestrator/stall-watchdog.test.d.ts +0 -1
- package/dist/src/orchestrator/stall-watchdog.test.js +0 -153
- package/dist/src/orchestrator/steer-inbox.test.d.ts +0 -1
- package/dist/src/orchestrator/steer-inbox.test.js +0 -33
- package/dist/src/orchestrator/sub-agent-cap.test.d.ts +0 -1
- package/dist/src/orchestrator/sub-agent-cap.test.js +0 -208
- package/dist/src/orchestrator/subagent-compactor.spec.d.ts +0 -1
- package/dist/src/orchestrator/subagent-compactor.spec.js +0 -520
- package/dist/src/orchestrator/text-tool-call-detector.test.d.ts +0 -1
- package/dist/src/orchestrator/text-tool-call-detector.test.js +0 -147
- package/dist/src/orchestrator/token-counter.test.d.ts +0 -1
- package/dist/src/orchestrator/token-counter.test.js +0 -57
- package/dist/src/orchestrator/tool-args-hash.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-args-hash.test.js +0 -105
- package/dist/src/orchestrator/tool-args-repair.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-args-repair.test.js +0 -136
- package/dist/src/orchestrator/tool-loop-askcard.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-loop-askcard.test.js +0 -71
- package/dist/src/orchestrator/tool-loop-cap.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-loop-cap.test.js +0 -176
- package/dist/src/orchestrator/tool-repetition-detector.test.d.ts +0 -1
- package/dist/src/orchestrator/tool-repetition-detector.test.js +0 -101
- package/dist/src/pil/__tests__/budget.test.d.ts +0 -1
- package/dist/src/pil/__tests__/budget.test.js +0 -33
- package/dist/src/pil/__tests__/clarity-gate.test.d.ts +0 -1
- package/dist/src/pil/__tests__/clarity-gate.test.js +0 -37
- package/dist/src/pil/__tests__/config.test.d.ts +0 -1
- package/dist/src/pil/__tests__/config.test.js +0 -57
- package/dist/src/pil/__tests__/discovery-cache.test.d.ts +0 -1
- package/dist/src/pil/__tests__/discovery-cache.test.js +0 -38
- package/dist/src/pil/__tests__/discovery-types.test.d.ts +0 -1
- package/dist/src/pil/__tests__/discovery-types.test.js +0 -65
- package/dist/src/pil/__tests__/discovery.test.d.ts +0 -1
- package/dist/src/pil/__tests__/discovery.test.js +0 -178
- package/dist/src/pil/__tests__/dual-run.test.d.ts +0 -1
- package/dist/src/pil/__tests__/dual-run.test.js +0 -51
- package/dist/src/pil/__tests__/layer1-intent-trace.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer1-intent-trace.test.js +0 -138
- package/dist/src/pil/__tests__/layer1-intent.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer1-intent.test.js +0 -329
- package/dist/src/pil/__tests__/layer15-context-scan.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer15-context-scan.test.js +0 -64
- package/dist/src/pil/__tests__/layer16-clarity.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer16-clarity.test.js +0 -72
- package/dist/src/pil/__tests__/layer17-feasibility.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer17-feasibility.test.js +0 -36
- package/dist/src/pil/__tests__/layer18-acceptance.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer18-acceptance.test.js +0 -18
- package/dist/src/pil/__tests__/layer2-personality.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer2-personality.test.js +0 -57
- package/dist/src/pil/__tests__/layer2_5-ponytail.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer2_5-ponytail.test.js +0 -53
- package/dist/src/pil/__tests__/layer3-ee-injection.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer3-ee-injection.test.js +0 -221
- package/dist/src/pil/__tests__/layer3-injected-chunk.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer3-injected-chunk.test.js +0 -134
- package/dist/src/pil/__tests__/layer4-gsd.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer4-gsd.test.js +0 -191
- package/dist/src/pil/__tests__/layer5-context.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer5-context.test.js +0 -175
- package/dist/src/pil/__tests__/layer6-output.test.d.ts +0 -1
- package/dist/src/pil/__tests__/layer6-output.test.js +0 -465
- package/dist/src/pil/__tests__/llm-classify.test.d.ts +0 -1
- package/dist/src/pil/__tests__/llm-classify.test.js +0 -197
- package/dist/src/pil/__tests__/native-capabilities-workbook.test.d.ts +0 -1
- package/dist/src/pil/__tests__/native-capabilities-workbook.test.js +0 -40
- package/dist/src/pil/__tests__/ollama-classify.test.d.ts +0 -1
- package/dist/src/pil/__tests__/ollama-classify.test.js +0 -68
- package/dist/src/pil/__tests__/orchestrator-integration.test.d.ts +0 -10
- package/dist/src/pil/__tests__/orchestrator-integration.test.js +0 -100
- package/dist/src/pil/__tests__/pipeline.test.d.ts +0 -1
- package/dist/src/pil/__tests__/pipeline.test.js +0 -188
- package/dist/src/pil/__tests__/renderer-coverage.test.d.ts +0 -7
- package/dist/src/pil/__tests__/renderer-coverage.test.js +0 -42
- package/dist/src/pil/__tests__/response-tools.test.d.ts +0 -1
- package/dist/src/pil/__tests__/response-tools.test.js +0 -242
- package/dist/src/pil/__tests__/schema.test.d.ts +0 -1
- package/dist/src/pil/__tests__/schema.test.js +0 -202
- package/dist/src/pil/__tests__/scoreComplexity.test.d.ts +0 -1
- package/dist/src/pil/__tests__/scoreComplexity.test.js +0 -119
- package/dist/src/pil/__tests__/scoreSufficiency.test.d.ts +0 -8
- package/dist/src/pil/__tests__/scoreSufficiency.test.js +0 -89
- package/dist/src/pil/__tests__/store.test.d.ts +0 -1
- package/dist/src/pil/__tests__/store.test.js +0 -44
- package/dist/src/pil/__tests__/surface-compaction-artifacts.test.d.ts +0 -1
- package/dist/src/pil/__tests__/surface-compaction-artifacts.test.js +0 -112
- package/dist/src/pil/__tests__/task-tier-map.test.d.ts +0 -1
- package/dist/src/pil/__tests__/task-tier-map.test.js +0 -33
- package/dist/src/pil/agent-operating-contract.test.d.ts +0 -1
- package/dist/src/pil/agent-operating-contract.test.js +0 -80
- package/dist/src/pil/cheap-model-playbook.test.d.ts +0 -1
- package/dist/src/pil/cheap-model-playbook.test.js +0 -160
- package/dist/src/pil/cheap-model-workbooks.test.d.ts +0 -1
- package/dist/src/pil/cheap-model-workbooks.test.js +0 -129
- package/dist/src/pil/layer1-intent.test.d.ts +0 -1
- package/dist/src/pil/layer1-intent.test.js +0 -764
- package/dist/src/pil/layer1_5-complexity-size.test.d.ts +0 -10
- package/dist/src/pil/layer1_5-complexity-size.test.js +0 -248
- package/dist/src/pil/session-experience-injection.test.d.ts +0 -6
- package/dist/src/pil/session-experience-injection.test.js +0 -79
- package/dist/src/pil/session-state.test.d.ts +0 -1
- package/dist/src/pil/session-state.test.js +0 -73
- package/dist/src/playbook/__tests__/directives.test.d.ts +0 -1
- package/dist/src/playbook/__tests__/directives.test.js +0 -115
- package/dist/src/product-loop/__tests__/artifact-io.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/artifact-io.test.js +0 -83
- package/dist/src/product-loop/__tests__/assumption-ledger.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/assumption-ledger.test.js +0 -261
- package/dist/src/product-loop/__tests__/backlog-builder.test.d.ts +0 -10
- package/dist/src/product-loop/__tests__/backlog-builder.test.js +0 -175
- package/dist/src/product-loop/__tests__/backlog-store.test.d.ts +0 -4
- package/dist/src/product-loop/__tests__/backlog-store.test.js +0 -96
- package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.d.ts +0 -13
- package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.js +0 -158
- package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.js +0 -67
- package/dist/src/product-loop/__tests__/circuit-breakers.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/circuit-breakers.test.js +0 -79
- package/dist/src/product-loop/__tests__/complexity-routing.spec.d.ts +0 -11
- package/dist/src/product-loop/__tests__/complexity-routing.spec.js +0 -240
- package/dist/src/product-loop/__tests__/context-policy.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/context-policy.test.js +0 -266
- package/dist/src/product-loop/__tests__/cost-preview.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/cost-preview.test.js +0 -111
- package/dist/src/product-loop/__tests__/cost-scoper.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/cost-scoper.test.js +0 -50
- package/dist/src/product-loop/__tests__/cross-run-memory.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/cross-run-memory.test.js +0 -168
- package/dist/src/product-loop/__tests__/design-output.spec.d.ts +0 -1
- package/dist/src/product-loop/__tests__/design-output.spec.js +0 -36
- package/dist/src/product-loop/__tests__/discover.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discover.test.js +0 -83
- package/dist/src/product-loop/__tests__/discovery-context-format.test.d.ts +0 -13
- package/dist/src/product-loop/__tests__/discovery-context-format.test.js +0 -100
- package/dist/src/product-loop/__tests__/discovery-council-runner.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-council-runner.test.js +0 -13
- package/dist/src/product-loop/__tests__/discovery-detection.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-detection.test.js +0 -151
- package/dist/src/product-loop/__tests__/discovery-ecosystem.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/discovery-ecosystem.test.js +0 -209
- package/dist/src/product-loop/__tests__/discovery-integration.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-integration.test.js +0 -126
- package/dist/src/product-loop/__tests__/discovery-interview.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-interview.test.js +0 -394
- package/dist/src/product-loop/__tests__/discovery-migrations.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-migrations.test.js +0 -69
- package/dist/src/product-loop/__tests__/discovery-persistence.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-persistence.test.js +0 -146
- package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.js +0 -65
- package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.js +0 -55
- package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.d.ts +0 -9
- package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.js +0 -178
- package/dist/src/product-loop/__tests__/discovery-recommender.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-recommender.test.js +0 -316
- package/dist/src/product-loop/__tests__/discovery-schema.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/discovery-schema.test.js +0 -77
- package/dist/src/product-loop/__tests__/done-gate-coverage.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/done-gate-coverage.test.js +0 -135
- package/dist/src/product-loop/__tests__/done-gate.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/done-gate.test.js +0 -122
- package/dist/src/product-loop/__tests__/ee-extract-wiring.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/ee-extract-wiring.test.js +0 -186
- package/dist/src/product-loop/__tests__/extract-to-ee.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/extract-to-ee.test.js +0 -161
- package/dist/src/product-loop/__tests__/feedback-routing.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/feedback-routing.test.js +0 -83
- package/dist/src/product-loop/__tests__/gather-selectable-alts.test.d.ts +0 -15
- package/dist/src/product-loop/__tests__/gather-selectable-alts.test.js +0 -143
- package/dist/src/product-loop/__tests__/hot-path.spec.d.ts +0 -11
- package/dist/src/product-loop/__tests__/hot-path.spec.js +0 -146
- package/dist/src/product-loop/__tests__/integration.test.d.ts +0 -7
- package/dist/src/product-loop/__tests__/integration.test.js +0 -301
- package/dist/src/product-loop/__tests__/loop-driver-audit.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/loop-driver-audit.test.js +0 -269
- package/dist/src/product-loop/__tests__/loop-driver.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/loop-driver.test.js +0 -225
- package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.js +0 -67
- package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.d.ts +0 -13
- package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.js +0 -268
- package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.js +0 -162
- package/dist/src/product-loop/__tests__/phase-budget.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-budget.test.js +0 -149
- package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.js +0 -138
- package/dist/src/product-loop/__tests__/phase-plan.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-plan.test.js +0 -208
- package/dist/src/product-loop/__tests__/phase-rituals.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-rituals.test.js +0 -174
- package/dist/src/product-loop/__tests__/phase-runner.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-runner.test.js +0 -414
- package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.js +0 -67
- package/dist/src/product-loop/__tests__/pick-backend-stack.test.d.ts +0 -11
- package/dist/src/product-loop/__tests__/pick-backend-stack.test.js +0 -95
- package/dist/src/product-loop/__tests__/product-identity.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/product-identity.test.js +0 -40
- package/dist/src/product-loop/__tests__/progress-snapshot.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/progress-snapshot.test.js +0 -152
- package/dist/src/product-loop/__tests__/reality-anchor.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/reality-anchor.test.js +0 -49
- package/dist/src/product-loop/__tests__/repo-audit.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/repo-audit.test.js +0 -97
- package/dist/src/product-loop/__tests__/repo-brief.test.d.ts +0 -9
- package/dist/src/product-loop/__tests__/repo-brief.test.js +0 -132
- package/dist/src/product-loop/__tests__/role-memory.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/role-memory.test.js +0 -56
- package/dist/src/product-loop/__tests__/role-registry.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/role-registry.test.js +0 -222
- package/dist/src/product-loop/__tests__/role-routing-ee.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/role-routing-ee.test.js +0 -79
- package/dist/src/product-loop/__tests__/route-decision-emit.test.d.ts +0 -10
- package/dist/src/product-loop/__tests__/route-decision-emit.test.js +0 -222
- package/dist/src/product-loop/__tests__/seed-questions.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/seed-questions.test.js +0 -30
- package/dist/src/product-loop/__tests__/ship-polish.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/ship-polish.test.js +0 -96
- package/dist/src/product-loop/__tests__/sprint-planner.test.d.ts +0 -6
- package/dist/src/product-loop/__tests__/sprint-planner.test.js +0 -140
- package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.js +0 -221
- package/dist/src/product-loop/__tests__/sprint-runner-emit.test.d.ts +0 -14
- package/dist/src/product-loop/__tests__/sprint-runner-emit.test.js +0 -279
- package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.d.ts +0 -14
- package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.js +0 -193
- package/dist/src/product-loop/__tests__/sprint-runner.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/sprint-runner.test.js +0 -432
- package/dist/src/product-loop/__tests__/sprint-self-verify.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/sprint-self-verify.test.js +0 -73
- package/dist/src/product-loop/__tests__/sprint-store.test.d.ts +0 -7
- package/dist/src/product-loop/__tests__/sprint-store.test.js +0 -84
- package/dist/src/product-loop/__tests__/stakeholder-acl.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/stakeholder-acl.test.js +0 -83
- package/dist/src/product-loop/__tests__/state-md-ee-injections.test.d.ts +0 -8
- package/dist/src/product-loop/__tests__/state-md-ee-injections.test.js +0 -182
- package/dist/src/product-loop/__tests__/sufficiency-routing.spec.d.ts +0 -12
- package/dist/src/product-loop/__tests__/sufficiency-routing.spec.js +0 -140
- package/dist/src/product-loop/__tests__/typed-artifacts.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/typed-artifacts.test.js +0 -222
- package/dist/src/product-loop/__tests__/types.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/types.test.js +0 -79
- package/dist/src/product-loop/__tests__/verify-failure-threshold.test.d.ts +0 -9
- package/dist/src/product-loop/__tests__/verify-failure-threshold.test.js +0 -146
- package/dist/src/product-loop/__tests__/verify-failure-tracking.test.d.ts +0 -4
- package/dist/src/product-loop/__tests__/verify-failure-tracking.test.js +0 -122
- package/dist/src/product-loop/__tests__/verify-result.test.d.ts +0 -1
- package/dist/src/product-loop/__tests__/verify-result.test.js +0 -53
- package/dist/src/providers/__tests__/adapter-oauth-wiring.test.d.ts +0 -8
- package/dist/src/providers/__tests__/adapter-oauth-wiring.test.js +0 -125
- package/dist/src/providers/__tests__/capabilities-cosmetic.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-cosmetic.test.js +0 -109
- package/dist/src/providers/__tests__/capabilities-flags.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-flags.test.js +0 -145
- package/dist/src/providers/__tests__/capabilities-provider-options.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-provider-options.test.js +0 -201
- package/dist/src/providers/__tests__/capabilities-sanitize.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities-sanitize.test.js +0 -60
- package/dist/src/providers/__tests__/capabilities.test.d.ts +0 -1
- package/dist/src/providers/__tests__/capabilities.test.js +0 -41
- package/dist/src/providers/__tests__/provider-coverage.test.d.ts +0 -1
- package/dist/src/providers/__tests__/provider-coverage.test.js +0 -45
- package/dist/src/providers/__tests__/reasoning-roundtrip.test.d.ts +0 -1
- package/dist/src/providers/__tests__/reasoning-roundtrip.test.js +0 -216
- package/dist/src/providers/__tests__/runtime-integration.test.d.ts +0 -1
- package/dist/src/providers/__tests__/runtime-integration.test.js +0 -93
- package/dist/src/providers/__tests__/runtime.test.d.ts +0 -1
- package/dist/src/providers/__tests__/runtime.test.js +0 -80
- package/dist/src/providers/__tests__/siliconflow-sse-repair.test.d.ts +0 -1
- package/dist/src/providers/__tests__/siliconflow-sse-repair.test.js +0 -267
- package/dist/src/providers/__tests__/strategies-registry.test.d.ts +0 -8
- package/dist/src/providers/__tests__/strategies-registry.test.js +0 -49
- package/dist/src/providers/__tests__/strategies-resolve.test.d.ts +0 -12
- package/dist/src/providers/__tests__/strategies-resolve.test.js +0 -128
- package/dist/src/providers/__tests__/wire-debug.test.d.ts +0 -1
- package/dist/src/providers/__tests__/wire-debug.test.js +0 -39
- package/dist/src/providers/adapter.test.d.ts +0 -1
- package/dist/src/providers/adapter.test.js +0 -19
- package/dist/src/providers/auth/__tests__/browser-flow.test.d.ts +0 -8
- package/dist/src/providers/auth/__tests__/browser-flow.test.js +0 -186
- package/dist/src/providers/auth/__tests__/device-flow.test.d.ts +0 -6
- package/dist/src/providers/auth/__tests__/device-flow.test.js +0 -219
- package/dist/src/providers/auth/__tests__/gemini-oauth.test.d.ts +0 -4
- package/dist/src/providers/auth/__tests__/gemini-oauth.test.js +0 -306
- package/dist/src/providers/auth/__tests__/grok-oauth.test.d.ts +0 -8
- package/dist/src/providers/auth/__tests__/grok-oauth.test.js +0 -236
- package/dist/src/providers/auth/__tests__/openai-oauth.test.d.ts +0 -7
- package/dist/src/providers/auth/__tests__/openai-oauth.test.js +0 -309
- package/dist/src/providers/auth/__tests__/token-store.test.d.ts +0 -7
- package/dist/src/providers/auth/__tests__/token-store.test.js +0 -125
- package/dist/src/providers/errors.test.d.ts +0 -1
- package/dist/src/providers/errors.test.js +0 -66
- package/dist/src/providers/gemini.test.d.ts +0 -1
- package/dist/src/providers/gemini.test.js +0 -37
- package/dist/src/providers/keychain.test.d.ts +0 -1
- package/dist/src/providers/keychain.test.js +0 -84
- package/dist/src/providers/mcp-vision-bridge.test.d.ts +0 -1
- package/dist/src/providers/mcp-vision-bridge.test.js +0 -381
- package/dist/src/providers/ollama.test.d.ts +0 -1
- package/dist/src/providers/ollama.test.js +0 -37
- package/dist/src/providers/openai-compatible.test.d.ts +0 -1
- package/dist/src/providers/openai-compatible.test.js +0 -53
- package/dist/src/providers/openai.test.d.ts +0 -1
- package/dist/src/providers/openai.test.js +0 -53
- package/dist/src/providers/pricing.test.d.ts +0 -1
- package/dist/src/providers/pricing.test.js +0 -81
- package/dist/src/providers/prompt-cache-key.spec.d.ts +0 -5
- package/dist/src/providers/prompt-cache-key.spec.js +0 -24
- package/dist/src/providers/runtime-mock.spec.d.ts +0 -8
- package/dist/src/providers/runtime-mock.spec.js +0 -69
- package/dist/src/providers/vision-proxy.test.d.ts +0 -1
- package/dist/src/providers/vision-proxy.test.js +0 -212
- package/dist/src/reporter/__tests__/acl-check.test.d.ts +0 -6
- package/dist/src/reporter/__tests__/acl-check.test.js +0 -59
- package/dist/src/reporter/__tests__/auto-fire.test.d.ts +0 -10
- package/dist/src/reporter/__tests__/auto-fire.test.js +0 -140
- package/dist/src/reporter/__tests__/budget.test.d.ts +0 -7
- package/dist/src/reporter/__tests__/budget.test.js +0 -60
- package/dist/src/reporter/__tests__/handlers.test.d.ts +0 -7
- package/dist/src/reporter/__tests__/handlers.test.js +0 -163
- package/dist/src/reporter/__tests__/query-router.test.d.ts +0 -6
- package/dist/src/reporter/__tests__/query-router.test.js +0 -90
- package/dist/src/router/__tests__/step-router.test.d.ts +0 -4
- package/dist/src/router/__tests__/step-router.test.js +0 -131
- package/dist/src/router/classifier/index.test.d.ts +0 -1
- package/dist/src/router/classifier/index.test.js +0 -29
- package/dist/src/router/classifier/regex.test.d.ts +0 -1
- package/dist/src/router/classifier/regex.test.js +0 -44
- package/dist/src/router/classifier/tree-sitter.test.d.ts +0 -1
- package/dist/src/router/classifier/tree-sitter.test.js +0 -23
- package/dist/src/router/cold.test.d.ts +0 -1
- package/dist/src/router/cold.test.js +0 -56
- package/dist/src/router/decide.test.d.ts +0 -1
- package/dist/src/router/decide.test.js +0 -198
- package/dist/src/router/health.test.d.ts +0 -1
- package/dist/src/router/health.test.js +0 -52
- package/dist/src/router/provider-sentinel.test.d.ts +0 -1
- package/dist/src/router/provider-sentinel.test.js +0 -20
- package/dist/src/router/role-override.test.d.ts +0 -1
- package/dist/src/router/role-override.test.js +0 -26
- package/dist/src/router/warm.test.d.ts +0 -1
- package/dist/src/router/warm.test.js +0 -202
- package/dist/src/scaffold/__tests__/continuation-prompt.test.d.ts +0 -4
- package/dist/src/scaffold/__tests__/continuation-prompt.test.js +0 -79
- package/dist/src/scaffold/__tests__/continue-as-council.spec.d.ts +0 -10
- package/dist/src/scaffold/__tests__/continue-as-council.spec.js +0 -102
- package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.d.ts +0 -1
- package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.js +0 -27
- package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.d.ts +0 -1
- package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.js +0 -106
- package/dist/src/scaffold/__tests__/init-new.smoke.spec.d.ts +0 -15
- package/dist/src/scaffold/__tests__/init-new.smoke.spec.js +0 -81
- package/dist/src/scaffold/__tests__/init-new.spec.d.ts +0 -5
- package/dist/src/scaffold/__tests__/init-new.spec.js +0 -378
- package/dist/src/scaffold/__tests__/install-bb-templates.spec.d.ts +0 -1
- package/dist/src/scaffold/__tests__/install-bb-templates.spec.js +0 -77
- package/dist/src/scaffold/__tests__/point-to-existing.spec.d.ts +0 -7
- package/dist/src/scaffold/__tests__/point-to-existing.spec.js +0 -94
- package/dist/src/self-qa/__tests__/agentic-context.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/agentic-context.test.js +0 -98
- package/dist/src/self-qa/__tests__/agentic-loop.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/agentic-loop.test.js +0 -62
- package/dist/src/self-qa/__tests__/delta-encoder.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/delta-encoder.test.js +0 -97
- package/dist/src/self-qa/__tests__/judge.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/judge.test.js +0 -131
- package/dist/src/self-qa/__tests__/scenario-planner.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/scenario-planner.test.js +0 -79
- package/dist/src/self-qa/__tests__/spec-emitter.test.d.ts +0 -1
- package/dist/src/self-qa/__tests__/spec-emitter.test.js +0 -62
- package/dist/src/storage/__tests__/migrations.test.d.ts +0 -12
- package/dist/src/storage/__tests__/migrations.test.js +0 -357
- package/dist/src/storage/__tests__/sweep-stale-pending.test.d.ts +0 -10
- package/dist/src/storage/__tests__/sweep-stale-pending.test.js +0 -97
- package/dist/src/storage/__tests__/ui-interaction-log.test.d.ts +0 -7
- package/dist/src/storage/__tests__/ui-interaction-log.test.js +0 -127
- package/dist/src/storage/atomic-io.test.d.ts +0 -1
- package/dist/src/storage/atomic-io.test.js +0 -74
- package/dist/src/storage/config.test.d.ts +0 -1
- package/dist/src/storage/config.test.js +0 -29
- package/dist/src/storage/session-experience-store.test.d.ts +0 -5
- package/dist/src/storage/session-experience-store.test.js +0 -86
- package/dist/src/storage/tool-results.test.d.ts +0 -1
- package/dist/src/storage/tool-results.test.js +0 -48
- package/dist/src/storage/transcript-response-entry.test.d.ts +0 -1
- package/dist/src/storage/transcript-response-entry.test.js +0 -98
- package/dist/src/storage/transcript.test.d.ts +0 -1
- package/dist/src/storage/transcript.test.js +0 -22
- package/dist/src/storage/usage-cap.test.d.ts +0 -1
- package/dist/src/storage/usage-cap.test.js +0 -51
- package/dist/src/tools/__tests__/native-tools.test.d.ts +0 -1
- package/dist/src/tools/__tests__/native-tools.test.js +0 -59
- package/dist/src/tools/__tests__/vision-gate.test.d.ts +0 -1
- package/dist/src/tools/__tests__/vision-gate.test.js +0 -56
- package/dist/src/tools/bash-output-cache.test.d.ts +0 -1
- package/dist/src/tools/bash-output-cache.test.js +0 -89
- package/dist/src/tools/bash-output-integration.test.d.ts +0 -10
- package/dist/src/tools/bash-output-integration.test.js +0 -30
- package/dist/src/tools/bash.test.d.ts +0 -1
- package/dist/src/tools/bash.test.js +0 -90
- package/dist/src/tools/computer.test.d.ts +0 -1
- package/dist/src/tools/computer.test.js +0 -142
- package/dist/src/tools/file-tracker.test.d.ts +0 -1
- package/dist/src/tools/file-tracker.test.js +0 -77
- package/dist/src/tools/file.test.d.ts +0 -1
- package/dist/src/tools/file.test.js +0 -106
- package/dist/src/tools/git-safety.test.d.ts +0 -1
- package/dist/src/tools/git-safety.test.js +0 -155
- package/dist/src/tools/registry-bash-empty-command.test.d.ts +0 -13
- package/dist/src/tools/registry-bash-empty-command.test.js +0 -57
- package/dist/src/tools/registry-bash-footer.test.d.ts +0 -7
- package/dist/src/tools/registry-bash-footer.test.js +0 -82
- package/dist/src/tools/registry-ee-query.test.d.ts +0 -11
- package/dist/src/tools/registry-ee-query.test.js +0 -71
- package/dist/src/tools/registry-git-safety.test.d.ts +0 -7
- package/dist/src/tools/registry-git-safety.test.js +0 -103
- package/dist/src/tools/registry-session-repeat.test.d.ts +0 -12
- package/dist/src/tools/registry-session-repeat.test.js +0 -87
- package/dist/src/tools/registry.test.d.ts +0 -1
- package/dist/src/tools/registry.test.js +0 -34
- package/dist/src/tools/schedule.test.d.ts +0 -1
- package/dist/src/tools/schedule.test.js +0 -118
- package/dist/src/tools/todo-write-snapshot.test.d.ts +0 -1
- package/dist/src/tools/todo-write-snapshot.test.js +0 -43
- package/dist/src/ui/__tests__/markdown-render.test.d.ts +0 -1
- package/dist/src/ui/__tests__/markdown-render.test.js +0 -65
- package/dist/src/ui/__tests__/picker-providers.test.d.ts +0 -1
- package/dist/src/ui/__tests__/picker-providers.test.js +0 -31
- package/dist/src/ui/cards/__tests__/product-status-card.test.d.ts +0 -1
- package/dist/src/ui/cards/__tests__/product-status-card.test.js +0 -27
- package/dist/src/ui/components/__tests__/council-leader-bubble.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-leader-bubble.test.js +0 -14
- package/dist/src/ui/components/__tests__/council-message-bubble.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-message-bubble.test.js +0 -74
- package/dist/src/ui/components/__tests__/council-phase-timeline.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-phase-timeline.test.js +0 -51
- package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.js +0 -14
- package/dist/src/ui/components/__tests__/council-question-card.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-question-card.test.js +0 -121
- package/dist/src/ui/components/__tests__/council-synthesis-banner.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/council-synthesis-banner.test.js +0 -11
- package/dist/src/ui/components/__tests__/task-list-panel.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/task-list-panel.test.js +0 -31
- package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.d.ts +0 -1
- package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.js +0 -37
- package/dist/src/ui/slash/__tests__/clear.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/clear.test.js +0 -58
- package/dist/src/ui/slash/__tests__/compact.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/compact.test.js +0 -43
- package/dist/src/ui/slash/__tests__/cost.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/cost.test.js +0 -54
- package/dist/src/ui/slash/__tests__/discuss.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/discuss.test.js +0 -83
- package/dist/src/ui/slash/__tests__/execute.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/execute.test.js +0 -71
- package/dist/src/ui/slash/__tests__/expand.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/expand.test.js +0 -67
- package/dist/src/ui/slash/__tests__/ideal.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/ideal.test.js +0 -158
- package/dist/src/ui/slash/__tests__/menu-parity.test.d.ts +0 -17
- package/dist/src/ui/slash/__tests__/menu-parity.test.js +0 -43
- package/dist/src/ui/slash/__tests__/optimize.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/optimize.test.js +0 -130
- package/dist/src/ui/slash/__tests__/pin.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/pin.test.js +0 -38
- package/dist/src/ui/slash/__tests__/plan.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/plan.test.js +0 -82
- package/dist/src/ui/slash/__tests__/ponytail.test.d.ts +0 -1
- package/dist/src/ui/slash/__tests__/ponytail.test.js +0 -37
- package/dist/src/ui/slash/__tests__/status-render.test.d.ts +0 -7
- package/dist/src/ui/slash/__tests__/status-render.test.js +0 -77
- package/dist/src/ui/slash/route.test.d.ts +0 -1
- package/dist/src/ui/slash/route.test.js +0 -70
- package/dist/src/ui/status-bar/index.test.d.ts +0 -1
- package/dist/src/ui/status-bar/index.test.js +0 -139
- package/dist/src/ui/status-bar/store.test.d.ts +0 -1
- package/dist/src/ui/status-bar/store.test.js +0 -116
- package/dist/src/ui/status-bar/tier-badge.test.d.ts +0 -1
- package/dist/src/ui/status-bar/tier-badge.test.js +0 -34
- package/dist/src/ui/status-bar/usd-meter.test.d.ts +0 -1
- package/dist/src/ui/status-bar/usd-meter.test.js +0 -32
- package/dist/src/ui/utils/__tests__/format.test.d.ts +0 -1
- package/dist/src/ui/utils/__tests__/format.test.js +0 -50
- package/dist/src/ui/utils/__tests__/tools.test.d.ts +0 -1
- package/dist/src/ui/utils/__tests__/tools.test.js +0 -48
- package/dist/src/ui/utils/relaunch.test.d.ts +0 -1
- package/dist/src/ui/utils/relaunch.test.js +0 -133
- package/dist/src/ui/utils/text.test.d.ts +0 -1
- package/dist/src/ui/utils/text.test.js +0 -47
- package/dist/src/usage/__tests__/product-ledger.test.d.ts +0 -1
- package/dist/src/usage/__tests__/product-ledger.test.js +0 -60
- package/dist/src/usage/downgrade.test.d.ts +0 -1
- package/dist/src/usage/downgrade.test.js +0 -70
- package/dist/src/usage/estimator.test.d.ts +0 -1
- package/dist/src/usage/estimator.test.js +0 -38
- package/dist/src/usage/ledger.test.d.ts +0 -1
- package/dist/src/usage/ledger.test.js +0 -171
- package/dist/src/usage/midstream.test.d.ts +0 -1
- package/dist/src/usage/midstream.test.js +0 -47
- package/dist/src/usage/thresholds.test.d.ts +0 -1
- package/dist/src/usage/thresholds.test.js +0 -77
- package/dist/src/utils/__tests__/auto-council-settings.test.d.ts +0 -1
- package/dist/src/utils/__tests__/auto-council-settings.test.js +0 -41
- package/dist/src/utils/__tests__/compaction-caps.test.d.ts +0 -21
- package/dist/src/utils/__tests__/compaction-caps.test.js +0 -187
- package/dist/src/utils/__tests__/ee-logger.test.d.ts +0 -11
- package/dist/src/utils/__tests__/ee-logger.test.js +0 -165
- package/dist/src/utils/__tests__/file-lock.test.d.ts +0 -1
- package/dist/src/utils/__tests__/file-lock.test.js +0 -66
- package/dist/src/utils/__tests__/footprint-gitignore.test.d.ts +0 -1
- package/dist/src/utils/__tests__/footprint-gitignore.test.js +0 -50
- package/dist/src/utils/__tests__/llm-deadline-abort.test.d.ts +0 -1
- package/dist/src/utils/__tests__/llm-deadline-abort.test.js +0 -33
- package/dist/src/utils/__tests__/llm-deadline.test.d.ts +0 -1
- package/dist/src/utils/__tests__/llm-deadline.test.js +0 -56
- package/dist/src/utils/__tests__/rate-limit.test.d.ts +0 -1
- package/dist/src/utils/__tests__/rate-limit.test.js +0 -38
- package/dist/src/utils/__tests__/settings-disabled-models.test.d.ts +0 -7
- package/dist/src/utils/__tests__/settings-disabled-models.test.js +0 -99
- package/dist/src/utils/__tests__/settings-web-research.test.d.ts +0 -1
- package/dist/src/utils/__tests__/settings-web-research.test.js +0 -46
- package/dist/src/utils/__tests__/slugify.test.d.ts +0 -1
- package/dist/src/utils/__tests__/slugify.test.js +0 -37
- package/dist/src/utils/__tests__/visible-retry.test.d.ts +0 -1
- package/dist/src/utils/__tests__/visible-retry.test.js +0 -143
- package/dist/src/utils/install-manager.test.d.ts +0 -1
- package/dist/src/utils/install-manager.test.js +0 -127
- package/dist/src/utils/instructions.test.d.ts +0 -1
- package/dist/src/utils/instructions.test.js +0 -93
- package/dist/src/utils/open-url.test.d.ts +0 -1
- package/dist/src/utils/open-url.test.js +0 -86
- package/dist/src/utils/permission-mode.test.d.ts +0 -1
- package/dist/src/utils/permission-mode.test.js +0 -188
- package/dist/src/utils/redactor.test.d.ts +0 -1
- package/dist/src/utils/redactor.test.js +0 -84
- package/dist/src/utils/settings.test.d.ts +0 -1
- package/dist/src/utils/settings.test.js +0 -212
- package/dist/src/utils/shell.test.d.ts +0 -1
- package/dist/src/utils/shell.test.js +0 -97
- package/dist/src/utils/skills.test.d.ts +0 -1
- package/dist/src/utils/skills.test.js +0 -45
- package/dist/src/utils/subagent-display.test.d.ts +0 -1
- package/dist/src/utils/subagent-display.test.js +0 -21
- package/dist/src/utils/subagents-settings.test.d.ts +0 -1
- package/dist/src/utils/subagents-settings.test.js +0 -64
- package/dist/src/utils/telegram-audio-settings.test.d.ts +0 -1
- package/dist/src/utils/telegram-audio-settings.test.js +0 -39
- package/dist/src/utils/update-checker.test.d.ts +0 -1
- package/dist/src/utils/update-checker.test.js +0 -138
- package/dist/src/verify/__tests__/coverage-parsers.test.d.ts +0 -1
- package/dist/src/verify/__tests__/coverage-parsers.test.js +0 -69
- package/dist/src/verify/__tests__/dotnet-recipe.test.d.ts +0 -10
- package/dist/src/verify/__tests__/dotnet-recipe.test.js +0 -70
- package/dist/src/verify/checkpoint.test.d.ts +0 -1
- package/dist/src/verify/checkpoint.test.js +0 -160
- package/dist/src/verify/entrypoint.test.d.ts +0 -1
- package/dist/src/verify/entrypoint.test.js +0 -233
- package/dist/src/verify/environment.test.d.ts +0 -1
- package/dist/src/verify/environment.test.js +0 -94
- package/dist/src/verify/orchestrator.test.d.ts +0 -1
- package/dist/src/verify/orchestrator.test.js +0 -126
- package/dist/src/verify/runtime-prep.test.d.ts +0 -1
- package/dist/src/verify/runtime-prep.test.js +0 -38
|
@@ -1,520 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
2
|
-
import { compactSubAgentMessages, cumulativeMessageChars } from "./subagent-compactor.js";
|
|
3
|
-
function bigText(label, kb) {
|
|
4
|
-
const block = `${label}:${"x".repeat(kb * 1000)}`;
|
|
5
|
-
return block;
|
|
6
|
-
}
|
|
7
|
-
function toolTurn(idx, kb) {
|
|
8
|
-
return [
|
|
9
|
-
{
|
|
10
|
-
role: "assistant",
|
|
11
|
-
content: [
|
|
12
|
-
{
|
|
13
|
-
type: "tool-call",
|
|
14
|
-
toolCallId: `call_${idx}`,
|
|
15
|
-
toolName: "read_file",
|
|
16
|
-
input: JSON.stringify({ path: `/tmp/f${idx}.txt` }),
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
role: "tool",
|
|
22
|
-
content: [
|
|
23
|
-
{
|
|
24
|
-
type: "tool-result",
|
|
25
|
-
toolCallId: `call_${idx}`,
|
|
26
|
-
toolName: "read_file",
|
|
27
|
-
output: { type: "text", value: bigText(`R${idx}`, kb) },
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
function buildHistory(turns, kbPerTurn) {
|
|
34
|
-
const msgs = [
|
|
35
|
-
{ role: "system", content: "You are the Explore sub-agent. You are read-only." },
|
|
36
|
-
{ role: "user", content: "research auth wiring" },
|
|
37
|
-
];
|
|
38
|
-
for (let i = 1; i <= turns; i++)
|
|
39
|
-
msgs.push(...toolTurn(i, kbPerTurn));
|
|
40
|
-
return msgs;
|
|
41
|
-
}
|
|
42
|
-
describe("subagent-compactor: cumulativeMessageChars", () => {
|
|
43
|
-
it("sums tool_result output JSON length", () => {
|
|
44
|
-
const m = buildHistory(2, 10); // ~20kb of tool output
|
|
45
|
-
expect(cumulativeMessageChars(m)).toBeGreaterThan(20_000);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe("subagent-compactor: compactSubAgentMessages", () => {
|
|
49
|
-
const ENV_KEYS = ["MUONROI_SUBAGENT_COMPACT_THRESHOLD_CHARS", "MUONROI_SUBAGENT_COMPACT_KEEP_LAST"];
|
|
50
|
-
const saved = {};
|
|
51
|
-
afterEach(() => {
|
|
52
|
-
for (const k of ENV_KEYS) {
|
|
53
|
-
if (saved[k] !== undefined)
|
|
54
|
-
process.env[k] = saved[k];
|
|
55
|
-
else
|
|
56
|
-
delete process.env[k];
|
|
57
|
-
delete saved[k];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
it("passes through small message arrays unchanged in shape", () => {
|
|
61
|
-
const msgs = buildHistory(2, 5); // ~10kb < 80kb default threshold
|
|
62
|
-
const out = compactSubAgentMessages(msgs);
|
|
63
|
-
expect(out.length).toBe(msgs.length);
|
|
64
|
-
// No tool-result rewrite happened — output object identity per part preserved.
|
|
65
|
-
expect(out[3]).toBe(msgs[3]);
|
|
66
|
-
});
|
|
67
|
-
it("returns the SAME array reference on a no-op below threshold (compacted===input contract)", () => {
|
|
68
|
-
// Callers (message-processor B4 prepareStep:1840/1908/1914) detect "did NOT
|
|
69
|
-
// compact this step" via `compacted === stripped`. The docstring promises the
|
|
70
|
-
// original ref on a no-op; returning a fresh slice silently broke that —
|
|
71
|
-
// making the pre-compaction warning dead and the compaction note fire every
|
|
72
|
-
// step. Lock the identity contract.
|
|
73
|
-
const msgs = buildHistory(2, 5); // below threshold
|
|
74
|
-
expect(compactSubAgentMessages(msgs)).toBe(msgs);
|
|
75
|
-
});
|
|
76
|
-
it("returns a NEW array when compaction actually elides (compacted!==input)", () => {
|
|
77
|
-
const msgs = buildHistory(10, 10); // ~100kb > threshold
|
|
78
|
-
for (const m of msgs) {
|
|
79
|
-
if (m.role === "tool" && Array.isArray(m.content)) {
|
|
80
|
-
m.content[0].toolName = "other_tool"; // force low-value so it elides
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
expect(compactSubAgentMessages(msgs)).not.toBe(msgs);
|
|
84
|
-
});
|
|
85
|
-
it("compacts when cumulative chars exceed threshold", () => {
|
|
86
|
-
const msgs = buildHistory(10, 10); // ~100kb of tool output
|
|
87
|
-
// Neutralize to test pure size-based elision (high-value keep would reduce savings).
|
|
88
|
-
for (const m of msgs) {
|
|
89
|
-
if (m.role === "tool" && Array.isArray(m.content)) {
|
|
90
|
-
m.content[0].toolName = "other_tool";
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const before = cumulativeMessageChars(msgs);
|
|
94
|
-
const out = compactSubAgentMessages(msgs);
|
|
95
|
-
const after = cumulativeMessageChars(out);
|
|
96
|
-
expect(before).toBeGreaterThan(80_000);
|
|
97
|
-
expect(after).toBeLessThan(before / 2);
|
|
98
|
-
});
|
|
99
|
-
it("preserves system + first user message verbatim", () => {
|
|
100
|
-
const msgs = buildHistory(10, 10);
|
|
101
|
-
const out = compactSubAgentMessages(msgs);
|
|
102
|
-
expect(out[0]).toBe(msgs[0]); // system
|
|
103
|
-
expect(out[1]).toBe(msgs[1]); // first user
|
|
104
|
-
});
|
|
105
|
-
it("preserves last N tool turns verbatim (default 3)", () => {
|
|
106
|
-
const msgs = buildHistory(10, 10);
|
|
107
|
-
const out = compactSubAgentMessages(msgs);
|
|
108
|
-
// Last 3 turns = 6 messages; verify the trailing slice is referentially equal.
|
|
109
|
-
for (let i = 1; i <= 6; i++) {
|
|
110
|
-
expect(out[out.length - i]).toBe(msgs[msgs.length - i]);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
it("keeps an OLDER authoritative muonroi-docs MCP result verbatim while eliding low-value peers (session 584ba476c07a)", () => {
|
|
114
|
-
// History: an early muonroi-docs setup_guide (older than keepLast=3) + many
|
|
115
|
-
// low-value tool turns. The ecosystem doc must survive compaction so the
|
|
116
|
-
// agent stays grounded on the source it was nudged to fetch first.
|
|
117
|
-
const docsValue = bigText("ECOSYSTEM_DOCS", 6); // ~6kb authoritative payload
|
|
118
|
-
const msgs = [
|
|
119
|
-
{ role: "system", content: "You are the agent." },
|
|
120
|
-
{ role: "user", content: "ecosystem question" },
|
|
121
|
-
{
|
|
122
|
-
role: "assistant",
|
|
123
|
-
content: [
|
|
124
|
-
{
|
|
125
|
-
type: "tool-call",
|
|
126
|
-
toolCallId: "call_docs",
|
|
127
|
-
toolName: "mcp_muonroi-docs__setup_guide",
|
|
128
|
-
input: JSON.stringify({ component: "ecosystem" }),
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
role: "tool",
|
|
134
|
-
content: [
|
|
135
|
-
{
|
|
136
|
-
type: "tool-result",
|
|
137
|
-
toolCallId: "call_docs",
|
|
138
|
-
toolName: "mcp_muonroi-docs__setup_guide",
|
|
139
|
-
output: { type: "text", value: docsValue },
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
},
|
|
143
|
-
];
|
|
144
|
-
// Pile on low-value turns to push well past threshold and make the docs turn "old".
|
|
145
|
-
for (let i = 1; i <= 10; i++) {
|
|
146
|
-
const t = toolTurn(i, 10);
|
|
147
|
-
t[1].content[0].toolName = "mcp_filesystem__list_directory"; // low-value MCP
|
|
148
|
-
t[0].content[0].toolName = "mcp_filesystem__list_directory";
|
|
149
|
-
msgs.push(...t);
|
|
150
|
-
}
|
|
151
|
-
const out = compactSubAgentMessages(msgs);
|
|
152
|
-
expect(out).not.toBe(msgs); // compaction fired
|
|
153
|
-
// The muonroi-docs result is kept verbatim (full payload, no stub).
|
|
154
|
-
const docsMsg = out.find((m) => m.role === "tool" &&
|
|
155
|
-
Array.isArray(m.content) &&
|
|
156
|
-
m.content[0]?.toolName === "mcp_muonroi-docs__setup_guide");
|
|
157
|
-
const docsOut = (docsMsg?.content)[0].output.value;
|
|
158
|
-
expect(docsOut).toBe(docsValue);
|
|
159
|
-
expect(docsOut).not.toMatch(/elided by/);
|
|
160
|
-
// A low-value filesystem MCP peer from an OLD turn IS stubbed.
|
|
161
|
-
const stubbed = out.some((m) => m.role === "tool" &&
|
|
162
|
-
Array.isArray(m.content) &&
|
|
163
|
-
typeof m.content[0]?.output?.value === "string" &&
|
|
164
|
-
m.content[0].output.value.includes("elided by"));
|
|
165
|
-
expect(stubbed).toBe(true);
|
|
166
|
-
});
|
|
167
|
-
it("rewrites older tool-result parts with elision stub", () => {
|
|
168
|
-
const msgs = buildHistory(10, 10);
|
|
169
|
-
// Neutralize tool so the basic elision test is not affected by high-value auto-keep (idea 1).
|
|
170
|
-
for (const m of msgs) {
|
|
171
|
-
if (m.role === "tool" && Array.isArray(m.content)) {
|
|
172
|
-
m.content[0].toolName = "other_tool";
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
const out = compactSubAgentMessages(msgs);
|
|
176
|
-
// First tool message is at index 3 (system, user, asst, tool, ...).
|
|
177
|
-
const firstToolMsg = out[3];
|
|
178
|
-
expect(firstToolMsg.role).toBe("tool");
|
|
179
|
-
const parts = firstToolMsg.content;
|
|
180
|
-
const tr = parts[0];
|
|
181
|
-
expect(tr.type).toBe("tool-result");
|
|
182
|
-
expect(tr.output.value).toMatch(/earlier tool_result for tool=other_tool/);
|
|
183
|
-
expect(tr.output.value).toMatch(/elided by sub-agent compactor/);
|
|
184
|
-
});
|
|
185
|
-
it("respects custom threshold (no compaction when threshold raised)", () => {
|
|
186
|
-
const msgs = buildHistory(10, 10);
|
|
187
|
-
const out = compactSubAgentMessages(msgs, { thresholdChars: 500_000 });
|
|
188
|
-
// No rewrite — every tool result still references the original object.
|
|
189
|
-
for (let i = 3; i < msgs.length; i++) {
|
|
190
|
-
if (msgs[i]?.role === "tool") {
|
|
191
|
-
expect(out[i]).toBe(msgs[i]);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
it("keepLastTurns=0 compacts every tool turn (no trailing window preserved)", () => {
|
|
196
|
-
const msgs = buildHistory(10, 10);
|
|
197
|
-
// Neutralize so high-value (idea 1) does not override keep=0 for this test's intent.
|
|
198
|
-
for (const m of msgs) {
|
|
199
|
-
if (m.role === "tool" && Array.isArray(m.content)) {
|
|
200
|
-
m.content[0].toolName = "other_tool";
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
const out = compactSubAgentMessages(msgs, { keepLastTurns: 0 });
|
|
204
|
-
// Every tool message in the output is a compacted stub.
|
|
205
|
-
for (let i = 0; i < out.length; i++) {
|
|
206
|
-
if (out[i]?.role !== "tool")
|
|
207
|
-
continue;
|
|
208
|
-
const parts = out[i].content;
|
|
209
|
-
const tr = parts[0];
|
|
210
|
-
expect(tr.output.value).toMatch(/sub-agent compactor/);
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
it("env override raises threshold → no compaction", () => {
|
|
214
|
-
// The compactor itself doesn't read env (settings.ts does), but verify the
|
|
215
|
-
// option pipeline does what callers expect.
|
|
216
|
-
const msgs = buildHistory(10, 10);
|
|
217
|
-
const out = compactSubAgentMessages(msgs, { thresholdChars: 1_000_000 });
|
|
218
|
-
expect(cumulativeMessageChars(out)).toBe(cumulativeMessageChars(msgs));
|
|
219
|
-
});
|
|
220
|
-
// F2 — envelope counted in threshold
|
|
221
|
-
it("envelopeChars contributes to threshold check (F2)", () => {
|
|
222
|
-
const msgs = buildHistory(2, 5); // only ~10kb of messages
|
|
223
|
-
// Without envelope: well below 80K → no compaction.
|
|
224
|
-
const noEnv = compactSubAgentMessages(msgs);
|
|
225
|
-
expect(cumulativeMessageChars(noEnv)).toBe(cumulativeMessageChars(msgs));
|
|
226
|
-
// With 100K envelope: total > 80K → compactor fires (but only 2 turns
|
|
227
|
-
// means everything is in the keep window, so still no-op).
|
|
228
|
-
const withEnvInput = buildHistory(10, 5);
|
|
229
|
-
for (const m of withEnvInput) {
|
|
230
|
-
if (m.role === "tool" && Array.isArray(m.content)) {
|
|
231
|
-
m.content[0].toolName = "other_tool";
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
const withEnv = compactSubAgentMessages(withEnvInput, {
|
|
235
|
-
thresholdChars: 80_000,
|
|
236
|
-
envelopeChars: 100_000,
|
|
237
|
-
});
|
|
238
|
-
// 10 turns × 5kb ≈ 50K + 100K envelope = 150K → fires; older stubs land.
|
|
239
|
-
let foundStub = false;
|
|
240
|
-
for (const m of withEnv) {
|
|
241
|
-
if (m.role !== "tool" || !Array.isArray(m.content))
|
|
242
|
-
continue;
|
|
243
|
-
for (const p of m.content) {
|
|
244
|
-
if (p.type !== "tool-result")
|
|
245
|
-
continue;
|
|
246
|
-
const o = p.output;
|
|
247
|
-
if (typeof o?.value === "string" && /elided by sub-agent compactor/.test(o.value)) {
|
|
248
|
-
foundStub = true;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
expect(foundStub).toBe(true);
|
|
253
|
-
});
|
|
254
|
-
// F1 (revised, A3 cache-stability) — compaction is IDEMPOTENT.
|
|
255
|
-
//
|
|
256
|
-
// Previously a second pass super-shrank existing stubs further, mutating
|
|
257
|
-
// their content every round. In the agentic loop the compactor runs once
|
|
258
|
-
// per streamText call, so an already-stubbed message changed bytes on every
|
|
259
|
-
// call → the OpenAI prompt-cache prefix churned (forensics: 0% cache hit on
|
|
260
|
-
// calls 1-4, only stabilising by call 5). Terminal stubs let the prefix
|
|
261
|
-
// cache from call 2. The marginal extra shrink is not worth the cache loss.
|
|
262
|
-
it("is idempotent (fixed point) — compacting twice equals once, keeping the cached prefix stable", () => {
|
|
263
|
-
const msgs = buildHistory(12, 10);
|
|
264
|
-
const once = compactSubAgentMessages(msgs);
|
|
265
|
-
const twice = compactSubAgentMessages(once);
|
|
266
|
-
expect(twice).toEqual(once);
|
|
267
|
-
});
|
|
268
|
-
it("does NOT rewrite an already-written stub on re-compaction (terminal stubs)", () => {
|
|
269
|
-
const msgs = buildHistory(12, 10);
|
|
270
|
-
const firstPass = compactSubAgentMessages(msgs);
|
|
271
|
-
const total = cumulativeMessageChars(firstPass);
|
|
272
|
-
// Force another pass with a lower threshold; existing stubs must be byte-identical.
|
|
273
|
-
const secondPass = compactSubAgentMessages(firstPass, { thresholdChars: Math.floor(total / 2) });
|
|
274
|
-
const stubsOf = (arr) => arr
|
|
275
|
-
.flatMap((m) => Array.isArray(m.content)
|
|
276
|
-
? m.content
|
|
277
|
-
.filter((p) => p.type === "tool-result")
|
|
278
|
-
.map((p) => p.output?.value)
|
|
279
|
-
: [])
|
|
280
|
-
.filter((v) => typeof v === "string" && /elided by sub-agent compactor/.test(v));
|
|
281
|
-
// Every stub the first pass produced is present, byte-identical, after re-compaction.
|
|
282
|
-
for (const s of stubsOf(firstPass)) {
|
|
283
|
-
expect(stubsOf(secondPass)).toContain(s);
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
// G1 — context-window-aware threshold
|
|
287
|
-
it("contextWindowTokens overrides char threshold to fire earlier (G1)", () => {
|
|
288
|
-
// 8K window × 0.5 ratio × 4 chars/token = 16K char budget.
|
|
289
|
-
// Build 30K of messages — char-threshold 80K would NOT fire, but the
|
|
290
|
-
// tiny window MUST trigger compaction.
|
|
291
|
-
const msgs = buildHistory(6, 5); // ~30K chars
|
|
292
|
-
// Neutral tool name so high-value heuristic (idea 1) does not force-keep everything.
|
|
293
|
-
for (const m of msgs) {
|
|
294
|
-
if (m.role === "tool" && Array.isArray(m.content)) {
|
|
295
|
-
m.content[0].toolName = "other_tool";
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
const out = compactSubAgentMessages(msgs, {
|
|
299
|
-
thresholdChars: 80_000, // would normally skip
|
|
300
|
-
contextWindowTokens: 8_000,
|
|
301
|
-
contextFillRatio: 0.5,
|
|
302
|
-
});
|
|
303
|
-
// Earlier tool results stubbed.
|
|
304
|
-
let stubbed = 0;
|
|
305
|
-
for (const m of out) {
|
|
306
|
-
if (m.role !== "tool" || !Array.isArray(m.content))
|
|
307
|
-
continue;
|
|
308
|
-
for (const p of m.content) {
|
|
309
|
-
if (p.type !== "tool-result")
|
|
310
|
-
continue;
|
|
311
|
-
const o = p.output;
|
|
312
|
-
if (typeof o?.value === "string" && /elided by sub-agent compactor/.test(o.value)) {
|
|
313
|
-
stubbed += 1;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
expect(stubbed).toBeGreaterThan(0);
|
|
318
|
-
});
|
|
319
|
-
// G2 — dynamic keepLastTurns shrinks when context is near full
|
|
320
|
-
it("shrinks keepLastTurns when context fill ≥ 80% (G2)", () => {
|
|
321
|
-
// Window 8K, message+envelope chars ≈ 7K tokens × 4 = 28K → 0.875 fill.
|
|
322
|
-
// keepLastTurns starts at 5; should drop to 1 → more turns get stubbed.
|
|
323
|
-
const msgs = buildHistory(10, 3); // ~30K chars ≈ 7.5K tokens
|
|
324
|
-
// Neutral tool so high-value (idea 1) does not interfere with dynamic keepLast count.
|
|
325
|
-
for (const m of msgs) {
|
|
326
|
-
if (m.role === "tool" && Array.isArray(m.content)) {
|
|
327
|
-
m.content[0].toolName = "other_tool";
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
const out = compactSubAgentMessages(msgs, {
|
|
331
|
-
thresholdChars: 10_000,
|
|
332
|
-
keepLastTurns: 5,
|
|
333
|
-
contextWindowTokens: 8_000,
|
|
334
|
-
contextFillRatio: 0.3,
|
|
335
|
-
});
|
|
336
|
-
// Count NON-stubbed tool messages (these were kept verbatim).
|
|
337
|
-
let kept = 0;
|
|
338
|
-
for (const m of out) {
|
|
339
|
-
if (m.role !== "tool" || !Array.isArray(m.content))
|
|
340
|
-
continue;
|
|
341
|
-
for (const p of m.content) {
|
|
342
|
-
if (p.type !== "tool-result")
|
|
343
|
-
continue;
|
|
344
|
-
const o = p.output;
|
|
345
|
-
if (typeof o?.value === "string" && !/elided/.test(o.value)) {
|
|
346
|
-
kept += 1;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
// Effective keepLast was 1 (not 5) → only 1 tool result kept verbatim.
|
|
351
|
-
expect(kept).toBe(1);
|
|
352
|
-
});
|
|
353
|
-
// Idea 1: high-value tool results kept verbatim even when older than keepLast
|
|
354
|
-
it("keeps high-value tool results (read_file/grep on src + error/PLAN) verbatim (idea 1)", () => {
|
|
355
|
-
const msgs = buildHistory(8, 4);
|
|
356
|
-
// Force a high-value marker in an early turn (index ~3-4)
|
|
357
|
-
const earlyTool = msgs[3];
|
|
358
|
-
if (earlyTool?.content?.[0]) {
|
|
359
|
-
earlyTool.content[0].output = { type: "text", value: "PLAN.md\nsrc/index.ts\nerror: critical" };
|
|
360
|
-
}
|
|
361
|
-
const out = compactSubAgentMessages(msgs, { thresholdChars: 10_000, keepLastTurns: 2 });
|
|
362
|
-
// The early high-value one should not be stubbed.
|
|
363
|
-
const earlyOut = out[3];
|
|
364
|
-
const val = earlyOut?.content?.[0]?.output?.value || "";
|
|
365
|
-
expect(val).not.toMatch(/elided by .* compactor/);
|
|
366
|
-
});
|
|
367
|
-
// Idea 3: explicit keepToolIds bypasses elision
|
|
368
|
-
it("respects keepToolIds (idea 3) — specific ids kept even if old", () => {
|
|
369
|
-
const msgs = buildHistory(6, 5);
|
|
370
|
-
const targetId = "call_2"; // early turn
|
|
371
|
-
const out = compactSubAgentMessages(msgs, {
|
|
372
|
-
thresholdChars: 10_000,
|
|
373
|
-
keepLastTurns: 1,
|
|
374
|
-
keepToolIds: [targetId],
|
|
375
|
-
});
|
|
376
|
-
let keptExplicit = false;
|
|
377
|
-
for (const m of out) {
|
|
378
|
-
if (m.role !== "tool" || !Array.isArray(m.content))
|
|
379
|
-
continue;
|
|
380
|
-
const tr = m.content[0];
|
|
381
|
-
if (tr?.toolCallId === targetId && typeof tr.output?.value === "string" && !/elided/.test(tr.output.value)) {
|
|
382
|
-
keptExplicit = true;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
expect(keptExplicit).toBe(true);
|
|
386
|
-
});
|
|
387
|
-
it("elides low-value large read_file results while keeping high-value ones", () => {
|
|
388
|
-
// Turn 1: large low-value read_file output (15000 chars of 'x', no ts/src/PLAN/error keywords)
|
|
389
|
-
const lowValueOutput = "x".repeat(15000);
|
|
390
|
-
// Turn 2: large high-value read_file output containing 'error'
|
|
391
|
-
const highValueOutputWithError = "error: failed to load module\n" + "x".repeat(15000);
|
|
392
|
-
// Turn 3: small source file read (5000 chars of 'x' containing 'src/index.ts')
|
|
393
|
-
const highValueSourceOutput = "src/index.ts\n" + "x".repeat(5000);
|
|
394
|
-
const msgs = [
|
|
395
|
-
{ role: "system", content: "You are the agent." },
|
|
396
|
-
{ role: "user", content: "perform task" },
|
|
397
|
-
{
|
|
398
|
-
role: "assistant",
|
|
399
|
-
content: [{ type: "tool-call", toolCallId: "call_low", toolName: "read_file", input: {} }],
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
role: "tool",
|
|
403
|
-
content: [{ type: "tool-result", toolCallId: "call_low", toolName: "read_file", output: { type: "text", value: lowValueOutput } }],
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
role: "assistant",
|
|
407
|
-
content: [{ type: "tool-call", toolCallId: "call_err", toolName: "read_file", input: {} }],
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
role: "tool",
|
|
411
|
-
content: [{ type: "tool-result", toolCallId: "call_err", toolName: "read_file", output: { type: "text", value: highValueOutputWithError } }],
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
role: "assistant",
|
|
415
|
-
content: [{ type: "tool-call", toolCallId: "call_src", toolName: "read_file", input: {} }],
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
role: "tool",
|
|
419
|
-
content: [{ type: "tool-result", toolCallId: "call_src", toolName: "read_file", output: { type: "text", value: highValueSourceOutput } }],
|
|
420
|
-
},
|
|
421
|
-
// Add a couple of low-value turns to push past threshold and keepLast turns (keepLast=1)
|
|
422
|
-
...toolTurn(9, 10),
|
|
423
|
-
];
|
|
424
|
-
// Force low value on the final kept turn
|
|
425
|
-
msgs[msgs.length - 1].content[0].toolName = "other_tool";
|
|
426
|
-
const out = compactSubAgentMessages(msgs, { thresholdChars: 10_000, keepLastTurns: 1 });
|
|
427
|
-
// low-value large read_file MUST be elided
|
|
428
|
-
const lowValMsg = out.find(m => m.role === "tool" && Array.isArray(m.content) && m.content[0]?.toolCallId === "call_low");
|
|
429
|
-
expect((lowValMsg?.content)[0].output.value).toMatch(/elided by sub-agent compactor/);
|
|
430
|
-
// high-value large error read_file MUST NOT be elided
|
|
431
|
-
const errValMsg = out.find(m => m.role === "tool" && Array.isArray(m.content) && m.content[0]?.toolCallId === "call_err");
|
|
432
|
-
expect((errValMsg?.content)[0].output.value).toBe(highValueOutputWithError);
|
|
433
|
-
// high-value small source read_file MUST NOT be elided
|
|
434
|
-
const srcValMsg = out.find(m => m.role === "tool" && Array.isArray(m.content) && m.content[0]?.toolCallId === "call_src");
|
|
435
|
-
expect((srcValMsg?.content)[0].output.value).toBe(highValueSourceOutput);
|
|
436
|
-
});
|
|
437
|
-
it("T1.1 — strips reasoning parts from old assistant turns when stripOldReasoning is enabled", () => {
|
|
438
|
-
// Build history with reasoning parts in assistant messages
|
|
439
|
-
const msgs = [
|
|
440
|
-
{ role: "system", content: "You are an agent." },
|
|
441
|
-
{ role: "user", content: "fix the bug" },
|
|
442
|
-
];
|
|
443
|
-
// Add 6 tool turns with reasoning in assistant messages
|
|
444
|
-
for (let i = 1; i <= 6; i++) {
|
|
445
|
-
msgs.push({
|
|
446
|
-
role: "assistant",
|
|
447
|
-
content: [
|
|
448
|
-
{ type: "reasoning", text: `Thinking about step ${i}... ${"x".repeat(3000)}` },
|
|
449
|
-
{ type: "text", text: `Step ${i} analysis` },
|
|
450
|
-
{ type: "tool-call", toolCallId: `call_${i}`, toolName: "bash", input: `echo ${i}` },
|
|
451
|
-
],
|
|
452
|
-
});
|
|
453
|
-
msgs.push({
|
|
454
|
-
role: "tool",
|
|
455
|
-
content: [
|
|
456
|
-
{ type: "tool-result", toolCallId: `call_${i}`, toolName: "bash", output: { type: "text", value: bigText(`R${i}`, 2) } },
|
|
457
|
-
],
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
const out = compactSubAgentMessages(msgs, {
|
|
461
|
-
thresholdChars: 1000, // force compaction
|
|
462
|
-
keepLastTurns: 2,
|
|
463
|
-
stripOldReasoning: true,
|
|
464
|
-
});
|
|
465
|
-
// Old turns (1-4) should have reasoning stripped
|
|
466
|
-
const oldAssistants = out.filter((m, idx) => m.role === "assistant" && idx < out.length - 4);
|
|
467
|
-
for (const m of oldAssistants) {
|
|
468
|
-
const content = m.content;
|
|
469
|
-
if (!Array.isArray(content))
|
|
470
|
-
continue;
|
|
471
|
-
const hasReasoning = content.some((p) => p.type === "reasoning");
|
|
472
|
-
expect(hasReasoning).toBe(false);
|
|
473
|
-
}
|
|
474
|
-
// Recent turns (last 2) should still have reasoning
|
|
475
|
-
const recentAssistants = out.filter((m, idx) => m.role === "assistant" && idx >= out.length - 4);
|
|
476
|
-
for (const m of recentAssistants) {
|
|
477
|
-
const content = m.content;
|
|
478
|
-
if (!Array.isArray(content))
|
|
479
|
-
continue;
|
|
480
|
-
const hasReasoning = content.some((p) => p.type === "reasoning");
|
|
481
|
-
expect(hasReasoning).toBe(true);
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
it("T1.1 — does NOT strip reasoning when stripOldReasoning is false (default)", () => {
|
|
485
|
-
const msgs = [
|
|
486
|
-
{ role: "system", content: "You are an agent." },
|
|
487
|
-
{ role: "user", content: "fix the bug" },
|
|
488
|
-
];
|
|
489
|
-
for (let i = 1; i <= 4; i++) {
|
|
490
|
-
msgs.push({
|
|
491
|
-
role: "assistant",
|
|
492
|
-
content: [
|
|
493
|
-
{ type: "reasoning", text: `Thinking... ${"x".repeat(3000)}` },
|
|
494
|
-
{ type: "tool-call", toolCallId: `call_${i}`, toolName: "bash", input: `echo ${i}` },
|
|
495
|
-
],
|
|
496
|
-
});
|
|
497
|
-
msgs.push({
|
|
498
|
-
role: "tool",
|
|
499
|
-
content: [
|
|
500
|
-
{ type: "tool-result", toolCallId: `call_${i}`, toolName: "bash", output: { type: "text", value: bigText(`R${i}`, 2) } },
|
|
501
|
-
],
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
const out = compactSubAgentMessages(msgs, {
|
|
505
|
-
thresholdChars: 1000,
|
|
506
|
-
keepLastTurns: 1,
|
|
507
|
-
stripOldReasoning: false, // explicitly off
|
|
508
|
-
});
|
|
509
|
-
// All assistant messages should still have reasoning parts
|
|
510
|
-
const assistants = out.filter((m) => m.role === "assistant");
|
|
511
|
-
for (const m of assistants) {
|
|
512
|
-
const content = m.content;
|
|
513
|
-
if (!Array.isArray(content))
|
|
514
|
-
continue;
|
|
515
|
-
const hasReasoning = content.some((p) => p.type === "reasoning");
|
|
516
|
-
expect(hasReasoning).toBe(true);
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
});
|
|
520
|
-
//# sourceMappingURL=subagent-compactor.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { detectTextEmittedToolCall, parseDsmlToolCalls } from "./text-tool-call-detector.js";
|
|
3
|
-
describe("detectTextEmittedToolCall", () => {
|
|
4
|
-
it("detects the Cline/Roo <read_file><path> dialect (live deepseek failure)", () => {
|
|
5
|
-
// Verbatim shape from storyflow_ui A/B session 905d564dbde4: after a
|
|
6
|
-
// destructive edit, deepseek emitted this as plain assistant text to
|
|
7
|
-
// re-read the file — the CLI returned it as the final answer and the turn
|
|
8
|
-
// was silently wasted with a broken file left behind.
|
|
9
|
-
const text = `Let me restore the file properly.
|
|
10
|
-
|
|
11
|
-
<read_file>
|
|
12
|
-
<path>src/app/screens/story-list/story-list.component.html</path>
|
|
13
|
-
</read_file>`;
|
|
14
|
-
const r = detectTextEmittedToolCall(text);
|
|
15
|
-
expect(r.detected).toBe(true);
|
|
16
|
-
expect(r.tool).toBe("read_file");
|
|
17
|
-
});
|
|
18
|
-
it("detects write_to_file / execute_command / apply_diff blocks", () => {
|
|
19
|
-
expect(detectTextEmittedToolCall("<write_to_file>\n<path>a.ts</path>\n<content>x</content>\n</write_to_file>").detected).toBe(true);
|
|
20
|
-
expect(detectTextEmittedToolCall("<execute_command>\n<command>npm test</command>\n</execute_command>").detected).toBe(true);
|
|
21
|
-
expect(detectTextEmittedToolCall("<apply_diff>\n<path>a.ts</path>\n<diff>...</diff>\n</apply_diff>").detected).toBe(true);
|
|
22
|
-
});
|
|
23
|
-
it("detects an empty-but-closed tool block (open immediately closed)", () => {
|
|
24
|
-
expect(detectTextEmittedToolCall("here:\n<read_file></read_file>").detected).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
it("detects builtin tool names emitted as text (<bash>, <grep>) — live deepseek <bash> leak", () => {
|
|
27
|
-
const r = detectTextEmittedToolCall("Starting:\n<bash>\nfind /workspace -name '*.html'\n</bash>");
|
|
28
|
-
expect(r.detected).toBe(true);
|
|
29
|
-
expect(r.tool).toBe("bash");
|
|
30
|
-
expect(detectTextEmittedToolCall("<grep>\n<pattern>foo</pattern>\n</grep>").detected).toBe(true);
|
|
31
|
-
expect(detectTextEmittedToolCall("<delegate>\n<agent>explore</agent>\n</delegate>").detected).toBe(true);
|
|
32
|
-
});
|
|
33
|
-
it("does NOT fire on a bare inline mention of bash (no invocation shape)", () => {
|
|
34
|
-
expect(detectTextEmittedToolCall("Run the build with the <bash> tool to verify.").detected).toBe(false);
|
|
35
|
-
expect(detectTextEmittedToolCall("I used bash to run the tests; they pass.").detected).toBe(false);
|
|
36
|
-
});
|
|
37
|
-
it("detects generic native wrappers (Qwen <tool_call>, Anthropic <invoke name=>)", () => {
|
|
38
|
-
expect(detectTextEmittedToolCall('<tool_call>{"name":"read_file"}</tool_call>').detected).toBe(true);
|
|
39
|
-
expect(detectTextEmittedToolCall('<invoke name="read_file"><parameter name="path">a</parameter></invoke>').detected).toBe(true);
|
|
40
|
-
expect(detectTextEmittedToolCall("<function_calls>...").detected).toBe(true);
|
|
41
|
-
});
|
|
42
|
-
it("detects the DeepSeek-native DSML leak (│invoke …) and extracts the tool name", () => {
|
|
43
|
-
// Live: storyflow_ui explore-A/B, deepseek T3 (session 799f0508e830) emitted
|
|
44
|
-
// this as text and made no real tool call → empty, silent turn. The generic
|
|
45
|
-
// <invoke matcher misses it because `<` is followed by the U+FF5C sentinel.
|
|
46
|
-
const text = `<│tool_calls>
|
|
47
|
-
<│invoke name="read_file">
|
|
48
|
-
<│parameter name="file_path" string="true">src/app/foo.html</│parameter>
|
|
49
|
-
</│invoke>
|
|
50
|
-
</│tool_calls>`;
|
|
51
|
-
const r = detectTextEmittedToolCall(text);
|
|
52
|
-
expect(r.detected).toBe(true);
|
|
53
|
-
expect(r.tool).toBe("read_file");
|
|
54
|
-
});
|
|
55
|
-
it("detects the newer DeepSeek DSML format with │ DSML │ sentinel (2026-06-23+ leak)", () => {
|
|
56
|
-
// Newer DSML format where the model inserts "DSML" text between bars:
|
|
57
|
-
// <│ DSML │invoke name="read_file">...</│ DSML │invoke>
|
|
58
|
-
const text = `<│tool_calls>
|
|
59
|
-
<│ DSML │invoke name="read_file">
|
|
60
|
-
<│ DSML │parameter name="file_path" string="true">D:\\sources\\Core\\muonroi-cli\\biome.json</│ DSML │parameter>
|
|
61
|
-
</│ DSML │invoke>
|
|
62
|
-
</│tool_calls>`;
|
|
63
|
-
const r = detectTextEmittedToolCall(text);
|
|
64
|
-
expect(r.detected).toBe(true);
|
|
65
|
-
expect(r.tool).toBe("read_file");
|
|
66
|
-
});
|
|
67
|
-
it("detects the double-bar DeepSeek DSML format with || sentinel", () => {
|
|
68
|
-
const text = `<||DSML||tool_calls>
|
|
69
|
-
<||DSML||invoke name="read_file">
|
|
70
|
-
<||DSML||parameter name="file_path" string="true">src/app/foo.html</||DSML||parameter>
|
|
71
|
-
</||DSML||invoke>
|
|
72
|
-
</||DSML||tool_calls>`;
|
|
73
|
-
const r = detectTextEmittedToolCall(text);
|
|
74
|
-
expect(r.detected).toBe(true);
|
|
75
|
-
expect(r.tool).toBe("read_file");
|
|
76
|
-
});
|
|
77
|
-
it("parses double-bar DSML blocks with || DSML || sentinel format", () => {
|
|
78
|
-
const text = `<||DSML||invoke name="read_file">
|
|
79
|
-
<||DSML||parameter name="file_path" string="true">src/app/foo.html</||DSML||parameter>
|
|
80
|
-
</||DSML||invoke>`;
|
|
81
|
-
const calls = parseDsmlToolCalls(text);
|
|
82
|
-
expect(calls).toHaveLength(1);
|
|
83
|
-
expect(calls[0].name).toBe("read_file");
|
|
84
|
-
expect(calls[0].args.file_path).toBe("src/app/foo.html");
|
|
85
|
-
});
|
|
86
|
-
it("parses DSML blocks with │ DSML │ sentinel format", () => {
|
|
87
|
-
const text = `<│ DSML │invoke name="read_file">
|
|
88
|
-
<│ DSML │parameter name="file_path" string="true">src/app.ts</│ DSML │parameter>
|
|
89
|
-
</│ DSML │invoke>`;
|
|
90
|
-
const calls = parseDsmlToolCalls(text);
|
|
91
|
-
expect(calls).toHaveLength(1);
|
|
92
|
-
expect(calls[0].name).toBe("read_file");
|
|
93
|
-
expect(calls[0].args.file_path).toBe("src/app.ts");
|
|
94
|
-
});
|
|
95
|
-
it("does NOT fire on a bare inline mention of a tool name (no invocation shape)", () => {
|
|
96
|
-
// Precision: a prose mention must not be flagged — it would wrongly mark a
|
|
97
|
-
// legitimate final answer as a broken tool call.
|
|
98
|
-
expect(detectTextEmittedToolCall("Use the <read_file> tool to view the source.").detected).toBe(false);
|
|
99
|
-
expect(detectTextEmittedToolCall("The read_file and edit_file tools handle this.").detected).toBe(false);
|
|
100
|
-
expect(detectTextEmittedToolCall("I edited the file and ran the tests; everything passes.").detected).toBe(false);
|
|
101
|
-
});
|
|
102
|
-
it("parseDsmlToolCalls extracts name + args from the DSML block (for targeted re-steer)", () => {
|
|
103
|
-
const text = `<│tool_calls>
|
|
104
|
-
<│invoke name="read_file">
|
|
105
|
-
<│parameter name="file_path" string="true">src/app/foo.html</│parameter>
|
|
106
|
-
<│parameter name="start_line" string="false">25</│parameter>
|
|
107
|
-
</│invoke>
|
|
108
|
-
</│tool_calls>`;
|
|
109
|
-
const calls = parseDsmlToolCalls(text);
|
|
110
|
-
expect(calls).toHaveLength(1);
|
|
111
|
-
expect(calls[0].name).toBe("read_file");
|
|
112
|
-
expect(calls[0].args.file_path).toBe("src/app/foo.html");
|
|
113
|
-
expect(calls[0].args.start_line).toBe("25");
|
|
114
|
-
});
|
|
115
|
-
it("parseDsmlToolCalls handles multiple invoke blocks and returns [] for non-DSML text", () => {
|
|
116
|
-
const text = `<│invoke name="read_file"><│parameter name="file_path">a.ts</│parameter></│invoke><│invoke name="edit_file"><│parameter name="path">b.ts</│parameter></│invoke>`;
|
|
117
|
-
const calls = parseDsmlToolCalls(text);
|
|
118
|
-
expect(calls.map((c) => c.name)).toEqual(["read_file", "edit_file"]);
|
|
119
|
-
expect(parseDsmlToolCalls("just a normal answer")).toEqual([]);
|
|
120
|
-
});
|
|
121
|
-
it("does NOT fire on ordinary prose / code answers", () => {
|
|
122
|
-
expect(detectTextEmittedToolCall("Final number: 16").detected).toBe(false);
|
|
123
|
-
expect(detectTextEmittedToolCall("```ts\nconst a = readFile(path);\n```").detected).toBe(false);
|
|
124
|
-
expect(detectTextEmittedToolCall("").detected).toBe(false);
|
|
125
|
-
// Angular template with self-closing/nested tags must not match a tool tag.
|
|
126
|
-
expect(detectTextEmittedToolCall('<span *ngIf="!story.cover" class="placeholder">{{ title }}</span>').detected).toBe(false);
|
|
127
|
-
});
|
|
128
|
-
it("detects and parses Gemini-style ASCII DSML leak with spaces and standard pipes", () => {
|
|
129
|
-
const text = `Tôi cần xác nhận ecosystem có những extension gì trước khi sửa - không đoán, phải đọc source thật.
|
|
130
|
-
|
|
131
|
-
< | | DSML | | tool_calls>
|
|
132
|
-
< | | DSML | | invoke name="mcp_filesystem__search_files">
|
|
133
|
-
< | | DSML | | parameter name="pattern" string="true">Serilog</ | | DSML | | parameter>
|
|
134
|
-
< | | DSML | | parameter name="path" string="true">D:\\sources\\Core\\muonroi-building-block\\src</ | | DSML | | parameter>
|
|
135
|
-
</ | | DSML | | invoke>
|
|
136
|
-
</ | | DSML | | tool_calls>`;
|
|
137
|
-
const r = detectTextEmittedToolCall(text);
|
|
138
|
-
expect(r.detected).toBe(true);
|
|
139
|
-
expect(r.tool).toBe("mcp_filesystem__search_files");
|
|
140
|
-
const calls = parseDsmlToolCalls(text);
|
|
141
|
-
expect(calls).toHaveLength(1);
|
|
142
|
-
expect(calls[0].name).toBe("mcp_filesystem__search_files");
|
|
143
|
-
expect(calls[0].args.pattern).toBe("Serilog");
|
|
144
|
-
expect(calls[0].args.path).toBe("D:\\sources\\Core\\muonroi-building-block\\src");
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
//# sourceMappingURL=text-tool-call-detector.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|