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
|
@@ -326,22 +326,25 @@ function rewriteOlderToolMessage(msg, previewChars, label, keepToolIds, persistA
|
|
|
326
326
|
export function compactSubAgentMessages(messages, opts = {}) {
|
|
327
327
|
const resolved = resolveOpts(opts);
|
|
328
328
|
const { outputPreviewChars, label, envelopeChars } = resolved;
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
|
|
329
|
+
// Step 4: Hard-limit message history sent to the model to prevent token bloating
|
|
330
|
+
// When input (messages + envelope) exceeds 50K characters and messages array is > 30,
|
|
331
|
+
// we slice the history to keep at most 30 messages (preserving system and user start).
|
|
332
|
+
let processedMessages = messages;
|
|
333
333
|
const messagesTotal = cumulativeMessageChars(messages);
|
|
334
334
|
const total = messagesTotal + envelopeChars;
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
335
|
+
if (total > 50_000 && messages.length > 30) {
|
|
336
|
+
processedMessages = sliceMessageHistory(messages, 30);
|
|
337
|
+
}
|
|
338
|
+
// Calculate effective thresholds and keep last turns using the processed messages
|
|
339
|
+
const processedMessagesTotal = cumulativeMessageChars(processedMessages);
|
|
340
|
+
const processedTotal = processedMessagesTotal + envelopeChars;
|
|
341
|
+
const { effectiveThresholdChars, effectiveKeepLastTurns } = computeDynamicParams(processedTotal, resolved);
|
|
339
342
|
// No-op: return the input BY REFERENCE (contract above) so `compacted === input`.
|
|
340
|
-
if (
|
|
341
|
-
return
|
|
342
|
-
const keepFrom = findKeepFromIndex(
|
|
343
|
+
if (processedTotal < effectiveThresholdChars)
|
|
344
|
+
return processedMessages;
|
|
345
|
+
const keepFrom = findKeepFromIndex(processedMessages, effectiveKeepLastTurns);
|
|
343
346
|
if (keepFrom <= 0)
|
|
344
|
-
return
|
|
347
|
+
return processedMessages;
|
|
345
348
|
// Walk older messages; rewrite fresh tool results into stubs, super-shrink
|
|
346
349
|
// already-stubbed results (F1), and strip args off older assistant
|
|
347
350
|
// tool-call shells (F1). The 1:1 assistant↔tool pairing required by the AI
|
|
@@ -349,8 +352,8 @@ export function compactSubAgentMessages(messages, opts = {}) {
|
|
|
349
352
|
// structure or count.
|
|
350
353
|
let firstUserSeen = false;
|
|
351
354
|
const out = [];
|
|
352
|
-
for (let i = 0; i <
|
|
353
|
-
const msg =
|
|
355
|
+
for (let i = 0; i < processedMessages.length; i++) {
|
|
356
|
+
const msg = processedMessages[i];
|
|
354
357
|
if (i >= keepFrom) {
|
|
355
358
|
out.push(msg);
|
|
356
359
|
continue;
|
|
@@ -497,4 +500,52 @@ export function applyAnthropicPromptCaching(messages, modelId) {
|
|
|
497
500
|
newMessages[lastIndex] = lastMsg;
|
|
498
501
|
return newMessages;
|
|
499
502
|
}
|
|
503
|
+
/**
|
|
504
|
+
* Safely slice message history to keep at most `maxMessages` messages.
|
|
505
|
+
* Preserves the system message(s) at the front and ensures that the slice
|
|
506
|
+
* starts with a "user" message and does not split assistant tool calls and
|
|
507
|
+
* corresponding tool results.
|
|
508
|
+
*/
|
|
509
|
+
export function sliceMessageHistory(messages, maxMessages = 30) {
|
|
510
|
+
if (messages.length <= maxMessages)
|
|
511
|
+
return messages;
|
|
512
|
+
// Find all user message indices (excluding system messages)
|
|
513
|
+
const userIndices = [];
|
|
514
|
+
for (let idx = 0; idx < messages.length; idx++) {
|
|
515
|
+
if (messages[idx]?.role === "user") {
|
|
516
|
+
userIndices.push(idx);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if (userIndices.length === 0) {
|
|
520
|
+
return messages;
|
|
521
|
+
}
|
|
522
|
+
// Group messages into turns.
|
|
523
|
+
// Each turn is a range [start, end] inclusive.
|
|
524
|
+
const turns = [];
|
|
525
|
+
for (let idx = 0; idx < userIndices.length; idx++) {
|
|
526
|
+
const start = userIndices[idx];
|
|
527
|
+
const end = idx + 1 < userIndices.length ? userIndices[idx + 1] - 1 : messages.length - 1;
|
|
528
|
+
turns.push({ start, end });
|
|
529
|
+
}
|
|
530
|
+
// Accumulate turns from the end, up to maxMessages
|
|
531
|
+
let keptMessagesCount = 0;
|
|
532
|
+
let keepFromIndex = -1;
|
|
533
|
+
for (let idx = turns.length - 1; idx >= 0; idx--) {
|
|
534
|
+
const turn = turns[idx];
|
|
535
|
+
const turnLength = turn.end - turn.start + 1;
|
|
536
|
+
if (keptMessagesCount === 0 || keptMessagesCount + turnLength <= maxMessages) {
|
|
537
|
+
keptMessagesCount += turnLength;
|
|
538
|
+
keepFromIndex = turn.start;
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
if (keepFromIndex === -1) {
|
|
545
|
+
return messages;
|
|
546
|
+
}
|
|
547
|
+
const kept = messages.slice(keepFromIndex);
|
|
548
|
+
const systemMessages = messages.filter((m) => m.role === "system");
|
|
549
|
+
return [...systemMessages, ...kept];
|
|
550
|
+
}
|
|
500
551
|
//# sourceMappingURL=subagent-compactor.js.map
|
|
@@ -21,6 +21,7 @@ import type { TurnRunnerDepsBase } from "./turn-runner-deps.js";
|
|
|
21
21
|
* subsequent turns). Method callbacks delegate to Agent private methods.
|
|
22
22
|
*/
|
|
23
23
|
export interface MessageProcessorDeps extends TurnRunnerDepsBase {
|
|
24
|
+
readonly isSubSession?: boolean;
|
|
24
25
|
/** Live messageSeqs array (mutated by push; parallel to messages). */
|
|
25
26
|
readonly messageSeqs: Array<number | null>;
|
|
26
27
|
/** Session bookkeeping. */
|
|
@@ -75,6 +76,7 @@ export interface MessageProcessorDeps extends TurnRunnerDepsBase {
|
|
|
75
76
|
setMessages(messages: ModelMessage[]): void;
|
|
76
77
|
requireProvider(): LegacyProvider;
|
|
77
78
|
emitSubagentStatus(status: SubagentStatus | null): void;
|
|
79
|
+
consultParentSession?: (question: string) => Promise<string>;
|
|
78
80
|
fireHook(input: unknown, signal?: AbortSignal): Promise<{
|
|
79
81
|
blocked: boolean;
|
|
80
82
|
blockingErrors: Array<{
|
|
@@ -76,6 +76,7 @@ import { visionToolsNeeded } from "../tools/vision-gate.js";
|
|
|
76
76
|
import { recordTurnTrace } from "../ui/slash/debug.js";
|
|
77
77
|
import { statusBarStore } from "../ui/status-bar/store.js";
|
|
78
78
|
import { appendDecisionLog } from "../usage/decision-log.js";
|
|
79
|
+
import { logger } from "../utils/logger.js";
|
|
79
80
|
import { openUrl } from "../utils/open-url.js";
|
|
80
81
|
import { appendAudit, toolNeedsApproval } from "../utils/permission-mode.js";
|
|
81
82
|
import { getAutoCouncilConfidence, getAutoCouncilMinRoles, getProviderStallRetries, getProviderStallTimeoutMs, getRoleModels, getSteerInjectionEnabled, getTopLevelCompactKeepLast, getTopLevelCompactThresholdChars, getTopLevelToolBudgetChars, isAutoCouncilEnabled, loadMcpServers, } from "../utils/settings.js";
|
|
@@ -86,7 +87,7 @@ import { humanizeApiError, isAuthenticationError, isContextLimitError, summarize
|
|
|
86
87
|
import { buildGroundingFootnote, findUnverifiedClaims } from "./grounding-check.js";
|
|
87
88
|
import { buildInterruptedTurnNote } from "./interrupted-turn.js";
|
|
88
89
|
import { stableCallId } from "./pending-calls.js";
|
|
89
|
-
import { buildMcpCapabilityBlock } from "./prompts.js";
|
|
90
|
+
import { buildMcpCapabilityBlock, MAX_LLM_CALLS_PER_TURN, } from "./prompts.js";
|
|
90
91
|
import { extractProviderOptionsShape } from "./provider-options-shape.js";
|
|
91
92
|
import { wrapToolSetWithReadBudget } from "./read-path-budget.js";
|
|
92
93
|
import { containsEncryptedReasoning, sanitizeModelMessages } from "./reasoning.js";
|
|
@@ -194,7 +195,7 @@ export function rewriteSafetyApprovedToolResults(messages) {
|
|
|
194
195
|
}
|
|
195
196
|
import { stripDsmlMarkup } from "./message-processor.js";
|
|
196
197
|
export async function* executeToolEngine(args) {
|
|
197
|
-
let { deps, stepRouterPhase, phase2Runtime, runtime, modelInfo, _debugSteps, _ceilingHit, userMessage, pilCtx, turnModelId, turnProvider, _stepCeiling, userModelMessage, userEnrichedMessage, signal, observer, taskHash, provider, system, routerStore, attemptedOverflowRecovery, patternLoopForceHalt, userWriteAheadSeq, streamRetryCount, MAX_STREAM_RETRIES, subagents, systemParts, playwrightGuidance, _hasResponseTools, _pilResponseTools, patternLoopInjectCount, agentLoopDecisionCount, MAX_AGENT_LOOP_DECISIONS, _naturalCeiling, _ceilingTaskType, _ceilingSize, textToolReSteerCount, MAX_TEXT_TOOL_RESTEER, turnStartMs, _debugOn, _debugTurnId, _pilEnrichmentDeltaSnapshot, isChitchat, } = args;
|
|
198
|
+
let { deps, stepRouterPhase, phase2Runtime, runtime, modelInfo, _debugSteps, _ceilingHit, userMessage, pilCtx, turnModelId, turnProvider, _stepCeiling, userModelMessage, userEnrichedMessage, signal, observer, taskHash, provider, system, routerStore, attemptedOverflowRecovery, patternLoopForceHalt, userWriteAheadSeq, streamRetryCount, MAX_STREAM_RETRIES, subagents, systemParts, toolTurnSystem, playwrightGuidance, _hasResponseTools, _pilResponseTools, patternLoopInjectCount, agentLoopDecisionCount, MAX_AGENT_LOOP_DECISIONS, _naturalCeiling, _ceilingTaskType, _ceilingSize, textToolReSteerCount, MAX_TEXT_TOOL_RESTEER, turnStartMs, _debugOn, _debugTurnId, _pilEnrichmentDeltaSnapshot, isChitchat, } = args;
|
|
198
199
|
// Put all extracted code here:
|
|
199
200
|
let stallTriggered = false;
|
|
200
201
|
// Time-to-first-byte stall RE-PROMPT: some providers (observed:
|
|
@@ -219,6 +220,11 @@ export async function* executeToolEngine(args) {
|
|
|
219
220
|
// Bounded by the same maxStallRetries cap so a persistently-dead provider
|
|
220
221
|
// still falls through to the partial-answer rescue.
|
|
221
222
|
let midLoopStallRetryCount = 0;
|
|
223
|
+
// F3c — per-turn LLM call cap: counts every streamText() invocation
|
|
224
|
+
// (tool round-trip, stall re-prompt, stream retry) and hard-aborts
|
|
225
|
+
// the turn when exceeded. Prevents the session 526a83cf22df pattern
|
|
226
|
+
// where 3 user messages burnt 82% of 2.44M tokens in 36 LLM calls.
|
|
227
|
+
let llmCallsThisTurn = 0;
|
|
222
228
|
// Live-queue steering: messages the user typed mid-turn are drained at a
|
|
223
229
|
// prepareStep boundary and accumulated here, then re-appended (deduped) to
|
|
224
230
|
// the messages returned for each subsequent step. Loop-persistent so they
|
|
@@ -395,7 +401,7 @@ export async function* executeToolEngine(args) {
|
|
|
395
401
|
});
|
|
396
402
|
}
|
|
397
403
|
catch (emitErr) {
|
|
398
|
-
|
|
404
|
+
logger.error("orchestrator", "stall-reprompt telemetry failed", { error: emitErr });
|
|
399
405
|
}
|
|
400
406
|
try {
|
|
401
407
|
if (deps.session) {
|
|
@@ -411,7 +417,7 @@ export async function* executeToolEngine(args) {
|
|
|
411
417
|
}
|
|
412
418
|
}
|
|
413
419
|
catch (logErr) {
|
|
414
|
-
|
|
420
|
+
logger.error("orchestrator", "stall-reprompt log failed", { error: logErr });
|
|
415
421
|
}
|
|
416
422
|
return backoffMs;
|
|
417
423
|
};
|
|
@@ -434,11 +440,19 @@ export async function* executeToolEngine(args) {
|
|
|
434
440
|
let _pendingStructuredResponse = null;
|
|
435
441
|
let _pendingStructuredResponseLen = -1;
|
|
436
442
|
try {
|
|
443
|
+
const { getDatabase } = await import("../storage/db.js");
|
|
444
|
+
const db = getDatabase();
|
|
445
|
+
const row = db.prepare("SELECT parent_session_id FROM sessions WHERE id = ?").get(deps.session.id);
|
|
446
|
+
const isSubSession = !!row?.parent_session_id;
|
|
447
|
+
let contextWindow = modelInfo?.contextWindow || 0;
|
|
448
|
+
if (isSubSession && contextWindow > 0) {
|
|
449
|
+
contextWindow = Math.min(45000, contextWindow);
|
|
450
|
+
}
|
|
437
451
|
const settings = attemptedOverflowRecovery
|
|
438
|
-
? relaxCompactionSettings(deps.getCompactionSettings(
|
|
439
|
-
: deps.getCompactionSettings(
|
|
440
|
-
if (
|
|
441
|
-
await deps.compactForContext(provider, system,
|
|
452
|
+
? relaxCompactionSettings(deps.getCompactionSettings(contextWindow))
|
|
453
|
+
: deps.getCompactionSettings(contextWindow);
|
|
454
|
+
if (contextWindow) {
|
|
455
|
+
await deps.compactForContext(provider, system, contextWindow, signal, settings, attemptedOverflowRecovery);
|
|
442
456
|
}
|
|
443
457
|
// Vision-tool gate: for vision-proxy (text-only) models the registry
|
|
444
458
|
// adds 3 image tools (~500-700 tok) on every turn. Drop them when the
|
|
@@ -457,6 +471,7 @@ export async function* executeToolEngine(args) {
|
|
|
457
471
|
listDelegations: () => deps.listDelegations(),
|
|
458
472
|
modelId: turnModelId,
|
|
459
473
|
includeVisionTools,
|
|
474
|
+
consultParentSession: deps.consultParentSession,
|
|
460
475
|
});
|
|
461
476
|
// Top-level cumulative cap state. We accumulate the raw tool set
|
|
462
477
|
// (base + MCP + PIL response tools) across the assembly below,
|
|
@@ -532,7 +547,7 @@ export async function* executeToolEngine(args) {
|
|
|
532
547
|
});
|
|
533
548
|
}
|
|
534
549
|
catch (err) {
|
|
535
|
-
|
|
550
|
+
logger.error("mcp", "buildMcpToolSet failed, proceeding with builtins only", { error: err });
|
|
536
551
|
}
|
|
537
552
|
if (mcpBundle) {
|
|
538
553
|
closeMcp = mcpBundle.close;
|
|
@@ -596,7 +611,7 @@ export async function* executeToolEngine(args) {
|
|
|
596
611
|
// Apply the top-level cumulative cap once over the fully-assembled
|
|
597
612
|
// raw tool set. State is per-turn; each turn gets a fresh budget.
|
|
598
613
|
const topLevelCap = wrapToolSetWithCap(rawToolSet, {
|
|
599
|
-
maxCumulativeChars: getTopLevelToolBudgetChars(),
|
|
614
|
+
maxCumulativeChars: getTopLevelToolBudgetChars(deps.maxToolRounds),
|
|
600
615
|
midTierRatio: 0.5,
|
|
601
616
|
highTierRatio: 0.8,
|
|
602
617
|
label: "top-level",
|
|
@@ -669,9 +684,12 @@ export async function* executeToolEngine(args) {
|
|
|
669
684
|
// cheap-model cost) layered UNDER the tool-use playbook so the
|
|
670
685
|
// CRITICAL tool rules stay at the very front. Both fixed per turn, so
|
|
671
686
|
// they stay inside the cached prefix.
|
|
687
|
+
// F3c — tool-turn: use reduced system prompt (skip
|
|
688
|
+
// native-capabilities + skills already shown in first call).
|
|
689
|
+
const activeSystem = llmCallsThisTurn > 0 && toolTurnSystem ? toolTurnSystem : system;
|
|
672
690
|
const systemWithWorkbook = shouldInjectCheapModelWorkbook(runtime.modelInfo)
|
|
673
|
-
? injectCheapModelWorkbook(
|
|
674
|
-
:
|
|
691
|
+
? injectCheapModelWorkbook(activeSystem, pilCtx.taskType)
|
|
692
|
+
: activeSystem;
|
|
675
693
|
const systemWithPlaybook = shouldInjectCheapModelPlaybook(runtime.modelInfo)
|
|
676
694
|
? injectCheapModelPlaybook(systemWithWorkbook)
|
|
677
695
|
: systemWithWorkbook;
|
|
@@ -761,6 +779,8 @@ export async function* executeToolEngine(args) {
|
|
|
761
779
|
// stepCountIs(maxToolRounds) fires and the user sees the TUI freeze
|
|
762
780
|
// (session 7dcf8fd7d6a4 hit exactly 100 rounds → looked like a crash).
|
|
763
781
|
let _lastFinishReason = null;
|
|
782
|
+
// F3b — track hard cap hit for visible toast after stream ends.
|
|
783
|
+
let _hardCapHit = false;
|
|
764
784
|
// Phase B4: compact older tool_result parts before each top-level
|
|
765
785
|
// step once cumulative message chars exceed the configured threshold.
|
|
766
786
|
// The compactor preserves system + first user verbatim and keeps the
|
|
@@ -864,7 +884,7 @@ export async function* executeToolEngine(args) {
|
|
|
864
884
|
}
|
|
865
885
|
}
|
|
866
886
|
catch (err) {
|
|
867
|
-
|
|
887
|
+
logger.error("orchestrator", "loop auto-decision failed", { error: err });
|
|
868
888
|
}
|
|
869
889
|
}
|
|
870
890
|
return deps.askToolLoopContinue ? await deps.askToolLoopContinue(info) : "stop";
|
|
@@ -910,6 +930,14 @@ export async function* executeToolEngine(args) {
|
|
|
910
930
|
// _ceilingHit and _ceilingHitAtStep are kept for telemetry: a
|
|
911
931
|
// crossing event is logged for forensics, but no action is taken.
|
|
912
932
|
const dynamicStopWhen = (async (state) => {
|
|
933
|
+
// F3b — HARD cap: absolute non-bumpable ceiling per user turn.
|
|
934
|
+
// Fires AFTER the soft cap (maxToolRounds) has been bumped by the
|
|
935
|
+
// user. Prevents runaway sessions (session 526a83cf22df: 16 LLM
|
|
936
|
+
// calls for a single user message, 2.44M total input tokens).
|
|
937
|
+
if (state.steps.length > deps.hardMaxToolRounds) {
|
|
938
|
+
_hardCapHit = true;
|
|
939
|
+
return true;
|
|
940
|
+
}
|
|
913
941
|
// Terminal response tool: a `respond_*` call IS the model's final
|
|
914
942
|
// structured answer (its `execute` is identity — the payload lives
|
|
915
943
|
// in the tool-call args). `shouldHaltOnResponseTool` decides if the
|
|
@@ -1007,6 +1035,17 @@ export async function* executeToolEngine(args) {
|
|
|
1007
1035
|
const stall = createStallWatchdog(getProviderStallTimeoutMs(), () => {
|
|
1008
1036
|
stallTriggered = true;
|
|
1009
1037
|
});
|
|
1038
|
+
// F3c — hard-cap LLM calls per turn before this streamText()
|
|
1039
|
+
if (++llmCallsThisTurn > MAX_LLM_CALLS_PER_TURN) {
|
|
1040
|
+
stall.dispose();
|
|
1041
|
+
yield {
|
|
1042
|
+
type: "error",
|
|
1043
|
+
content: `Turn aborted: reached the limit of ${MAX_LLM_CALLS_PER_TURN} LLM calls for this message. Try a narrower request or break your task into smaller steps.`,
|
|
1044
|
+
isAuthError: false,
|
|
1045
|
+
};
|
|
1046
|
+
yield { type: "done" };
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1010
1049
|
const result = streamText({
|
|
1011
1050
|
model: runtime.model,
|
|
1012
1051
|
system: systemForModel,
|
|
@@ -1022,12 +1061,18 @@ export async function* executeToolEngine(args) {
|
|
|
1022
1061
|
// See src/orchestrator/tool-args-repair.ts for the transforms.
|
|
1023
1062
|
experimental_repairToolCall: repairToolCallHook,
|
|
1024
1063
|
prepareStep: ({ stepNumber: sn, messages: stepMessages }) => {
|
|
1025
|
-
// A new step's provider request is about to go out — reset the
|
|
1026
|
-
// per-step chunk counter. Fires after the previous step's chunks
|
|
1027
|
-
// were counted (prepareStep runs post tool-execution), so if THIS
|
|
1028
|
-
// step's request wedges before any byte, chunksThisStep stays 0 and
|
|
1029
|
-
// the mid-loop dead-socket continuation can safely resume from here.
|
|
1030
1064
|
chunksThisStep = 0;
|
|
1065
|
+
if (deps.isSubSession) {
|
|
1066
|
+
logger.info("orchestrator", "Sub-session executing tool round", {
|
|
1067
|
+
stepNumber: sn,
|
|
1068
|
+
maxToolRounds: deps.maxToolRounds,
|
|
1069
|
+
});
|
|
1070
|
+
deps.emitSubagentStatus({
|
|
1071
|
+
agent: "sub-session",
|
|
1072
|
+
description: `Running sub-session task...`,
|
|
1073
|
+
detail: `[Sub-Session] Executing tool round ${sn + 1} of ${deps.maxToolRounds}...`,
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1031
1076
|
// --- Live-queue steering injection ---------------------------
|
|
1032
1077
|
// Drain the UI steer queue ONCE per prepareStep call (sn >= 1),
|
|
1033
1078
|
// accumulate into pendingSteers, and graft pendingSteers onto the
|
|
@@ -1058,7 +1103,7 @@ export async function* executeToolEngine(args) {
|
|
|
1058
1103
|
});
|
|
1059
1104
|
}
|
|
1060
1105
|
catch (emitErr) {
|
|
1061
|
-
|
|
1106
|
+
logger.error("orchestrator", "steer-inject telemetry failed", { error: emitErr });
|
|
1062
1107
|
}
|
|
1063
1108
|
}
|
|
1064
1109
|
const baseRes = (() => {
|
|
@@ -1338,7 +1383,7 @@ export async function* executeToolEngine(args) {
|
|
|
1338
1383
|
});
|
|
1339
1384
|
}
|
|
1340
1385
|
catch (err) {
|
|
1341
|
-
|
|
1386
|
+
logger.error("orchestrator", "failed to emit llm-done", { error: err });
|
|
1342
1387
|
}
|
|
1343
1388
|
deps.setCurrentCallId("");
|
|
1344
1389
|
// Rec #1 persisted forensics: onFinish fires once per top-level turn,
|
|
@@ -1349,7 +1394,7 @@ export async function* executeToolEngine(args) {
|
|
|
1349
1394
|
persistSessionExperience(deps.session?.id ?? null, getSessionExperienceCounts());
|
|
1350
1395
|
}
|
|
1351
1396
|
catch (err) {
|
|
1352
|
-
|
|
1397
|
+
logger.error("orchestrator", "persistSessionExperience failed", { error: err });
|
|
1353
1398
|
}
|
|
1354
1399
|
},
|
|
1355
1400
|
});
|
|
@@ -2749,6 +2794,15 @@ export async function* executeToolEngine(args) {
|
|
|
2749
2794
|
catch {
|
|
2750
2795
|
/* fail-open */
|
|
2751
2796
|
}
|
|
2797
|
+
// F3b — surface hard-cap stop (absolute ceiling, cannot be bumped).
|
|
2798
|
+
if (_hardCapHit) {
|
|
2799
|
+
yield {
|
|
2800
|
+
type: "content",
|
|
2801
|
+
content: `\n\n[Hard limit reached: Agent hit the absolute step ceiling of ${deps.hardMaxToolRounds} steps. ` +
|
|
2802
|
+
`This turn cannot continue — too many LLM round-trips. ` +
|
|
2803
|
+
`Start a new turn or break your task into smaller steps.]\n`,
|
|
2804
|
+
};
|
|
2805
|
+
}
|
|
2752
2806
|
// Surface the round-cap stop so the user knows why the agent halted
|
|
2753
2807
|
// (session 7dcf8fd7d6a4 hit stepCountIs(100) silently, looked like a
|
|
2754
2808
|
// crash). AI SDK reports finishReason='tool-calls' when the step cap
|
|
@@ -3075,5 +3129,10 @@ export async function* executeToolEngine(args) {
|
|
|
3075
3129
|
catch (err) {
|
|
3076
3130
|
throw err;
|
|
3077
3131
|
}
|
|
3132
|
+
finally {
|
|
3133
|
+
if (deps.isSubSession) {
|
|
3134
|
+
deps.emitSubagentStatus(null);
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3078
3137
|
}
|
|
3079
3138
|
//# sourceMappingURL=tool-engine.js.map
|
|
@@ -23,6 +23,8 @@ export interface TurnRunnerDepsBase {
|
|
|
23
23
|
readonly bash: BashTool;
|
|
24
24
|
readonly mode: AgentMode;
|
|
25
25
|
readonly maxToolRounds: number;
|
|
26
|
+
/** Absolute non-bumpable ceiling per turn — fires after the user bumps past maxToolRounds. */
|
|
27
|
+
readonly hardMaxToolRounds: number;
|
|
26
28
|
readonly schedules: import("../tools/schedule.js").ScheduleManager;
|
|
27
29
|
readonly sendTelegramFile: ((filePath: string) => Promise<ToolResult>) | null;
|
|
28
30
|
getCompactedThisTurn(): boolean;
|
|
@@ -76,3 +76,14 @@ export type LlmClassifyFn = (prompt: string, signal?: AbortSignal) => Promise<Ll
|
|
|
76
76
|
* fail-open (keep prior taskType, do not block the turn).
|
|
77
77
|
*/
|
|
78
78
|
export declare function createLlmClassifier(factory: ProviderFactory, modelId: string): LlmClassifyFn;
|
|
79
|
+
export type SubSessionAction = "DIRECT_ANSWER" | "ROTATE_SESSION" | "SPAWN_SUB_SESSION";
|
|
80
|
+
export interface SubSessionRouteResult {
|
|
81
|
+
action: SubSessionAction;
|
|
82
|
+
confidence: number;
|
|
83
|
+
reason: string;
|
|
84
|
+
}
|
|
85
|
+
export declare function classifySubSessionActionHeuristic(prompt: string): SubSessionRouteResult | null;
|
|
86
|
+
export declare function classifySubSessionAction(factory: ProviderFactory, modelId: string, prompt: string, contextInfo?: {
|
|
87
|
+
currentChars: number;
|
|
88
|
+
threshold: number;
|
|
89
|
+
}, signal?: AbortSignal): Promise<SubSessionRouteResult | null>;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* DeepSeek Flash). Timeout 2500ms — bails fast if the model stalls.
|
|
14
14
|
*/
|
|
15
15
|
import { streamText } from "ai";
|
|
16
|
+
import { getModelByTier, getModelInfo } from "../models/registry.js";
|
|
16
17
|
import { getProviderCapabilities } from "../providers/capabilities.js";
|
|
17
18
|
import { resolveModelRuntime } from "../providers/runtime.js";
|
|
18
19
|
const LLM_CLASSIFY_TIMEOUT_MS = 2500;
|
|
@@ -271,4 +272,196 @@ export function createLlmClassifier(factory, modelId) {
|
|
|
271
272
|
}
|
|
272
273
|
};
|
|
273
274
|
}
|
|
275
|
+
export function classifySubSessionActionHeuristic(prompt) {
|
|
276
|
+
const trimmed = prompt.trim().toLowerCase();
|
|
277
|
+
if (!trimmed)
|
|
278
|
+
return null;
|
|
279
|
+
// Strip trailing punctuation for list-based matching so "hello!" and "cảm ơn!"
|
|
280
|
+
// still hit the static lists instead of falling through to the LLM classifier.
|
|
281
|
+
const stripped = trimmed.replace(/[!?.…,;:]+$/g, "").trim();
|
|
282
|
+
// 1. Simple math equations (exact matches like "2+2", "1 + 1")
|
|
283
|
+
if (/^\d+\s*[+\-*/]\s*\d+$/.test(trimmed)) {
|
|
284
|
+
return {
|
|
285
|
+
action: "DIRECT_ANSWER",
|
|
286
|
+
confidence: 0.99,
|
|
287
|
+
reason: "Obvious input classified via heuristic (simple math)",
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
// 2. Greetings (exact matches only, trailing punctuation stripped)
|
|
291
|
+
const greetings = [
|
|
292
|
+
"hi",
|
|
293
|
+
"hello",
|
|
294
|
+
"hey",
|
|
295
|
+
"chào",
|
|
296
|
+
"xin chào",
|
|
297
|
+
"hi there",
|
|
298
|
+
"hello there",
|
|
299
|
+
"chào bạn",
|
|
300
|
+
"halo",
|
|
301
|
+
"hola",
|
|
302
|
+
"bạn ơi",
|
|
303
|
+
];
|
|
304
|
+
if (greetings.includes(stripped)) {
|
|
305
|
+
return {
|
|
306
|
+
action: "DIRECT_ANSWER",
|
|
307
|
+
confidence: 0.99,
|
|
308
|
+
reason: "Obvious input classified via heuristic (greeting)",
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
// 3. Thanks (exact matches only, trailing punctuation stripped)
|
|
312
|
+
const thanks = [
|
|
313
|
+
"thanks",
|
|
314
|
+
"thank you",
|
|
315
|
+
"cảm ơn",
|
|
316
|
+
"cám ơn",
|
|
317
|
+
"thank",
|
|
318
|
+
"thx",
|
|
319
|
+
"ty",
|
|
320
|
+
"cảm ơn bạn",
|
|
321
|
+
"cám ơn bạn",
|
|
322
|
+
"cảm ơn nhé",
|
|
323
|
+
"cám ơn nhé",
|
|
324
|
+
];
|
|
325
|
+
if (thanks.includes(stripped)) {
|
|
326
|
+
return {
|
|
327
|
+
action: "DIRECT_ANSWER",
|
|
328
|
+
confidence: 0.99,
|
|
329
|
+
reason: "Obvious input classified via heuristic (thanks)",
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
// 4. Help (exact matches only, trailing punctuation stripped)
|
|
333
|
+
const help = ["help", "hướng dẫn", "cứu", "help me"];
|
|
334
|
+
if (help.includes(stripped)) {
|
|
335
|
+
return {
|
|
336
|
+
action: "DIRECT_ANSWER",
|
|
337
|
+
confidence: 0.99,
|
|
338
|
+
reason: "Obvious input classified via heuristic (help)",
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
// 5. Short conversational words / acknowledgements (exact matches only, trailing punctuation stripped)
|
|
342
|
+
const conversation = [
|
|
343
|
+
"ok",
|
|
344
|
+
"okay",
|
|
345
|
+
"yes",
|
|
346
|
+
"no",
|
|
347
|
+
"vâng",
|
|
348
|
+
"dạ",
|
|
349
|
+
"ừ",
|
|
350
|
+
"chắc thế",
|
|
351
|
+
"ừm",
|
|
352
|
+
"umm",
|
|
353
|
+
"cool",
|
|
354
|
+
"nice",
|
|
355
|
+
"perfect",
|
|
356
|
+
"done",
|
|
357
|
+
"xong",
|
|
358
|
+
"yep",
|
|
359
|
+
"yup",
|
|
360
|
+
"nah",
|
|
361
|
+
"fine",
|
|
362
|
+
"tốt",
|
|
363
|
+
"được",
|
|
364
|
+
"okie",
|
|
365
|
+
];
|
|
366
|
+
if (conversation.includes(stripped)) {
|
|
367
|
+
return {
|
|
368
|
+
action: "DIRECT_ANSWER",
|
|
369
|
+
confidence: 0.99,
|
|
370
|
+
reason: "Obvious input classified via heuristic (acknowledgement)",
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
const ROUTER_SYSTEM_PROMPT = "You are a routing controller for an AI coding agent. Your goal is to decide the execution strategy for the user's prompt based on the conversation history and metadata.\n\n" +
|
|
376
|
+
"Analyze the user's prompt and select one of the following ACTIONS:\n" +
|
|
377
|
+
'- "DIRECT_ANSWER": The prompt is informational, a quick question, a code review, an explanation, greeting, or thanks. No file creation/modification, test execution, or multi-turn tool runs are needed.\n' +
|
|
378
|
+
'- "ROTATE_SESSION": The user is starting a completely new topic or task unrelated to the active discussion (e.g. "let\'s switch to writing a python script", "forget the previous bug, show me how to..."). OR, if the session size (metadata) exceeds the rotation threshold and the active task is completed or the prompt starts a new focus, choose ROTATE_SESSION to prune/summarize the context.\n' +
|
|
379
|
+
'- "SPAWN_SUB_SESSION": The user wants to execute a multi-step task (e.g. "write tests for X and debug it", "refactor the storage layer", "implement feature Y", "fix all compile errors"). This requires running multiple tools (file edits, bash commands, searches).\n\n' +
|
|
380
|
+
"Response format: Reply with exactly one comma-separated line containing:\n" +
|
|
381
|
+
"<ACTION>,<CONFIDENCE>,<REASON>\n\n" +
|
|
382
|
+
"Examples:\n" +
|
|
383
|
+
'- "DIRECT_ANSWER,0.95,Simple explanation of how the DB migration works."\n' +
|
|
384
|
+
'- "ROTATE_SESSION,0.90,Complete shift to a different project/language."\n' +
|
|
385
|
+
'- "ROTATE_SESSION,0.95,Session size exceeds threshold and current request starts a new task."\n' +
|
|
386
|
+
'- "SPAWN_SUB_SESSION,0.98,Requires writing a test suite and fixing multiple files to get it green."\n' +
|
|
387
|
+
"No other text, only the comma-separated line.";
|
|
388
|
+
export async function classifySubSessionAction(factory, modelId, prompt, contextInfo, signal) {
|
|
389
|
+
if (process.env.MUONROI_DISABLE_HEURISTIC_ROUTING !== "1") {
|
|
390
|
+
const heuristic = classifySubSessionActionHeuristic(prompt);
|
|
391
|
+
if (heuristic)
|
|
392
|
+
return heuristic;
|
|
393
|
+
}
|
|
394
|
+
const controller = new AbortController();
|
|
395
|
+
let timer;
|
|
396
|
+
try {
|
|
397
|
+
// Zero-hardcode: query models catalog for a cheap fast-tier model under the same provider.
|
|
398
|
+
const info = getModelInfo(modelId);
|
|
399
|
+
const provider = info?.provider;
|
|
400
|
+
const fastModel = provider ? getModelByTier("fast", provider) || getModelByTier("balanced", provider) : undefined;
|
|
401
|
+
const classificationModelId = fastModel?.id ?? modelId;
|
|
402
|
+
const runtime = resolveModelRuntime(factory, classificationModelId);
|
|
403
|
+
const isReasoning = runtime.modelInfo?.reasoning === true;
|
|
404
|
+
timer = setTimeout(() => controller.abort(), isReasoning ? REASONING_CLASSIFY_TIMEOUT_MS : LLM_CLASSIFY_TIMEOUT_MS);
|
|
405
|
+
const combinedSignal = signal
|
|
406
|
+
? (AbortSignal.any?.([signal, controller.signal]) ?? controller.signal)
|
|
407
|
+
: controller.signal;
|
|
408
|
+
const dropMaxTokens = runtime.unsupportedParams?.includes("maxOutputTokens") === true;
|
|
409
|
+
const maxOut = isReasoning ? REASONING_MAX_OUTPUT_TOKENS : NONREASONING_MAX_OUTPUT_TOKENS;
|
|
410
|
+
let providerOptions = runtime.providerOptions;
|
|
411
|
+
if (isReasoning && runtime.modelInfo?.supportsReasoningEffort && runtime.modelInfo.provider) {
|
|
412
|
+
const lowEffort = getProviderCapabilities(runtime.modelInfo.provider).buildProviderOptions({
|
|
413
|
+
model: runtime.model,
|
|
414
|
+
reasoningEffort: "low",
|
|
415
|
+
});
|
|
416
|
+
providerOptions = mergeProviderOptions(runtime.providerOptions, lowEffort);
|
|
417
|
+
}
|
|
418
|
+
let promptWithContext = prompt.slice(0, 1000);
|
|
419
|
+
if (contextInfo) {
|
|
420
|
+
promptWithContext =
|
|
421
|
+
`[SESSION METADATA]\n` +
|
|
422
|
+
`Current session size: ${contextInfo.currentChars} characters.\n` +
|
|
423
|
+
`Rotation threshold: ${contextInfo.threshold} characters.\n\n` +
|
|
424
|
+
`[USER PROMPT]\n${promptWithContext}`;
|
|
425
|
+
}
|
|
426
|
+
const result = streamText({
|
|
427
|
+
model: runtime.model,
|
|
428
|
+
abortSignal: combinedSignal,
|
|
429
|
+
system: ROUTER_SYSTEM_PROMPT,
|
|
430
|
+
prompt: promptWithContext,
|
|
431
|
+
...(dropMaxTokens ? {} : { maxOutputTokens: maxOut }),
|
|
432
|
+
...(providerOptions ? { providerOptions } : {}),
|
|
433
|
+
});
|
|
434
|
+
let text = "";
|
|
435
|
+
let reasoningText = "";
|
|
436
|
+
for await (const part of result.fullStream) {
|
|
437
|
+
if (part.type === "text-delta")
|
|
438
|
+
text += part.textDelta ?? part.text ?? "";
|
|
439
|
+
else if (part.type === "reasoning-delta")
|
|
440
|
+
reasoningText += part.textDelta ?? part.text ?? "";
|
|
441
|
+
}
|
|
442
|
+
const rawResult = text.trim() || reasoningText.trim();
|
|
443
|
+
if (!rawResult)
|
|
444
|
+
return null;
|
|
445
|
+
const clean = rawResult.replace(/[`*"]/g, "").trim();
|
|
446
|
+
const firstLine = clean.split(/\r?\n/)[0] ?? "";
|
|
447
|
+
const parts = firstLine.split(",");
|
|
448
|
+
if (parts.length < 2)
|
|
449
|
+
return null;
|
|
450
|
+
const action = parts[0].trim().toUpperCase();
|
|
451
|
+
const confidence = Number(parts[1].trim()) || 0.8;
|
|
452
|
+
const reason = parts.slice(2).join(",").trim() || "No reason given";
|
|
453
|
+
if (action === "DIRECT_ANSWER" || action === "ROTATE_SESSION" || action === "SPAWN_SUB_SESSION") {
|
|
454
|
+
return { action, confidence, reason };
|
|
455
|
+
}
|
|
456
|
+
return null;
|
|
457
|
+
}
|
|
458
|
+
catch (err) {
|
|
459
|
+
console.error(`[pil.llm-classify] classifySubSessionAction failed: ${err?.message}`);
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
finally {
|
|
463
|
+
if (timer)
|
|
464
|
+
clearTimeout(timer);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
274
467
|
//# sourceMappingURL=llm-classify.js.map
|