agent-nuvira 3.3.12 → 3.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -1
- package/dist/agents/agents/planner.d.ts.map +1 -1
- package/dist/agents/agents/planner.js +9 -0
- package/dist/agents/agents/planner.js.map +1 -1
- package/dist/agents/agents/reasoner.d.ts.map +1 -1
- package/dist/agents/agents/reasoner.js +13 -0
- package/dist/agents/agents/reasoner.js.map +1 -1
- package/dist/agents/orchestrator.d.ts +31 -0
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +103 -135
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/cli/chat.d.ts +89 -0
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +798 -39
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/cli-program.d.ts.map +1 -1
- package/dist/cli/cli-program.js +20 -0
- package/dist/cli/cli-program.js.map +1 -1
- package/dist/cli/config.d.ts +12 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +107 -3
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/decisions.d.ts +28 -0
- package/dist/cli/decisions.d.ts.map +1 -0
- package/dist/cli/decisions.js +140 -0
- package/dist/cli/decisions.js.map +1 -0
- package/dist/cli/doctor.d.ts +6 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +46 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/execute.d.ts.map +1 -1
- package/dist/cli/execute.js +6 -0
- package/dist/cli/execute.js.map +1 -1
- package/dist/cli/failover-runner.d.ts.map +1 -1
- package/dist/cli/failover-runner.js +19 -1
- package/dist/cli/failover-runner.js.map +1 -1
- package/dist/cli/feedback.d.ts.map +1 -1
- package/dist/cli/feedback.js +5 -1
- package/dist/cli/feedback.js.map +1 -1
- package/dist/cli/hooks.d.ts +30 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +224 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/knowledge.d.ts +31 -0
- package/dist/cli/knowledge.d.ts.map +1 -0
- package/dist/cli/knowledge.js +223 -0
- package/dist/cli/knowledge.js.map +1 -0
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +92 -18
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/model.d.ts +20 -0
- package/dist/cli/model.d.ts.map +1 -1
- package/dist/cli/model.js +294 -14
- package/dist/cli/model.js.map +1 -1
- package/dist/cli/omniroute-control.d.ts +88 -0
- package/dist/cli/omniroute-control.d.ts.map +1 -0
- package/dist/cli/omniroute-control.js +179 -0
- package/dist/cli/omniroute-control.js.map +1 -0
- package/dist/cli/omniroute.d.ts +21 -0
- package/dist/cli/omniroute.d.ts.map +1 -0
- package/dist/cli/omniroute.js +67 -0
- package/dist/cli/omniroute.js.map +1 -0
- package/dist/cli/rate.d.ts +78 -0
- package/dist/cli/rate.d.ts.map +1 -0
- package/dist/cli/rate.js +294 -0
- package/dist/cli/rate.js.map +1 -0
- package/dist/config/process-env.d.ts.map +1 -1
- package/dist/config/process-env.js +10 -0
- package/dist/config/process-env.js.map +1 -1
- package/dist/config/types.d.ts +8 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/context/history.d.ts +21 -0
- package/dist/context/history.d.ts.map +1 -1
- package/dist/context/history.js +50 -0
- package/dist/context/history.js.map +1 -1
- package/dist/enterprise/vault.d.ts.map +1 -1
- package/dist/enterprise/vault.js +5 -21
- package/dist/enterprise/vault.js.map +1 -1
- package/dist/gateway/hook-contract.d.ts +206 -0
- package/dist/gateway/hook-contract.d.ts.map +1 -0
- package/dist/gateway/hook-contract.js +449 -0
- package/dist/gateway/hook-contract.js.map +1 -0
- package/dist/gateway/hooks.d.ts.map +1 -1
- package/dist/gateway/hooks.js +14 -0
- package/dist/gateway/hooks.js.map +1 -1
- package/dist/inference/gemini-adapter.d.ts.map +1 -1
- package/dist/inference/gemini-adapter.js +4 -0
- package/dist/inference/gemini-adapter.js.map +1 -1
- package/dist/inference/interface.d.ts +54 -0
- package/dist/inference/interface.d.ts.map +1 -1
- package/dist/inference/model-id-validation.d.ts +57 -0
- package/dist/inference/model-id-validation.d.ts.map +1 -0
- package/dist/inference/model-id-validation.js +127 -0
- package/dist/inference/model-id-validation.js.map +1 -0
- package/dist/inference/native-tools.d.ts +16 -1
- package/dist/inference/native-tools.d.ts.map +1 -1
- package/dist/inference/native-tools.js +34 -10
- package/dist/inference/native-tools.js.map +1 -1
- package/dist/inference/openai-compat-adapter.d.ts.map +1 -1
- package/dist/inference/openai-compat-adapter.js +12 -1
- package/dist/inference/openai-compat-adapter.js.map +1 -1
- package/dist/inference/provider-catalog.d.ts +11 -0
- package/dist/inference/provider-catalog.d.ts.map +1 -1
- package/dist/inference/provider-catalog.js +80 -0
- package/dist/inference/provider-catalog.js.map +1 -1
- package/dist/inference/route-resolver.d.ts +32 -8
- package/dist/inference/route-resolver.d.ts.map +1 -1
- package/dist/inference/route-resolver.js +175 -1
- package/dist/inference/route-resolver.js.map +1 -1
- package/dist/inference/tool-call-utils.d.ts.map +1 -1
- package/dist/inference/tool-call-utils.js +10 -8
- package/dist/inference/tool-call-utils.js.map +1 -1
- package/dist/inference/tools.d.ts +17 -1
- package/dist/inference/tools.d.ts.map +1 -1
- package/dist/inference/tools.js +69 -19
- package/dist/inference/tools.js.map +1 -1
- package/dist/learning/acceptance-model.d.ts +247 -0
- package/dist/learning/acceptance-model.d.ts.map +1 -0
- package/dist/learning/acceptance-model.js +708 -0
- package/dist/learning/acceptance-model.js.map +1 -0
- package/dist/learning/auto-router.d.ts +121 -24
- package/dist/learning/auto-router.d.ts.map +1 -1
- package/dist/learning/auto-router.js +374 -96
- package/dist/learning/auto-router.js.map +1 -1
- package/dist/learning/autonomy-policy.d.ts +12 -16
- package/dist/learning/autonomy-policy.d.ts.map +1 -1
- package/dist/learning/autonomy-policy.js +50 -48
- package/dist/learning/autonomy-policy.js.map +1 -1
- package/dist/learning/behavioural-labels.d.ts +86 -0
- package/dist/learning/behavioural-labels.d.ts.map +1 -0
- package/dist/learning/behavioural-labels.js +166 -0
- package/dist/learning/behavioural-labels.js.map +1 -0
- package/dist/learning/capability-evidence.d.ts +167 -0
- package/dist/learning/capability-evidence.d.ts.map +1 -0
- package/dist/learning/capability-evidence.js +210 -0
- package/dist/learning/capability-evidence.js.map +1 -0
- package/dist/learning/capability-readiness.d.ts +64 -0
- package/dist/learning/capability-readiness.d.ts.map +1 -0
- package/dist/learning/capability-readiness.js +74 -0
- package/dist/learning/capability-readiness.js.map +1 -0
- package/dist/learning/capability-types.d.ts +169 -0
- package/dist/learning/capability-types.d.ts.map +1 -0
- package/dist/learning/capability-types.js +20 -0
- package/dist/learning/capability-types.js.map +1 -0
- package/dist/learning/catalog-feed.d.ts +89 -0
- package/dist/learning/catalog-feed.d.ts.map +1 -0
- package/dist/learning/catalog-feed.js +211 -0
- package/dist/learning/catalog-feed.js.map +1 -0
- package/dist/learning/cli-intent-effects.d.ts +60 -0
- package/dist/learning/cli-intent-effects.d.ts.map +1 -0
- package/dist/learning/cli-intent-effects.js +153 -0
- package/dist/learning/cli-intent-effects.js.map +1 -0
- package/dist/learning/command-adaptation.d.ts +41 -0
- package/dist/learning/command-adaptation.d.ts.map +1 -0
- package/dist/learning/command-adaptation.js +122 -0
- package/dist/learning/command-adaptation.js.map +1 -0
- package/dist/learning/consent-picture.d.ts +42 -0
- package/dist/learning/consent-picture.d.ts.map +1 -0
- package/dist/learning/consent-picture.js +53 -0
- package/dist/learning/consent-picture.js.map +1 -0
- package/dist/learning/context-budget.d.ts +37 -6
- package/dist/learning/context-budget.d.ts.map +1 -1
- package/dist/learning/context-budget.js +38 -9
- package/dist/learning/context-budget.js.map +1 -1
- package/dist/learning/decision-log.d.ts +114 -0
- package/dist/learning/decision-log.d.ts.map +1 -0
- package/dist/learning/decision-log.js +296 -0
- package/dist/learning/decision-log.js.map +1 -0
- package/dist/learning/deliverable-class.d.ts.map +1 -1
- package/dist/learning/deliverable-class.js +19 -0
- package/dist/learning/deliverable-class.js.map +1 -1
- package/dist/learning/deliverable-corpus.d.ts +117 -0
- package/dist/learning/deliverable-corpus.d.ts.map +1 -0
- package/dist/learning/deliverable-corpus.js +176 -0
- package/dist/learning/deliverable-corpus.js.map +1 -0
- package/dist/learning/error-repair.d.ts +45 -2
- package/dist/learning/error-repair.d.ts.map +1 -1
- package/dist/learning/error-repair.js +95 -0
- package/dist/learning/error-repair.js.map +1 -1
- package/dist/learning/exhaustion-report.d.ts +136 -0
- package/dist/learning/exhaustion-report.d.ts.map +1 -0
- package/dist/learning/exhaustion-report.js +239 -0
- package/dist/learning/exhaustion-report.js.map +1 -0
- package/dist/learning/failure-bookkeeping.d.ts +16 -0
- package/dist/learning/failure-bookkeeping.d.ts.map +1 -1
- package/dist/learning/failure-bookkeeping.js +51 -5
- package/dist/learning/failure-bookkeeping.js.map +1 -1
- package/dist/learning/gate-friction.d.ts +39 -0
- package/dist/learning/gate-friction.d.ts.map +1 -0
- package/dist/learning/gate-friction.js +91 -0
- package/dist/learning/gate-friction.js.map +1 -0
- package/dist/learning/harness-narration.d.ts +34 -0
- package/dist/learning/harness-narration.d.ts.map +1 -0
- package/dist/learning/harness-narration.js +58 -0
- package/dist/learning/harness-narration.js.map +1 -0
- package/dist/learning/hub-skill-catalog.d.ts.map +1 -1
- package/dist/learning/hub-skill-catalog.js +1 -2
- package/dist/learning/hub-skill-catalog.js.map +1 -1
- package/dist/learning/hybrid-router.d.ts +65 -0
- package/dist/learning/hybrid-router.d.ts.map +1 -1
- package/dist/learning/hybrid-router.js +186 -0
- package/dist/learning/hybrid-router.js.map +1 -1
- package/dist/learning/knowledge-base.d.ts +350 -0
- package/dist/learning/knowledge-base.d.ts.map +1 -0
- package/dist/learning/knowledge-base.js +906 -0
- package/dist/learning/knowledge-base.js.map +1 -0
- package/dist/learning/knowledge-eval.d.ts +171 -0
- package/dist/learning/knowledge-eval.d.ts.map +1 -0
- package/dist/learning/knowledge-eval.js +196 -0
- package/dist/learning/knowledge-eval.js.map +1 -0
- package/dist/learning/knowledge-turn.d.ts +92 -0
- package/dist/learning/knowledge-turn.d.ts.map +1 -0
- package/dist/learning/knowledge-turn.js +190 -0
- package/dist/learning/knowledge-turn.js.map +1 -0
- package/dist/learning/learned-commands.d.ts +64 -0
- package/dist/learning/learned-commands.d.ts.map +1 -0
- package/dist/learning/learned-commands.js +108 -0
- package/dist/learning/learned-commands.js.map +1 -0
- package/dist/learning/lexical-search.d.ts +50 -0
- package/dist/learning/lexical-search.d.ts.map +1 -0
- package/dist/learning/lexical-search.js +111 -0
- package/dist/learning/lexical-search.js.map +1 -0
- package/dist/learning/machine-facts.d.ts +71 -0
- package/dist/learning/machine-facts.d.ts.map +1 -0
- package/dist/learning/machine-facts.js +164 -0
- package/dist/learning/machine-facts.js.map +1 -0
- package/dist/learning/markdown-outline.d.ts +73 -0
- package/dist/learning/markdown-outline.d.ts.map +1 -0
- package/dist/learning/markdown-outline.js +136 -0
- package/dist/learning/markdown-outline.js.map +1 -0
- package/dist/learning/model-first-router.d.ts +33 -1
- package/dist/learning/model-first-router.d.ts.map +1 -1
- package/dist/learning/model-first-router.js +123 -9
- package/dist/learning/model-first-router.js.map +1 -1
- package/dist/learning/model-identity.d.ts +80 -0
- package/dist/learning/model-identity.d.ts.map +1 -0
- package/dist/learning/model-identity.js +115 -0
- package/dist/learning/model-identity.js.map +1 -0
- package/dist/learning/model-registry.d.ts +141 -2
- package/dist/learning/model-registry.d.ts.map +1 -1
- package/dist/learning/model-registry.js +324 -38
- package/dist/learning/model-registry.js.map +1 -1
- package/dist/learning/model-scoring.d.ts.map +1 -1
- package/dist/learning/model-scoring.js +8 -1
- package/dist/learning/model-scoring.js.map +1 -1
- package/dist/learning/model-selection.d.ts +2 -1
- package/dist/learning/model-selection.d.ts.map +1 -1
- package/dist/learning/model-selection.js +76 -2
- package/dist/learning/model-selection.js.map +1 -1
- package/dist/learning/outcome-observation.d.ts +49 -0
- package/dist/learning/outcome-observation.d.ts.map +1 -0
- package/dist/learning/outcome-observation.js +95 -0
- package/dist/learning/outcome-observation.js.map +1 -0
- package/dist/learning/pair-entitlement.d.ts +184 -0
- package/dist/learning/pair-entitlement.d.ts.map +1 -0
- package/dist/learning/pair-entitlement.js +214 -0
- package/dist/learning/pair-entitlement.js.map +1 -0
- package/dist/learning/project-docs.d.ts +83 -0
- package/dist/learning/project-docs.d.ts.map +1 -0
- package/dist/learning/project-docs.js +132 -0
- package/dist/learning/project-docs.js.map +1 -0
- package/dist/learning/provider-fallback.d.ts +23 -1
- package/dist/learning/provider-fallback.d.ts.map +1 -1
- package/dist/learning/provider-fallback.js +24 -0
- package/dist/learning/provider-fallback.js.map +1 -1
- package/dist/learning/quota-ledger.d.ts +13 -0
- package/dist/learning/quota-ledger.d.ts.map +1 -1
- package/dist/learning/quota-ledger.js +28 -0
- package/dist/learning/quota-ledger.js.map +1 -1
- package/dist/learning/reasoning-trace.d.ts +65 -1
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js +123 -1
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/requirement-probe.d.ts +55 -0
- package/dist/learning/requirement-probe.d.ts.map +1 -0
- package/dist/learning/requirement-probe.js +77 -0
- package/dist/learning/requirement-probe.js.map +1 -0
- package/dist/learning/resilient-call.d.ts +20 -1
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +42 -4
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/learning/response-usability.d.ts +85 -0
- package/dist/learning/response-usability.d.ts.map +1 -0
- package/dist/learning/response-usability.js +135 -0
- package/dist/learning/response-usability.js.map +1 -0
- package/dist/learning/router-bandit.d.ts +132 -0
- package/dist/learning/router-bandit.d.ts.map +1 -1
- package/dist/learning/router-bandit.js +253 -0
- package/dist/learning/router-bandit.js.map +1 -1
- package/dist/learning/routing-history.d.ts +41 -2
- package/dist/learning/routing-history.d.ts.map +1 -1
- package/dist/learning/routing-history.js.map +1 -1
- package/dist/learning/run-trace.d.ts +21 -0
- package/dist/learning/run-trace.d.ts.map +1 -1
- package/dist/learning/run-trace.js +38 -0
- package/dist/learning/run-trace.js.map +1 -1
- package/dist/learning/seeded-benchmark.d.ts +14 -0
- package/dist/learning/seeded-benchmark.d.ts.map +1 -1
- package/dist/learning/seeded-benchmark.js +43 -4
- package/dist/learning/seeded-benchmark.js.map +1 -1
- package/dist/learning/session-grant.d.ts +75 -0
- package/dist/learning/session-grant.d.ts.map +1 -0
- package/dist/learning/session-grant.js +112 -0
- package/dist/learning/session-grant.js.map +1 -0
- package/dist/learning/task-model-continuity.d.ts +73 -0
- package/dist/learning/task-model-continuity.d.ts.map +1 -0
- package/dist/learning/task-model-continuity.js +87 -0
- package/dist/learning/task-model-continuity.js.map +1 -0
- package/dist/learning/turn-feedback.d.ts +93 -0
- package/dist/learning/turn-feedback.d.ts.map +1 -0
- package/dist/learning/turn-feedback.js +127 -0
- package/dist/learning/turn-feedback.js.map +1 -0
- package/dist/learning/turn-report.d.ts +104 -2
- package/dist/learning/turn-report.d.ts.map +1 -1
- package/dist/learning/turn-report.js +161 -6
- package/dist/learning/turn-report.js.map +1 -1
- package/dist/learning/verdict-routing.d.ts +51 -0
- package/dist/learning/verdict-routing.d.ts.map +1 -0
- package/dist/learning/verdict-routing.js +122 -0
- package/dist/learning/verdict-routing.js.map +1 -0
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +5 -0
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/manager.d.ts +10 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +20 -0
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/mcp-discovery.d.ts +34 -0
- package/dist/mcp/mcp-discovery.d.ts.map +1 -0
- package/dist/mcp/mcp-discovery.js +71 -0
- package/dist/mcp/mcp-discovery.js.map +1 -0
- package/dist/mcp/mcp-schema-cache.d.ts +17 -0
- package/dist/mcp/mcp-schema-cache.d.ts.map +1 -1
- package/dist/mcp/mcp-schema-cache.js +47 -3
- package/dist/mcp/mcp-schema-cache.js.map +1 -1
- package/dist/mcp/types.d.ts +28 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/security/secret-scan.d.ts +156 -0
- package/dist/security/secret-scan.d.ts.map +1 -0
- package/dist/security/secret-scan.js +525 -0
- package/dist/security/secret-scan.js.map +1 -0
- package/dist/tools/ask-user.d.ts.map +1 -1
- package/dist/tools/ask-user.js +4 -0
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/capability-registry.d.ts +150 -0
- package/dist/tools/capability-registry.d.ts.map +1 -0
- package/dist/tools/capability-registry.js +400 -0
- package/dist/tools/capability-registry.js.map +1 -0
- package/dist/tools/child-agent-runtime.d.ts.map +1 -1
- package/dist/tools/child-agent-runtime.js +19 -5
- package/dist/tools/child-agent-runtime.js.map +1 -1
- package/dist/tools/coding-tools.d.ts +17 -5
- package/dist/tools/coding-tools.d.ts.map +1 -1
- package/dist/tools/coding-tools.js +80 -11
- package/dist/tools/coding-tools.js.map +1 -1
- package/dist/tools/command-memo.d.ts +116 -0
- package/dist/tools/command-memo.d.ts.map +1 -0
- package/dist/tools/command-memo.js +202 -0
- package/dist/tools/command-memo.js.map +1 -0
- package/dist/tools/git-tool.d.ts.map +1 -1
- package/dist/tools/git-tool.js +13 -3
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/tools/harness-directive.d.ts +42 -0
- package/dist/tools/harness-directive.d.ts.map +1 -0
- package/dist/tools/harness-directive.js +45 -0
- package/dist/tools/harness-directive.js.map +1 -0
- package/dist/tools/loop-skill-hint.d.ts +74 -174
- package/dist/tools/loop-skill-hint.d.ts.map +1 -1
- package/dist/tools/loop-skill-hint.js +110 -536
- package/dist/tools/loop-skill-hint.js.map +1 -1
- package/dist/tools/mcp-client-tool.d.ts +2 -0
- package/dist/tools/mcp-client-tool.d.ts.map +1 -1
- package/dist/tools/mcp-client-tool.js +3 -0
- package/dist/tools/mcp-client-tool.js.map +1 -1
- package/dist/tools/modality/shared.d.ts +1 -4
- package/dist/tools/modality/shared.d.ts.map +1 -1
- package/dist/tools/modality/shared.js +7 -22
- package/dist/tools/modality/shared.js.map +1 -1
- package/dist/tools/plan-store.d.ts +44 -4
- package/dist/tools/plan-store.d.ts.map +1 -1
- package/dist/tools/plan-store.js +93 -9
- package/dist/tools/plan-store.js.map +1 -1
- package/dist/tools/registry.d.ts +76 -3
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +623 -15
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/remediation-ladder.d.ts +91 -0
- package/dist/tools/remediation-ladder.d.ts.map +1 -0
- package/dist/tools/remediation-ladder.js +316 -0
- package/dist/tools/remediation-ladder.js.map +1 -0
- package/dist/tools/run-cli.d.ts.map +1 -1
- package/dist/tools/run-cli.js +29 -4
- package/dist/tools/run-cli.js.map +1 -1
- package/dist/tools/run-terminal.d.ts +11 -0
- package/dist/tools/run-terminal.d.ts.map +1 -1
- package/dist/tools/run-terminal.js +289 -10
- package/dist/tools/run-terminal.js.map +1 -1
- package/dist/tools/skills-hub.d.ts +7 -0
- package/dist/tools/skills-hub.d.ts.map +1 -1
- package/dist/tools/skills-hub.js +11 -2
- package/dist/tools/skills-hub.js.map +1 -1
- package/dist/tools/step-artifact.d.ts +35 -0
- package/dist/tools/step-artifact.d.ts.map +1 -0
- package/dist/tools/step-artifact.js +154 -0
- package/dist/tools/step-artifact.js.map +1 -0
- package/dist/tools/tool-loop.d.ts +327 -13
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +891 -66
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/tools/toolsets.js +4 -4
- package/dist/tools/toolsets.js.map +1 -1
- package/dist/tools/worktree.d.ts +11 -2
- package/dist/tools/worktree.d.ts.map +1 -1
- package/dist/tools/worktree.js +11 -2
- package/dist/tools/worktree.js.map +1 -1
- package/dist/utils/atomic-store.d.ts +53 -0
- package/dist/utils/atomic-store.d.ts.map +1 -0
- package/dist/utils/atomic-store.js +178 -0
- package/dist/utils/atomic-store.js.map +1 -0
- package/dist/utils/binary-probe.d.ts +25 -0
- package/dist/utils/binary-probe.d.ts.map +1 -0
- package/dist/utils/binary-probe.js +48 -0
- package/dist/utils/binary-probe.js.map +1 -0
- package/dist/utils/workspace-path.d.ts +50 -0
- package/dist/utils/workspace-path.d.ts.map +1 -0
- package/dist/utils/workspace-path.js +86 -0
- package/dist/utils/workspace-path.js.map +1 -0
- package/dist/web-dashboard/chat-console.d.ts +24 -0
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +38 -0
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/project-context.d.ts +27 -2
- package/dist/web-dashboard/project-context.d.ts.map +1 -1
- package/dist/web-dashboard/project-context.js +32 -2
- package/dist/web-dashboard/project-context.js.map +1 -1
- package/dist/web-dashboard/server.d.ts +40 -0
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +733 -15
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +236 -1
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/dist/web-dashboard/workspace-guard.d.ts +18 -2
- package/dist/web-dashboard/workspace-guard.d.ts.map +1 -1
- package/dist/web-dashboard/workspace-guard.js +94 -12
- package/dist/web-dashboard/workspace-guard.js.map +1 -1
- package/dist/web-dashboard/workspace-resolution.d.ts +87 -0
- package/dist/web-dashboard/workspace-resolution.d.ts.map +1 -0
- package/dist/web-dashboard/workspace-resolution.js +105 -0
- package/dist/web-dashboard/workspace-resolution.js.map +1 -0
- package/package.json +1 -1
- package/src/web-dashboard/public/assets/index-tK8Y2qHB.css +1 -0
- package/src/web-dashboard/public/assets/index-zjbdJnO-.js +210 -0
- package/src/web-dashboard/public/assets/index-zjbdJnO-.js.map +1 -0
- package/src/web-dashboard/public/index.html +2 -2
- package/src/web-dashboard/public/assets/index-BrZcYhy6.js +0 -207
- package/src/web-dashboard/public/assets/index-BrZcYhy6.js.map +0 -1
- package/src/web-dashboard/public/assets/index-DsWczTa6.css +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Step artifacts — a step that names a FILE is not done until that file exists.
|
|
3
|
+
*
|
|
4
|
+
* WHY (A6). A plan is a claim about the future, and marking a step `done` is a
|
|
5
|
+
* claim about the past. On the `cal` Android run the plan included producing an
|
|
6
|
+
* APK; the build failed, but nothing tied the step's DONE state to the artifact
|
|
7
|
+
* it named, so the checklist could — and did — advance past work that was never
|
|
8
|
+
* delivered. A step whose description names an artifact is verifiable, so it is
|
|
9
|
+
* verified: `plan_todo` refuses to mark it done while the file is absent.
|
|
10
|
+
*
|
|
11
|
+
* The extraction is deliberately CONSERVATIVE. It fires only on tokens that are
|
|
12
|
+
* unambiguously file-like (a quoted path, a slash-containing path, or a token
|
|
13
|
+
* with a known file extension) and skips anything it cannot be sure about —
|
|
14
|
+
* URLs, globs, flags, version numbers, prose. A false "artifact missing" that
|
|
15
|
+
* blocks a legitimate step is worse than missing a check, so when in doubt the
|
|
16
|
+
* token is ignored.
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
19
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
20
|
+
/** Extensions that make a bare token file-like. Keep this list pragmatic. */
|
|
21
|
+
const ARTIFACT_EXT = /\.(apk|aab|aar|jar|zip|tar|tgz|gz|md|mdx|txt|json|ya?ml|toml|xml|html?|css|js|mjs|cjs|ts|tsx|jsx|py|rb|go|rs|java|kt|kts|gradle|properties|lock|pdf|png|jpe?g|gif|svg|webp|sh|bash|csv|tsv|xlsx?|docx?|pptx?|bin|exe|dll|so|dylib|whl|ipynb)$/i;
|
|
22
|
+
/**
|
|
23
|
+
* Tokens that must never be treated as artifacts even when they look file-like:
|
|
24
|
+
* URLs, globs, flags, and prose fragments.
|
|
25
|
+
*/
|
|
26
|
+
function isExcluded(token) {
|
|
27
|
+
if (!token)
|
|
28
|
+
return true;
|
|
29
|
+
if (/^https?:\/\//i.test(token) || token.includes('://'))
|
|
30
|
+
return true;
|
|
31
|
+
if (/[<>*?{}()=]/.test(token))
|
|
32
|
+
return true; // globs, prose, assignments
|
|
33
|
+
if (token.startsWith('-'))
|
|
34
|
+
return true; // flags
|
|
35
|
+
if (token.startsWith('~'))
|
|
36
|
+
return true; // home-relative — machine-local, not the project's
|
|
37
|
+
if (token.includes(' '))
|
|
38
|
+
return true;
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/** Strip wrapping punctuation a description commonly puts around a path. */
|
|
42
|
+
function cleanToken(raw) {
|
|
43
|
+
return raw.replace(/^[`"'([{<]+/, '').replace(/[`"'\])}>,.;:!?]+$/, '');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Extract candidate artifact paths from a step description. Returns a deduped
|
|
47
|
+
* list, in first-seen order. Never throws.
|
|
48
|
+
*/
|
|
49
|
+
export function extractArtifactPaths(description) {
|
|
50
|
+
const text = String(description ?? '');
|
|
51
|
+
if (!text)
|
|
52
|
+
return [];
|
|
53
|
+
const out = [];
|
|
54
|
+
const seen = new Set();
|
|
55
|
+
const push = (raw) => {
|
|
56
|
+
const token = cleanToken(raw);
|
|
57
|
+
if (isExcluded(token))
|
|
58
|
+
return;
|
|
59
|
+
const looksLikePath = token.includes('/') && !token.endsWith('/');
|
|
60
|
+
const hasExtension = ARTIFACT_EXT.test(token);
|
|
61
|
+
if (!looksLikePath && !hasExtension)
|
|
62
|
+
return;
|
|
63
|
+
// A slash-containing token must still look like a filename at the end
|
|
64
|
+
// (`src/foo`) unless it carries a known extension.
|
|
65
|
+
if (looksLikePath && !hasExtension && !/[^/]\.[a-z0-9]+$/i.test(token))
|
|
66
|
+
return;
|
|
67
|
+
if (seen.has(token))
|
|
68
|
+
return;
|
|
69
|
+
seen.add(token);
|
|
70
|
+
out.push(token);
|
|
71
|
+
};
|
|
72
|
+
// Quoted / backticked spans first — the strongest signal.
|
|
73
|
+
for (const m of text.matchAll(/[`"']([^`"']+)[`"']/g))
|
|
74
|
+
push(m[1]);
|
|
75
|
+
// Then any whitespace-separated token.
|
|
76
|
+
for (const m of text.matchAll(/\S+/g))
|
|
77
|
+
push(m[0]);
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Check the artifacts a step names against the workspace. When `cwd` is absent
|
|
82
|
+
* nothing is checked (there is no workspace to check against) — the caller must
|
|
83
|
+
* treat an empty `missing` as "no verdict", not as "present".
|
|
84
|
+
*/
|
|
85
|
+
export function checkStepArtifacts(description, cwd) {
|
|
86
|
+
const paths = extractArtifactPaths(description);
|
|
87
|
+
if (!cwd || paths.length === 0)
|
|
88
|
+
return { checked: paths, missing: [] };
|
|
89
|
+
const missing = [];
|
|
90
|
+
for (const p of paths) {
|
|
91
|
+
try {
|
|
92
|
+
// A token that names a LOCATION is checked there directly. A BARE file
|
|
93
|
+
// name (`local.properties`, `app-debug.apk`) has no location, and a step
|
|
94
|
+
// routinely names an artifact that a tool wrote into a subdirectory
|
|
95
|
+
// (`android/local.properties`, `android/app/build/outputs/apk/debug/`).
|
|
96
|
+
// Resolving a bare name against the workspace ROOT produced false
|
|
97
|
+
// "missing" verdicts on the live run — it refused to mark a `local.properties`
|
|
98
|
+
// step done after the file had been written one level down. A bare name is
|
|
99
|
+
// therefore searched for in the workspace before it is called missing.
|
|
100
|
+
if (isAbsolute(p) || p.includes('/')) {
|
|
101
|
+
const abs = isAbsolute(p) ? p : resolve(cwd, p);
|
|
102
|
+
if (!existsSync(abs))
|
|
103
|
+
missing.push(p);
|
|
104
|
+
}
|
|
105
|
+
else if (!basenameExists(cwd, p)) {
|
|
106
|
+
missing.push(p);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
// An unreadable path is not proof of absence — stay silent.
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return { checked: paths, missing };
|
|
114
|
+
}
|
|
115
|
+
/** Directories never worth descending into when locating a named artifact. */
|
|
116
|
+
const SEARCH_SKIP_DIRS = new Set(['node_modules', '.git', '.gradle', '.idea', '.vscode']);
|
|
117
|
+
/** Bounds so a workspace walk can never become the expensive part of a plan update. */
|
|
118
|
+
const SEARCH_MAX_DEPTH = 6;
|
|
119
|
+
const SEARCH_MAX_DIRS = 4000;
|
|
120
|
+
/**
|
|
121
|
+
* Does a file with this basename exist anywhere in the (bounded) workspace? Used
|
|
122
|
+
* only for a token that names no directory, so a step that calls `app-debug.apk`
|
|
123
|
+
* an artifact is satisfied by the APK under `android/.../apk/debug/` — while a
|
|
124
|
+
* name that exists nowhere is still genuinely missing.
|
|
125
|
+
*/
|
|
126
|
+
function basenameExists(cwd, name) {
|
|
127
|
+
const target = name.toLowerCase();
|
|
128
|
+
const queue = [{ dir: cwd, depth: 0 }];
|
|
129
|
+
let visited = 0;
|
|
130
|
+
while (queue.length > 0) {
|
|
131
|
+
if (++visited > SEARCH_MAX_DIRS)
|
|
132
|
+
break;
|
|
133
|
+
const { dir, depth } = queue.shift();
|
|
134
|
+
let entries;
|
|
135
|
+
try {
|
|
136
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
for (const e of entries) {
|
|
142
|
+
if (e.isDirectory()) {
|
|
143
|
+
if (depth < SEARCH_MAX_DEPTH && !SEARCH_SKIP_DIRS.has(e.name)) {
|
|
144
|
+
queue.push({ dir: join(dir, e.name), depth: depth + 1 });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (e.isFile() && e.name.toLowerCase() === target) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=step-artifact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-artifact.js","sourceRoot":"","sources":["../../src/tools/step-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtD,6EAA6E;AAC7E,MAAM,YAAY,GAChB,gPAAgP,CAAC;AAEnP;;;GAGG;AACH,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtE,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,4BAA4B;IACxE,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,QAAQ;IAChD,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,mDAAmD;IAC3F,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,4EAA4E;AAC5E,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAmB;IACtD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,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chema } from './registry.js';
|
|
|
19
19
|
import type { ExecutedAction } from '../findings/verdicts.js';
|
|
20
20
|
import { type SpanHandle } from '../observability/otel.js';
|
|
21
21
|
import { type StepReplay } from '../learning/step-checkpoint.js';
|
|
22
|
+
import type { UnusableResponseKind } from '../learning/response-usability.js';
|
|
22
23
|
import { RunTrace, type RunTraceSnapshot } from '../learning/run-trace.js';
|
|
23
24
|
import { type FollowupSuggestion } from './followup-utils.js';
|
|
25
|
+
import type { ToolArgumentsError } from '../inference/interface.js';
|
|
24
26
|
import { type ToolCallEvidence } from './edit-verification.js';
|
|
25
27
|
import type { TraceEvent, TraceGateName } from '../learning/reasoning-trace.js';
|
|
26
28
|
/**
|
|
@@ -64,7 +66,28 @@ export interface StepResponse {
|
|
|
64
66
|
arguments: Record<string, unknown>;
|
|
65
67
|
/** Provider-owned opaque data echoed back on replay (Gemini thoughtSignature). */
|
|
66
68
|
providerMeta?: Record<string, unknown>;
|
|
69
|
+
/**
|
|
70
|
+
* Why the arguments are USELESS — set by the adapter when the call's
|
|
71
|
+
* argument payload never arrived or could not be parsed (see
|
|
72
|
+
* `inference/interface.ts` `ToolArgumentsError`). The loop REFUSES such a
|
|
73
|
+
* call instead of executing it with an empty object; the measured cost of
|
|
74
|
+
* executing it is 59 silent retries in one dashboard turn.
|
|
75
|
+
*/
|
|
76
|
+
argumentsError?: ToolArgumentsError;
|
|
67
77
|
}>;
|
|
78
|
+
/**
|
|
79
|
+
* The model's `reasoning_content` for this step, when it returned one. Carried
|
|
80
|
+
* onto the assistant message so a thinking model (DeepSeek v4) can be handed
|
|
81
|
+
* its own prior reasoning back — see {@link ToolMessage.reasoningContent}.
|
|
82
|
+
*/
|
|
83
|
+
reasoningContent?: string;
|
|
84
|
+
/**
|
|
85
|
+
* The provider's `finish_reason` for this step, when it reported one.
|
|
86
|
+
* `'length'` means the response was cut at the output-token cap — the reason a
|
|
87
|
+
* call's arguments can arrive empty or truncated, and the fact the refusal in
|
|
88
|
+
* `malformedToolCallRefusal` quotes instead of guessing.
|
|
89
|
+
*/
|
|
90
|
+
finishReason?: string;
|
|
68
91
|
/**
|
|
69
92
|
* Which transport ACTUALLY carried this step's tool calls, in the same
|
|
70
93
|
* vocabulary the subagent child announces
|
|
@@ -110,6 +133,43 @@ export interface ToolLoopDeps {
|
|
|
110
133
|
executeTool(name: string, args: Record<string, unknown>, ctx: ToolContext): Promise<string>;
|
|
111
134
|
/** Whether a content-only response is a think-only block (continues, doesn't end). */
|
|
112
135
|
isThinkOnly?(content: string): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* P2 — MID-TURN MODEL HANDOFF. The loop calls this when the model it is
|
|
138
|
+
* talking to resolved with NOTHING usable (no answer text and no tool call) and
|
|
139
|
+
* the same model has already had its one retry. The caller owns the pool, so
|
|
140
|
+
* it — not the loop — decides which model is next: install a DIFFERENT
|
|
141
|
+
* provider/model and resolve `true`, or resolve `false` when there is genuinely
|
|
142
|
+
* no other candidate left to try.
|
|
143
|
+
*
|
|
144
|
+
* Why the loop cannot do this itself: the pool, its exclusions, the credential
|
|
145
|
+
* gate and the session cooldowns all live above it. Retrying the SAME model was
|
|
146
|
+
* the defect (five consecutive empty responses from one model ended a real turn
|
|
147
|
+
* while healthy models sat configured and unused), so the retry decision is
|
|
148
|
+
* delegated out rather than guessed at.
|
|
149
|
+
*
|
|
150
|
+
* A `false` is NOT a dead end: the loop falls back to its own bounded
|
|
151
|
+
* escalation, so a turn with no alternative still ends exactly as it did
|
|
152
|
+
* before. Omitted entirely (mocks, sub-agent children, older callers) → the old
|
|
153
|
+
* behaviour, byte for byte.
|
|
154
|
+
*/
|
|
155
|
+
requestModelSwitch?(reason: UnusableResponseKind): Promise<boolean> | boolean;
|
|
156
|
+
/**
|
|
157
|
+
* C5 — RE-FIT THE THREAD TO THE MODEL THAT NOW ANSWERS.
|
|
158
|
+
*
|
|
159
|
+
* `threadBudgetChars` (see `LoopOptions`) is resolved ONCE by the caller —
|
|
160
|
+
* before this loop starts, from the pair the turn began on. But
|
|
161
|
+
* `requestModelSwitch` may install a DIFFERENT pair mid-turn, and the handoff
|
|
162
|
+
* that actually overflows is the one to a SMALLER window: the caller had just
|
|
163
|
+
* looked that window up, and the budget in hand was computed from the model
|
|
164
|
+
* that just returned nothing.
|
|
165
|
+
*
|
|
166
|
+
* The caller owns the session, so the caller — not the loop — knows which
|
|
167
|
+
* model is now serving and re-resolves its window. A NUMBER replaces the
|
|
168
|
+
* budget; `undefined` KEEPS the current one, so an unknown window can never
|
|
169
|
+
* silently shrink a thread. Omitted (mocks, sub-agent children, older
|
|
170
|
+
* callers) → the budget stays exactly as resolved, byte for byte.
|
|
171
|
+
*/
|
|
172
|
+
threadBudgetAfterSwitch?(): number | undefined;
|
|
113
173
|
/** Log a loop event (board note / console line). Defaults to logger.info. */
|
|
114
174
|
onEvent?(line: string): void;
|
|
115
175
|
}
|
|
@@ -358,6 +418,19 @@ export interface ToolLoopResult {
|
|
|
358
418
|
steps: number;
|
|
359
419
|
/** True when the step bound was hit before an end turn. */
|
|
360
420
|
bounded: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* P2 — how many times the turn handed the work to a DIFFERENT model after the
|
|
423
|
+
* one serving it returned nothing usable (0 = it ran on one model throughout).
|
|
424
|
+
* Reported rather than merely logged: "this turn moved models twice to get you
|
|
425
|
+
* an answer" is the fact the trace and the dashboard show.
|
|
426
|
+
*/
|
|
427
|
+
modelHandoffs?: number;
|
|
428
|
+
/**
|
|
429
|
+
* P3 — WHY the turn ended (see {@link TurnTermination}). Set on every exit so
|
|
430
|
+
* a surface never has to infer the reason from a `bounded` boolean, which
|
|
431
|
+
* cannot tell a model shortage from an exhausted budget.
|
|
432
|
+
*/
|
|
433
|
+
termination?: TurnTermination;
|
|
361
434
|
/**
|
|
362
435
|
* How many bounded auto-continuations were spent this turn (0 = the turn ran
|
|
363
436
|
* straight through). Telemetry only — a resumed turn reports the SAME content
|
|
@@ -458,6 +531,50 @@ export interface ToolLoopResult {
|
|
|
458
531
|
* as done; the trace records it and the outcome is `incomplete`.
|
|
459
532
|
*/
|
|
460
533
|
unverifiedBuildClaim?: boolean;
|
|
534
|
+
/**
|
|
535
|
+
* Bundle 19 — a file this turn WROTE declares that its own content was omitted.
|
|
536
|
+
* The turn's artifact says it is incomplete, so no surface may read the turn as
|
|
537
|
+
* finished work. Carries the path and the artifact's own words as evidence.
|
|
538
|
+
*/
|
|
539
|
+
artifactIncomplete?: {
|
|
540
|
+
path: string;
|
|
541
|
+
statement: string;
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* Bundle 20 — the answer ASSERTS a file was written, and the turn's own record
|
|
545
|
+
* says none was. Kept separate from `undeliveredArtifact` (a function of the
|
|
546
|
+
* ASK): this is a function of the turn's OWN claim, so a fabricated "I saved it"
|
|
547
|
+
* is disclosed even when the ask was never recognised as a deliverable.
|
|
548
|
+
*/
|
|
549
|
+
unverifiedFileClaim?: boolean;
|
|
550
|
+
/**
|
|
551
|
+
* Bundle 23 (item 13) — the ask NAMED a magnitude ("about 5000 words", "a 100
|
|
552
|
+
* page story") and this turn's written artifact is far short of it. A factual
|
|
553
|
+
* comparison of the delivered file against the REQUEST — not a judgement of its
|
|
554
|
+
* quality — which is why it is a shortfall of a stated number and never a phrase
|
|
555
|
+
* list. Carries the measurement as evidence. Only set for a SINGLE written
|
|
556
|
+
* artifact: an append/sectioned delivery cannot be measured from these records
|
|
557
|
+
* without risking a false "short".
|
|
558
|
+
*/
|
|
559
|
+
artifactShortfall?: {
|
|
560
|
+
path: string;
|
|
561
|
+
deliveredWords: number;
|
|
562
|
+
targetWords: number;
|
|
563
|
+
source: string;
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* Item 13 (round 3) — a SINGLE authored artifact that tripped neither the
|
|
567
|
+
* omission nor the shortfall check: the "fluent, on-length" delivery that no
|
|
568
|
+
* deterministic rule can judge. Reported as FACTS only (path, length, a bounded
|
|
569
|
+
* excerpt) so a caller can COLLECT the case; no verdict is made here, and
|
|
570
|
+
* nothing routes on it.
|
|
571
|
+
*/
|
|
572
|
+
authoredDeliverable?: {
|
|
573
|
+
path: string;
|
|
574
|
+
deliveredWords: number;
|
|
575
|
+
targetWords?: number;
|
|
576
|
+
excerpt: string;
|
|
577
|
+
};
|
|
461
578
|
/**
|
|
462
579
|
* R2 — which transport carried this turn's tool calls (`native` / `json` /
|
|
463
580
|
* `none`), as reported by the caller's own model-call seam. Absent when the
|
|
@@ -496,23 +613,25 @@ export declare function extractFallbackToolCalls(content: string): {
|
|
|
496
613
|
*/
|
|
497
614
|
export declare function isBareAcknowledgment(content: string): boolean;
|
|
498
615
|
/**
|
|
499
|
-
*
|
|
500
|
-
* model emits several of them in ONE step. Everything else — writes, terminal
|
|
501
|
-
* commands, pipeline dispatch, delegation, `tool_search` (it mutates the
|
|
502
|
-
* tiering state), `plan_todo`, `ask_user` (it blocks on user input) — stays
|
|
503
|
-
* strictly serial and in the model's original order.
|
|
616
|
+
* Whether a tool may run concurrently with sibling calls in the same step.
|
|
504
617
|
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
618
|
+
* DERIVED FROM THE CAPABILITY REGISTRY, not a hand-maintained allowlist. This used
|
|
619
|
+
* to be a six-name list that had to be reviewed by hand whenever a read tool was
|
|
620
|
+
* added — so any new read tool, and every read-only MCP tool discovered at
|
|
621
|
+
* runtime, silently lost the fan-out. The effect class answers it now.
|
|
509
622
|
*
|
|
510
|
-
*
|
|
511
|
-
*
|
|
623
|
+
* THE SAFETY DIRECTION IS UNCHANGED, which is the part that matters: a tool the
|
|
624
|
+
* registry does not describe maps to `local-state`, so a newly registered tool is
|
|
625
|
+
* still SERIAL until someone declares it a read. `READ_BUT_SERIAL` is the one
|
|
626
|
+
* hand-written exception, and it is a harness fact rather than an effect guess.
|
|
512
627
|
*/
|
|
513
|
-
export declare const PARALLEL_SAFE_TOOL_NAMES: ReadonlySet<string>;
|
|
514
|
-
/** Whether a tool may run concurrently with sibling calls in the same step. */
|
|
515
628
|
export declare function isParallelSafeTool(name: string): boolean;
|
|
629
|
+
/**
|
|
630
|
+
* Every REGISTRY tool that currently qualifies, derived by filtering with
|
|
631
|
+
* `isParallelSafeTool` — so the set and the predicate can never disagree. Built
|
|
632
|
+
* lazily, because the registry must be fully loaded before it can be enumerated.
|
|
633
|
+
*/
|
|
634
|
+
export declare function parallelSafeToolNames(): ReadonlySet<string>;
|
|
516
635
|
/**
|
|
517
636
|
* Consecutive REASONING-ONLY steps the loop tolerates before it escalates, and
|
|
518
637
|
* then one more before it ends the turn.
|
|
@@ -523,6 +642,59 @@ export declare function isParallelSafeTool(name: string): boolean;
|
|
|
523
642
|
* were well able to do (see `THINK_ONLY_ESCALATION`).
|
|
524
643
|
*/
|
|
525
644
|
export declare const MAX_THINK_CONTINUES = 3;
|
|
645
|
+
/**
|
|
646
|
+
* P2 — how many times the SAME model may answer with nothing before the loop
|
|
647
|
+
* insists on a handoff. One, deliberately: a single empty completion can be a
|
|
648
|
+
* blip at a shared endpoint, but a model that resolves with nothing twice has
|
|
649
|
+
* demonstrated it is not answering this step, and re-calling it is the loop that
|
|
650
|
+
* killed a real turn (five consecutive empties, then the turn reported itself
|
|
651
|
+
* bounded with zero tool calls).
|
|
652
|
+
*/
|
|
653
|
+
export declare const MAX_SAME_MODEL_EMPTY_RETRIES = 1;
|
|
654
|
+
/**
|
|
655
|
+
* P2 — ceiling on mid-turn handoffs, so a caller whose pool churns through
|
|
656
|
+
* unusable models cannot spin. Each handoff is a genuinely different candidate
|
|
657
|
+
* (the caller must refuse to hand back the same pair), so this only bounds a
|
|
658
|
+
* pathological pool; a real one is exhausted well before it.
|
|
659
|
+
*/
|
|
660
|
+
export declare const MAX_MODEL_HANDOFFS_PER_TURN = 5;
|
|
661
|
+
/**
|
|
662
|
+
* P3 — the turn's ATTEMPT budget, kept separate from its STEP budget.
|
|
663
|
+
*
|
|
664
|
+
* A mid-turn handoff spends model calls that produced nothing: the empty
|
|
665
|
+
* completion that triggered it, and the first call to the replacement (which
|
|
666
|
+
* may itself come back empty). Charging those to the same budget that governs
|
|
667
|
+
* the actual WORK means a run against two or three dead models exhausts its
|
|
668
|
+
* road before it has done anything — the exact way a task gets abandoned while
|
|
669
|
+
* capable models are still queued. Each handoff therefore GRANTS two extra
|
|
670
|
+
* steps of credit (capped), so hand-offs cannot be cut short by step
|
|
671
|
+
* accounting; everything else — the step budget, the continuation budget, the
|
|
672
|
+
* think-only cap — is untouched.
|
|
673
|
+
*/
|
|
674
|
+
export declare const MAX_HANDOFF_ATTEMPT_CREDIT: number;
|
|
675
|
+
/**
|
|
676
|
+
* P3 — WHY a turn ended, named.
|
|
677
|
+
*
|
|
678
|
+
* `bounded: true` said only "stopped before finishing", conflating a genuine
|
|
679
|
+
* shortage of capable models with a budget that ran out while models remained.
|
|
680
|
+
* The two demand opposite responses (an exhaustion report vs. a longer road),
|
|
681
|
+
* so the loop now says which one it was:
|
|
682
|
+
*
|
|
683
|
+
* - `delivered` — an answer was produced. Finished.
|
|
684
|
+
* - `cancelled` — the user stopped it (the dashboard Cancel button).
|
|
685
|
+
* - `no-capable-candidate` — every model that answered returned NOTHING
|
|
686
|
+
* usable (or none could be reached). An evidenced
|
|
687
|
+
* claim, and the trigger for the exhaustion report.
|
|
688
|
+
* - `reasoning-spin` — one model kept emitting reasoning and never acted
|
|
689
|
+
* or answered, past the bound. A bounded stop, not a
|
|
690
|
+
* model shortage.
|
|
691
|
+
* - `budget-exhausted` — the step budget ran out. BUG SIGNAL when nothing
|
|
692
|
+
* was delivered and a handoff was still available;
|
|
693
|
+
* the loop logs that loudly at the exit.
|
|
694
|
+
* - `generation-failed` — the model call threw and there was nothing to
|
|
695
|
+
* deliver (the provider walk already gave up).
|
|
696
|
+
*/
|
|
697
|
+
export type TurnTermination = 'delivered' | 'cancelled' | 'no-capable-candidate' | 'reasoning-spin' | 'budget-exhausted' | 'generation-failed';
|
|
526
698
|
/**
|
|
527
699
|
* Consecutive steps that RAN tools and had NO success before the loop asks the
|
|
528
700
|
* model to diagnose the stall. This generalises {@link RunTrace.repeatedFailure}
|
|
@@ -587,6 +759,17 @@ export interface ToolLoopProgress {
|
|
|
587
759
|
deliveryConfirmed: boolean;
|
|
588
760
|
/** Session 4 — paths mutated successfully this turn (for verification relevance). */
|
|
589
761
|
mutatedPaths: string[];
|
|
762
|
+
/**
|
|
763
|
+
* Bundle 19 — the CONTENT of every file this turn successfully wrote or edited, so
|
|
764
|
+
* the turn can be judged on its own ARTIFACT rather than on its prose. Bounded in
|
|
765
|
+
* both size and count (see `AUTHORED_ARTIFACT_MAX*`).
|
|
766
|
+
*/
|
|
767
|
+
authoredArtifacts: Array<{
|
|
768
|
+
tool: string;
|
|
769
|
+
path: string;
|
|
770
|
+
content: string;
|
|
771
|
+
words: number;
|
|
772
|
+
}>;
|
|
590
773
|
/** Session 4 — successful verification calls (args + result) to judge relevance. */
|
|
591
774
|
verificationEvidence: ToolCallEvidence[];
|
|
592
775
|
/**
|
|
@@ -624,6 +807,73 @@ export interface ToolLoopProgress {
|
|
|
624
807
|
* there is no tool call at all.
|
|
625
808
|
*/
|
|
626
809
|
export declare function detectUnverifiedDeliveryClaim(content: string, toolsRun: readonly string[]): boolean;
|
|
810
|
+
/**
|
|
811
|
+
* True when the answer CLAIMS a file was produced and the turn's own record says
|
|
812
|
+
* none was. This is the sibling of `detectUnverifiedDeliveryClaim` (which covers
|
|
813
|
+
* SENDS), and it closes a gap found live: a turn wrote nothing, then replied
|
|
814
|
+
* "The guide has been written and saved as GUIDE.md … contains a full ~5,000-word
|
|
815
|
+
* technical guide", and NO flag could see it.
|
|
816
|
+
*
|
|
817
|
+
* Why it is not redundant with `undeliveredArtifact`: that flag is a function of
|
|
818
|
+
* the ASK (it is gated on the request classifying as an authored deliverable), so
|
|
819
|
+
* an ask the classifier does not recognise — or a plain code ask that happens to
|
|
820
|
+
* be answered with a fabricated "I saved it" — produced no disclosure at all. This
|
|
821
|
+
* one is a function of what the turn DID: a completed file claim, contradicted by
|
|
822
|
+
* the absence of any write. The two are made mutually exclusive at the call site so
|
|
823
|
+
* one turn is never reported under two names.
|
|
824
|
+
*
|
|
825
|
+
* Conservative by construction, so an honest turn is never flagged: it fires only
|
|
826
|
+
* when NOTHING was mutated AND no write-capable tool succeeded; a heredoc through
|
|
827
|
+
* `run_terminal`, an `edit_file`, or any executed snippet therefore exempts the
|
|
828
|
+
* turn, because the run's record cannot contradict the claim.
|
|
829
|
+
*/
|
|
830
|
+
export declare function detectUnverifiedFileClaim(content: string, evidence: {
|
|
831
|
+
mutatedPaths: readonly string[];
|
|
832
|
+
successfulToolCalls: readonly string[];
|
|
833
|
+
}): boolean;
|
|
834
|
+
/**
|
|
835
|
+
* Tool-shaped actions a first-person imminent promise can drop. Matched by
|
|
836
|
+
* STEM (`\w*` suffix) so "scaffold" covers "scaffolding", "write" covers
|
|
837
|
+
* "writing", etc. — the promise is usually phrased as a gerund ("start by
|
|
838
|
+
* scaffolding").
|
|
839
|
+
*/
|
|
840
|
+
/**
|
|
841
|
+
* Bundle 23 (item 13) — how far short of a stated magnitude counts as a miss.
|
|
842
|
+
* Half, deliberately: "about 5000 words" delivered as 4,200 is a tighter draft,
|
|
843
|
+
* not a shortfall, and an over-eager version of this flag would be ignored like
|
|
844
|
+
* every other noisy guard. Under half is materially not what was asked for.
|
|
845
|
+
*/
|
|
846
|
+
export declare const ARTIFACT_SHORTFALL_RATIO = 0.5;
|
|
847
|
+
/**
|
|
848
|
+
* How much of a delivered artifact travels to the corpus (item 13). Bounded on
|
|
849
|
+
* purpose: a candidate row is a SAMPLE to fit a signal to, not a copy of the
|
|
850
|
+
* user's document, and an unbounded row would turn a collection file into a
|
|
851
|
+
* second copy of everything the agent ever wrote.
|
|
852
|
+
*/
|
|
853
|
+
export declare const AUTHORED_DELIVERABLE_EXCERPT_MAX = 2000;
|
|
854
|
+
/**
|
|
855
|
+
* Compare a written artifact against an EXPLICIT magnitude the ask named.
|
|
856
|
+
*
|
|
857
|
+
* This is item 13's honest half: the delivered artifact is measured AGAINST THE
|
|
858
|
+
* REQUEST, deterministically, instead of judging quality from a model's
|
|
859
|
+
* vocabulary. It fires only when the ask states a number ("about 5000 words",
|
|
860
|
+
* "a 100 page story") — a plain "write a long document" names no magnitude, so
|
|
861
|
+
* there is nothing to compare against and this must not invent one.
|
|
862
|
+
*
|
|
863
|
+
* Returns null unless the file is under `ARTIFACT_SHORTFALL_RATIO` of the target,
|
|
864
|
+
* so an honest document is never flagged. An empty file returns null too — a
|
|
865
|
+
* missing artifact is the omission/undelivered gates' job, not a shortfall's.
|
|
866
|
+
*/
|
|
867
|
+
export declare function detectArtifactShortfall(ask: string, artifact: {
|
|
868
|
+
path: string;
|
|
869
|
+
content: string;
|
|
870
|
+
words?: number;
|
|
871
|
+
}): {
|
|
872
|
+
path: string;
|
|
873
|
+
deliveredWords: number;
|
|
874
|
+
targetWords: number;
|
|
875
|
+
source: string;
|
|
876
|
+
} | null;
|
|
627
877
|
/**
|
|
628
878
|
* True when the answer CLOSES on an unconditional first-person promise to take
|
|
629
879
|
* a tool-shaped action — the "I will begin by scaffolding…" shape that ends a
|
|
@@ -640,6 +890,11 @@ export declare function detectUnverifiedDeliveryClaim(content: string, toolsRun:
|
|
|
640
890
|
* summarise) are excluded.
|
|
641
891
|
*/
|
|
642
892
|
export declare function detectUnfulfilledIntentPromise(content: string): boolean;
|
|
893
|
+
/**
|
|
894
|
+
* The statement an artifact makes about its own incompleteness, or `null`.
|
|
895
|
+
* Returns the MATCHED TEXT so the report can quote what the file said about itself.
|
|
896
|
+
*/
|
|
897
|
+
export declare function detectSelfDeclaredOmission(text: string): string | null;
|
|
643
898
|
/**
|
|
644
899
|
* True when the turn's OWN evidence contradicts its prose: a build command it
|
|
645
900
|
* ran FAILED, no later build succeeded, and the answer still asserts the
|
|
@@ -695,10 +950,69 @@ export declare function zeroActionNudge(ask: string): string;
|
|
|
695
950
|
* Returns null when the result is an ordinary tool/runtime error, so the caller
|
|
696
951
|
* keeps its own wording rather than inventing a cause.
|
|
697
952
|
*/
|
|
953
|
+
/** How many steps of an existing plan are re-shown to the model (bounded). */
|
|
954
|
+
export declare const PLAN_CONTEXT_MAX_STEPS = 12;
|
|
955
|
+
/**
|
|
956
|
+
* The block that hands the model the plan its own conversation already tracks.
|
|
957
|
+
*
|
|
958
|
+
* Written to make the correct next move obvious rather than merely possible: the
|
|
959
|
+
* step ids are given verbatim (so `update` can address them), the statuses are the
|
|
960
|
+
* stored truth, and the one thing a model tends to do instead — declare the plan
|
|
961
|
+
* again — is named as wrong, because a re-declaration under the same goal now
|
|
962
|
+
* carries progress but still replaces the step LIST the user is watching.
|
|
963
|
+
*/
|
|
964
|
+
export declare function planContextBlock(plan: {
|
|
965
|
+
goal: string;
|
|
966
|
+
steps: Array<{
|
|
967
|
+
id: string;
|
|
968
|
+
description: string;
|
|
969
|
+
status: string;
|
|
970
|
+
note?: string;
|
|
971
|
+
}>;
|
|
972
|
+
revision: number;
|
|
973
|
+
}): string;
|
|
974
|
+
/**
|
|
975
|
+
* The refusal a tool call gets when its ARGUMENTS never arrived.
|
|
976
|
+
*
|
|
977
|
+
* Measured defect (dashboard session `4e2b0e51…-1791349543186`, 2026-10-07): the
|
|
978
|
+
* goal "deliver complete document" produced **59 `write_file` calls with empty
|
|
979
|
+
* arguments**, plus 14 `run_terminal` and 2 `code_execution` — 73 of the turn's 81
|
|
980
|
+
* calls. Each one was executed as `{}`, so the model's feedback was
|
|
981
|
+
* `write_file: path is required`, which names the wrong problem: the model HAD
|
|
982
|
+
* asked for a write, with a payload (a whole design document) that could not fit
|
|
983
|
+
* in one output. It diagnosed "my calls were emitted empty", retried 59 times,
|
|
984
|
+
* and the turn ended `bounded: true` with no document. Two things were missing
|
|
985
|
+
* and both are here: the REAL cause, and a way to succeed at all.
|
|
986
|
+
*
|
|
987
|
+
* The refusal is `Error:`-prefixed because the call genuinely did not run — the
|
|
988
|
+
* loop's honest accounting (successful calls, mutations, verification) depends
|
|
989
|
+
* on that prefix, so a call that never reached a tool is never counted as one.
|
|
990
|
+
*/
|
|
991
|
+
export declare function malformedToolCallRefusal(call: {
|
|
992
|
+
name: string;
|
|
993
|
+
argumentsError: ToolArgumentsError;
|
|
994
|
+
}, opts?: {
|
|
995
|
+
finishReason?: string;
|
|
996
|
+
attempt?: number;
|
|
997
|
+
}): string;
|
|
998
|
+
/**
|
|
999
|
+
* The one bounded mid-turn nudge for the same defect, pushed after the results of
|
|
1000
|
+
* the step that produced it — so a model that keeps re-sending a payload too large
|
|
1001
|
+
* for one output is told the strategy, not merely that it failed again.
|
|
1002
|
+
*/
|
|
1003
|
+
export declare function malformedCallNudge(attempts: number): string;
|
|
698
1004
|
export declare function classifyToolRefusal(result: string): {
|
|
699
1005
|
gate?: TraceGateName;
|
|
700
1006
|
summary: string;
|
|
701
1007
|
} | null;
|
|
1008
|
+
/**
|
|
1009
|
+
* A one-field preview of a tool call's arguments, preferring the IDENTIFYING
|
|
1010
|
+
* field ({@link IDENTIFYING_ARG_KEYS}) over whichever key was emitted first.
|
|
1011
|
+
*
|
|
1012
|
+
* Exported for the test that pins the preference — the bug it fixed was not a
|
|
1013
|
+
* crash but a true statement that named the wrong thing.
|
|
1014
|
+
*/
|
|
1015
|
+
export declare function summarizeArgs(args: Record<string, unknown>): string;
|
|
702
1016
|
/** Default thread budget in characters (~50K tokens at 4 chars/token). */
|
|
703
1017
|
export declare const DEFAULT_THREAD_BUDGET_CHARS = 200000;
|
|
704
1018
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-loop.d.ts","sourceRoot":"","sources":["../../src/tools/tool-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"tool-loop.d.ts","sourceRoot":"","sources":["../../src/tools/tool-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAuC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM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