pulseed 0.6.1 → 0.6.2
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 +1 -1
- package/dist/adapters/types/a2a.d.ts +24 -24
- package/dist/base/config/global-config.d.ts +4 -4
- package/dist/base/state/state-manager-goal-write.d.ts +1 -1
- package/dist/base/state/state-manager-goal-write.d.ts.map +1 -1
- package/dist/base/state/state-manager.d.ts +2 -6
- package/dist/base/state/state-manager.d.ts.map +1 -1
- package/dist/base/state/state-manager.js.map +1 -1
- package/dist/base/state/state-write-fence.d.ts +7 -0
- package/dist/base/state/state-write-fence.d.ts.map +1 -0
- package/dist/base/state/state-write-fence.js +2 -0
- package/dist/base/state/state-write-fence.js.map +1 -0
- package/dist/base/types/companion.d.ts +2 -0
- package/dist/base/types/companion.d.ts.map +1 -0
- package/dist/base/types/companion.js +2 -0
- package/dist/base/types/companion.js.map +1 -0
- package/dist/base/types/index.d.ts +1 -0
- package/dist/base/types/index.d.ts.map +1 -1
- package/dist/base/types/index.js +1 -0
- package/dist/base/types/index.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/interface/chat/chat-event-state.d.ts +2 -0
- package/dist/interface/chat/chat-event-state.d.ts.map +1 -1
- package/dist/interface/chat/chat-event-state.js +28 -11
- package/dist/interface/chat/chat-event-state.js.map +1 -1
- package/dist/interface/chat/chat-events.d.ts +9 -1
- package/dist/interface/chat/chat-events.d.ts.map +1 -1
- package/dist/interface/chat/chat-history.d.ts +4739 -1
- package/dist/interface/chat/chat-history.d.ts.map +1 -1
- package/dist/interface/chat/chat-history.js +40 -2
- package/dist/interface/chat/chat-history.js.map +1 -1
- package/dist/interface/chat/chat-runner-commands.d.ts +2 -32
- package/dist/interface/chat/chat-runner-commands.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-commands.js +2 -2
- package/dist/interface/chat/chat-runner-commands.js.map +1 -1
- package/dist/interface/chat/chat-runner-contracts.d.ts +152 -0
- package/dist/interface/chat/chat-runner-contracts.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-contracts.js +2 -0
- package/dist/interface/chat/chat-runner-contracts.js.map +1 -0
- package/dist/interface/chat/chat-runner-event-bridge.d.ts +8 -2
- package/dist/interface/chat/chat-runner-event-bridge.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-event-bridge.js +76 -11
- package/dist/interface/chat/chat-runner-event-bridge.js.map +1 -1
- package/dist/interface/chat/chat-runner-routes.d.ts +66 -12
- package/dist/interface/chat/chat-runner-routes.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-routes.js +322 -30
- package/dist/interface/chat/chat-runner-routes.js.map +1 -1
- package/dist/interface/chat/chat-runner-runtime.d.ts +1 -1
- package/dist/interface/chat/chat-runner-runtime.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-runtime.js +4 -0
- package/dist/interface/chat/chat-runner-runtime.js.map +1 -1
- package/dist/interface/chat/chat-runner.d.ts +10 -71
- package/dist/interface/chat/chat-runner.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner.js +403 -58
- package/dist/interface/chat/chat-runner.js.map +1 -1
- package/dist/interface/chat/chat-session-store.d.ts +2 -0
- package/dist/interface/chat/chat-session-store.d.ts.map +1 -1
- package/dist/interface/chat/chat-session-store.js +3 -6
- package/dist/interface/chat/chat-session-store.js.map +1 -1
- package/dist/interface/chat/cross-platform-session-global.d.ts +2 -1
- package/dist/interface/chat/cross-platform-session-global.d.ts.map +1 -1
- package/dist/interface/chat/cross-platform-session-global.js +4 -10
- package/dist/interface/chat/cross-platform-session-global.js.map +1 -1
- package/dist/interface/chat/cross-platform-session.d.ts +30 -1
- package/dist/interface/chat/cross-platform-session.d.ts.map +1 -1
- package/dist/interface/chat/cross-platform-session.js +413 -52
- package/dist/interface/chat/cross-platform-session.js.map +1 -1
- package/dist/interface/chat/event-subscriber.js +2 -2
- package/dist/interface/chat/event-subscriber.js.map +1 -1
- package/dist/interface/chat/failure-recovery.js +1 -1
- package/dist/interface/chat/failure-recovery.js.map +1 -1
- package/dist/interface/chat/freeform-route-classifier.d.ts +5 -5
- package/dist/interface/chat/freeform-route-classifier.js +3 -2
- package/dist/interface/chat/freeform-route-classifier.js.map +1 -1
- package/dist/interface/chat/gateway-setup-status.d.ts +33 -0
- package/dist/interface/chat/gateway-setup-status.d.ts.map +1 -0
- package/dist/interface/chat/gateway-setup-status.js +44 -0
- package/dist/interface/chat/gateway-setup-status.js.map +1 -0
- package/dist/interface/chat/ingress-router.d.ts +22 -0
- package/dist/interface/chat/ingress-router.d.ts.map +1 -1
- package/dist/interface/chat/ingress-router.js +148 -11
- package/dist/interface/chat/ingress-router.js.map +1 -1
- package/dist/interface/chat/operation-progress.d.ts +17 -0
- package/dist/interface/chat/operation-progress.d.ts.map +1 -0
- package/dist/interface/chat/operation-progress.js +29 -0
- package/dist/interface/chat/operation-progress.js.map +1 -0
- package/dist/interface/chat/setup-config-write.d.ts +27 -0
- package/dist/interface/chat/setup-config-write.d.ts.map +1 -0
- package/dist/interface/chat/setup-config-write.js +79 -0
- package/dist/interface/chat/setup-config-write.js.map +1 -0
- package/dist/interface/chat/setup-dialogue.d.ts +199 -0
- package/dist/interface/chat/setup-dialogue.d.ts.map +1 -0
- package/dist/interface/chat/setup-dialogue.js +97 -0
- package/dist/interface/chat/setup-dialogue.js.map +1 -0
- package/dist/interface/chat/setup-secret-intake.d.ts +68 -0
- package/dist/interface/chat/setup-secret-intake.d.ts.map +1 -0
- package/dist/interface/chat/setup-secret-intake.js +84 -0
- package/dist/interface/chat/setup-secret-intake.js.map +1 -0
- package/dist/interface/chat/turn-language.d.ts +23 -0
- package/dist/interface/chat/turn-language.d.ts.map +1 -0
- package/dist/interface/chat/turn-language.js +46 -0
- package/dist/interface/chat/turn-language.js.map +1 -0
- package/dist/interface/cli/cli-command-registry.d.ts +1 -1
- package/dist/interface/cli/cli-command-registry.d.ts.map +1 -1
- package/dist/interface/cli/cli-runner.js +1 -1
- package/dist/interface/cli/cli-runner.js.map +1 -1
- package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
- package/dist/interface/cli/commands/daemon.js +3 -0
- package/dist/interface/cli/commands/daemon.js.map +1 -1
- package/dist/interface/cli/commands/operator-binding-status.d.ts +59 -0
- package/dist/interface/cli/commands/operator-binding-status.d.ts.map +1 -0
- package/dist/interface/cli/commands/operator-binding-status.js +257 -0
- package/dist/interface/cli/commands/operator-binding-status.js.map +1 -0
- package/dist/interface/cli/commands/run.d.ts +2 -2
- package/dist/interface/cli/commands/run.d.ts.map +1 -1
- package/dist/interface/cli/commands/run.js.map +1 -1
- package/dist/interface/cli/commands/runtime.d.ts.map +1 -1
- package/dist/interface/cli/commands/runtime.js +8 -1
- package/dist/interface/cli/commands/runtime.js.map +1 -1
- package/dist/interface/cli/commands/setup/steps-gateway.js +14 -3
- package/dist/interface/cli/commands/setup/steps-gateway.js.map +1 -1
- package/dist/interface/cli/commands/setup-wizard.d.ts +31 -0
- package/dist/interface/cli/commands/setup-wizard.d.ts.map +1 -1
- package/dist/interface/cli/commands/setup-wizard.js +88 -0
- package/dist/interface/cli/commands/setup-wizard.js.map +1 -1
- package/dist/interface/cli/commands/telegram.d.ts.map +1 -1
- package/dist/interface/cli/commands/telegram.js +27 -3
- package/dist/interface/cli/commands/telegram.js.map +1 -1
- package/dist/interface/cli/setup.d.ts +3 -3
- package/dist/interface/cli/setup.d.ts.map +1 -1
- package/dist/interface/cli/setup.js +3 -2
- package/dist/interface/cli/setup.js.map +1 -1
- package/dist/interface/cli/utils/loop-runner.d.ts +1 -1
- package/dist/interface/cli/utils/loop-runner.d.ts.map +1 -1
- package/dist/interface/cli/utils.js +1 -1
- package/dist/interface/tui/actions.d.ts.map +1 -1
- package/dist/interface/tui/actions.js +14 -6
- package/dist/interface/tui/actions.js.map +1 -1
- package/dist/interface/tui/app.d.ts +1 -7
- package/dist/interface/tui/app.d.ts.map +1 -1
- package/dist/interface/tui/app.js +71 -120
- package/dist/interface/tui/app.js.map +1 -1
- package/dist/interface/tui/chat-surface.d.ts +1 -0
- package/dist/interface/tui/chat-surface.d.ts.map +1 -1
- package/dist/interface/tui/chat-surface.js +15 -0
- package/dist/interface/tui/chat-surface.js.map +1 -1
- package/dist/interface/tui/entry-approval.js +2 -2
- package/dist/interface/tui/entry-approval.js.map +1 -1
- package/dist/interface/tui/entry-deps.d.ts +1 -1
- package/dist/interface/tui/entry-deps.d.ts.map +1 -1
- package/dist/interface/tui/entry-deps.js +54 -8
- package/dist/interface/tui/entry-deps.js.map +1 -1
- package/dist/interface/tui/input-action.d.ts +49 -0
- package/dist/interface/tui/input-action.d.ts.map +1 -0
- package/dist/interface/tui/input-action.js +46 -0
- package/dist/interface/tui/input-action.js.map +1 -0
- package/dist/interface/tui/markdown-renderer.d.ts.map +1 -1
- package/dist/interface/tui/markdown-renderer.js +4 -1
- package/dist/interface/tui/markdown-renderer.js.map +1 -1
- package/dist/interface/tui/use-loop.d.ts +1 -1
- package/dist/interface/tui/use-loop.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js +14 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-events.d.ts +3 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-events.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-events.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts +17 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-output.d.ts +3 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-output.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts +1 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js +20 -3
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-trace-store.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-trace-store.js +5 -3
- package/dist/orchestrator/execution/agent-loop/agent-loop-trace-store.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-timeline.d.ts +3 -1
- package/dist/orchestrator/execution/agent-loop/agent-timeline.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-timeline.js +8 -20
- package/dist/orchestrator/execution/agent-loop/agent-timeline.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js +38 -25
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js +20 -4
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.d.ts +1 -51
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.js +3 -239
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/durable-loop-control-tools.d.ts +60 -0
- package/dist/orchestrator/execution/agent-loop/durable-loop-control-tools.d.ts.map +1 -0
- package/dist/orchestrator/execution/agent-loop/durable-loop-control-tools.js +244 -0
- package/dist/orchestrator/execution/agent-loop/durable-loop-control-tools.js.map +1 -0
- package/dist/orchestrator/execution/agent-loop/index.d.ts +1 -1
- package/dist/orchestrator/execution/agent-loop/index.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/index.js +1 -1
- package/dist/orchestrator/execution/agent-loop/index.js.map +1 -1
- package/dist/orchestrator/execution/task/task-generation.d.ts +50 -2
- package/dist/orchestrator/execution/task/task-generation.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-generation.js +19 -1
- package/dist/orchestrator/execution/task/task-generation.js.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle.js +8 -11
- package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.js +9 -0
- package/dist/orchestrator/execution/task/task-prompt-builder.js.map +1 -1
- package/dist/orchestrator/execution/types/task-group.d.ts +68 -4
- package/dist/orchestrator/execution/types/task-group.d.ts.map +1 -1
- package/dist/orchestrator/execution/types/task.d.ts +100 -2
- package/dist/orchestrator/execution/types/task.d.ts.map +1 -1
- package/dist/orchestrator/execution/types/task.js +10 -0
- package/dist/orchestrator/execution/types/task.js.map +1 -1
- package/dist/orchestrator/goal/goal-decomposer.d.ts.map +1 -1
- package/dist/orchestrator/goal/goal-decomposer.js +2 -1
- package/dist/orchestrator/goal/goal-decomposer.js.map +1 -1
- package/dist/orchestrator/goal/goal-negotiator.d.ts.map +1 -1
- package/dist/orchestrator/goal/goal-negotiator.js +5 -2
- package/dist/orchestrator/goal/goal-negotiator.js.map +1 -1
- package/dist/orchestrator/goal/goal-suggest.d.ts +6 -6
- package/dist/orchestrator/goal/goal-validation.d.ts +4 -5
- package/dist/orchestrator/goal/goal-validation.d.ts.map +1 -1
- package/dist/orchestrator/goal/goal-validation.js +11 -17
- package/dist/orchestrator/goal/goal-validation.js.map +1 -1
- package/dist/orchestrator/goal/negotiator-prompts.d.ts.map +1 -1
- package/dist/orchestrator/goal/negotiator-prompts.js +8 -4
- package/dist/orchestrator/goal/negotiator-prompts.js.map +1 -1
- package/dist/orchestrator/goal/negotiator-steps.d.ts.map +1 -1
- package/dist/orchestrator/goal/negotiator-steps.js +7 -11
- package/dist/orchestrator/goal/negotiator-steps.js.map +1 -1
- package/dist/orchestrator/goal/types/goal-refiner.d.ts +6 -6
- package/dist/orchestrator/goal/types/goal.d.ts +161 -0
- package/dist/orchestrator/goal/types/goal.d.ts.map +1 -1
- package/dist/orchestrator/goal/types/goal.js +8 -0
- package/dist/orchestrator/goal/types/goal.js.map +1 -1
- package/dist/orchestrator/goal/types/negotiation.d.ts +120 -6
- package/dist/orchestrator/goal/types/negotiation.d.ts.map +1 -1
- package/dist/orchestrator/goal/types/negotiation.js +3 -0
- package/dist/orchestrator/goal/types/negotiation.js.map +1 -1
- package/dist/orchestrator/goal/types/suggest.d.ts +6 -6
- package/dist/orchestrator/loop/checkpoint-manager-loop.d.ts +1 -1
- package/dist/orchestrator/loop/checkpoint-manager-loop.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/capability.d.ts +1 -21
- package/dist/orchestrator/loop/core-loop/capability.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/capability.js +1 -150
- package/dist/orchestrator/loop/core-loop/capability.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/contracts.d.ts +1 -318
- package/dist/orchestrator/loop/core-loop/contracts.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/contracts.js +1 -39
- package/dist/orchestrator/loop/core-loop/contracts.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/control.d.ts +1 -26
- package/dist/orchestrator/loop/core-loop/control.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/control.js +1 -71
- package/dist/orchestrator/loop/core-loop/control.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/decision-engine.d.ts +1 -78
- package/dist/orchestrator/loop/core-loop/decision-engine.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/decision-engine.js +1 -144
- package/dist/orchestrator/loop/core-loop/decision-engine.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.d.ts +1 -47
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.js +1 -385
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/evidence-ledger.d.ts +1 -21
- package/dist/orchestrator/loop/core-loop/evidence-ledger.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/evidence-ledger.js +1 -35
- package/dist/orchestrator/loop/core-loop/evidence-ledger.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.d.ts +1 -6
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.js +1 -42
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.d.ts +1 -13
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.js +1 -40
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts +1 -36
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js +1 -834
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/learning.d.ts +1 -30
- package/dist/orchestrator/loop/core-loop/learning.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/learning.js +1 -91
- package/dist/orchestrator/loop/core-loop/learning.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-policy.d.ts +1 -19
- package/dist/orchestrator/loop/core-loop/phase-policy.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-policy.js +1 -157
- package/dist/orchestrator/loop/core-loop/phase-policy.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-runtime.d.ts +1 -30
- package/dist/orchestrator/loop/core-loop/phase-runtime.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-runtime.js +1 -102
- package/dist/orchestrator/loop/core-loop/phase-runtime.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-specs.d.ts +1 -1268
- package/dist/orchestrator/loop/core-loop/phase-specs.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-specs.js +1 -348
- package/dist/orchestrator/loop/core-loop/phase-specs.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/preparation.d.ts +1 -58
- package/dist/orchestrator/loop/core-loop/preparation.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/preparation.js +1 -367
- package/dist/orchestrator/loop/core-loop/preparation.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/public-research.d.ts +1 -31
- package/dist/orchestrator/loop/core-loop/public-research.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/public-research.js +1 -111
- package/dist/orchestrator/loop/core-loop/public-research.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.d.ts +1 -8
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.js +1 -432
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.d.ts +1 -10
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.js +1 -175
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts +1 -40
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle.js +1 -429
- package/dist/orchestrator/loop/core-loop/task-cycle.js.map +1 -1
- package/dist/orchestrator/loop/core-loop.d.ts +1 -85
- package/dist/orchestrator/loop/core-loop.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop.js +3 -625
- package/dist/orchestrator/loop/core-loop.js.map +1 -1
- package/dist/orchestrator/loop/durable-loop/capability.d.ts +22 -0
- package/dist/orchestrator/loop/durable-loop/capability.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/capability.js +151 -0
- package/dist/orchestrator/loop/durable-loop/capability.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/contracts.d.ts +319 -0
- package/dist/orchestrator/loop/durable-loop/contracts.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/contracts.js +40 -0
- package/dist/orchestrator/loop/durable-loop/contracts.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/control.d.ts +27 -0
- package/dist/orchestrator/loop/durable-loop/control.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/control.js +72 -0
- package/dist/orchestrator/loop/durable-loop/control.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/decision-engine.d.ts +79 -0
- package/dist/orchestrator/loop/durable-loop/decision-engine.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/decision-engine.js +145 -0
- package/dist/orchestrator/loop/durable-loop/decision-engine.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/dream-review-checkpoint.d.ts +48 -0
- package/dist/orchestrator/loop/durable-loop/dream-review-checkpoint.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/dream-review-checkpoint.js +386 -0
- package/dist/orchestrator/loop/durable-loop/dream-review-checkpoint.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/evidence-ledger.d.ts +22 -0
- package/dist/orchestrator/loop/durable-loop/evidence-ledger.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/evidence-ledger.js +36 -0
- package/dist/orchestrator/loop/durable-loop/evidence-ledger.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-knowledge.d.ts +7 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-knowledge.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-knowledge.js +43 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-knowledge.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-wait.d.ts +14 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-wait.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-wait.js +41 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel-wait.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel.d.ts +37 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel.js +835 -0
- package/dist/orchestrator/loop/durable-loop/iteration-kernel.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/learning.d.ts +31 -0
- package/dist/orchestrator/loop/durable-loop/learning.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/learning.js +92 -0
- package/dist/orchestrator/loop/durable-loop/learning.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/phase-policy.d.ts +20 -0
- package/dist/orchestrator/loop/durable-loop/phase-policy.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/phase-policy.js +158 -0
- package/dist/orchestrator/loop/durable-loop/phase-policy.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/phase-runtime.d.ts +31 -0
- package/dist/orchestrator/loop/durable-loop/phase-runtime.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/phase-runtime.js +103 -0
- package/dist/orchestrator/loop/durable-loop/phase-runtime.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/phase-specs.d.ts +1269 -0
- package/dist/orchestrator/loop/durable-loop/phase-specs.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/phase-specs.js +349 -0
- package/dist/orchestrator/loop/durable-loop/phase-specs.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/preparation.d.ts +59 -0
- package/dist/orchestrator/loop/durable-loop/preparation.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/preparation.js +368 -0
- package/dist/orchestrator/loop/durable-loop/preparation.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/public-research.d.ts +32 -0
- package/dist/orchestrator/loop/durable-loop/public-research.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/public-research.js +112 -0
- package/dist/orchestrator/loop/durable-loop/public-research.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-stall.d.ts +9 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-stall.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-stall.js +464 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-stall.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-wait.d.ts +11 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-wait.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-wait.js +176 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle-wait.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle.d.ts +41 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle.js +430 -0
- package/dist/orchestrator/loop/durable-loop/task-cycle.js.map +1 -0
- package/dist/orchestrator/loop/durable-loop.d.ts +92 -0
- package/dist/orchestrator/loop/durable-loop.d.ts.map +1 -0
- package/dist/orchestrator/loop/durable-loop.js +631 -0
- package/dist/orchestrator/loop/durable-loop.js.map +1 -0
- package/dist/orchestrator/loop/loop-report-helper.d.ts +1 -1
- package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
- package/dist/orchestrator/loop/loop-result-types.d.ts +1 -1
- package/dist/orchestrator/loop/loop-result-types.d.ts.map +1 -1
- package/dist/orchestrator/loop/parallel-dispatch.d.ts +2 -2
- package/dist/orchestrator/loop/parallel-dispatch.d.ts.map +1 -1
- package/dist/orchestrator/loop/post-loop-hooks.d.ts +1 -1
- package/dist/orchestrator/loop/post-loop-hooks.d.ts.map +1 -1
- package/dist/orchestrator/loop/run-policy.d.ts +1 -1
- package/dist/orchestrator/loop/run-policy.d.ts.map +1 -1
- package/dist/orchestrator/loop/tree-loop-runner.d.ts +1 -1
- package/dist/orchestrator/loop/tree-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/loop/tree-loop-runner.js +1 -1
- package/dist/orchestrator/loop/tree-loop-runner.js.map +1 -1
- package/dist/orchestrator/strategy/divergent-exploration.d.ts +2 -1
- package/dist/orchestrator/strategy/divergent-exploration.d.ts.map +1 -1
- package/dist/orchestrator/strategy/divergent-exploration.js +119 -36
- package/dist/orchestrator/strategy/divergent-exploration.js.map +1 -1
- package/dist/orchestrator/strategy/strategy-helpers.d.ts +86 -4
- package/dist/orchestrator/strategy/strategy-helpers.d.ts.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager-base.d.ts +6 -2
- package/dist/orchestrator/strategy/strategy-manager-base.d.ts.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager-base.js +71 -18
- package/dist/orchestrator/strategy/strategy-manager-base.js.map +1 -1
- package/dist/orchestrator/strategy/types/strategy.d.ts +450 -14
- package/dist/orchestrator/strategy/types/strategy.d.ts.map +1 -1
- package/dist/orchestrator/strategy/types/strategy.js +30 -0
- package/dist/orchestrator/strategy/types/strategy.js.map +1 -1
- package/dist/platform/code-search/contracts.d.ts +3 -0
- package/dist/platform/code-search/contracts.d.ts.map +1 -1
- package/dist/platform/code-search/contracts.js.map +1 -1
- package/dist/platform/code-search/indexes/indexer.d.ts.map +1 -1
- package/dist/platform/code-search/indexes/indexer.js +3 -0
- package/dist/platform/code-search/indexes/indexer.js.map +1 -1
- package/dist/platform/code-search/indexes/semantic-index.d.ts.map +1 -1
- package/dist/platform/code-search/indexes/semantic-index.js +3 -0
- package/dist/platform/code-search/indexes/semantic-index.js.map +1 -1
- package/dist/platform/code-search/orchestrator.d.ts.map +1 -1
- package/dist/platform/code-search/orchestrator.js +14 -3
- package/dist/platform/code-search/orchestrator.js.map +1 -1
- package/dist/platform/code-search/query-planner.d.ts.map +1 -1
- package/dist/platform/code-search/query-planner.js +1 -17
- package/dist/platform/code-search/query-planner.js.map +1 -1
- package/dist/platform/code-search/reranker.d.ts +5 -1
- package/dist/platform/code-search/reranker.d.ts.map +1 -1
- package/dist/platform/code-search/reranker.js +9 -5
- package/dist/platform/code-search/reranker.js.map +1 -1
- package/dist/platform/corrections/memory-correction-ledger.d.ts +30 -30
- package/dist/platform/dream/dream-activation.d.ts +161 -1
- package/dist/platform/dream/dream-activation.d.ts.map +1 -1
- package/dist/platform/dream/dream-activation.js +63 -14
- package/dist/platform/dream/dream-activation.js.map +1 -1
- package/dist/platform/dream/dream-event-workflows.d.ts +2 -2
- package/dist/platform/dream/dream-types.d.ts +52 -52
- package/dist/platform/dream/playbook-memory.d.ts +3 -3
- package/dist/platform/drive/stall-detector/repetitive.d.ts.map +1 -1
- package/dist/platform/drive/stall-detector/repetitive.js +50 -5
- package/dist/platform/drive/stall-detector/repetitive.js.map +1 -1
- package/dist/platform/drive/stall-detector.d.ts +19 -0
- package/dist/platform/drive/stall-detector.d.ts.map +1 -1
- package/dist/platform/drive/stall-detector.js.map +1 -1
- package/dist/platform/drive/types/stall.d.ts +1 -1
- package/dist/platform/knowledge/transfer/knowledge-transfer-apply.d.ts.map +1 -1
- package/dist/platform/knowledge/transfer/knowledge-transfer-apply.js +7 -3
- package/dist/platform/knowledge/transfer/knowledge-transfer-apply.js.map +1 -1
- package/dist/platform/knowledge/types/agent-memory.d.ts +46 -46
- package/dist/platform/knowledge/types/embedding.d.ts +4 -4
- package/dist/platform/knowledge/types/knowledge.d.ts +53 -0
- package/dist/platform/knowledge/types/knowledge.d.ts.map +1 -1
- package/dist/platform/knowledge/types/knowledge.js +15 -0
- package/dist/platform/knowledge/types/knowledge.js.map +1 -1
- package/dist/platform/knowledge/types/memory-lifecycle.d.ts +2 -2
- package/dist/platform/observation/capability-detector/types.d.ts +4 -4
- package/dist/platform/observation/context-provider/collector.d.ts +2 -0
- package/dist/platform/observation/context-provider/collector.d.ts.map +1 -1
- package/dist/platform/observation/context-provider/collector.js +27 -2
- package/dist/platform/observation/context-provider/collector.js.map +1 -1
- package/dist/platform/observation/context-provider.d.ts +4 -0
- package/dist/platform/observation/context-provider.d.ts.map +1 -1
- package/dist/platform/observation/context-provider.js.map +1 -1
- package/dist/platform/observation/engine/observe-datasource-stage.d.ts +3 -2
- package/dist/platform/observation/engine/observe-datasource-stage.d.ts.map +1 -1
- package/dist/platform/observation/engine/observe-datasource-stage.js +2 -2
- package/dist/platform/observation/engine/observe-datasource-stage.js.map +1 -1
- package/dist/platform/observation/observation-apply.d.ts +1 -1
- package/dist/platform/observation/observation-apply.d.ts.map +1 -1
- package/dist/platform/observation/observation-apply.js +3 -3
- package/dist/platform/observation/observation-apply.js.map +1 -1
- package/dist/platform/observation/observation-datasource.d.ts +2 -2
- package/dist/platform/observation/observation-datasource.d.ts.map +1 -1
- package/dist/platform/observation/observation-datasource.js +13 -7
- package/dist/platform/observation/observation-datasource.js.map +1 -1
- package/dist/platform/observation/observation-engine.d.ts +1 -1
- package/dist/platform/observation/observation-engine.d.ts.map +1 -1
- package/dist/platform/observation/observation-engine.js +8 -6
- package/dist/platform/observation/observation-engine.js.map +1 -1
- package/dist/platform/observation/types/capability.d.ts +16 -16
- package/dist/platform/observation/workspace-context.d.ts +8 -1
- package/dist/platform/observation/workspace-context.d.ts.map +1 -1
- package/dist/platform/observation/workspace-context.js +35 -14
- package/dist/platform/observation/workspace-context.js.map +1 -1
- package/dist/platform/profile/profile-change-proposal.d.ts +20 -20
- package/dist/platform/profile/relationship-profile.d.ts +6 -6
- package/dist/platform/profile/user-md-profile-import.d.ts +2 -2
- package/dist/platform/soil/contracts.d.ts +98 -98
- package/dist/platform/soil/types.d.ts +8 -8
- package/dist/platform/traits/curiosity-engine.d.ts +2 -5
- package/dist/platform/traits/curiosity-engine.d.ts.map +1 -1
- package/dist/platform/traits/curiosity-engine.js.map +1 -1
- package/dist/platform/traits/curiosity-proposals.d.ts +2 -0
- package/dist/platform/traits/curiosity-proposals.d.ts.map +1 -1
- package/dist/platform/traits/curiosity-proposals.js +36 -17
- package/dist/platform/traits/curiosity-proposals.js.map +1 -1
- package/dist/platform/traits/curiosity-transfer.d.ts +9 -5
- package/dist/platform/traits/curiosity-transfer.d.ts.map +1 -1
- package/dist/platform/traits/curiosity-transfer.js +4 -1
- package/dist/platform/traits/curiosity-transfer.js.map +1 -1
- package/dist/platform/traits/ethics-gate.d.ts +16 -17
- package/dist/platform/traits/ethics-gate.d.ts.map +1 -1
- package/dist/platform/traits/ethics-gate.js +83 -47
- package/dist/platform/traits/ethics-gate.js.map +1 -1
- package/dist/platform/traits/ethics-rules.d.ts +4 -6
- package/dist/platform/traits/ethics-rules.d.ts.map +1 -1
- package/dist/platform/traits/ethics-rules.js +19 -261
- package/dist/platform/traits/ethics-rules.js.map +1 -1
- package/dist/platform/traits/types/curiosity.d.ts +157 -10
- package/dist/platform/traits/types/curiosity.d.ts.map +1 -1
- package/dist/platform/traits/types/curiosity.js +10 -0
- package/dist/platform/traits/types/curiosity.js.map +1 -1
- package/dist/platform/traits/types/guardrail.d.ts +6 -6
- package/dist/prompt/purposes/curiosity.d.ts +4 -4
- package/dist/runtime/approval-broker.d.ts +33 -0
- package/dist/runtime/approval-broker.d.ts.map +1 -1
- package/dist/runtime/approval-broker.js +155 -17
- package/dist/runtime/approval-broker.js.map +1 -1
- package/dist/runtime/companion-policy.d.ts +27 -0
- package/dist/runtime/companion-policy.d.ts.map +1 -0
- package/dist/runtime/companion-policy.js +135 -0
- package/dist/runtime/companion-policy.js.map +1 -0
- package/dist/runtime/confirmation-decision.d.ts +2 -2
- package/dist/runtime/control/daemon-runtime-control-executor.d.ts +0 -6
- package/dist/runtime/control/daemon-runtime-control-executor.d.ts.map +1 -1
- package/dist/runtime/control/daemon-runtime-control-executor.js +1 -1
- package/dist/runtime/control/daemon-runtime-control-executor.js.map +1 -1
- package/dist/runtime/control/index.d.ts +6 -3
- package/dist/runtime/control/index.d.ts.map +1 -1
- package/dist/runtime/control/index.js +2 -1
- package/dist/runtime/control/index.js.map +1 -1
- package/dist/runtime/control/runtime-control-intent.d.ts +16 -1
- package/dist/runtime/control/runtime-control-intent.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-intent.js +26 -13
- package/dist/runtime/control/runtime-control-intent.js.map +1 -1
- package/dist/runtime/control/runtime-control-service.d.ts +1 -1
- package/dist/runtime/control/runtime-control-service.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-service.js +29 -64
- package/dist/runtime/control/runtime-control-service.js.map +1 -1
- package/dist/runtime/control/runtime-target-resolver.d.ts +39 -0
- package/dist/runtime/control/runtime-target-resolver.d.ts.map +1 -0
- package/dist/runtime/control/runtime-target-resolver.js +112 -0
- package/dist/runtime/control/runtime-target-resolver.js.map +1 -0
- package/dist/runtime/conversational-approval-decision.d.ts +29 -0
- package/dist/runtime/conversational-approval-decision.d.ts.map +1 -0
- package/dist/runtime/conversational-approval-decision.js +92 -0
- package/dist/runtime/conversational-approval-decision.js.map +1 -0
- package/dist/runtime/daemon/client.d.ts +1 -4
- package/dist/runtime/daemon/client.d.ts.map +1 -1
- package/dist/runtime/daemon/client.js +0 -3
- package/dist/runtime/daemon/client.js.map +1 -1
- package/dist/runtime/daemon/control-contracts.d.ts +7 -0
- package/dist/runtime/daemon/control-contracts.d.ts.map +1 -0
- package/dist/runtime/daemon/control-contracts.js +2 -0
- package/dist/runtime/daemon/control-contracts.js.map +1 -0
- package/dist/runtime/daemon/runner-startup.js +1 -1
- package/dist/runtime/daemon/runner-startup.js.map +1 -1
- package/dist/runtime/daemon/runner.d.ts +1 -1
- package/dist/runtime/daemon/runner.d.ts.map +1 -1
- package/dist/runtime/executor/goal-worker.d.ts +3 -3
- package/dist/runtime/executor/goal-worker.d.ts.map +1 -1
- package/dist/runtime/executor/loop-supervisor.d.ts +2 -2
- package/dist/runtime/executor/loop-supervisor.d.ts.map +1 -1
- package/dist/runtime/executor/loop-supervisor.js +2 -2
- package/dist/runtime/executor/loop-supervisor.js.map +1 -1
- package/dist/runtime/gateway/channel-adapter.d.ts +19 -0
- package/dist/runtime/gateway/channel-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/channel-policy.d.ts +1 -0
- package/dist/runtime/gateway/channel-policy.d.ts.map +1 -1
- package/dist/runtime/gateway/channel-policy.js +6 -4
- package/dist/runtime/gateway/channel-policy.js.map +1 -1
- package/dist/runtime/gateway/chat-event-rendering.d.ts +34 -0
- package/dist/runtime/gateway/chat-event-rendering.d.ts.map +1 -0
- package/dist/runtime/gateway/chat-event-rendering.js +61 -0
- package/dist/runtime/gateway/chat-event-rendering.js.map +1 -0
- package/dist/runtime/gateway/chat-session-dispatch.d.ts +2 -13
- package/dist/runtime/gateway/chat-session-dispatch.d.ts.map +1 -1
- package/dist/runtime/gateway/chat-session-dispatch.js +6 -3
- package/dist/runtime/gateway/chat-session-dispatch.js.map +1 -1
- package/dist/runtime/gateway/chat-session-port.d.ts +25 -0
- package/dist/runtime/gateway/chat-session-port.d.ts.map +1 -0
- package/dist/runtime/gateway/chat-session-port.js +20 -0
- package/dist/runtime/gateway/chat-session-port.js.map +1 -0
- package/dist/runtime/gateway/discord-gateway-adapter.d.ts +3 -1
- package/dist/runtime/gateway/discord-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/discord-gateway-adapter.js +34 -2
- package/dist/runtime/gateway/discord-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/index.d.ts +2 -0
- package/dist/runtime/gateway/index.d.ts.map +1 -1
- package/dist/runtime/gateway/index.js +1 -0
- package/dist/runtime/gateway/index.js.map +1 -1
- package/dist/runtime/gateway/ingress-gateway.d.ts.map +1 -1
- package/dist/runtime/gateway/ingress-gateway.js +1 -0
- package/dist/runtime/gateway/ingress-gateway.js.map +1 -1
- package/dist/runtime/gateway/signal-gateway-adapter.d.ts +2 -1
- package/dist/runtime/gateway/signal-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/signal-gateway-adapter.js +13 -3
- package/dist/runtime/gateway/signal-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/slack-channel-adapter.d.ts +2 -1
- package/dist/runtime/gateway/slack-channel-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/slack-channel-adapter.js +6 -2
- package/dist/runtime/gateway/slack-channel-adapter.js.map +1 -1
- package/dist/runtime/gateway/telegram-gateway-adapter.d.ts +9 -2
- package/dist/runtime/gateway/telegram-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/telegram-gateway-adapter.js +141 -13
- package/dist/runtime/gateway/telegram-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/typing-indicator.d.ts +11 -0
- package/dist/runtime/gateway/typing-indicator.d.ts.map +1 -0
- package/dist/runtime/gateway/typing-indicator.js +68 -0
- package/dist/runtime/gateway/typing-indicator.js.map +1 -0
- package/dist/runtime/gateway/whatsapp-gateway-adapter.d.ts +2 -1
- package/dist/runtime/gateway/whatsapp-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/whatsapp-gateway-adapter.js +22 -8
- package/dist/runtime/gateway/whatsapp-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/ws-channel-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/ws-channel-adapter.js +1 -0
- package/dist/runtime/gateway/ws-channel-adapter.js.map +1 -1
- package/dist/runtime/interactive-automation/failure-classifier.d.ts +0 -1
- package/dist/runtime/interactive-automation/failure-classifier.d.ts.map +1 -1
- package/dist/runtime/interactive-automation/failure-classifier.js +0 -19
- package/dist/runtime/interactive-automation/failure-classifier.js.map +1 -1
- package/dist/runtime/interactive-automation/providers/manus-browser.d.ts.map +1 -1
- package/dist/runtime/interactive-automation/providers/manus-browser.js +30 -1
- package/dist/runtime/interactive-automation/providers/manus-browser.js.map +1 -1
- package/dist/runtime/logger.d.ts.map +1 -1
- package/dist/runtime/logger.js +5 -2
- package/dist/runtime/logger.js.map +1 -1
- package/dist/runtime/plugin-loader.js +2 -2
- package/dist/runtime/plugin-loader.js.map +1 -1
- package/dist/runtime/run-spec/derive.d.ts +24 -24
- package/dist/runtime/run-spec/derive.d.ts.map +1 -1
- package/dist/runtime/run-spec/derive.js +6 -0
- package/dist/runtime/run-spec/derive.js.map +1 -1
- package/dist/runtime/run-spec/handoff.d.ts +74 -0
- package/dist/runtime/run-spec/handoff.d.ts.map +1 -0
- package/dist/runtime/run-spec/handoff.js +496 -0
- package/dist/runtime/run-spec/handoff.js.map +1 -0
- package/dist/runtime/run-spec/index.d.ts +2 -0
- package/dist/runtime/run-spec/index.d.ts.map +1 -1
- package/dist/runtime/run-spec/index.js +2 -0
- package/dist/runtime/run-spec/index.js.map +1 -1
- package/dist/runtime/run-spec/pending-dialogue-arbiter.d.ts +25 -0
- package/dist/runtime/run-spec/pending-dialogue-arbiter.d.ts.map +1 -0
- package/dist/runtime/run-spec/pending-dialogue-arbiter.js +81 -0
- package/dist/runtime/run-spec/pending-dialogue-arbiter.js.map +1 -0
- package/dist/runtime/run-spec/types.d.ts +91 -42
- package/dist/runtime/run-spec/types.d.ts.map +1 -1
- package/dist/runtime/run-spec/types.js +7 -0
- package/dist/runtime/run-spec/types.js.map +1 -1
- package/dist/runtime/schedule/engine-execution.js +2 -35
- package/dist/runtime/schedule/engine-execution.js.map +1 -1
- package/dist/runtime/schedule/history.d.ts +2 -2
- package/dist/runtime/schedule/presets.d.ts +4 -4
- package/dist/runtime/schedule/source.d.ts +1 -1
- package/dist/runtime/session-registry/registry.d.ts.map +1 -1
- package/dist/runtime/session-registry/registry.js +27 -2
- package/dist/runtime/session-registry/registry.js.map +1 -1
- package/dist/runtime/session-registry/types.d.ts +120 -112
- package/dist/runtime/session-registry/types.d.ts.map +1 -1
- package/dist/runtime/session-registry/types.js +1 -0
- package/dist/runtime/session-registry/types.js.map +1 -1
- package/dist/runtime/store/artifact-retention.d.ts +11 -6
- package/dist/runtime/store/artifact-retention.d.ts.map +1 -1
- package/dist/runtime/store/artifact-retention.js +0 -13
- package/dist/runtime/store/artifact-retention.js.map +1 -1
- package/dist/runtime/store/background-run-store.d.ts +1 -0
- package/dist/runtime/store/background-run-store.d.ts.map +1 -1
- package/dist/runtime/store/background-run-store.js +1 -0
- package/dist/runtime/store/background-run-store.js.map +1 -1
- package/dist/runtime/store/budget-store.d.ts +8 -8
- package/dist/runtime/store/dream-checkpoints.d.ts +1 -1
- package/dist/runtime/store/dream-checkpoints.d.ts.map +1 -1
- package/dist/runtime/store/evaluator-results.d.ts +1 -1
- package/dist/runtime/store/evaluator-results.d.ts.map +1 -1
- package/dist/runtime/store/evidence-ledger.d.ts +39 -6377
- package/dist/runtime/store/evidence-ledger.d.ts.map +1 -1
- package/dist/runtime/store/evidence-ledger.js +415 -501
- package/dist/runtime/store/evidence-ledger.js.map +1 -1
- package/dist/runtime/store/evidence-types.d.ts +6378 -0
- package/dist/runtime/store/evidence-types.d.ts.map +1 -0
- package/dist/runtime/store/evidence-types.js +459 -0
- package/dist/runtime/store/evidence-types.js.map +1 -0
- package/dist/runtime/store/experiment-queue-store.d.ts +109 -109
- package/dist/runtime/store/experiment-queue-store.d.ts.map +1 -1
- package/dist/runtime/store/experiment-queue-store.js +1 -1
- package/dist/runtime/store/experiment-queue-store.js.map +1 -1
- package/dist/runtime/store/index.d.ts +4 -4
- package/dist/runtime/store/index.d.ts.map +1 -1
- package/dist/runtime/store/index.js +2 -2
- package/dist/runtime/store/index.js.map +1 -1
- package/dist/runtime/store/metric-history.d.ts +1 -1
- package/dist/runtime/store/metric-history.d.ts.map +1 -1
- package/dist/runtime/store/operator-handoff-store.d.ts +12 -12
- package/dist/runtime/store/postmortem-report.d.ts +38 -38
- package/dist/runtime/store/postmortem-report.js.map +1 -1
- package/dist/runtime/store/proactive-intervention-store.d.ts +8 -8
- package/dist/runtime/store/reproducibility-manifest.d.ts +27 -27
- package/dist/runtime/store/reproducibility-manifest.d.ts.map +1 -1
- package/dist/runtime/store/reproducibility-manifest.js.map +1 -1
- package/dist/runtime/store/research-evidence.d.ts +1 -1
- package/dist/runtime/store/research-evidence.d.ts.map +1 -1
- package/dist/runtime/store/runtime-operation-schemas.d.ts +46 -46
- package/dist/runtime/store/runtime-schemas.d.ts +73 -12
- package/dist/runtime/store/runtime-schemas.d.ts.map +1 -1
- package/dist/runtime/store/runtime-schemas.js +9 -0
- package/dist/runtime/store/runtime-schemas.js.map +1 -1
- package/dist/runtime/types/companion.d.ts +394 -0
- package/dist/runtime/types/companion.d.ts.map +1 -0
- package/dist/runtime/types/companion.js +87 -0
- package/dist/runtime/types/companion.js.map +1 -0
- package/dist/runtime/types/daemon.d.ts +3 -3
- package/dist/runtime/types/hook.d.ts +12 -12
- package/dist/runtime/types/schedule.d.ts +32 -32
- package/dist/tools/builtin/exports.d.ts +2 -0
- package/dist/tools/builtin/exports.d.ts.map +1 -1
- package/dist/tools/builtin/exports.js +2 -0
- package/dist/tools/builtin/exports.js.map +1 -1
- package/dist/tools/builtin/factory.d.ts +10 -1
- package/dist/tools/builtin/factory.d.ts.map +1 -1
- package/dist/tools/builtin/factory.js +18 -1
- package/dist/tools/builtin/factory.js.map +1 -1
- package/dist/tools/executor.d.ts.map +1 -1
- package/dist/tools/executor.js +8 -6
- package/dist/tools/executor.js.map +1 -1
- package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.d.ts.map +1 -1
- package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.js +1 -0
- package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.js.map +1 -1
- package/dist/tools/fs/FileEditTool/FileEditTool.d.ts.map +1 -1
- package/dist/tools/fs/FileEditTool/FileEditTool.js +1 -0
- package/dist/tools/fs/FileEditTool/FileEditTool.js.map +1 -1
- package/dist/tools/fs/FileWriteTool/FileWriteTool.d.ts.map +1 -1
- package/dist/tools/fs/FileWriteTool/FileWriteTool.js +1 -0
- package/dist/tools/fs/FileWriteTool/FileWriteTool.js.map +1 -1
- package/dist/tools/fs/GlobTool/GlobTool.d.ts.map +1 -1
- package/dist/tools/fs/GlobTool/GlobTool.js +1 -0
- package/dist/tools/fs/GlobTool/GlobTool.js.map +1 -1
- package/dist/tools/fs/GrepTool/GrepTool.d.ts.map +1 -1
- package/dist/tools/fs/GrepTool/GrepTool.js +1 -0
- package/dist/tools/fs/GrepTool/GrepTool.js.map +1 -1
- package/dist/tools/fs/JsonQueryTool/JsonQueryTool.d.ts.map +1 -1
- package/dist/tools/fs/JsonQueryTool/JsonQueryTool.js +1 -0
- package/dist/tools/fs/JsonQueryTool/JsonQueryTool.js.map +1 -1
- package/dist/tools/fs/ListDirTool/ListDirTool.d.ts.map +1 -1
- package/dist/tools/fs/ListDirTool/ListDirTool.js +1 -0
- package/dist/tools/fs/ListDirTool/ListDirTool.js.map +1 -1
- package/dist/tools/fs/ReadTool/ReadTool.d.ts.map +1 -1
- package/dist/tools/fs/ReadTool/ReadTool.js +1 -0
- package/dist/tools/fs/ReadTool/ReadTool.js.map +1 -1
- package/dist/tools/kaggle/KaggleSubmissionTools.d.ts +4 -4
- package/dist/tools/kaggle/metrics.d.ts +4 -4
- package/dist/tools/mutation/TaskCreateTool/TaskCreateTool.d.ts +4 -4
- package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts +4 -4
- package/dist/tools/network/GitHubCliTool/GitHubCliTool.d.ts +8 -8
- package/dist/tools/network/HttpFetchTool/HttpFetchTool.d.ts.map +1 -1
- package/dist/tools/network/HttpFetchTool/HttpFetchTool.js +1 -0
- package/dist/tools/network/HttpFetchTool/HttpFetchTool.js.map +1 -1
- package/dist/tools/network/WebSearchTool/WebSearchTool.d.ts.map +1 -1
- package/dist/tools/network/WebSearchTool/WebSearchTool.js +1 -0
- package/dist/tools/network/WebSearchTool/WebSearchTool.js.map +1 -1
- package/dist/tools/query/ArchitectureTool/ArchitectureTool.js +3 -3
- package/dist/tools/query/ArchitectureTool/ArchitectureTool.js.map +1 -1
- package/dist/tools/query/CodeReadContextTool/CodeReadContextTool.d.ts +20 -20
- package/dist/tools/query/CodeReadContextTool/CodeReadContextTool.d.ts.map +1 -1
- package/dist/tools/query/CodeReadContextTool/CodeReadContextTool.js +1 -0
- package/dist/tools/query/CodeReadContextTool/CodeReadContextTool.js.map +1 -1
- package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.d.ts.map +1 -1
- package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.js +1 -0
- package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.js.map +1 -1
- package/dist/tools/query/CodeSearchTool/CodeSearchTool.d.ts.map +1 -1
- package/dist/tools/query/CodeSearchTool/CodeSearchTool.js +1 -0
- package/dist/tools/query/CodeSearchTool/CodeSearchTool.js.map +1 -1
- package/dist/tools/query/KnowledgeQueryTool/KnowledgeQueryTool.d.ts.map +1 -1
- package/dist/tools/query/KnowledgeQueryTool/KnowledgeQueryTool.js +1 -0
- package/dist/tools/query/KnowledgeQueryTool/KnowledgeQueryTool.js.map +1 -1
- package/dist/tools/query/SkillSearchTool/SkillSearchTool.d.ts.map +1 -1
- package/dist/tools/query/SkillSearchTool/SkillSearchTool.js +1 -0
- package/dist/tools/query/SkillSearchTool/SkillSearchTool.js.map +1 -1
- package/dist/tools/query/ToolSearchTool/ToolSearchTool.d.ts.map +1 -1
- package/dist/tools/query/ToolSearchTool/ToolSearchTool.js +1 -0
- package/dist/tools/query/ToolSearchTool/ToolSearchTool.js.map +1 -1
- package/dist/tools/runtime/LongRunningRuntimeTools.d.ts +32 -32
- package/dist/tools/runtime/RunSpecHandoffTools.d.ts +12 -0
- package/dist/tools/runtime/RunSpecHandoffTools.d.ts.map +1 -0
- package/dist/tools/runtime/RunSpecHandoffTools.js +224 -0
- package/dist/tools/runtime/RunSpecHandoffTools.js.map +1 -0
- package/dist/tools/runtime/SetupRuntimeControlTools.d.ts +11 -0
- package/dist/tools/runtime/SetupRuntimeControlTools.d.ts.map +1 -0
- package/dist/tools/runtime/SetupRuntimeControlTools.js +463 -0
- package/dist/tools/runtime/SetupRuntimeControlTools.js.map +1 -0
- package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts +28 -28
- package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts +32 -32
- package/dist/tools/system/GitDiffTool/GitDiffTool.d.ts.map +1 -1
- package/dist/tools/system/GitDiffTool/GitDiffTool.js +1 -0
- package/dist/tools/system/GitDiffTool/GitDiffTool.js.map +1 -1
- package/dist/tools/system/GitLogTool/GitLogTool.d.ts.map +1 -1
- package/dist/tools/system/GitLogTool/GitLogTool.js +1 -0
- package/dist/tools/system/GitLogTool/GitLogTool.js.map +1 -1
- package/dist/tools/system/ShellTool/ShellTool.d.ts.map +1 -1
- package/dist/tools/system/ShellTool/ShellTool.js +1 -0
- package/dist/tools/system/ShellTool/ShellTool.js.map +1 -1
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.d.ts.map +1 -1
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.js +1 -0
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.js.map +1 -1
- package/dist/tools/system/UpdatePlanTool/UpdatePlanTool.d.ts.map +1 -1
- package/dist/tools/system/UpdatePlanTool/UpdatePlanTool.js +1 -0
- package/dist/tools/system/UpdatePlanTool/UpdatePlanTool.js.map +1 -1
- package/dist/tools/types.d.ts +62 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +25 -0
- package/dist/tools/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/interface/tui/approval-overlay.d.ts +0 -8
- package/dist/interface/tui/approval-overlay.d.ts.map +0 -1
- package/dist/interface/tui/approval-overlay.js +0 -21
- package/dist/interface/tui/approval-overlay.js.map +0 -1
|
@@ -1,835 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { generateLoopReport } from "../loop-report-helper.js";
|
|
3
|
-
import { makeEmptyIterationResult } from "../loop-result-types.js";
|
|
4
|
-
import { loadGoalWithAggregation, observeAndReload, calculateGapOrComplete, scoreDrivesAndCheckKnowledge, phaseAutoDecompose, } from "./preparation.js";
|
|
5
|
-
import { checkCompletionAndMilestones, detectStallsAndRebalance, evaluateWaitStrategiesForObserveOnly, checkDependencyBlock, runTaskCycleWithContext, } from "./task-cycle.js";
|
|
6
|
-
import { runStateDiffCheck, tryParallelExecution, } from "./control.js";
|
|
7
|
-
import { handleCapabilityAcquisition } from "./capability.js";
|
|
8
|
-
import { CoreLoopEvidenceLedger } from "./evidence-ledger.js";
|
|
9
|
-
import { CorePhaseRuntime } from "./phase-runtime.js";
|
|
10
|
-
import { buildDreamReviewCheckpointSpec, buildKnowledgeRefreshSpec, buildObserveEvidenceSpec, buildPublicResearchSpec, buildReplanningOptionsSpec, buildStallInvestigationSpec, buildWaitObservationSpec, buildVerificationEvidenceSpec, } from "./phase-specs.js";
|
|
11
|
-
import { buildDeadlineFinalizationStatus, normalizeFinalizationPolicy, shouldStopExplorationForFinalization, } from "../../../platform/time/deadline-finalization.js";
|
|
12
|
-
import { deriveExecutionModeFromDeadlineStatus } from "../../../platform/time/execution-mode.js";
|
|
13
|
-
import { findActiveWaitObservationInput } from "./iteration-kernel-wait.js";
|
|
14
|
-
import { autoAcquireKnowledgeForDreamStall, autoAcquireKnowledgeForRefresh, } from "./iteration-kernel-knowledge.js";
|
|
15
|
-
import { buildDreamReviewCheckpointRequest, dreamCheckpointRawRefs, formatDreamRunControlRecommendationContext, normalizeDreamReviewCheckpoint, } from "./dream-review-checkpoint.js";
|
|
16
|
-
import { buildPublicResearchRequest, normalizePublicResearchMemo, publicResearchSummary, researchRawRefs, } from "./public-research.js";
|
|
17
|
-
import { RuntimeReproducibilityManifestStore } from "../../../runtime/store/reproducibility-manifest.js";
|
|
18
|
-
export class CoreIterationKernel {
|
|
19
|
-
deps;
|
|
20
|
-
constructor(deps) {
|
|
21
|
-
this.deps = deps;
|
|
22
|
-
}
|
|
23
|
-
async run(input) {
|
|
24
|
-
const { goalId, loopIndex, isFirstIteration } = input;
|
|
25
|
-
const startTime = Date.now();
|
|
26
|
-
let config = this.deps.getConfig();
|
|
27
|
-
const pendingDirective = this.deps.getPendingDirective(goalId);
|
|
28
|
-
const ctx = {
|
|
29
|
-
deps: this.deps.deps,
|
|
30
|
-
config,
|
|
31
|
-
logger: this.deps.logger,
|
|
32
|
-
toolExecutor: this.deps.deps.toolExecutor,
|
|
33
|
-
timeHorizonEngine: this.deps.timeHorizonEngine,
|
|
34
|
-
};
|
|
35
|
-
const runPhase = async (phase, work) => {
|
|
36
|
-
const phaseStartedAt = Date.now();
|
|
37
|
-
this.deps.logger?.info(`[CoreLoop] phase ${phase} starting`, { goalId, loopIndex });
|
|
38
|
-
try {
|
|
39
|
-
const value = await work();
|
|
40
|
-
this.deps.logger?.info(`[CoreLoop] phase ${phase} completed`, {
|
|
41
|
-
goalId,
|
|
42
|
-
loopIndex,
|
|
43
|
-
duration_ms: Date.now() - phaseStartedAt,
|
|
44
|
-
});
|
|
45
|
-
return value;
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
this.deps.logger?.warn(`[CoreLoop] phase ${phase} failed`, {
|
|
49
|
-
goalId,
|
|
50
|
-
loopIndex,
|
|
51
|
-
duration_ms: Date.now() - phaseStartedAt,
|
|
52
|
-
error: err instanceof Error ? err.message : String(err),
|
|
53
|
-
});
|
|
54
|
-
throw err;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const result = makeEmptyIterationResult(goalId, loopIndex);
|
|
58
|
-
const activationContext = this.deps.getActivationContext();
|
|
59
|
-
const evidenceLedger = new CoreLoopEvidenceLedger();
|
|
60
|
-
const runtimeEvidenceScope = {
|
|
61
|
-
goal_id: goalId,
|
|
62
|
-
...(activationContext?.backgroundRun?.backgroundRunId
|
|
63
|
-
? { run_id: activationContext.backgroundRun.backgroundRunId }
|
|
64
|
-
: {}),
|
|
65
|
-
loop_index: loopIndex,
|
|
66
|
-
};
|
|
67
|
-
const appendRuntimeEvidence = async (entry) => {
|
|
68
|
-
if (config.dryRun || !this.deps.deps.evidenceLedger)
|
|
69
|
-
return;
|
|
70
|
-
try {
|
|
71
|
-
await this.deps.deps.evidenceLedger.append({
|
|
72
|
-
...entry,
|
|
73
|
-
scope: {
|
|
74
|
-
...runtimeEvidenceScope,
|
|
75
|
-
...entry.scope,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
catch (err) {
|
|
80
|
-
this.deps.logger?.warn("CoreLoop: failed to append runtime evidence ledger entry", {
|
|
81
|
-
goalId,
|
|
82
|
-
loopIndex,
|
|
83
|
-
kind: entry.kind,
|
|
84
|
-
error: err instanceof Error ? err.message : String(err),
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
const corePhaseRuntime = new CorePhaseRuntime({
|
|
89
|
-
phaseRunner: this.deps.deps.corePhaseRunner,
|
|
90
|
-
policyRegistry: this.deps.corePhasePolicyRegistry,
|
|
91
|
-
});
|
|
92
|
-
let dreamReviewCheckpointRan = false;
|
|
93
|
-
const rememberPhase = (execution) => {
|
|
94
|
-
if (execution.status === "skipped")
|
|
95
|
-
return;
|
|
96
|
-
evidenceLedger.record(execution);
|
|
97
|
-
result.corePhaseResults = evidenceLedger.toIterationPhaseResults();
|
|
98
|
-
};
|
|
99
|
-
const maybeRunDreamReviewCheckpoint = async (input) => {
|
|
100
|
-
if (dreamReviewCheckpointRan)
|
|
101
|
-
return null;
|
|
102
|
-
const evidenceSummary = await loadDreamReviewEvidenceSummary(this.deps.deps.evidenceLedger, goalId);
|
|
103
|
-
const request = buildDreamReviewCheckpointRequest({
|
|
104
|
-
goal: input.goal,
|
|
105
|
-
loopIndex,
|
|
106
|
-
result,
|
|
107
|
-
driveScores: input.driveScores,
|
|
108
|
-
finalizationStatus: input.finalizationStatus,
|
|
109
|
-
executionMode: input.executionMode,
|
|
110
|
-
evidenceSummary,
|
|
111
|
-
recentCheckpoints: evidenceSummary?.dream_checkpoints,
|
|
112
|
-
...(input.requestedTrigger ? { requestedTrigger: input.requestedTrigger } : {}),
|
|
113
|
-
});
|
|
114
|
-
if (!request)
|
|
115
|
-
return null;
|
|
116
|
-
const dreamReview = await runPhase("dream-review-checkpoint", () => corePhaseRuntime.run({
|
|
117
|
-
...buildDreamReviewCheckpointSpec(),
|
|
118
|
-
requiredTools: ["soil_query"],
|
|
119
|
-
allowedTools: ["soil_query", "knowledge_query", "memory_recall"],
|
|
120
|
-
budget: {
|
|
121
|
-
maxModelTurns: 3,
|
|
122
|
-
maxToolCalls: 5,
|
|
123
|
-
maxWallClockMs: 45_000,
|
|
124
|
-
maxRepeatedToolCalls: 1,
|
|
125
|
-
},
|
|
126
|
-
}, {
|
|
127
|
-
goalTitle: input.goal.title,
|
|
128
|
-
trigger: request.trigger,
|
|
129
|
-
reason: request.reason,
|
|
130
|
-
activeDimensions: request.activeDimensions,
|
|
131
|
-
...(request.bestEvidenceSummary ? { bestEvidenceSummary: request.bestEvidenceSummary } : {}),
|
|
132
|
-
recentStrategyFamilies: request.recentStrategyFamilies,
|
|
133
|
-
activeHypotheses: request.activeHypotheses,
|
|
134
|
-
rejectedApproaches: request.rejectedApproaches,
|
|
135
|
-
failedLineages: request.failedLineages,
|
|
136
|
-
...(request.metricTrendSummary ? { metricTrendSummary: request.metricTrendSummary } : {}),
|
|
137
|
-
...(request.finalizationReason ? { finalizationReason: request.finalizationReason } : {}),
|
|
138
|
-
...(request.currentExecutionMode ? { currentExecutionMode: request.currentExecutionMode } : {}),
|
|
139
|
-
runControlPolicy: request.runControlPolicy,
|
|
140
|
-
memoryAuthorityPolicy: request.memoryAuthorityPolicy,
|
|
141
|
-
maxGuidanceItems: request.maxGuidanceItems,
|
|
142
|
-
}, { goalId, stallDetected: result.stallDetected, gapAggregate: input.gapAggregate }));
|
|
143
|
-
rememberPhase(dreamReview);
|
|
144
|
-
const checkpoint = await appendDreamReviewCheckpointEvidence(appendRuntimeEvidence, dreamReview, request, input.goal);
|
|
145
|
-
if (checkpoint?.run_control_recommendations.length) {
|
|
146
|
-
result.dreamRunControlRecommendations = checkpoint.run_control_recommendations;
|
|
147
|
-
}
|
|
148
|
-
dreamReviewCheckpointRan = dreamReview.status !== "skipped";
|
|
149
|
-
return checkpoint;
|
|
150
|
-
};
|
|
151
|
-
this.deps.logger?.info(`[CoreLoop] iteration ${loopIndex + 1} starting`, { goalId, loopIndex });
|
|
152
|
-
const loadedGoal = await runPhase("load-goal", () => loadGoalWithAggregation(ctx, goalId, result, startTime));
|
|
153
|
-
if (!loadedGoal)
|
|
154
|
-
return result;
|
|
155
|
-
let goal = loadedGoal;
|
|
156
|
-
await runPhase("auto-decompose", () => phaseAutoDecompose(goalId, goal, this.deps.deps, config, this.deps.logger, this.deps.decomposedGoals, isFirstIteration));
|
|
157
|
-
if (!goal.children_ids.length) {
|
|
158
|
-
const reloadedAfterDecompose = await this.deps.deps.stateManager.loadGoal(goalId);
|
|
159
|
-
if (reloadedAfterDecompose && reloadedAfterDecompose.children_ids.length > 0) {
|
|
160
|
-
goal = reloadedAfterDecompose;
|
|
161
|
-
if (this.deps.deps.treeLoopOrchestrator) {
|
|
162
|
-
config = { ...config, treeMode: true };
|
|
163
|
-
this.deps.setConfig(config);
|
|
164
|
-
ctx.config = config;
|
|
165
|
-
this.deps.logger?.info("[CoreLoop] treeMode enabled after auto-decomposition", {
|
|
166
|
-
goalId,
|
|
167
|
-
childrenCount: goal.children_ids.length,
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
const observeEvidence = await runPhase("observe-evidence", () => corePhaseRuntime.run({
|
|
173
|
-
...buildObserveEvidenceSpec(),
|
|
174
|
-
requiredTools: [],
|
|
175
|
-
allowedTools: [],
|
|
176
|
-
budget: {},
|
|
177
|
-
}, {
|
|
178
|
-
goalTitle: goal.title,
|
|
179
|
-
goalDescription: goal.description,
|
|
180
|
-
dimensions: goal.dimensions.map((dimension) => dimension.name),
|
|
181
|
-
}, { goalId, gapAggregate: result.gapAggregate }));
|
|
182
|
-
rememberPhase(observeEvidence);
|
|
183
|
-
await appendPhaseEvidence(appendRuntimeEvidence, observeEvidence, "observation");
|
|
184
|
-
goal = await runPhase("observe", () => observeAndReload(ctx, goalId, goal, loopIndex));
|
|
185
|
-
if (this.deps.stateDiff) {
|
|
186
|
-
const { shouldSkip } = await runStateDiffCheck(this.deps.stateDiff, this.deps.stateDiffState, goalId, goal, loopIndex, config, this.deps.deps, result, startTime, this.deps.logger);
|
|
187
|
-
if (shouldSkip)
|
|
188
|
-
return result;
|
|
189
|
-
}
|
|
190
|
-
const gapResult = await runPhase("gap-analysis", () => calculateGapOrComplete(ctx, goalId, goal, loopIndex, result, startTime));
|
|
191
|
-
if (!gapResult)
|
|
192
|
-
return result;
|
|
193
|
-
const { gapVector, gapAggregate, skipTaskGeneration } = gapResult;
|
|
194
|
-
this.deps.logger?.info(`[iter ${loopIndex}] gap: ${gapAggregate.toFixed(2)} | ${(gapVector.gaps ?? [])
|
|
195
|
-
.map((g) => `${g.dimension_name}=${g.normalized_weighted_gap.toFixed(2)}`)
|
|
196
|
-
.join(", ")}`);
|
|
197
|
-
const finalizationStatus = await runPhase("deadline-finalization", async () => {
|
|
198
|
-
const bestArtifact = await loadBestFinalizationArtifact(this.deps.deps.evidenceLedger, goalId, normalizeFinalizationPolicy(goal.finalization_policy).best_artifact_selection);
|
|
199
|
-
const reproducibilityManifestId = await loadReadyFinalizationManifestId({
|
|
200
|
-
stateManager: this.deps.deps.stateManager,
|
|
201
|
-
goalId,
|
|
202
|
-
runId: runtimeEvidenceScope.run_id,
|
|
203
|
-
bestArtifact,
|
|
204
|
-
requireReproducibilityManifest: normalizeFinalizationPolicy(goal.finalization_policy).require_reproducibility_manifest,
|
|
205
|
-
});
|
|
206
|
-
return buildDeadlineFinalizationStatus({
|
|
207
|
-
goal,
|
|
208
|
-
bestArtifact,
|
|
209
|
-
reproducibilityManifestId,
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
result.finalizationStatus = finalizationStatus;
|
|
213
|
-
const executionMode = deriveExecutionModeFromDeadlineStatus(finalizationStatus);
|
|
214
|
-
result.executionMode = executionMode;
|
|
215
|
-
if (shouldStopExplorationForFinalization(finalizationStatus)) {
|
|
216
|
-
await maybeRunDreamReviewCheckpoint({
|
|
217
|
-
goal,
|
|
218
|
-
gapAggregate,
|
|
219
|
-
driveScores: [],
|
|
220
|
-
finalizationStatus,
|
|
221
|
-
executionMode,
|
|
222
|
-
requestedTrigger: "pre_finalization",
|
|
223
|
-
});
|
|
224
|
-
result.skipped = true;
|
|
225
|
-
result.skipReason =
|
|
226
|
-
finalizationStatus.mode === "missed_deadline"
|
|
227
|
-
? "deadline_missed_finalization"
|
|
228
|
-
: "deadline_finalization";
|
|
229
|
-
await appendRuntimeEvidence({
|
|
230
|
-
kind: "decision",
|
|
231
|
-
summary: finalizationStatus.reason,
|
|
232
|
-
outcome: "blocked",
|
|
233
|
-
decision_reason: finalizationStatus.reason,
|
|
234
|
-
scope: { phase: "deadline_finalization" },
|
|
235
|
-
result: {
|
|
236
|
-
status: finalizationStatus.mode,
|
|
237
|
-
summary: finalizationStatus.finalization_plan?.deliverable_contract ?? finalizationStatus.reason,
|
|
238
|
-
},
|
|
239
|
-
});
|
|
240
|
-
await generateLoopReport(goalId, loopIndex, result, goal, this.deps.deps.reportingEngine, this.deps.logger);
|
|
241
|
-
result.elapsedMs = Date.now() - startTime;
|
|
242
|
-
return result;
|
|
243
|
-
}
|
|
244
|
-
const activeWait = await findActiveWaitObservationInput(this.deps.deps, goalId, goal.title, activationContext?.waitResume?.strategyId);
|
|
245
|
-
if (activeWait) {
|
|
246
|
-
const waitObservationPhase = await runPhase("wait-observation-agentic", () => corePhaseRuntime.run({
|
|
247
|
-
...buildWaitObservationSpec(),
|
|
248
|
-
requiredTools: [],
|
|
249
|
-
allowedTools: [],
|
|
250
|
-
budget: {},
|
|
251
|
-
}, activeWait, { goalId, gapAggregate }));
|
|
252
|
-
rememberPhase(waitObservationPhase);
|
|
253
|
-
await appendPhaseEvidence(appendRuntimeEvidence, waitObservationPhase, "observation");
|
|
254
|
-
}
|
|
255
|
-
const waitObservationDecision = await runPhase("wait-observation", () => evaluateWaitStrategiesForObserveOnly(ctx, goalId, goal, result, activationContext?.waitResume?.strategyId));
|
|
256
|
-
if (waitObservationDecision.observeOnly) {
|
|
257
|
-
result.skipped = true;
|
|
258
|
-
result.skipReason =
|
|
259
|
-
waitObservationDecision.outcome?.status === "not_due"
|
|
260
|
-
? "wait_not_due"
|
|
261
|
-
: "wait_observe_only";
|
|
262
|
-
await generateLoopReport(goalId, loopIndex, result, goal, this.deps.deps.reportingEngine, this.deps.logger);
|
|
263
|
-
result.elapsedMs = Date.now() - startTime;
|
|
264
|
-
return result;
|
|
265
|
-
}
|
|
266
|
-
let driveScores = [];
|
|
267
|
-
let highDissatisfactionDimensions = [];
|
|
268
|
-
if (!skipTaskGeneration) {
|
|
269
|
-
const driveResult = await runPhase("drive-scoring", () => scoreDrivesAndCheckKnowledge(ctx, goalId, goal, gapVector, loopIndex, result, startTime, (id, idx, r, g) => generateLoopReport(id, idx, r, g, this.deps.deps.reportingEngine, this.deps.logger)));
|
|
270
|
-
if (!driveResult)
|
|
271
|
-
return result;
|
|
272
|
-
driveScores = driveResult.driveScores;
|
|
273
|
-
highDissatisfactionDimensions = driveResult.highDissatisfactionDimensions;
|
|
274
|
-
}
|
|
275
|
-
const knowledgeRefresh = !skipTaskGeneration
|
|
276
|
-
? await runPhase("knowledge-refresh", () => corePhaseRuntime.run({
|
|
277
|
-
...buildKnowledgeRefreshSpec(),
|
|
278
|
-
requiredTools: [],
|
|
279
|
-
allowedTools: [],
|
|
280
|
-
budget: {},
|
|
281
|
-
}, {
|
|
282
|
-
goalTitle: goal.title,
|
|
283
|
-
topDimensions: highDissatisfactionDimensions.length > 0
|
|
284
|
-
? [
|
|
285
|
-
...(pendingDirective?.focusDimension ? [pendingDirective.focusDimension] : []),
|
|
286
|
-
...highDissatisfactionDimensions,
|
|
287
|
-
].filter((value, index, values) => values.indexOf(value) === index)
|
|
288
|
-
: [
|
|
289
|
-
...(pendingDirective?.focusDimension ? [pendingDirective.focusDimension] : []),
|
|
290
|
-
...driveScores.map((score) => score.dimension_name),
|
|
291
|
-
].filter((value, index, values) => values.indexOf(value) === index),
|
|
292
|
-
gapAggregate,
|
|
293
|
-
}, { goalId, gapAggregate }))
|
|
294
|
-
: null;
|
|
295
|
-
if (knowledgeRefresh)
|
|
296
|
-
rememberPhase(knowledgeRefresh);
|
|
297
|
-
if (knowledgeRefresh)
|
|
298
|
-
await appendPhaseEvidence(appendRuntimeEvidence, knowledgeRefresh, "strategy");
|
|
299
|
-
const replanningOptions = this.deps.coreDecisionEngine.shouldRunReplanningOptions({
|
|
300
|
-
skipTaskGeneration: Boolean(skipTaskGeneration),
|
|
301
|
-
taskCycleBlocked: false,
|
|
302
|
-
gapAggregate,
|
|
303
|
-
})
|
|
304
|
-
? await runPhase("replanning-options", () => corePhaseRuntime.run({
|
|
305
|
-
...buildReplanningOptionsSpec(),
|
|
306
|
-
requiredTools: [],
|
|
307
|
-
allowedTools: [],
|
|
308
|
-
budget: {},
|
|
309
|
-
}, {
|
|
310
|
-
goalTitle: goal.title,
|
|
311
|
-
targetDimensions: driveScores.map((score) => score.dimension_name),
|
|
312
|
-
gapAggregate,
|
|
313
|
-
}, { goalId, gapAggregate }))
|
|
314
|
-
: null;
|
|
315
|
-
if (replanningOptions)
|
|
316
|
-
rememberPhase(replanningOptions);
|
|
317
|
-
if (replanningOptions)
|
|
318
|
-
await appendPhaseEvidence(appendRuntimeEvidence, replanningOptions, "strategy");
|
|
319
|
-
await runPhase("completion-check", () => checkCompletionAndMilestones(ctx, goalId, goal, result, startTime));
|
|
320
|
-
if (result.error)
|
|
321
|
-
return result;
|
|
322
|
-
const stallActionHints = this.deps.coreDecisionEngine.buildStallActionHints({
|
|
323
|
-
phase: replanningOptions,
|
|
324
|
-
});
|
|
325
|
-
await runPhase("stall-detection", () => detectStallsAndRebalance(ctx, goalId, goal, result, stallActionHints.recommendedAction
|
|
326
|
-
? stallActionHints
|
|
327
|
-
: pendingDirective?.preferredAction
|
|
328
|
-
? { recommendedAction: pendingDirective.preferredAction }
|
|
329
|
-
: undefined));
|
|
330
|
-
const stallInvestigation = this.deps.coreDecisionEngine.shouldRunStallInvestigation(result)
|
|
331
|
-
? await runPhase("stall-investigation", () => corePhaseRuntime.run({
|
|
332
|
-
...buildStallInvestigationSpec(),
|
|
333
|
-
requiredTools: [],
|
|
334
|
-
allowedTools: [],
|
|
335
|
-
budget: {},
|
|
336
|
-
}, {
|
|
337
|
-
goalTitle: goal.title,
|
|
338
|
-
stallType: result.stallReport?.stall_type ?? "unknown",
|
|
339
|
-
...(result.stallReport?.dimension_name ? { dimensionName: result.stallReport.dimension_name } : {}),
|
|
340
|
-
...(result.stallReport?.suggested_cause ? { suggestedCause: result.stallReport.suggested_cause } : {}),
|
|
341
|
-
}, { goalId, stallDetected: result.stallDetected, gapAggregate }))
|
|
342
|
-
: null;
|
|
343
|
-
if (stallInvestigation)
|
|
344
|
-
rememberPhase(stallInvestigation);
|
|
345
|
-
if (stallInvestigation)
|
|
346
|
-
await appendPhaseEvidence(appendRuntimeEvidence, stallInvestigation, "failure");
|
|
347
|
-
if (result.stallDetected && result.stallReport) {
|
|
348
|
-
this.deps.logger?.warn(`[iter ${loopIndex}] stall detected: ${result.stallReport.stall_type}`, {
|
|
349
|
-
escalation: result.stallReport.escalation_level,
|
|
350
|
-
});
|
|
351
|
-
void this.deps.deps.hookManager?.emit("StallDetected", {
|
|
352
|
-
goal_id: goalId,
|
|
353
|
-
dimension: result.stallReport.dimension_name ?? undefined,
|
|
354
|
-
data: {
|
|
355
|
-
stall_type: result.stallReport.stall_type,
|
|
356
|
-
escalation_level: result.stallReport.escalation_level,
|
|
357
|
-
suggested_cause: result.stallReport.suggested_cause,
|
|
358
|
-
task_id: result.stallReport.task_id ?? undefined,
|
|
359
|
-
},
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
const dreamCheckpoint = await maybeRunDreamReviewCheckpoint({
|
|
363
|
-
goal,
|
|
364
|
-
gapAggregate,
|
|
365
|
-
driveScores,
|
|
366
|
-
finalizationStatus,
|
|
367
|
-
executionMode,
|
|
368
|
-
});
|
|
369
|
-
const dreamRunControlRecommendationContext = formatDreamRunControlRecommendationContext(dreamCheckpoint?.run_control_recommendations);
|
|
370
|
-
const publicResearchRequest = buildPublicResearchRequest({
|
|
371
|
-
goal,
|
|
372
|
-
result,
|
|
373
|
-
gapAggregate,
|
|
374
|
-
driveScores,
|
|
375
|
-
knowledgeRefresh,
|
|
376
|
-
});
|
|
377
|
-
const publicResearch = publicResearchRequest
|
|
378
|
-
? await runPhase("public-research", () => corePhaseRuntime.run({
|
|
379
|
-
...buildPublicResearchSpec(),
|
|
380
|
-
requiredTools: ["research_answer_with_sources"],
|
|
381
|
-
allowedTools: ["research_web", "research_answer_with_sources"],
|
|
382
|
-
budget: {
|
|
383
|
-
maxModelTurns: 4,
|
|
384
|
-
maxToolCalls: 4,
|
|
385
|
-
maxWallClockMs: 60_000,
|
|
386
|
-
maxRepeatedToolCalls: 1,
|
|
387
|
-
},
|
|
388
|
-
}, {
|
|
389
|
-
goalTitle: goal.title,
|
|
390
|
-
trigger: publicResearchRequest.trigger,
|
|
391
|
-
question: publicResearchRequest.question,
|
|
392
|
-
targetDimensions: publicResearchRequest.targetDimensions,
|
|
393
|
-
sourcePreference: publicResearchRequest.sourcePreference,
|
|
394
|
-
maxSources: publicResearchRequest.maxSources,
|
|
395
|
-
sensitiveContextPolicy: publicResearchRequest.sensitiveContextPolicy,
|
|
396
|
-
untrustedContentPolicy: publicResearchRequest.untrustedContentPolicy,
|
|
397
|
-
}, { goalId, stallDetected: result.stallDetected, gapAggregate }))
|
|
398
|
-
: null;
|
|
399
|
-
if (publicResearch)
|
|
400
|
-
rememberPhase(publicResearch);
|
|
401
|
-
if (publicResearch && publicResearchRequest) {
|
|
402
|
-
await appendPublicResearchEvidence(appendRuntimeEvidence, publicResearch, publicResearchRequest);
|
|
403
|
-
}
|
|
404
|
-
const knowledgeAcquisitionDecision = this.deps.coreDecisionEngine.evaluateKnowledgeAcquisition({
|
|
405
|
-
phase: knowledgeRefresh,
|
|
406
|
-
hasKnowledgeManager: !!this.deps.deps.knowledgeManager,
|
|
407
|
-
hasToolExecutor: !!this.deps.deps.toolExecutor,
|
|
408
|
-
});
|
|
409
|
-
if (knowledgeAcquisitionDecision.shouldAcquire &&
|
|
410
|
-
knowledgeAcquisitionDecision.question &&
|
|
411
|
-
this.deps.deps.knowledgeManager &&
|
|
412
|
-
this.deps.deps.toolExecutor) {
|
|
413
|
-
try {
|
|
414
|
-
const acquiredCount = await autoAcquireKnowledgeForRefresh(this.deps.deps, this.deps.logger, goalId, knowledgeAcquisitionDecision.question);
|
|
415
|
-
if (acquiredCount > 0) {
|
|
416
|
-
result.nextIterationDirective = this.deps.coreDecisionEngine.buildNextIterationDirective({
|
|
417
|
-
knowledgeRefreshPhase: knowledgeRefresh,
|
|
418
|
-
replanningPhase: replanningOptions,
|
|
419
|
-
goalDimensions: goal.dimensions.map((dimension) => dimension.name),
|
|
420
|
-
fallbackFocusDimension: driveScores[0]?.dimension_name ?? pendingDirective?.focusDimension,
|
|
421
|
-
});
|
|
422
|
-
await appendDecisionEvidence(appendRuntimeEvidence, result.nextIterationDirective, "knowledge_refresh_auto_acquire");
|
|
423
|
-
this.deps.logger?.info("CoreLoop: knowledge_refresh auto-acquired knowledge and skipped execution", {
|
|
424
|
-
goalId,
|
|
425
|
-
acquiredCount,
|
|
426
|
-
});
|
|
427
|
-
await generateLoopReport(goalId, loopIndex, result, goal, this.deps.deps.reportingEngine, this.deps.logger);
|
|
428
|
-
result.skipped = true;
|
|
429
|
-
result.skipReason = "knowledge_refresh_auto_acquire";
|
|
430
|
-
result.elapsedMs = Date.now() - startTime;
|
|
431
|
-
return result;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
catch (err) {
|
|
435
|
-
this.deps.logger?.warn("CoreLoop: knowledge_refresh auto acquisition failed (non-fatal)", {
|
|
436
|
-
goalId,
|
|
437
|
-
error: err instanceof Error ? err.message : String(err),
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
if (result.stallDetected && this.deps.deps.knowledgeManager && this.deps.deps.toolExecutor) {
|
|
442
|
-
try {
|
|
443
|
-
const acquiredCount = await autoAcquireKnowledgeForDreamStall(this.deps.deps, this.deps.logger, goalId, goal, gapVector);
|
|
444
|
-
if (acquiredCount > 0) {
|
|
445
|
-
this.deps.logger?.info("CoreLoop: dream auto-acquired knowledge and skipped execution for context refresh", { goalId, acquiredCount });
|
|
446
|
-
await generateLoopReport(goalId, loopIndex, result, goal, this.deps.deps.reportingEngine, this.deps.logger);
|
|
447
|
-
result.skipped = true;
|
|
448
|
-
result.skipReason = "dream_auto_acquire_knowledge";
|
|
449
|
-
result.elapsedMs = Date.now() - startTime;
|
|
450
|
-
return result;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
catch (err) {
|
|
454
|
-
this.deps.logger?.warn("CoreLoop: autoAcquireKnowledge failed (non-fatal)", {
|
|
455
|
-
goalId,
|
|
456
|
-
error: err instanceof Error ? err.message : String(err),
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
if (skipTaskGeneration) {
|
|
461
|
-
result.nextIterationDirective = this.deps.coreDecisionEngine.buildNextIterationDirective({
|
|
462
|
-
knowledgeRefreshPhase: knowledgeRefresh,
|
|
463
|
-
replanningPhase: replanningOptions,
|
|
464
|
-
goalDimensions: goal.dimensions.map((dimension) => dimension.name),
|
|
465
|
-
fallbackFocusDimension: driveScores[0]?.dimension_name ?? pendingDirective?.focusDimension,
|
|
466
|
-
});
|
|
467
|
-
await appendDecisionEvidence(appendRuntimeEvidence, result.nextIterationDirective, "skip_task_generation");
|
|
468
|
-
await generateLoopReport(goalId, loopIndex, result, goal, this.deps.deps.reportingEngine, this.deps.logger);
|
|
469
|
-
result.elapsedMs = Date.now() - startTime;
|
|
470
|
-
return result;
|
|
471
|
-
}
|
|
472
|
-
if (checkDependencyBlock(ctx, goalId, result))
|
|
473
|
-
return result;
|
|
474
|
-
const tookParallelPath = await tryParallelExecution(goalId, goal, gapAggregate, result, startTime, this.deps.deps, loopIndex, this.deps.logger);
|
|
475
|
-
if (tookParallelPath)
|
|
476
|
-
return result;
|
|
477
|
-
const shouldPreferReplanningContext = this.deps.coreDecisionEngine.shouldPreferReplanningContext({
|
|
478
|
-
phase: replanningOptions,
|
|
479
|
-
});
|
|
480
|
-
const taskGenerationHints = this.deps.coreDecisionEngine.buildTaskGenerationHints({
|
|
481
|
-
phase: replanningOptions,
|
|
482
|
-
goalDimensions: goal.dimensions.map((dimension) => dimension.name),
|
|
483
|
-
});
|
|
484
|
-
const runtimeBudgetContext = await this.deps.getRuntimeBudgetContext?.().catch((err) => {
|
|
485
|
-
this.deps.logger?.warn("CoreLoop: failed to load runtime budget context", {
|
|
486
|
-
goalId,
|
|
487
|
-
loopIndex,
|
|
488
|
-
error: err instanceof Error ? err.message : String(err),
|
|
489
|
-
});
|
|
490
|
-
return undefined;
|
|
491
|
-
});
|
|
492
|
-
const mergedTaskGenerationHints = {
|
|
493
|
-
targetDimensionOverride: taskGenerationHints.targetDimensionOverride ?? pendingDirective?.focusDimension,
|
|
494
|
-
knowledgeContextPrefix: taskGenerationHints.knowledgeContextPrefix,
|
|
495
|
-
budgetContext: runtimeBudgetContext,
|
|
496
|
-
executionMode,
|
|
497
|
-
runControlRecommendationContext: dreamRunControlRecommendationContext,
|
|
498
|
-
};
|
|
499
|
-
if (!shouldPreferReplanningContext && replanningOptions?.status === "completed") {
|
|
500
|
-
this.deps.logger?.debug("CoreLoop: replanning evidence collected but not adopted as preferred context", {
|
|
501
|
-
goalId,
|
|
502
|
-
loopIndex,
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
const loopCallbacks = {
|
|
506
|
-
handleCapabilityAcquisition: (task, gId, adapter) => handleCapabilityAcquisition(task, gId, adapter, this.deps.deps.capabilityDetector, this.deps.capabilityFailures, this.deps.logger),
|
|
507
|
-
incrementTransferCounter: () => this.deps.incrementTransferCounter(),
|
|
508
|
-
tryGenerateReport: (id, idx, r, g) => generateLoopReport(id, idx, r, g, this.deps.deps.reportingEngine, this.deps.logger),
|
|
509
|
-
};
|
|
510
|
-
const taskCycleOk = await runTaskCycleWithContext(ctx, goalId, goal, gapVector, driveScores, highDissatisfactionDimensions, loopIndex, result, startTime, loopCallbacks, evidenceLedger, mergedTaskGenerationHints);
|
|
511
|
-
if (!taskCycleOk)
|
|
512
|
-
return result;
|
|
513
|
-
const completedTaskResult = result.taskResult;
|
|
514
|
-
if (completedTaskResult) {
|
|
515
|
-
await appendTaskCycleEvidence(appendRuntimeEvidence, completedTaskResult);
|
|
516
|
-
}
|
|
517
|
-
if (this.deps.coreDecisionEngine.shouldRunVerificationEvidence(result) && completedTaskResult) {
|
|
518
|
-
const verificationPhase = await runPhase("verification-evidence", () => corePhaseRuntime.run({
|
|
519
|
-
...buildVerificationEvidenceSpec(),
|
|
520
|
-
budget: {},
|
|
521
|
-
}, {
|
|
522
|
-
taskId: completedTaskResult.task.id,
|
|
523
|
-
taskDescription: completedTaskResult.task.work_description,
|
|
524
|
-
successCriteria: completedTaskResult.task.success_criteria.map((criterion) => criterion.description),
|
|
525
|
-
executionAction: completedTaskResult.action,
|
|
526
|
-
}, {
|
|
527
|
-
goalId,
|
|
528
|
-
taskId: completedTaskResult.task.id,
|
|
529
|
-
hasTaskResult: true,
|
|
530
|
-
}));
|
|
531
|
-
rememberPhase(verificationPhase);
|
|
532
|
-
await appendPhaseEvidence(appendRuntimeEvidence, verificationPhase, "verification", {
|
|
533
|
-
task_id: completedTaskResult.task.id,
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
result.nextIterationDirective = this.deps.coreDecisionEngine.buildNextIterationDirective({
|
|
537
|
-
knowledgeRefreshPhase: knowledgeRefresh,
|
|
538
|
-
replanningPhase: replanningOptions,
|
|
539
|
-
goalDimensions: goal.dimensions.map((dimension) => dimension.name),
|
|
540
|
-
fallbackFocusDimension: driveScores[0]?.dimension_name ?? pendingDirective?.focusDimension,
|
|
541
|
-
});
|
|
542
|
-
await appendDecisionEvidence(appendRuntimeEvidence, result.nextIterationDirective, "next_iteration_directive");
|
|
543
|
-
await generateLoopReport(goalId, loopIndex, result, goal, this.deps.deps.reportingEngine, this.deps.logger);
|
|
544
|
-
result.elapsedMs = Date.now() - startTime;
|
|
545
|
-
return result;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
async function appendPublicResearchEvidence(appendRuntimeEvidence, execution, request) {
|
|
549
|
-
if (execution.status === "skipped")
|
|
550
|
-
return;
|
|
551
|
-
const output = buildPublicResearchSpec().outputSchema.safeParse(execution.output);
|
|
552
|
-
if (!output.success) {
|
|
553
|
-
await appendRuntimeEvidence({
|
|
554
|
-
kind: "research",
|
|
555
|
-
scope: { phase: execution.phase },
|
|
556
|
-
summary: execution.summary ?? request.reason,
|
|
557
|
-
outcome: "inconclusive",
|
|
558
|
-
result: {
|
|
559
|
-
status: execution.status,
|
|
560
|
-
summary: request.reason,
|
|
561
|
-
error: output.error.issues.map((issue) => issue.message).join("; "),
|
|
562
|
-
},
|
|
563
|
-
});
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
const memo = normalizePublicResearchMemo(output.data, request);
|
|
567
|
-
await appendRuntimeEvidence({
|
|
568
|
-
kind: "research",
|
|
569
|
-
scope: { phase: execution.phase },
|
|
570
|
-
summary: publicResearchSummary(memo),
|
|
571
|
-
outcome: phaseStatusToOutcome(execution.status),
|
|
572
|
-
research: [memo],
|
|
573
|
-
result: {
|
|
574
|
-
status: execution.status,
|
|
575
|
-
summary: memo.summary,
|
|
576
|
-
...(execution.error ? { error: execution.error } : {}),
|
|
577
|
-
},
|
|
578
|
-
raw_refs: [
|
|
579
|
-
...researchRawRefs(memo),
|
|
580
|
-
...(execution.traceId ? [{ kind: "agentloop_trace", id: execution.traceId }] : []),
|
|
581
|
-
...(execution.sessionId ? [{ kind: "agentloop_state", id: execution.sessionId }] : []),
|
|
582
|
-
...(execution.turnId ? [{ kind: "agentloop_turn", id: execution.turnId }] : []),
|
|
583
|
-
],
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
async function appendDreamReviewCheckpointEvidence(appendRuntimeEvidence, execution, request, goal) {
|
|
587
|
-
if (execution.status === "skipped")
|
|
588
|
-
return null;
|
|
589
|
-
const output = buildDreamReviewCheckpointSpec().outputSchema.safeParse(execution.output);
|
|
590
|
-
if (!output.success) {
|
|
591
|
-
await appendRuntimeEvidence({
|
|
592
|
-
kind: "dream_checkpoint",
|
|
593
|
-
scope: { phase: execution.phase },
|
|
594
|
-
summary: execution.summary ?? request.reason,
|
|
595
|
-
outcome: "inconclusive",
|
|
596
|
-
result: {
|
|
597
|
-
status: execution.status,
|
|
598
|
-
summary: request.reason,
|
|
599
|
-
error: output.error.issues.map((issue) => issue.message).join("; "),
|
|
600
|
-
},
|
|
601
|
-
});
|
|
602
|
-
return null;
|
|
603
|
-
}
|
|
604
|
-
const checkpoint = normalizeDreamReviewCheckpoint(output.data, request, goal);
|
|
605
|
-
await appendRuntimeEvidence({
|
|
606
|
-
kind: "dream_checkpoint",
|
|
607
|
-
scope: { phase: execution.phase },
|
|
608
|
-
summary: checkpoint.summary,
|
|
609
|
-
outcome: phaseStatusToOutcome(execution.status),
|
|
610
|
-
dream_checkpoints: [checkpoint],
|
|
611
|
-
result: {
|
|
612
|
-
status: execution.status,
|
|
613
|
-
summary: checkpoint.guidance,
|
|
614
|
-
...(execution.error ? { error: execution.error } : {}),
|
|
615
|
-
},
|
|
616
|
-
raw_refs: [
|
|
617
|
-
...dreamCheckpointRawRefs(checkpoint),
|
|
618
|
-
...(execution.traceId ? [{ kind: "agentloop_trace", id: execution.traceId }] : []),
|
|
619
|
-
...(execution.sessionId ? [{ kind: "agentloop_state", id: execution.sessionId }] : []),
|
|
620
|
-
...(execution.turnId ? [{ kind: "agentloop_turn", id: execution.turnId }] : []),
|
|
621
|
-
],
|
|
622
|
-
});
|
|
623
|
-
return checkpoint;
|
|
624
|
-
}
|
|
625
|
-
async function loadDreamReviewEvidenceSummary(evidenceLedger, goalId) {
|
|
626
|
-
if (!evidenceLedger?.summarizeGoal)
|
|
627
|
-
return null;
|
|
628
|
-
try {
|
|
629
|
-
return await evidenceLedger.summarizeGoal(goalId);
|
|
630
|
-
}
|
|
631
|
-
catch {
|
|
632
|
-
return null;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
async function loadBestFinalizationArtifact(evidenceLedger, goalId, selection) {
|
|
636
|
-
if (!evidenceLedger)
|
|
637
|
-
return null;
|
|
638
|
-
try {
|
|
639
|
-
if (selection === "best_evidence") {
|
|
640
|
-
const summary = await evidenceLedger.summarizeGoal?.(goalId);
|
|
641
|
-
return summary?.best_evidence ? bestArtifactFromEvidence(summary.best_evidence) : null;
|
|
642
|
-
}
|
|
643
|
-
const entries = evidenceLedger.readByGoal
|
|
644
|
-
? (await evidenceLedger.readByGoal(goalId)).entries
|
|
645
|
-
: (await evidenceLedger.summarizeGoal?.(goalId))?.recent_entries ?? [];
|
|
646
|
-
const newestFirst = [...entries].sort((a, b) => b.occurred_at.localeCompare(a.occurred_at));
|
|
647
|
-
const selected = selection === "latest_artifact"
|
|
648
|
-
? newestFirst.find((entry) => entry.artifacts.length > 0 || entry.kind === "artifact")
|
|
649
|
-
: selectLatestVerifiedArtifact(newestFirst);
|
|
650
|
-
return selected ? bestArtifactFromEvidence(selected) : null;
|
|
651
|
-
}
|
|
652
|
-
catch {
|
|
653
|
-
return null;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
async function loadReadyFinalizationManifestId(input) {
|
|
657
|
-
if (!input.requireReproducibilityManifest)
|
|
658
|
-
return null;
|
|
659
|
-
if (!input.bestArtifact)
|
|
660
|
-
return null;
|
|
661
|
-
try {
|
|
662
|
-
const store = new RuntimeReproducibilityManifestStore(path.join(input.stateManager.getBaseDir(), "runtime"));
|
|
663
|
-
const manifest = await store.findReadyForFinalization({
|
|
664
|
-
goalId: input.goalId,
|
|
665
|
-
runId: input.runId,
|
|
666
|
-
deliverable: input.bestArtifact
|
|
667
|
-
? {
|
|
668
|
-
...(input.bestArtifact.id ? { id: input.bestArtifact.id } : {}),
|
|
669
|
-
label: input.bestArtifact.label,
|
|
670
|
-
...(input.bestArtifact.path ? { path: input.bestArtifact.path } : {}),
|
|
671
|
-
...(input.bestArtifact.state_relative_path ? { state_relative_path: input.bestArtifact.state_relative_path } : {}),
|
|
672
|
-
...(input.bestArtifact.url ? { url: input.bestArtifact.url } : {}),
|
|
673
|
-
}
|
|
674
|
-
: null,
|
|
675
|
-
});
|
|
676
|
-
return manifest?.manifest_id ?? null;
|
|
677
|
-
}
|
|
678
|
-
catch {
|
|
679
|
-
return null;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
function selectLatestVerifiedArtifact(entriesNewestFirst) {
|
|
683
|
-
for (const verification of entriesNewestFirst) {
|
|
684
|
-
const verified = verification.verification?.verdict === "pass"
|
|
685
|
-
|| (verification.kind === "verification" && verification.outcome === "improved");
|
|
686
|
-
if (!verified)
|
|
687
|
-
continue;
|
|
688
|
-
if (verification.artifacts.length > 0)
|
|
689
|
-
return verification;
|
|
690
|
-
const taskId = verification.scope.task_id;
|
|
691
|
-
if (!taskId)
|
|
692
|
-
continue;
|
|
693
|
-
const matchedArtifact = entriesNewestFirst.find((entry) => entry.scope.task_id === taskId
|
|
694
|
-
&& entry.occurred_at <= verification.occurred_at
|
|
695
|
-
&& entry.artifacts.length > 0);
|
|
696
|
-
if (matchedArtifact)
|
|
697
|
-
return matchedArtifact;
|
|
698
|
-
}
|
|
699
|
-
return undefined;
|
|
700
|
-
}
|
|
701
|
-
function bestArtifactFromEvidence(entry) {
|
|
702
|
-
const primaryArtifact = entry.artifacts[0];
|
|
703
|
-
return {
|
|
704
|
-
id: primaryArtifact?.label ?? entry.id,
|
|
705
|
-
label: primaryArtifact?.label ?? entry.summary ?? entry.result?.summary ?? entry.id,
|
|
706
|
-
kind: primaryArtifact?.kind ?? entry.kind,
|
|
707
|
-
summary: entry.summary ?? entry.result?.summary ?? entry.verification?.summary,
|
|
708
|
-
path: primaryArtifact?.path,
|
|
709
|
-
state_relative_path: primaryArtifact?.state_relative_path,
|
|
710
|
-
url: primaryArtifact?.url,
|
|
711
|
-
occurred_at: entry.occurred_at,
|
|
712
|
-
source: "runtime_evidence_ledger",
|
|
713
|
-
};
|
|
714
|
-
}
|
|
715
|
-
async function appendPhaseEvidence(appendRuntimeEvidence, execution, kind, scope) {
|
|
716
|
-
if (execution.status === "skipped")
|
|
717
|
-
return;
|
|
718
|
-
await appendRuntimeEvidence({
|
|
719
|
-
kind,
|
|
720
|
-
scope: { ...scope, phase: execution.phase },
|
|
721
|
-
summary: execution.summary ?? `${execution.phase} ${execution.status}`,
|
|
722
|
-
outcome: phaseStatusToOutcome(execution.status),
|
|
723
|
-
result: {
|
|
724
|
-
status: execution.status,
|
|
725
|
-
...(execution.error ? { error: execution.error } : {}),
|
|
726
|
-
...(execution.summary ? { summary: execution.summary } : {}),
|
|
727
|
-
},
|
|
728
|
-
raw_refs: [
|
|
729
|
-
...(execution.traceId ? [{ kind: "agentloop_trace", id: execution.traceId }] : []),
|
|
730
|
-
...(execution.sessionId ? [{ kind: "agentloop_state", id: execution.sessionId }] : []),
|
|
731
|
-
...(execution.turnId ? [{ kind: "agentloop_turn", id: execution.turnId }] : []),
|
|
732
|
-
],
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
async function appendDecisionEvidence(appendRuntimeEvidence, directive, fallbackReason) {
|
|
736
|
-
if (!directive)
|
|
737
|
-
return;
|
|
738
|
-
await appendRuntimeEvidence({
|
|
739
|
-
kind: "decision",
|
|
740
|
-
summary: directive.reason,
|
|
741
|
-
strategy: directive.preferredAction,
|
|
742
|
-
outcome: "continued",
|
|
743
|
-
decision_reason: directive.reason,
|
|
744
|
-
scope: { phase: directive.sourcePhase },
|
|
745
|
-
result: {
|
|
746
|
-
status: fallbackReason,
|
|
747
|
-
summary: directive.reason,
|
|
748
|
-
},
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
async function appendTaskCycleEvidence(appendRuntimeEvidence, taskResult) {
|
|
752
|
-
const task = taskResult.task;
|
|
753
|
-
await appendRuntimeEvidence({
|
|
754
|
-
kind: "task_generation",
|
|
755
|
-
scope: { task_id: task.id },
|
|
756
|
-
hypothesis: task.rationale,
|
|
757
|
-
strategy: task.approach,
|
|
758
|
-
task: {
|
|
759
|
-
id: task.id,
|
|
760
|
-
description: task.work_description,
|
|
761
|
-
primary_dimension: task.primary_dimension,
|
|
762
|
-
},
|
|
763
|
-
summary: task.work_description,
|
|
764
|
-
outcome: "continued",
|
|
765
|
-
decision_reason: task.rationale,
|
|
766
|
-
});
|
|
767
|
-
await appendRuntimeEvidence({
|
|
768
|
-
kind: taskResult.action === "completed" ? "execution" : "failure",
|
|
769
|
-
scope: { task_id: task.id },
|
|
770
|
-
task: {
|
|
771
|
-
id: task.id,
|
|
772
|
-
description: task.work_description,
|
|
773
|
-
action: taskResult.action,
|
|
774
|
-
primary_dimension: task.primary_dimension,
|
|
775
|
-
},
|
|
776
|
-
artifacts: taskResult.verificationResult.file_diffs?.map((diff) => ({
|
|
777
|
-
label: diff.path,
|
|
778
|
-
path: diff.path,
|
|
779
|
-
kind: "diff",
|
|
780
|
-
})) ?? [],
|
|
781
|
-
result: {
|
|
782
|
-
status: taskResult.action,
|
|
783
|
-
...(task.execution_output ? { summary: truncateOneLine(task.execution_output, 500) } : {}),
|
|
784
|
-
},
|
|
785
|
-
outcome: taskActionToOutcome(taskResult.action),
|
|
786
|
-
summary: `Task ${task.id} ${taskResult.action}`,
|
|
787
|
-
});
|
|
788
|
-
await appendRuntimeEvidence({
|
|
789
|
-
kind: taskResult.verificationResult.verdict === "pass" ? "verification" : "failure",
|
|
790
|
-
scope: { task_id: task.id },
|
|
791
|
-
verification: {
|
|
792
|
-
verdict: taskResult.verificationResult.verdict,
|
|
793
|
-
confidence: taskResult.verificationResult.confidence,
|
|
794
|
-
summary: summarizeVerificationEvidence(taskResult.verificationResult.evidence),
|
|
795
|
-
},
|
|
796
|
-
result: {
|
|
797
|
-
status: taskResult.verificationResult.verdict,
|
|
798
|
-
summary: summarizeVerificationEvidence(taskResult.verificationResult.evidence),
|
|
799
|
-
},
|
|
800
|
-
outcome: verificationToOutcome(taskResult.verificationResult.verdict),
|
|
801
|
-
summary: `Verification ${taskResult.verificationResult.verdict} for ${task.id}`,
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
function phaseStatusToOutcome(status) {
|
|
805
|
-
if (status === "completed")
|
|
806
|
-
return "continued";
|
|
807
|
-
if (status === "failed")
|
|
808
|
-
return "failed";
|
|
809
|
-
return "inconclusive";
|
|
810
|
-
}
|
|
811
|
-
function taskActionToOutcome(action) {
|
|
812
|
-
if (action === "completed")
|
|
813
|
-
return "improved";
|
|
814
|
-
if (action === "approval_denied" || action === "capability_acquiring")
|
|
815
|
-
return "blocked";
|
|
816
|
-
if (action === "discard" || action === "escalate")
|
|
817
|
-
return "failed";
|
|
818
|
-
return "inconclusive";
|
|
819
|
-
}
|
|
820
|
-
function verificationToOutcome(verdict) {
|
|
821
|
-
if (verdict === "pass")
|
|
822
|
-
return "improved";
|
|
823
|
-
if (verdict === "fail")
|
|
824
|
-
return "failed";
|
|
825
|
-
return "inconclusive";
|
|
826
|
-
}
|
|
827
|
-
function summarizeVerificationEvidence(evidence) {
|
|
828
|
-
const summary = evidence.map((item) => item.description).filter(Boolean).join("; ");
|
|
829
|
-
return summary ? truncateOneLine(summary, 500) : undefined;
|
|
830
|
-
}
|
|
831
|
-
function truncateOneLine(value, maxLength) {
|
|
832
|
-
const normalized = value.replace(/\s+/g, " ").trim();
|
|
833
|
-
return normalized.length > maxLength ? `${normalized.slice(0, maxLength - 3)}...` : normalized;
|
|
834
|
-
}
|
|
1
|
+
export * from "../durable-loop/iteration-kernel.js";
|
|
835
2
|
//# sourceMappingURL=iteration-kernel.js.map
|