agent-nuvira 3.3.1 → 3.3.4
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 +18 -13
- package/dist/agent-sdk/src/agent.d.ts +2 -0
- package/dist/agent-sdk/src/agent.d.ts.map +1 -1
- package/dist/agent-sdk/src/define.d.ts +64 -0
- package/dist/agent-sdk/src/define.d.ts.map +1 -0
- package/dist/agent-sdk/src/define.js +76 -0
- package/dist/agent-sdk/src/define.js.map +1 -0
- package/dist/agent-sdk/src/index.d.ts +9 -0
- package/dist/agent-sdk/src/index.d.ts.map +1 -1
- package/dist/agent-sdk/src/index.js +9 -0
- package/dist/agent-sdk/src/index.js.map +1 -1
- package/dist/agent-sdk/src/scaffold.d.ts +11 -0
- package/dist/agent-sdk/src/scaffold.d.ts.map +1 -1
- package/dist/agent-sdk/src/scaffold.js +16 -6
- package/dist/agent-sdk/src/scaffold.js.map +1 -1
- package/dist/agents/agents/runner.d.ts +9 -0
- package/dist/agents/agents/runner.d.ts.map +1 -1
- package/dist/agents/agents/runner.js +34 -12
- package/dist/agents/agents/runner.js.map +1 -1
- package/dist/agents/agents/writer-tool-calling.d.ts.map +1 -1
- package/dist/agents/agents/writer-tool-calling.js +7 -2
- package/dist/agents/agents/writer-tool-calling.js.map +1 -1
- package/dist/agents/agents/writer.d.ts.map +1 -1
- package/dist/agents/agents/writer.js +7 -1
- package/dist/agents/agents/writer.js.map +1 -1
- package/dist/agents/artifact-verification.d.ts +102 -0
- package/dist/agents/artifact-verification.d.ts.map +1 -0
- package/dist/agents/artifact-verification.js +216 -0
- package/dist/agents/artifact-verification.js.map +1 -0
- package/dist/agents/checkpoint-store.d.ts +73 -0
- package/dist/agents/checkpoint-store.d.ts.map +1 -1
- package/dist/agents/checkpoint-store.js +161 -0
- package/dist/agents/checkpoint-store.js.map +1 -1
- package/dist/agents/credential-store.d.ts +120 -0
- package/dist/agents/credential-store.d.ts.map +1 -1
- package/dist/agents/credential-store.js +358 -19
- package/dist/agents/credential-store.js.map +1 -1
- package/dist/agents/long-form-plan.d.ts.map +1 -1
- package/dist/agents/long-form-plan.js +2 -1
- package/dist/agents/long-form-plan.js.map +1 -1
- package/dist/agents/orchestrator.d.ts +10 -1
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +239 -79
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/agents/phase-engine.d.ts +61 -0
- package/dist/agents/phase-engine.d.ts.map +1 -1
- package/dist/agents/phase-engine.js +68 -2
- package/dist/agents/phase-engine.js.map +1 -1
- package/dist/agents/prompt-assembly.d.ts +11 -0
- package/dist/agents/prompt-assembly.d.ts.map +1 -1
- package/dist/agents/prompt-assembly.js +17 -0
- package/dist/agents/prompt-assembly.js.map +1 -1
- package/dist/agents/release-preflight.d.ts +121 -0
- package/dist/agents/release-preflight.d.ts.map +1 -0
- package/dist/agents/release-preflight.js +259 -0
- package/dist/agents/release-preflight.js.map +1 -0
- package/dist/agents/release-runner.d.ts +157 -0
- package/dist/agents/release-runner.d.ts.map +1 -0
- package/dist/agents/release-runner.js +719 -0
- package/dist/agents/release-runner.js.map +1 -0
- package/dist/agents/step-handoff.d.ts +190 -0
- package/dist/agents/step-handoff.d.ts.map +1 -0
- package/dist/agents/step-handoff.js +443 -0
- package/dist/agents/step-handoff.js.map +1 -0
- package/dist/cli/agent.d.ts +2 -2
- package/dist/cli/agent.js +10 -10
- package/dist/cli/benchmark.d.ts.map +1 -1
- package/dist/cli/benchmark.js +11 -4
- package/dist/cli/benchmark.js.map +1 -1
- package/dist/cli/chat.d.ts +94 -0
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +379 -24
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/cli-program.d.ts.map +1 -1
- package/dist/cli/cli-program.js +8 -0
- package/dist/cli/cli-program.js.map +1 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +9 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/credentials.d.ts +28 -0
- package/dist/cli/credentials.d.ts.map +1 -0
- package/dist/cli/credentials.js +213 -0
- package/dist/cli/credentials.js.map +1 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +3 -2
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/edit.js +2 -2
- package/dist/cli/eval.d.ts +17 -0
- package/dist/cli/eval.d.ts.map +1 -1
- package/dist/cli/eval.js +105 -2
- package/dist/cli/eval.js.map +1 -1
- package/dist/cli/execute.d.ts +16 -1
- package/dist/cli/execute.d.ts.map +1 -1
- package/dist/cli/execute.js +192 -22
- package/dist/cli/execute.js.map +1 -1
- package/dist/cli/failover-runner.d.ts.map +1 -1
- package/dist/cli/failover-runner.js +9 -3
- package/dist/cli/failover-runner.js.map +1 -1
- package/dist/cli/loop-executor.d.ts +55 -0
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +285 -19
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/model.d.ts.map +1 -1
- package/dist/cli/model.js +9 -8
- package/dist/cli/model.js.map +1 -1
- package/dist/cli/models.d.ts +1 -1
- package/dist/cli/models.js +4 -4
- package/dist/cli/nlu.d.ts.map +1 -1
- package/dist/cli/nlu.js +8 -2
- package/dist/cli/nlu.js.map +1 -1
- package/dist/cli/parity.d.ts +85 -0
- package/dist/cli/parity.d.ts.map +1 -0
- package/dist/cli/parity.js +506 -0
- package/dist/cli/parity.js.map +1 -0
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +2 -1
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/publish.d.ts +22 -0
- package/dist/cli/publish.d.ts.map +1 -1
- package/dist/cli/publish.js +109 -13
- package/dist/cli/publish.js.map +1 -1
- package/dist/cli/retrieval.d.ts.map +1 -1
- package/dist/cli/retrieval.js +5 -4
- package/dist/cli/retrieval.js.map +1 -1
- package/dist/cli/sdk.js +4 -4
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli/trace.d.ts.map +1 -1
- package/dist/cli/trace.js +2 -1
- package/dist/cli/trace.js.map +1 -1
- package/dist/cli/workflow.js +2 -2
- package/dist/cli/workflow.js.map +1 -1
- package/dist/config/live-credentials.d.ts +57 -0
- package/dist/config/live-credentials.d.ts.map +1 -0
- package/dist/config/live-credentials.js +126 -0
- package/dist/config/live-credentials.js.map +1 -0
- package/dist/config/paths.d.ts +18 -0
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +25 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/config/types.d.ts +44 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/federation/a2a-types.js +1 -1
- package/dist/federation/a2a-types.js.map +1 -1
- package/dist/findings/verdicts.d.ts +241 -0
- package/dist/findings/verdicts.d.ts.map +1 -0
- package/dist/findings/verdicts.js +284 -0
- package/dist/findings/verdicts.js.map +1 -0
- package/dist/gateway/adapters.d.ts +65 -0
- package/dist/gateway/adapters.d.ts.map +1 -1
- package/dist/gateway/adapters.js +216 -10
- package/dist/gateway/adapters.js.map +1 -1
- package/dist/gateway/channel-directory.d.ts +31 -0
- package/dist/gateway/channel-directory.d.ts.map +1 -1
- package/dist/gateway/channel-directory.js +40 -0
- package/dist/gateway/channel-directory.js.map +1 -1
- package/dist/gateway/gateway-log.d.ts +1 -1
- package/dist/gateway/gateway-log.d.ts.map +1 -1
- package/dist/gateway/gateway-log.js.map +1 -1
- package/dist/gateway/hooks.d.ts +87 -19
- package/dist/gateway/hooks.d.ts.map +1 -1
- package/dist/gateway/hooks.js +62 -23
- package/dist/gateway/hooks.js.map +1 -1
- package/dist/gateway/inbound-media.d.ts +147 -0
- package/dist/gateway/inbound-media.d.ts.map +1 -0
- package/dist/gateway/inbound-media.js +317 -0
- package/dist/gateway/inbound-media.js.map +1 -0
- package/dist/gateway/inbox.d.ts +8 -1
- package/dist/gateway/inbox.d.ts.map +1 -1
- package/dist/gateway/inbox.js.map +1 -1
- package/dist/gateway/platform-config.d.ts +14 -0
- package/dist/gateway/platform-config.d.ts.map +1 -1
- package/dist/gateway/platform-config.js +26 -8
- package/dist/gateway/platform-config.js.map +1 -1
- package/dist/gateway/realtime.d.ts +114 -0
- package/dist/gateway/realtime.d.ts.map +1 -0
- package/dist/gateway/realtime.js +402 -0
- package/dist/gateway/realtime.js.map +1 -0
- package/dist/gateway/registry.d.ts +31 -0
- package/dist/gateway/registry.d.ts.map +1 -1
- package/dist/gateway/registry.js +224 -4
- package/dist/gateway/registry.js.map +1 -1
- package/dist/gateway/whatsapp/baileys-bridge.d.ts +11 -1
- package/dist/gateway/whatsapp/baileys-bridge.d.ts.map +1 -1
- package/dist/gateway/whatsapp/baileys-bridge.js +123 -4
- package/dist/gateway/whatsapp/baileys-bridge.js.map +1 -1
- package/dist/gateway/whatsapp/bridge.d.ts +6 -2
- package/dist/gateway/whatsapp/bridge.d.ts.map +1 -1
- package/dist/gateway/whatsapp/bridge.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/inference/factory.d.ts +14 -0
- package/dist/inference/factory.d.ts.map +1 -1
- package/dist/inference/factory.js +17 -0
- package/dist/inference/factory.js.map +1 -1
- package/dist/inference/groq-adapter.d.ts +2 -0
- package/dist/inference/groq-adapter.d.ts.map +1 -1
- package/dist/inference/groq-adapter.js +16 -6
- package/dist/inference/groq-adapter.js.map +1 -1
- package/dist/inference/model-validator.d.ts +6 -1
- package/dist/inference/model-validator.d.ts.map +1 -1
- package/dist/inference/model-validator.js +7 -2
- package/dist/inference/model-validator.js.map +1 -1
- package/dist/inference/route-resolver.d.ts +116 -0
- package/dist/inference/route-resolver.d.ts.map +1 -0
- package/dist/inference/route-resolver.js +159 -0
- package/dist/inference/route-resolver.js.map +1 -0
- package/dist/inference/tools.d.ts.map +1 -1
- package/dist/inference/tools.js +29 -0
- package/dist/inference/tools.js.map +1 -1
- package/dist/learning/autonomy-policy.d.ts +18 -0
- package/dist/learning/autonomy-policy.d.ts.map +1 -1
- package/dist/learning/autonomy-policy.js +35 -0
- package/dist/learning/autonomy-policy.js.map +1 -1
- package/dist/learning/benchmark.d.ts.map +1 -1
- package/dist/learning/benchmark.js +3 -2
- package/dist/learning/benchmark.js.map +1 -1
- package/dist/learning/continuation.d.ts.map +1 -1
- package/dist/learning/continuation.js +2 -1
- package/dist/learning/continuation.js.map +1 -1
- package/dist/learning/cost-tracker.d.ts.map +1 -1
- package/dist/learning/cost-tracker.js +2 -1
- package/dist/learning/cost-tracker.js.map +1 -1
- package/dist/learning/deferred-task.d.ts.map +1 -1
- package/dist/learning/deferred-task.js +13 -4
- package/dist/learning/deferred-task.js.map +1 -1
- package/dist/learning/eval-framework.d.ts.map +1 -1
- package/dist/learning/eval-framework.js +2 -1
- package/dist/learning/eval-framework.js.map +1 -1
- package/dist/learning/long-form.d.ts.map +1 -1
- package/dist/learning/long-form.js +2 -1
- package/dist/learning/long-form.js.map +1 -1
- package/dist/learning/model-registry.d.ts.map +1 -1
- package/dist/learning/model-registry.js +2 -1
- package/dist/learning/model-registry.js.map +1 -1
- package/dist/learning/reasoning-cache.d.ts.map +1 -1
- package/dist/learning/reasoning-cache.js +2 -1
- package/dist/learning/reasoning-cache.js.map +1 -1
- package/dist/learning/reasoning-trace.d.ts +38 -2
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js +91 -1
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +31 -18
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/learning/retrieval.d.ts.map +1 -1
- package/dist/learning/retrieval.js +2 -1
- package/dist/learning/retrieval.js.map +1 -1
- package/dist/learning/seeded-benchmark.d.ts +160 -0
- package/dist/learning/seeded-benchmark.d.ts.map +1 -0
- package/dist/learning/seeded-benchmark.js +321 -0
- package/dist/learning/seeded-benchmark.js.map +1 -0
- package/dist/learning/seeded-bugs.d.ts +142 -0
- package/dist/learning/seeded-bugs.d.ts.map +1 -0
- package/dist/learning/seeded-bugs.js +535 -0
- package/dist/learning/seeded-bugs.js.map +1 -0
- package/dist/learning/skill-store.d.ts.map +1 -1
- package/dist/learning/skill-store.js +30 -9
- package/dist/learning/skill-store.js.map +1 -1
- package/dist/learning/step-checkpoint.d.ts +127 -0
- package/dist/learning/step-checkpoint.d.ts.map +1 -0
- package/dist/learning/step-checkpoint.js +244 -0
- package/dist/learning/step-checkpoint.js.map +1 -0
- package/dist/mcp/catalog.js +2 -3
- package/dist/mcp/catalog.js.map +1 -1
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +5 -3
- package/dist/mcp/manager.js.map +1 -1
- package/dist/nlu/intent-confirm.d.ts +23 -1
- package/dist/nlu/intent-confirm.d.ts.map +1 -1
- package/dist/nlu/intent-confirm.js +85 -2
- package/dist/nlu/intent-confirm.js.map +1 -1
- package/dist/nlu/learnings.d.ts +7 -0
- package/dist/nlu/learnings.d.ts.map +1 -1
- package/dist/nlu/learnings.js +7 -0
- package/dist/nlu/learnings.js.map +1 -1
- package/dist/observability/debug-log.d.ts +250 -0
- package/dist/observability/debug-log.d.ts.map +1 -0
- package/dist/observability/debug-log.js +500 -0
- package/dist/observability/debug-log.js.map +1 -0
- package/dist/observability/event-bus.d.ts.map +1 -1
- package/dist/observability/event-bus.js +4 -1
- package/dist/observability/event-bus.js.map +1 -1
- package/dist/observability/otel.d.ts +278 -0
- package/dist/observability/otel.d.ts.map +1 -0
- package/dist/observability/otel.js +590 -0
- package/dist/observability/otel.js.map +1 -0
- package/dist/parity/drivers.d.ts +99 -0
- package/dist/parity/drivers.d.ts.map +1 -0
- package/dist/parity/drivers.js +1362 -0
- package/dist/parity/drivers.js.map +1 -0
- package/dist/parity/graph.d.ts +73 -0
- package/dist/parity/graph.d.ts.map +1 -0
- package/dist/parity/graph.js +162 -0
- package/dist/parity/graph.js.map +1 -0
- package/dist/parity/matrix.d.ts +105 -0
- package/dist/parity/matrix.d.ts.map +1 -0
- package/dist/parity/matrix.js +352 -0
- package/dist/parity/matrix.js.map +1 -0
- package/dist/parity/observation.d.ts +444 -0
- package/dist/parity/observation.d.ts.map +1 -0
- package/dist/parity/observation.js +333 -0
- package/dist/parity/observation.js.map +1 -0
- package/dist/parity/scenarios.d.ts +229 -0
- package/dist/parity/scenarios.d.ts.map +1 -0
- package/dist/parity/scenarios.js +175 -0
- package/dist/parity/scenarios.js.map +1 -0
- package/dist/parity/surfaces.d.ts +122 -0
- package/dist/parity/surfaces.d.ts.map +1 -0
- package/dist/parity/surfaces.js +190 -0
- package/dist/parity/surfaces.js.map +1 -0
- package/dist/runtime/fault-injection.d.ts +173 -0
- package/dist/runtime/fault-injection.d.ts.map +1 -0
- package/dist/runtime/fault-injection.js +281 -0
- package/dist/runtime/fault-injection.js.map +1 -0
- package/dist/skills/secret-capture.d.ts.map +1 -1
- package/dist/skills/secret-capture.js +9 -4
- package/dist/skills/secret-capture.js.map +1 -1
- package/dist/tools/child-agent-entry.d.ts +23 -0
- package/dist/tools/child-agent-entry.d.ts.map +1 -0
- package/dist/tools/child-agent-entry.js +129 -0
- package/dist/tools/child-agent-entry.js.map +1 -0
- package/dist/tools/child-agent-runtime.d.ts +124 -0
- package/dist/tools/child-agent-runtime.d.ts.map +1 -0
- package/dist/tools/child-agent-runtime.js +704 -0
- package/dist/tools/child-agent-runtime.js.map +1 -0
- package/dist/tools/coding-tools.d.ts.map +1 -1
- package/dist/tools/coding-tools.js +82 -10
- package/dist/tools/coding-tools.js.map +1 -1
- package/dist/tools/credentials-tool.d.ts +24 -0
- package/dist/tools/credentials-tool.d.ts.map +1 -0
- package/dist/tools/credentials-tool.js +125 -0
- package/dist/tools/credentials-tool.js.map +1 -0
- package/dist/tools/delegation-system.d.ts +31 -0
- package/dist/tools/delegation-system.d.ts.map +1 -1
- package/dist/tools/delegation-system.js +70 -9
- package/dist/tools/delegation-system.js.map +1 -1
- package/dist/tools/extract/docx.d.ts +27 -0
- package/dist/tools/extract/docx.d.ts.map +1 -0
- package/dist/tools/extract/docx.js +48 -0
- package/dist/tools/extract/docx.js.map +1 -0
- package/dist/tools/extract/html-text.d.ts +27 -0
- package/dist/tools/extract/html-text.d.ts.map +1 -0
- package/dist/tools/extract/html-text.js +86 -0
- package/dist/tools/extract/html-text.js.map +1 -0
- package/dist/tools/extract/pdf-ocr.d.ts +58 -0
- package/dist/tools/extract/pdf-ocr.d.ts.map +1 -0
- package/dist/tools/extract/pdf-ocr.js +116 -0
- package/dist/tools/extract/pdf-ocr.js.map +1 -0
- package/dist/tools/extract/pdf.d.ts +65 -0
- package/dist/tools/extract/pdf.d.ts.map +1 -0
- package/dist/tools/extract/pdf.js +197 -0
- package/dist/tools/extract/pdf.js.map +1 -0
- package/dist/tools/extract/pptx.d.ts +32 -0
- package/dist/tools/extract/pptx.d.ts.map +1 -0
- package/dist/tools/extract/pptx.js +77 -0
- package/dist/tools/extract/pptx.js.map +1 -0
- package/dist/tools/extract/xlsx.d.ts +47 -0
- package/dist/tools/extract/xlsx.d.ts.map +1 -0
- package/dist/tools/extract/xlsx.js +111 -0
- package/dist/tools/extract/xlsx.js.map +1 -0
- package/dist/tools/finding-tool.d.ts +76 -0
- package/dist/tools/finding-tool.d.ts.map +1 -0
- package/dist/tools/finding-tool.js +125 -0
- package/dist/tools/finding-tool.js.map +1 -0
- package/dist/tools/git-tool.d.ts +25 -7
- package/dist/tools/git-tool.d.ts.map +1 -1
- package/dist/tools/git-tool.js +155 -15
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/tools/loop-project-context.d.ts.map +1 -1
- package/dist/tools/loop-project-context.js +16 -0
- package/dist/tools/loop-project-context.js.map +1 -1
- package/dist/tools/loop-route-feed.d.ts +57 -0
- package/dist/tools/loop-route-feed.d.ts.map +1 -0
- package/dist/tools/loop-route-feed.js +101 -0
- package/dist/tools/loop-route-feed.js.map +1 -0
- package/dist/tools/messaging-tools.d.ts +41 -11
- package/dist/tools/messaging-tools.d.ts.map +1 -1
- package/dist/tools/messaging-tools.js +104 -55
- package/dist/tools/messaging-tools.js.map +1 -1
- package/dist/tools/neutts-synth.d.ts +27 -3
- package/dist/tools/neutts-synth.d.ts.map +1 -1
- package/dist/tools/neutts-synth.js +57 -13
- package/dist/tools/neutts-synth.js.map +1 -1
- package/dist/tools/pipeline-tool.d.ts +43 -1
- package/dist/tools/pipeline-tool.d.ts.map +1 -1
- package/dist/tools/pipeline-tool.js +21 -4
- package/dist/tools/pipeline-tool.js.map +1 -1
- package/dist/tools/publish-tool.d.ts.map +1 -1
- package/dist/tools/publish-tool.js +76 -10
- package/dist/tools/publish-tool.js.map +1 -1
- package/dist/tools/read-extract.d.ts +116 -45
- package/dist/tools/read-extract.d.ts.map +1 -1
- package/dist/tools/read-extract.js +494 -158
- package/dist/tools/read-extract.js.map +1 -1
- package/dist/tools/registry.d.ts +23 -3
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +196 -29
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/run-terminal.d.ts +9 -0
- package/dist/tools/run-terminal.d.ts.map +1 -1
- package/dist/tools/run-terminal.js +80 -2
- package/dist/tools/run-terminal.js.map +1 -1
- package/dist/tools/subagent-refusal.d.ts +15 -0
- package/dist/tools/subagent-refusal.d.ts.map +1 -0
- package/dist/tools/subagent-refusal.js +18 -0
- package/dist/tools/subagent-refusal.js.map +1 -0
- package/dist/tools/subagent-spawner.d.ts +122 -0
- package/dist/tools/subagent-spawner.d.ts.map +1 -1
- package/dist/tools/subagent-spawner.js +249 -28
- package/dist/tools/subagent-spawner.js.map +1 -1
- package/dist/tools/tool-hooks.d.ts +177 -0
- package/dist/tools/tool-hooks.d.ts.map +1 -0
- package/dist/tools/tool-hooks.js +427 -0
- package/dist/tools/tool-hooks.js.map +1 -0
- package/dist/tools/tool-loop.d.ts +94 -5
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +315 -9
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/tools/tool-refusal.d.ts +68 -0
- package/dist/tools/tool-refusal.d.ts.map +1 -0
- package/dist/tools/tool-refusal.js +78 -0
- package/dist/tools/tool-refusal.js.map +1 -0
- package/dist/tools/toolsets.d.ts +8 -0
- package/dist/tools/toolsets.d.ts.map +1 -1
- package/dist/tools/toolsets.js +14 -4
- package/dist/tools/toolsets.js.map +1 -1
- package/dist/tools/vision-tools.d.ts +88 -83
- package/dist/tools/vision-tools.d.ts.map +1 -1
- package/dist/tools/vision-tools.js +134 -103
- package/dist/tools/vision-tools.js.map +1 -1
- package/dist/tools/worktree.d.ts +210 -0
- package/dist/tools/worktree.d.ts.map +1 -0
- package/dist/tools/worktree.js +374 -0
- package/dist/tools/worktree.js.map +1 -0
- package/dist/utils/format.d.ts +3 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +32 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/web-dashboard/attachment-extract.d.ts +64 -0
- package/dist/web-dashboard/attachment-extract.d.ts.map +1 -0
- package/dist/web-dashboard/attachment-extract.js +154 -0
- package/dist/web-dashboard/attachment-extract.js.map +1 -0
- package/dist/web-dashboard/chat-console.d.ts +108 -1
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +36 -0
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/hub-data.d.ts +37 -0
- package/dist/web-dashboard/hub-data.d.ts.map +1 -1
- package/dist/web-dashboard/hub-data.js +61 -1
- package/dist/web-dashboard/hub-data.js.map +1 -1
- package/dist/web-dashboard/server.d.ts +14 -0
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +247 -13
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +196 -48
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/dist/workflow/registry.js +1 -1
- package/dist/workflow/registry.js.map +1 -1
- package/package.json +22 -6
- package/src/web-dashboard/public/assets/{index-Cyd6tIew.css → index-XJjj2cBX.css} +1 -1
- package/src/web-dashboard/public/assets/index-YWF9FpwQ.js +207 -0
- package/src/web-dashboard/public/assets/index-YWF9FpwQ.js.map +1 -0
- package/src/web-dashboard/public/index.html +2 -2
- package/dist/tools/child-agent-worker.js +0 -212
- package/src/web-dashboard/public/assets/index-CjvoBhlz.js +0 -207
- package/src/web-dashboard/public/assets/index-CjvoBhlz.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failover-runner.d.ts","sourceRoot":"","sources":["../../src/cli/failover-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AASH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAU5F;AAED,wEAAwE;AACxE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,KAAK,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1D;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,M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SAAS,CAAC,CAAC;IAC1D;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjH;;;;OAIG;IACH,aAAa,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxG;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuJpF"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import { resolveProvider } from './router.js';
|
|
26
26
|
import { getAutoRouter } from '../learning/auto-router.js';
|
|
27
|
-
import {
|
|
27
|
+
import { resolveRoute } from '../inference/route-resolver.js';
|
|
28
28
|
import { recordRoutingDecision } from '../learning/routing-history.js';
|
|
29
29
|
import { shouldConfirmFailover, promptFailoverChoice } from './failover-prompt.js';
|
|
30
30
|
import { classifyFallbackError } from '../learning/provider-fallback.js';
|
|
@@ -88,8 +88,14 @@ export async function runSingleShotAuto(opts) {
|
|
|
88
88
|
? first.model
|
|
89
89
|
: getAutoRouter().resolveModel(candidateType, opts.action, opts.configManager);
|
|
90
90
|
// Model health: only use models that actually exist on the provider
|
|
91
|
-
// (a pinned config.model can be deprecated → 404) — repair to live
|
|
92
|
-
|
|
91
|
+
// (a pinned config.model can be deprecated → 404) — repair to live, and
|
|
92
|
+
// say so out loud when the model is not the one that was asked for.
|
|
93
|
+
const model = (await resolveRoute({
|
|
94
|
+
providerType: candidateType,
|
|
95
|
+
provider: resolved.provider,
|
|
96
|
+
model: desired,
|
|
97
|
+
source: 'failover',
|
|
98
|
+
})).model;
|
|
93
99
|
candidateModel = model;
|
|
94
100
|
resolvedProvider = resolved.provider;
|
|
95
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failover-runner.js","sourceRoot":"","sources":["../../src/cli/failover-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"failover-runner.js","sourceRoot":"","sources":["../../src/cli/failover-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAsB,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,aAA4B,EAAE,YAAoB;IAChF,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,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ACb,CAAC,CAAC,aAAa,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YACjF,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,aAAa,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;YACtF,IAAI,MAAM,KAAK,QAAQ;gBAAE,MAAM,SAAS,CAAC;QAC3C,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,SAAS,aAAa,YAAY,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,uCAAuC,CAAC,CAAC;IAC1G,CAAC;IAED,MAAM,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* remains available for CI/publish — enterprise semantics are not weakened.
|
|
26
26
|
*/
|
|
27
27
|
import { ConfigManager } from '../config/manager.js';
|
|
28
|
+
import { type IsolationOutcome } from '../tools/worktree.js';
|
|
29
|
+
import { type ResumeOutcome } from '../learning/step-checkpoint.js';
|
|
28
30
|
/** The loop executor's result — every metric the Phase 0 eval needs. */
|
|
29
31
|
export interface LoopExecutorResult {
|
|
30
32
|
/** Final assistant content (the loop's end-turn answer). */
|
|
@@ -37,6 +39,20 @@ export interface LoopExecutorResult {
|
|
|
37
39
|
toolCalls: string[];
|
|
38
40
|
/** Tool names that returned an error result (captured from tool:called). */
|
|
39
41
|
erroredTools: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Per-call tool outcomes, in call order — WHICH call succeeded or failed, not
|
|
44
|
+
* a name list beside a separate error set.
|
|
45
|
+
*
|
|
46
|
+
* Captured from the loop's own `tool`/`refusal` trace events (the ones that
|
|
47
|
+
* carry `ok`), so pairing is unambiguous even when a tool runs more than once
|
|
48
|
+
* — a call that failed and later succeeded used to be indistinguishable from
|
|
49
|
+
* one that failed once. This is the `execute` arm's answer to the chat
|
|
50
|
+
* surfaces' `onToolCall` lifecycle (`tool-call-lifecycle@cli-execute`).
|
|
51
|
+
*/
|
|
52
|
+
toolOutcomes: Array<{
|
|
53
|
+
tool: string;
|
|
54
|
+
ok: boolean;
|
|
55
|
+
}>;
|
|
40
56
|
/** Wall-clock duration (ms). */
|
|
41
57
|
durationMs: number;
|
|
42
58
|
/** The provider id used (telemetry echo). */
|
|
@@ -61,6 +77,30 @@ export interface LoopExecutorResult {
|
|
|
61
77
|
runTrace?: import('../learning/run-trace.js').RunTraceSnapshot;
|
|
62
78
|
/** G18 — gate decisions recorded this turn (nudges spent, bounds reached). */
|
|
63
79
|
gateDecisions?: number;
|
|
80
|
+
/**
|
|
81
|
+
* R2 — the tool transport that served the run (`native` / `json` / `none`),
|
|
82
|
+
* reported by the loop's own model-call seam. Absent when no model call was
|
|
83
|
+
* made at all (a routing failure), which is the honest answer there.
|
|
84
|
+
*/
|
|
85
|
+
transport?: 'native' | 'json' | 'none';
|
|
86
|
+
/**
|
|
87
|
+
* WS5 (#27) — the isolation this run had, and the diff against its base.
|
|
88
|
+
* Present only when isolation was asked for AND the run happened; a refused
|
|
89
|
+
* run reports the refusal as its content instead.
|
|
90
|
+
*/
|
|
91
|
+
worktree?: IsolationOutcome;
|
|
92
|
+
/** WS5 (#27) — what this run's resume replayed, and what it saved. */
|
|
93
|
+
resume?: ResumeOutcome;
|
|
94
|
+
/**
|
|
95
|
+
* WS1 — every finding this run recorded, in call order, already gated.
|
|
96
|
+
*
|
|
97
|
+
* Read from the `finding:recorded` event the tool emits on this loop's own
|
|
98
|
+
* context bus — the same seam that carries `autonomy:write-applied` — so the
|
|
99
|
+
* command reports the verdicts its turn produced rather than leaving them in
|
|
100
|
+
* the model thread. `[]`/absent is "none recorded", never silence about a
|
|
101
|
+
* surface that cannot report them.
|
|
102
|
+
*/
|
|
103
|
+
findings?: import('../findings/verdicts.js').WireFinding[];
|
|
64
104
|
}
|
|
65
105
|
/** Options for runLoopExecutor — mirrors the pipeline arm's surface. */
|
|
66
106
|
export interface LoopExecutorOptions {
|
|
@@ -84,6 +124,21 @@ export interface LoopExecutorOptions {
|
|
|
84
124
|
maxSteps?: number;
|
|
85
125
|
/** Quiet mode: no progress logging (eval arms). */
|
|
86
126
|
quiet?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* WS5 (#27) — run this turn in its own git worktree of the project and report
|
|
129
|
+
* the diff against the base commit. `undefined` defers to `NUVIRA_ISOLATE`,
|
|
130
|
+
* which is how a surface with no command line asks.
|
|
131
|
+
*/
|
|
132
|
+
worktree?: boolean;
|
|
133
|
+
/** WS5 (#27) — keep the worktree after the run (its path is reported either way). */
|
|
134
|
+
keepWorktree?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* WS5 (#27) — replay this run's recorded steps whose input is unchanged instead
|
|
137
|
+
* of paying for them again. `--resume [id]` on `nuvira execute` carries it, and
|
|
138
|
+
* it means the SAME thing as the pipeline arm's `--resume`: the last run of this
|
|
139
|
+
* ask in this directory (both resolve their id through `checkpointIdFor`).
|
|
140
|
+
*/
|
|
141
|
+
resume?: string | boolean;
|
|
87
142
|
/**
|
|
88
143
|
* G18 — echo each tool RESULT (first line, bounded) under the call line.
|
|
89
144
|
* Previously even `-v` printed only the call (`⚙ edit_file({path: …})`) and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop-executor.d.ts","sourceRoot":"","sources":["../../src/cli/loop-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"loop-executor.d.ts","sourceRoot":"","sources":["../../src/cli/loop-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAUrD,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAA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E,MAAM,CAAC;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAeD;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,aAAa,EAC5B,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,kBAAkB,CAAC,CA64B7B"}
|
|
@@ -25,22 +25,35 @@
|
|
|
25
25
|
* remains available for CI/publish — enterprise semantics are not weakened.
|
|
26
26
|
*/
|
|
27
27
|
import { resolveProvider } from './router.js';
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
28
|
+
import { resolveRoute, servedRouteFrom } from '../inference/route-resolver.js';
|
|
29
|
+
import { debugLogNotice, sessionDebugLog } from '../observability/debug-log.js';
|
|
30
|
+
// WS3 (#25) — the turn as a span, when an operator has asked for OTLP export.
|
|
31
|
+
import { flushSpans, otelNoticeOnce, startTurnSpan } from '../observability/otel.js';
|
|
32
|
+
// WS5 (#27) — isolation (a git worktree around the whole run) and resume
|
|
33
|
+
// (replaying recorded steps). Both are resolved from the CLI's flags AND the
|
|
34
|
+
// environment, so `nuvira execute --worktree` and an isolated deployment take the
|
|
35
|
+
// same path (see `resolveIsolationRequest`).
|
|
36
|
+
import { beginIsolation, endIsolation, resolveIsolationRequest, worktreeNotice, } from '../tools/worktree.js';
|
|
37
|
+
import { closeResume, openResume, resolveResumeRequest, } from '../learning/step-checkpoint.js';
|
|
38
|
+
import { noteServedRoute } from '../tools/loop-route-feed.js';
|
|
39
|
+
import { getAutoRouter, isAutoProvider, governanceVerdict } from '../learning/auto-router.js';
|
|
30
40
|
import { buildDeepFailoverPool, createFailoverExclusionFilter } from '../learning/resilient-call.js';
|
|
31
41
|
import { recordActionFailure } from '../learning/failure-bookkeeping.js';
|
|
32
42
|
import { recordRegistrySuccess, getProviderFallback, classifyFallbackError, isRetryableError, } from '../learning/provider-fallback.js';
|
|
33
43
|
import { resolveThreadBudgetChars } from '../learning/context-budget.js';
|
|
34
44
|
import { buildLoopProjectContext } from '../tools/loop-project-context.js';
|
|
45
|
+
import { deliverablesNamedIn, recordStepHandoff } from '../agents/step-handoff.js';
|
|
35
46
|
import { getLoopExposureMode } from '../tools/toolsets.js';
|
|
36
47
|
import { resolveModelHarnessProfile } from '../learning/model-harness.js';
|
|
37
48
|
import { hasCredentials } from '../learning/model-selection.js';
|
|
38
49
|
import { resolveEngine } from '../learning/engine-router.js';
|
|
39
50
|
import { logger } from '../utils/logger.js';
|
|
40
|
-
import { beginTrace, endTrace, recordStep, recordTraceEvent, buildTraceOutcome, } from '../learning/reasoning-trace.js';
|
|
51
|
+
import { beginTrace, endTrace, recordStep, recordTraceEvent, recordTraceFindings, buildTraceOutcome, } from '../learning/reasoning-trace.js';
|
|
41
52
|
import { estimateTokens } from '../learning/cost-tracker.js';
|
|
42
53
|
import { createHash } from 'node:crypto';
|
|
43
54
|
import { toUserFacingGenerationError, detectAnswerQualityFailure, answerQualityError, } from '../inference/tool-call-utils.js';
|
|
55
|
+
// WS1 — the finding tool's bus event (the loop's context emit carries it).
|
|
56
|
+
import { FINDING_EVENT } from '../tools/finding-tool.js';
|
|
44
57
|
/**
|
|
45
58
|
* Serialize the loop's thread the way the chat transport does, so the SAME
|
|
46
59
|
* layer splitter (and therefore the same per-layer digests) applies to both
|
|
@@ -108,6 +121,84 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
108
121
|
const traceId = beginTrace({ goal, source: 'loop' });
|
|
109
122
|
/** Refusals/gates recorded this turn — reported in the CLI summary. */
|
|
110
123
|
const recorded = { refusals: 0, gateDecisions: 0 };
|
|
124
|
+
/** Per-call tool outcomes, in call order (see LoopExecutorResult.toolOutcomes). */
|
|
125
|
+
const toolOutcomes = [];
|
|
126
|
+
// ─── WS5 (#27) — ISOLATION AND RESUME, the run's envelope ───────────────
|
|
127
|
+
//
|
|
128
|
+
// Resolved BEFORE routing, so a run that cannot be isolated refuses without
|
|
129
|
+
// walking providers or spending a token: the request is the first thing it
|
|
130
|
+
// honours, and the refusal is a result the command reports as a failure rather
|
|
131
|
+
// than an answer (see `isolationRefusalText`).
|
|
132
|
+
const isolationRequest = resolveIsolationRequest({
|
|
133
|
+
worktree: opts.worktree,
|
|
134
|
+
keepWorktree: opts.keepWorktree,
|
|
135
|
+
});
|
|
136
|
+
const projectDir = process.cwd();
|
|
137
|
+
const isolation = beginIsolation({ request: isolationRequest, repoCwd: projectDir, label: goal });
|
|
138
|
+
if (isolation && !isolation.ok) {
|
|
139
|
+
if (!opts.quiet)
|
|
140
|
+
logger.error(isolation.refusal);
|
|
141
|
+
return failureResult(isolation.refusal, startedAt, opts.provider ?? 'auto', opts.model ?? 'default', 'refused: the run could not be isolated in a git worktree');
|
|
142
|
+
}
|
|
143
|
+
const worktree = isolation?.ok ? isolation.worktree : null;
|
|
144
|
+
/**
|
|
145
|
+
* The directory this run works in: the worktree when isolated, else the
|
|
146
|
+
* process's own cwd. Every directory-dependent path below reads this — the
|
|
147
|
+
* ambient project snapshot, the step hand-off record and the tools' `cwd` —
|
|
148
|
+
* because a run isolated for its tools but reading its context from the
|
|
149
|
+
* original tree is not isolated, it is confused.
|
|
150
|
+
*/
|
|
151
|
+
const turnCwd = worktree?.dir ?? projectDir;
|
|
152
|
+
const resumeRequest = resolveResumeRequest({ resume: opts.resume });
|
|
153
|
+
// Opened only when a resume was asked for: an ordinary run never touches the
|
|
154
|
+
// record store (no read, no write, no directory created).
|
|
155
|
+
const resume = resumeRequest
|
|
156
|
+
? openResume({ goal, cwd: turnCwd, resume: resumeRequest })
|
|
157
|
+
: null;
|
|
158
|
+
if (worktree && !opts.quiet)
|
|
159
|
+
logger.info(worktreeNotice(worktree));
|
|
160
|
+
// WS5 — what the RECORD holds, said before the run. The outcome is reported by
|
|
161
|
+
// `finishResult` below, where the counts are real (see `StepReplay.openNotice`).
|
|
162
|
+
if (resume && !opts.quiet)
|
|
163
|
+
logger.info(resume.ledger.openNotice());
|
|
164
|
+
/**
|
|
165
|
+
* Attach this run's isolation and resume outcomes to whatever it returns.
|
|
166
|
+
*
|
|
167
|
+
* Called on EVERY exit path (a routing failure included), because a worktree
|
|
168
|
+
* that is not measured and removed is a directory left in the operator's profile
|
|
169
|
+
* with a branch pointing at it — the same reason `endIsolation` measures the
|
|
170
|
+
* diff before it tears anything down. `endIsolation` never throws, so cleanup
|
|
171
|
+
* cannot replace this run's own result with a git error.
|
|
172
|
+
*/
|
|
173
|
+
const finishResult = (result) => {
|
|
174
|
+
const extra = {};
|
|
175
|
+
if (worktree) {
|
|
176
|
+
const outcome = endIsolation(worktree, { keep: isolationRequest.keep });
|
|
177
|
+
extra.worktree = outcome;
|
|
178
|
+
if (!opts.quiet)
|
|
179
|
+
logger.info(outcome.notice);
|
|
180
|
+
}
|
|
181
|
+
if (resume) {
|
|
182
|
+
const outcome = closeResume(resume, { goal, cwd: turnCwd });
|
|
183
|
+
extra.resume = outcome;
|
|
184
|
+
extra.replayedSteps = outcome.replayed;
|
|
185
|
+
if (!opts.quiet)
|
|
186
|
+
logger.info(outcome.notice);
|
|
187
|
+
}
|
|
188
|
+
return { ...result, ...extra };
|
|
189
|
+
};
|
|
190
|
+
/** WS1 — findings recorded this run, in call order (see LoopExecutorResult.findings). */
|
|
191
|
+
const findings = [];
|
|
192
|
+
// WS2 (#24) — the optional session debug log for this `execute` turn. Opened
|
|
193
|
+
// before routing (like the trace) so a run that dies in the provider walk
|
|
194
|
+
// still leaves the evidence of what it tried. Null unless logging is on.
|
|
195
|
+
const debugLog = sessionDebugLog({ surface: 'cli-execute', goal, backend: { engine: 'loop' } });
|
|
196
|
+
debugLog?.event('turn.start');
|
|
197
|
+
// WS3 (#25) — the turn's span root, when span export is on (else null). Opened
|
|
198
|
+
// beside the debug log and before routing, for the same reason: a run that
|
|
199
|
+
// dies in the provider walk is exactly the run whose shape a reader needs, and
|
|
200
|
+
// a span that only exists for successful turns cannot explain a failure.
|
|
201
|
+
const otelSpan = await startTurnSpan({ surface: 'cli-execute', goal });
|
|
111
202
|
/**
|
|
112
203
|
* G18 — one sink for the loop's non-LLM facts: persisted to the trace store,
|
|
113
204
|
* and (only under `-v`) echoed to the console so a live run is readable
|
|
@@ -115,10 +206,24 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
115
206
|
*/
|
|
116
207
|
const onTraceEvent = (event) => {
|
|
117
208
|
recordTraceEvent(traceId, event);
|
|
209
|
+
// WS2 — the same facts into the session debug log (bounded + redacted): a
|
|
210
|
+
// bug report needs the tool calls, gate decisions and refusals in order.
|
|
211
|
+
debugLog?.event(event.kind, {
|
|
212
|
+
...(event.tool ? { tool: event.tool } : {}),
|
|
213
|
+
...(event.gate ? { gate: event.gate } : {}),
|
|
214
|
+
...(event.ok === undefined ? {} : { ok: event.ok }),
|
|
215
|
+
summary: event.summary,
|
|
216
|
+
});
|
|
118
217
|
if (event.kind === 'refusal')
|
|
119
218
|
recorded.refusals += 1;
|
|
120
219
|
if (event.kind === 'gate')
|
|
121
220
|
recorded.gateDecisions += 1;
|
|
221
|
+
// One event per executed call, so this is the call-ordered per-call outcome
|
|
222
|
+
// (a refusal event is a call that ran and did not succeed). `ok` is set on
|
|
223
|
+
// both; fall back to the kind only if a future emitter omits it.
|
|
224
|
+
if ((event.kind === 'tool' || event.kind === 'refusal') && event.tool) {
|
|
225
|
+
toolOutcomes.push({ tool: event.tool, ok: event.ok ?? event.kind === 'tool' });
|
|
226
|
+
}
|
|
122
227
|
if (!opts.quiet && opts.verbose && (event.kind === 'tool' || event.kind === 'refusal')) {
|
|
123
228
|
logger.info(` ${event.ok ? '↳' : '⛔'} ${event.tool}: ${previewLine(event.result ?? event.summary)}`);
|
|
124
229
|
}
|
|
@@ -127,6 +232,12 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
127
232
|
let providerType = 'auto';
|
|
128
233
|
let model = 'default';
|
|
129
234
|
let provider = null;
|
|
235
|
+
/**
|
|
236
|
+
* The route ACTUALLY serving this turn, kept current through every failover
|
|
237
|
+
* and handed to the loop (which re-reads it before each model call) so the
|
|
238
|
+
* model can answer about itself from a measured fact instead of a guess.
|
|
239
|
+
*/
|
|
240
|
+
let servedRoute = null;
|
|
130
241
|
// ── Mid-turn failover candidate pool ────────────────────────────────────
|
|
131
242
|
// The SAME deep chain the orchestrator/chat walk. Before this the loop only
|
|
132
243
|
// used the chain to pick its STARTING provider: a 429 on the second step
|
|
@@ -224,9 +335,19 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
224
335
|
const resolved = resolveProvider(configManager, opts.provider);
|
|
225
336
|
providerType = resolved.type;
|
|
226
337
|
provider = resolved.provider;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
338
|
+
// Validate the pin against the provider that will serve it, ALWAYS — an
|
|
339
|
+
// explicit `--model` used to be used as-is (`opts.model ? opts.model :
|
|
340
|
+
// resolve…`), so `-p groq -m <a gemini model>` reached the API unvalidated
|
|
341
|
+
// and 404'd with the repair machinery sitting right there (issue #10).
|
|
342
|
+
const pinned = await resolveRoute({
|
|
343
|
+
providerType,
|
|
344
|
+
provider,
|
|
345
|
+
model: opts.model,
|
|
346
|
+
source: 'cli',
|
|
347
|
+
task: 'interactive loop (pinned provider)',
|
|
348
|
+
});
|
|
349
|
+
model = pinned.model;
|
|
350
|
+
servedRoute = servedRouteFrom(pinned);
|
|
230
351
|
pushCandidate(providerType, model);
|
|
231
352
|
// ── A PINNED RUN FAILS OVER TOO ──────────────────────────────────────
|
|
232
353
|
// A pinned provider used to contribute a SINGLE candidate, so any
|
|
@@ -297,7 +418,15 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
297
418
|
: getAutoRouter().resolveModel(pair.provider, 'execute', configManager);
|
|
298
419
|
providerType = resolved.type;
|
|
299
420
|
provider = resolved.provider;
|
|
300
|
-
|
|
421
|
+
const route = await resolveRoute({
|
|
422
|
+
providerType: resolved.type,
|
|
423
|
+
provider: resolved.provider,
|
|
424
|
+
model: desired,
|
|
425
|
+
source: 'cli',
|
|
426
|
+
task: 'interactive loop (failover chain)',
|
|
427
|
+
});
|
|
428
|
+
model = route.model;
|
|
429
|
+
servedRoute = servedRouteFrom(route);
|
|
301
430
|
break;
|
|
302
431
|
}
|
|
303
432
|
}
|
|
@@ -310,14 +439,14 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
310
439
|
catch (err) {
|
|
311
440
|
// G18 — a routing failure is a FAILED trace, not a missing one.
|
|
312
441
|
endTrace(traceId, false, { kind: 'failed', tools: [] });
|
|
313
|
-
return failureResult(
|
|
442
|
+
return finishResult(failureResult(
|
|
314
443
|
// User-facing reason is sanitized (no provider wire text); the raw error
|
|
315
444
|
// rides along as the technical explanation below.
|
|
316
|
-
toUserFacingGenerationError(err), startedAt, opts.provider ?? 'auto', opts.model ?? 'default', `routing failed before an engine decision was possible: ${err instanceof Error ? err.message : String(err)}`);
|
|
445
|
+
toUserFacingGenerationError(err), startedAt, opts.provider ?? 'auto', opts.model ?? 'default', `routing failed before an engine decision was possible: ${err instanceof Error ? err.message : String(err)}`));
|
|
317
446
|
}
|
|
318
447
|
if (!provider) {
|
|
319
448
|
endTrace(traceId, false, { kind: 'failed', tools: [] });
|
|
320
|
-
return failureResult('No available provider for the loop engine (check API keys / local runner).', startedAt, opts.provider ?? 'auto', opts.model ?? 'default', 'no available provider after the candidate walk');
|
|
449
|
+
return finishResult(failureResult('No available provider for the loop engine (check API keys / local runner).', startedAt, opts.provider ?? 'auto', opts.model ?? 'default', 'no available provider after the candidate walk'));
|
|
321
450
|
}
|
|
322
451
|
// ── Engine decision (Phase 2): audit-trail echo for the caller/telemetry ──
|
|
323
452
|
// The CALLER decides loop-vs-pipeline with the same function; this echo
|
|
@@ -335,7 +464,7 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
335
464
|
let projectContext;
|
|
336
465
|
if (!opts.skipProjectContext) {
|
|
337
466
|
try {
|
|
338
|
-
const built = await buildLoopProjectContext(
|
|
467
|
+
const built = await buildLoopProjectContext(turnCwd);
|
|
339
468
|
if (built)
|
|
340
469
|
projectContext = built;
|
|
341
470
|
}
|
|
@@ -390,10 +519,14 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
390
519
|
/** One generation attempt on a concrete provider × model (native → JSON). */
|
|
391
520
|
const tryOnce = async (prov, mdl, messages, schemas, abort) => {
|
|
392
521
|
if (typeof prov.generateTools === 'function' && schemas.length > 0) {
|
|
522
|
+
// R2 — tag the transport on the way out, the same vocabulary chat and the
|
|
523
|
+
// subagent child report, so an `execute` run can be attributed too.
|
|
393
524
|
if (typeof prov.generateToolsStream === 'function' && opts.onToken) {
|
|
394
|
-
|
|
525
|
+
const streamed = await prov.generateToolsStream(messages, schemas, { model: mdl, signal: abort }, opts.onToken);
|
|
526
|
+
return { ...streamed, transport: 'native' };
|
|
395
527
|
}
|
|
396
|
-
|
|
528
|
+
const native = await prov.generateTools(messages, schemas, { model: mdl, signal: abort });
|
|
529
|
+
return { ...native, transport: 'native' };
|
|
397
530
|
}
|
|
398
531
|
// JSON fallback transport — the shared helper the chat engine uses.
|
|
399
532
|
const { buildJsonFallbackPrompt } = await import('../inference/tool-call-utils.js');
|
|
@@ -412,7 +545,8 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
412
545
|
raw = await prov.generate(prompt, { model: mdl, signal: abort });
|
|
413
546
|
}
|
|
414
547
|
const { text, calls } = extractFallbackToolCalls(raw);
|
|
415
|
-
|
|
548
|
+
// R2 — the shared JSON fallback, named as such.
|
|
549
|
+
return { content: text, toolCalls: calls, transport: 'json' };
|
|
416
550
|
};
|
|
417
551
|
const callModel = async (messages, schemas, _stepOnToken, stepSignal) => {
|
|
418
552
|
void _stepOnToken;
|
|
@@ -471,12 +605,24 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
471
605
|
const desired = cand.model !== 'default'
|
|
472
606
|
? cand.model
|
|
473
607
|
: getAutoRouter().resolveModel(cand.provider, 'execute', configManager);
|
|
474
|
-
const
|
|
608
|
+
const route = await resolveRoute({
|
|
609
|
+
providerType: cand.provider,
|
|
610
|
+
provider: prov,
|
|
611
|
+
model: desired,
|
|
612
|
+
source: 'failover',
|
|
613
|
+
task: 'interactive loop (mid-turn failover)',
|
|
614
|
+
});
|
|
615
|
+
const mdl = route.model;
|
|
475
616
|
// Flip the loop's active provider/model to the candidate that answers,
|
|
476
617
|
// so telemetry and the NEXT step's primary pick follow the winner.
|
|
477
618
|
providerType = cand.provider;
|
|
478
619
|
provider = prov;
|
|
479
620
|
model = mdl;
|
|
621
|
+
// The model is TOLD about this, honestly (see loop-route-feed.ts): a
|
|
622
|
+
// failover that the model does not learn about is how a turn ends up
|
|
623
|
+
// answering "which model are you?" about a model that stopped serving
|
|
624
|
+
// it several steps earlier.
|
|
625
|
+
servedRoute = noteServedRoute(servedRoute, servedRouteFrom(route));
|
|
480
626
|
const resp = await tryOnce(prov, mdl, messages, schemas, abort);
|
|
481
627
|
// ── ANSWER-QUALITY GATE ──────────────────────────────────────────
|
|
482
628
|
// A reply that is the model's own REASONING, or its narration of the
|
|
@@ -559,6 +705,32 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
559
705
|
}
|
|
560
706
|
}
|
|
561
707
|
extendWithPinnedFallbacks();
|
|
708
|
+
// ── DURABLE HAND-OFF ────────────────────────────────────────────────
|
|
709
|
+
// The failure is written down BEFORE the walk moves on, so the next
|
|
710
|
+
// candidate, the next turn and the next run all inherit it. The design
|
|
711
|
+
// already said "a broken task is handed to another model" — what was
|
|
712
|
+
// missing is the RECORD that survives the hand-off, which is why the
|
|
713
|
+
// live NVDA-addon ask re-planned the identical step 18 times and would
|
|
714
|
+
// have re-planned a 19th (see step-handoff.ts).
|
|
715
|
+
//
|
|
716
|
+
// What the record carries is deliberately not "model X failed": it is
|
|
717
|
+
// the route, the failure KIND, the reason, and the artifacts the ask
|
|
718
|
+
// named — reconciled against the filesystem on every later read, so the
|
|
719
|
+
// incoming model is told what is genuinely still outstanding.
|
|
720
|
+
try {
|
|
721
|
+
recordStepHandoff({
|
|
722
|
+
projectPath: turnCwd,
|
|
723
|
+
goal,
|
|
724
|
+
stepDescription: goal,
|
|
725
|
+
declared: deliverablesNamedIn(goal),
|
|
726
|
+
route: `${cand.provider}:${cand.model !== 'default' ? cand.model : model}`,
|
|
727
|
+
kind: qualityKind ? 'quality' : 'failed',
|
|
728
|
+
reason: err instanceof Error ? err.message : String(err),
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
catch {
|
|
732
|
+
// Best-effort — a hand-off write must never mask the generation error.
|
|
733
|
+
}
|
|
562
734
|
if (!opts.quiet) {
|
|
563
735
|
logger.warn(qualityKind
|
|
564
736
|
? ` \u26A0\uFE0F ${cand.provider} answered with ${qualityKind === 'reasoning' ? 'its own reasoning' : 'tool-contract confusion'} instead of the task — trying the next loop candidate...`
|
|
@@ -578,6 +750,9 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
578
750
|
});
|
|
579
751
|
const result = await runToolLoop({
|
|
580
752
|
messages: thread,
|
|
753
|
+
// Read fresh on every step: a mid-turn failover must be visible to the
|
|
754
|
+
// model, not just to the log (see the route feed).
|
|
755
|
+
servedRoute: () => servedRoute,
|
|
581
756
|
maxSteps: opts.maxSteps ?? 16,
|
|
582
757
|
// Model-window-aware thread budget: a 1M-token model keeps its whole
|
|
583
758
|
// window instead of being trimmed to the fixed ~50K-token default.
|
|
@@ -585,12 +760,19 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
585
760
|
threadBudgetChars: resolveThreadBudgetChars({ provider: providerType, model }),
|
|
586
761
|
toolExposure: harness.exposure,
|
|
587
762
|
maxParallelReads: harness.maxParallelReads,
|
|
763
|
+
// WS3 (#25) — the turn span the loop hangs each tool call under.
|
|
764
|
+
otel: otelSpan,
|
|
765
|
+
// WS4 (#26) — the label a tool hook reports this call under.
|
|
766
|
+
surface: 'cli-execute',
|
|
767
|
+
// WS5 (#27) — the resume ledger, when this run was asked to resume.
|
|
768
|
+
// Omitted otherwise, so an ordinary run never consults it.
|
|
769
|
+
...(resume ? { resume: resume.ledger } : {}),
|
|
588
770
|
onToken: opts.onToken,
|
|
589
771
|
signal: opts.signal,
|
|
590
772
|
context: {
|
|
591
773
|
configManager,
|
|
592
774
|
loadedExtraTools,
|
|
593
|
-
cwd:
|
|
775
|
+
cwd: turnCwd,
|
|
594
776
|
// G18 — the autonomy gates report their DECISIONS on this bus
|
|
595
777
|
// (`autonomy:write-applied`, emitted by write_file/edit_file/
|
|
596
778
|
// run_terminal/run_cli/git). Forwarding them here is what makes "the
|
|
@@ -598,6 +780,11 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
598
780
|
// reason" reviewable after the fact instead of inferred from a missing
|
|
599
781
|
// round trip.
|
|
600
782
|
emit: (event, data) => {
|
|
783
|
+
// WS1 — a finding the turn recorded, with the gate's verdict.
|
|
784
|
+
if (event === FINDING_EVENT) {
|
|
785
|
+
findings.push(data);
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
601
788
|
if (event !== 'autonomy:write-applied')
|
|
602
789
|
return;
|
|
603
790
|
const d = data;
|
|
@@ -704,12 +891,68 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
704
891
|
unverifiedEditClaim: result.unverifiedEditClaim,
|
|
705
892
|
undeliveredArtifact: result.undeliveredArtifact,
|
|
706
893
|
}));
|
|
707
|
-
|
|
894
|
+
// WS1 (#23) — persist the run's findings on its trace too, so a `nuvira
|
|
895
|
+
// execute` turn's verdicts are auditable from the Trace tab exactly like a
|
|
896
|
+
// chat turn's. Best-effort; an id-less traceId would still attach to the
|
|
897
|
+
// run in progress, but the explicit id is what `endTrace` just closed.
|
|
898
|
+
recordTraceFindings(traceId, findings);
|
|
899
|
+
// WS2 — close the session debug log with the backend that ACTUALLY served
|
|
900
|
+
// the run: `servedRoute` is kept current through every failover, which is
|
|
901
|
+
// exactly the fact a debug header exists to record.
|
|
902
|
+
if (debugLog) {
|
|
903
|
+
const servedModel = servedRoute?.model ?? model;
|
|
904
|
+
debugLog.backendOf({
|
|
905
|
+
provider: servedRoute?.providerType ?? providerType,
|
|
906
|
+
...(servedModel ? { model: servedModel } : {}),
|
|
907
|
+
transport: result.transport ?? null,
|
|
908
|
+
});
|
|
909
|
+
debugLog.event('turn.end', {
|
|
910
|
+
generationFailed: result.generationFailed === true,
|
|
911
|
+
toolCalls: toolOutcomes.length,
|
|
912
|
+
refusals: recorded.refusals,
|
|
913
|
+
gateDecisions: recorded.gateDecisions,
|
|
914
|
+
findings: findings.length,
|
|
915
|
+
});
|
|
916
|
+
// A QUIET run (which is what `--json-events` sets) prints nothing extra:
|
|
917
|
+
// its stdout is a machine-readable event stream, and a helpful log line
|
|
918
|
+
// inside it is a corrupt event. The file is still written.
|
|
919
|
+
const path = debugLog.write();
|
|
920
|
+
const notice = opts.quiet ? null : debugLogNotice('cli-execute', path);
|
|
921
|
+
if (notice)
|
|
922
|
+
logger.info(notice);
|
|
923
|
+
}
|
|
924
|
+
// WS3 (#25) — close the turn span and ship it. The status is the turn's own
|
|
925
|
+
// outcome, so a failed turn is a RED span in the collector rather than an
|
|
926
|
+
// absent one — the same rule the debug log follows for a crash. Flushed here
|
|
927
|
+
// rather than left to the batch scheduler's clock: a one-shot `nuvira
|
|
928
|
+
// execute` has to be gone before the next tick.
|
|
929
|
+
if (otelSpan) {
|
|
930
|
+
otelSpan.attr('nuvira.toolCalls', toolOutcomes.length);
|
|
931
|
+
otelSpan.attr('nuvira.findings', findings.length);
|
|
932
|
+
otelSpan.end({
|
|
933
|
+
ok: result.generationFailed !== true && result.cancelled !== true,
|
|
934
|
+
...(result.generationFailed === true
|
|
935
|
+
? { message: 'the turn did not produce a usable answer' }
|
|
936
|
+
: result.cancelled === true
|
|
937
|
+
? { message: 'the turn was cancelled' }
|
|
938
|
+
: {}),
|
|
939
|
+
});
|
|
940
|
+
// A QUIET run (which is what `--json-events` sets) prints nothing extra:
|
|
941
|
+
// its stdout is the machine-readable event stream, and a notice inside it
|
|
942
|
+
// is a corrupt event. The span is still exported.
|
|
943
|
+
const otelLine = opts.quiet ? null : otelNoticeOnce('cli-execute');
|
|
944
|
+
if (otelLine)
|
|
945
|
+
logger.info(otelLine);
|
|
946
|
+
await flushSpans();
|
|
947
|
+
}
|
|
948
|
+
return finishResult({
|
|
708
949
|
content: result.content,
|
|
709
950
|
generationFailed: result.generationFailed ?? false,
|
|
710
951
|
bounded: result.bounded,
|
|
711
952
|
toolCalls: result.toolCalls,
|
|
712
953
|
erroredTools,
|
|
954
|
+
toolOutcomes,
|
|
955
|
+
...(findings.length > 0 ? { findings } : {}),
|
|
713
956
|
durationMs: Date.now() - startedAt,
|
|
714
957
|
provider: providerType,
|
|
715
958
|
model,
|
|
@@ -717,12 +960,34 @@ export async function runLoopExecutor(goal, configManager, opts = {}) {
|
|
|
717
960
|
traceId,
|
|
718
961
|
refusals: recorded.refusals,
|
|
719
962
|
gateDecisions: recorded.gateDecisions,
|
|
963
|
+
...(result.transport ? { transport: result.transport } : {}),
|
|
720
964
|
...(result.runTrace ? { runTrace: result.runTrace } : {}),
|
|
721
|
-
};
|
|
965
|
+
});
|
|
722
966
|
}
|
|
723
967
|
catch (err) {
|
|
724
968
|
endTrace(traceId, false, { kind: 'failed', tools: [] });
|
|
725
|
-
|
|
969
|
+
// WS3 (#25) — a run that THREW still ships its span, for the same reason it
|
|
970
|
+
// still writes its log: a crash is the single most useful thing to see in a
|
|
971
|
+
// trace, and a span that vanishes exactly when the run broke is worse than
|
|
972
|
+
// no tracing at all.
|
|
973
|
+
if (otelSpan) {
|
|
974
|
+
otelSpan.end({ ok: false, message: err instanceof Error ? err.message : String(err) });
|
|
975
|
+
const otelLine = opts.quiet ? null : otelNoticeOnce('cli-execute');
|
|
976
|
+
if (otelLine)
|
|
977
|
+
logger.info(otelLine);
|
|
978
|
+
await flushSpans();
|
|
979
|
+
}
|
|
980
|
+
// WS2 — a run that THREW still writes its log: a crash is the single most
|
|
981
|
+
// useful bug report there is, and the backend fields stay `unknown` rather
|
|
982
|
+
// than being invented.
|
|
983
|
+
if (debugLog) {
|
|
984
|
+
debugLog.event('turn.error', { error: err instanceof Error ? err.message : String(err) });
|
|
985
|
+
const path = debugLog.write();
|
|
986
|
+
const notice = opts.quiet ? null : debugLogNotice('cli-execute', path);
|
|
987
|
+
if (notice)
|
|
988
|
+
logger.info(notice);
|
|
989
|
+
}
|
|
990
|
+
return finishResult(failureResult(toUserFacingGenerationError(err), startedAt, providerType, model, `loop execution failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
726
991
|
}
|
|
727
992
|
}
|
|
728
993
|
/** Build a failed result (shape-complete for the eval arm comparison). */
|
|
@@ -733,6 +998,7 @@ function failureResult(message, startedAt, provider, model, engineExplanation) {
|
|
|
733
998
|
bounded: false,
|
|
734
999
|
toolCalls: [],
|
|
735
1000
|
erroredTools: [],
|
|
1001
|
+
toolOutcomes: [],
|
|
736
1002
|
durationMs: Date.now() - startedAt,
|
|
737
1003
|
provider,
|
|
738
1004
|
model,
|