pulseed 0.5.4 → 0.6.0
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 +13 -9
- package/dist/adapters/datasources/artifact-metric-datasource.d.ts +18 -0
- package/dist/adapters/datasources/artifact-metric-datasource.d.ts.map +1 -0
- package/dist/adapters/datasources/artifact-metric-datasource.js +592 -0
- package/dist/adapters/datasources/artifact-metric-datasource.js.map +1 -0
- package/dist/adapters/types/mcp.d.ts +6 -6
- package/dist/base/types/goal-activation.d.ts +14 -2
- package/dist/base/types/goal-activation.d.ts.map +1 -1
- package/dist/base/types/goal-activation.js +4 -0
- package/dist/base/types/goal-activation.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/interface/chat/chat-runner-commands.d.ts +6 -0
- package/dist/interface/chat/chat-runner-commands.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-commands.js +94 -2
- package/dist/interface/chat/chat-runner-commands.js.map +1 -1
- package/dist/interface/chat/chat-runner-event-bridge.d.ts +8 -1
- package/dist/interface/chat/chat-runner-event-bridge.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-event-bridge.js +69 -3
- package/dist/interface/chat/chat-runner-event-bridge.js.map +1 -1
- package/dist/interface/chat/chat-runner-routes.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-routes.js +23 -7
- package/dist/interface/chat/chat-runner-routes.js.map +1 -1
- package/dist/interface/chat/chat-runner-support.d.ts +25 -1
- package/dist/interface/chat/chat-runner-support.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-support.js +66 -12
- package/dist/interface/chat/chat-runner-support.js.map +1 -1
- package/dist/interface/chat/chat-runner.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner.js +38 -8
- package/dist/interface/chat/chat-runner.js.map +1 -1
- package/dist/interface/chat/cross-platform-session.d.ts.map +1 -1
- package/dist/interface/chat/cross-platform-session.js +13 -1
- package/dist/interface/chat/cross-platform-session.js.map +1 -1
- package/dist/interface/chat/event-subscriber.d.ts.map +1 -1
- package/dist/interface/chat/event-subscriber.js +20 -0
- package/dist/interface/chat/event-subscriber.js.map +1 -1
- package/dist/interface/chat/failure-recovery.d.ts +43 -1
- package/dist/interface/chat/failure-recovery.d.ts.map +1 -1
- package/dist/interface/chat/failure-recovery.js +259 -89
- package/dist/interface/chat/failure-recovery.js.map +1 -1
- package/dist/interface/chat/ingress-router.d.ts +2 -1
- package/dist/interface/chat/ingress-router.d.ts.map +1 -1
- package/dist/interface/chat/ingress-router.js +2 -3
- package/dist/interface/chat/ingress-router.js.map +1 -1
- package/dist/interface/chat/tend-command.js +1 -0
- package/dist/interface/chat/tend-command.js.map +1 -1
- package/dist/interface/cli/cli-command-registry.d.ts.map +1 -1
- package/dist/interface/cli/cli-command-registry.js +19 -3
- package/dist/interface/cli/cli-command-registry.js.map +1 -1
- package/dist/interface/cli/commands/daemon-shared.d.ts +2 -1
- package/dist/interface/cli/commands/daemon-shared.d.ts.map +1 -1
- package/dist/interface/cli/commands/daemon-shared.js +33 -1
- package/dist/interface/cli/commands/daemon-shared.js.map +1 -1
- package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
- package/dist/interface/cli/commands/daemon.js +59 -8
- package/dist/interface/cli/commands/daemon.js.map +1 -1
- package/dist/interface/cli/commands/goal-read.d.ts.map +1 -1
- package/dist/interface/cli/commands/goal-read.js +10 -3
- package/dist/interface/cli/commands/goal-read.js.map +1 -1
- package/dist/interface/cli/commands/notify.d.ts.map +1 -1
- package/dist/interface/cli/commands/notify.js +7 -1
- package/dist/interface/cli/commands/notify.js.map +1 -1
- package/dist/interface/cli/commands/run.d.ts.map +1 -1
- package/dist/interface/cli/commands/run.js +29 -0
- package/dist/interface/cli/commands/run.js.map +1 -1
- package/dist/interface/cli/commands/runtime.d.ts +1 -1
- package/dist/interface/cli/commands/runtime.d.ts.map +1 -1
- package/dist/interface/cli/commands/runtime.js +407 -2
- package/dist/interface/cli/commands/runtime.js.map +1 -1
- package/dist/interface/cli/data-source-bootstrap.d.ts.map +1 -1
- package/dist/interface/cli/data-source-bootstrap.js +25 -12
- package/dist/interface/cli/data-source-bootstrap.js.map +1 -1
- package/dist/interface/cli/setup.d.ts.map +1 -1
- package/dist/interface/cli/setup.js +14 -0
- package/dist/interface/cli/setup.js.map +1 -1
- package/dist/interface/cli/utils/loop-runner.d.ts.map +1 -1
- package/dist/interface/cli/utils/loop-runner.js +2 -1
- package/dist/interface/cli/utils/loop-runner.js.map +1 -1
- package/dist/interface/cli/utils.d.ts.map +1 -1
- package/dist/interface/cli/utils.js +8 -1
- package/dist/interface/cli/utils.js.map +1 -1
- package/dist/interface/tui/app.d.ts +4 -1
- package/dist/interface/tui/app.d.ts.map +1 -1
- package/dist/interface/tui/app.js +268 -10
- package/dist/interface/tui/app.js.map +1 -1
- package/dist/interface/tui/chat-surface.d.ts +2 -0
- package/dist/interface/tui/chat-surface.d.ts.map +1 -1
- package/dist/interface/tui/chat-surface.js +3 -0
- package/dist/interface/tui/chat-surface.js.map +1 -1
- package/dist/interface/tui/dashboard.d.ts +37 -1
- package/dist/interface/tui/dashboard.d.ts.map +1 -1
- package/dist/interface/tui/dashboard.js +264 -1
- package/dist/interface/tui/dashboard.js.map +1 -1
- package/dist/interface/tui/entry-deps.d.ts +3 -1
- package/dist/interface/tui/entry-deps.d.ts.map +1 -1
- package/dist/interface/tui/entry-deps.js +19 -1
- package/dist/interface/tui/entry-deps.js.map +1 -1
- package/dist/interface/tui/entry.d.ts.map +1 -1
- package/dist/interface/tui/entry.js +4 -2
- package/dist/interface/tui/entry.js.map +1 -1
- package/dist/interface/tui/intent-recognizer.d.ts +8 -3
- package/dist/interface/tui/intent-recognizer.d.ts.map +1 -1
- package/dist/interface/tui/intent-recognizer.js +74 -68
- package/dist/interface/tui/intent-recognizer.js.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 +41 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts +1 -1
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.d.ts +1 -1
- 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 -2
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/core-phase-runner.d.ts +1 -1
- package/dist/orchestrator/execution/agent-loop/core-phase-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/core-phase-runner.js +10 -1
- package/dist/orchestrator/execution/agent-loop/core-phase-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.d.ts +2 -0
- package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.js +4 -0
- package/dist/orchestrator/execution/agent-loop/kaggle-training-benchmark.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts +8 -8
- package/dist/orchestrator/execution/task/task-generation.d.ts +3 -1
- package/dist/orchestrator/execution/task/task-generation.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-generation.js +17 -2
- package/dist/orchestrator/execution/task/task-generation.js.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts +5 -1
- package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle-runner.js +9 -5
- package/dist/orchestrator/execution/task/task-lifecycle-runner.js.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle.d.ts +10 -1
- package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle.js +108 -7
- package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.d.ts +2 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.js +4 -2
- package/dist/orchestrator/execution/task/task-prompt-builder.js.map +1 -1
- package/dist/orchestrator/execution/types/pipeline.d.ts +6 -6
- package/dist/orchestrator/goal/types/goal.d.ts +282 -0
- package/dist/orchestrator/goal/types/goal.d.ts.map +1 -1
- package/dist/orchestrator/goal/types/goal.js +20 -0
- package/dist/orchestrator/goal/types/goal.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/contracts.d.ts +46 -3
- package/dist/orchestrator/loop/core-loop/contracts.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/contracts.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/decision-engine.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/decision-engine.js +4 -0
- package/dist/orchestrator/loop/core-loop/decision-engine.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.d.ts +48 -0
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.d.ts.map +1 -0
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.js +377 -0
- package/dist/orchestrator/loop/core-loop/dream-review-checkpoint.js.map +1 -0
- package/dist/orchestrator/loop/core-loop/evidence-ledger.js +1 -1
- package/dist/orchestrator/loop/core-loop/evidence-ledger.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts +1 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js +492 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-policy.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-policy.js +35 -0
- package/dist/orchestrator/loop/core-loop/phase-policy.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-runtime.d.ts +2 -0
- package/dist/orchestrator/loop/core-loop/phase-runtime.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-runtime.js +43 -2
- package/dist/orchestrator/loop/core-loop/phase-runtime.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-specs.d.ts +969 -2
- package/dist/orchestrator/loop/core-loop/phase-specs.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-specs.js +198 -0
- package/dist/orchestrator/loop/core-loop/phase-specs.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/public-research.d.ts +32 -0
- package/dist/orchestrator/loop/core-loop/public-research.d.ts.map +1 -0
- package/dist/orchestrator/loop/core-loop/public-research.js +112 -0
- package/dist/orchestrator/loop/core-loop/public-research.js.map +1 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.js +141 -5
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts +4 -0
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle.js +7 -0
- package/dist/orchestrator/loop/core-loop/task-cycle.js.map +1 -1
- package/dist/orchestrator/loop/core-loop.d.ts +15 -5
- package/dist/orchestrator/loop/core-loop.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop.js +283 -17
- package/dist/orchestrator/loop/core-loop.js.map +1 -1
- package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
- package/dist/orchestrator/loop/loop-report-helper.js +4 -0
- package/dist/orchestrator/loop/loop-report-helper.js.map +1 -1
- package/dist/orchestrator/loop/loop-result-types.d.ts +20 -1
- package/dist/orchestrator/loop/loop-result-types.d.ts.map +1 -1
- package/dist/orchestrator/loop/loop-result-types.js.map +1 -1
- package/dist/orchestrator/loop/post-loop-hooks.d.ts +1 -0
- package/dist/orchestrator/loop/post-loop-hooks.d.ts.map +1 -1
- package/dist/orchestrator/loop/post-loop-hooks.js +34 -1
- package/dist/orchestrator/loop/post-loop-hooks.js.map +1 -1
- package/dist/orchestrator/loop/run-policy.d.ts +10 -0
- package/dist/orchestrator/loop/run-policy.d.ts.map +1 -0
- package/dist/orchestrator/loop/run-policy.js +30 -0
- package/dist/orchestrator/loop/run-policy.js.map +1 -0
- package/dist/orchestrator/strategy/divergent-exploration.d.ts +37 -0
- package/dist/orchestrator/strategy/divergent-exploration.d.ts.map +1 -0
- package/dist/orchestrator/strategy/divergent-exploration.js +324 -0
- package/dist/orchestrator/strategy/divergent-exploration.js.map +1 -0
- package/dist/orchestrator/strategy/strategy-helpers.d.ts +108 -0
- package/dist/orchestrator/strategy/strategy-helpers.d.ts.map +1 -1
- package/dist/orchestrator/strategy/strategy-helpers.js +34 -2
- package/dist/orchestrator/strategy/strategy-helpers.js.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager-base.d.ts +20 -1
- package/dist/orchestrator/strategy/strategy-manager-base.d.ts.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager-base.js +71 -6
- package/dist/orchestrator/strategy/strategy-manager-base.js.map +1 -1
- package/dist/orchestrator/strategy/types/cross-portfolio.d.ts +2 -2
- package/dist/orchestrator/strategy/types/strategy.d.ts +364 -0
- package/dist/orchestrator/strategy/types/strategy.d.ts.map +1 -1
- package/dist/orchestrator/strategy/types/strategy.js +43 -0
- package/dist/orchestrator/strategy/types/strategy.js.map +1 -1
- package/dist/platform/dream/dream-activation.d.ts +1 -1
- package/dist/platform/dream/dream-event-workflows.d.ts +6 -6
- package/dist/platform/dream/dream-types.d.ts +91 -91
- package/dist/platform/drive/metric-history.d.ts +61 -0
- package/dist/platform/drive/metric-history.d.ts.map +1 -0
- package/dist/platform/drive/metric-history.js +206 -0
- package/dist/platform/drive/metric-history.js.map +1 -0
- package/dist/platform/drive/progress-predictor.d.ts +7 -0
- package/dist/platform/drive/progress-predictor.d.ts.map +1 -1
- package/dist/platform/drive/progress-predictor.js +23 -0
- package/dist/platform/drive/progress-predictor.js.map +1 -1
- package/dist/platform/drive/stall-detector.d.ts +3 -1
- package/dist/platform/drive/stall-detector.d.ts.map +1 -1
- package/dist/platform/drive/stall-detector.js +40 -1
- package/dist/platform/drive/stall-detector.js.map +1 -1
- package/dist/platform/drive/types/satisficing.d.ts +2 -2
- package/dist/platform/drive/types/stall.d.ts +4 -0
- package/dist/platform/drive/types/stall.d.ts.map +1 -1
- package/dist/platform/drive/types/stall.js +1 -0
- package/dist/platform/drive/types/stall.js.map +1 -1
- package/dist/platform/knowledge/types/learning.d.ts +2 -2
- package/dist/platform/observation/data-source-adapter.d.ts +1 -0
- package/dist/platform/observation/data-source-adapter.d.ts.map +1 -1
- package/dist/platform/observation/data-source-adapter.js.map +1 -1
- package/dist/platform/observation/observation-datasource.d.ts.map +1 -1
- package/dist/platform/observation/observation-datasource.js +2 -0
- package/dist/platform/observation/observation-datasource.js.map +1 -1
- package/dist/platform/observation/types/data-source.d.ts +153 -9
- package/dist/platform/observation/types/data-source.d.ts.map +1 -1
- package/dist/platform/observation/types/data-source.js +13 -1
- package/dist/platform/observation/types/data-source.js.map +1 -1
- package/dist/platform/soil/contracts.d.ts +65 -65
- package/dist/platform/soil/importer.d.ts +6 -6
- package/dist/platform/soil/types.d.ts +8 -8
- package/dist/platform/time/deadline-finalization.d.ts +57 -0
- package/dist/platform/time/deadline-finalization.d.ts.map +1 -0
- package/dist/platform/time/deadline-finalization.js +136 -0
- package/dist/platform/time/deadline-finalization.js.map +1 -0
- package/dist/platform/time/execution-mode.d.ts +29 -0
- package/dist/platform/time/execution-mode.d.ts.map +1 -0
- package/dist/platform/time/execution-mode.js +84 -0
- package/dist/platform/time/execution-mode.js.map +1 -0
- package/dist/platform/traits/types/curiosity.d.ts +9 -9
- package/dist/platform/traits/types/guardrail.d.ts +6 -6
- package/dist/reporting/report-formatters.d.ts.map +1 -1
- package/dist/reporting/report-formatters.js +67 -2
- package/dist/reporting/report-formatters.js.map +1 -1
- package/dist/reporting/reporting-engine.d.ts.map +1 -1
- package/dist/reporting/reporting-engine.js +3 -1
- package/dist/reporting/reporting-engine.js.map +1 -1
- package/dist/reporting/reporting-types.d.ts +4 -0
- package/dist/reporting/reporting-types.d.ts.map +1 -1
- package/dist/reporting/types/report.d.ts +59 -0
- package/dist/reporting/types/report.d.ts.map +1 -1
- package/dist/reporting/types/report.js +9 -0
- package/dist/reporting/types/report.js.map +1 -1
- package/dist/runtime/command-dispatcher.d.ts +2 -0
- package/dist/runtime/command-dispatcher.d.ts.map +1 -1
- package/dist/runtime/command-dispatcher.js +16 -0
- package/dist/runtime/command-dispatcher.js.map +1 -1
- package/dist/runtime/confirmation-decision.d.ts +94 -0
- package/dist/runtime/confirmation-decision.d.ts.map +1 -0
- package/dist/runtime/confirmation-decision.js +109 -0
- package/dist/runtime/confirmation-decision.js.map +1 -0
- package/dist/runtime/control/daemon-runtime-control-executor.d.ts.map +1 -1
- package/dist/runtime/control/daemon-runtime-control-executor.js +31 -1
- package/dist/runtime/control/daemon-runtime-control-executor.js.map +1 -1
- package/dist/runtime/control/runtime-control-intent.d.ts +9 -1
- package/dist/runtime/control/runtime-control-intent.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-intent.js +82 -16
- package/dist/runtime/control/runtime-control-intent.js.map +1 -1
- package/dist/runtime/control/runtime-control-service.d.ts +35 -1
- package/dist/runtime/control/runtime-control-service.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-service.js +285 -5
- package/dist/runtime/control/runtime-control-service.js.map +1 -1
- package/dist/runtime/daemon/client.d.ts +12 -0
- package/dist/runtime/daemon/client.d.ts.map +1 -1
- package/dist/runtime/daemon/client.js +9 -0
- package/dist/runtime/daemon/client.js.map +1 -1
- package/dist/runtime/daemon/runner-commands.d.ts +6 -2
- package/dist/runtime/daemon/runner-commands.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-commands.js +237 -1
- package/dist/runtime/daemon/runner-commands.js.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.js +59 -1
- package/dist/runtime/daemon/runner-goal-cycle.js.map +1 -1
- package/dist/runtime/daemon/runner-startup.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-startup.js +12 -2
- package/dist/runtime/daemon/runner-startup.js.map +1 -1
- package/dist/runtime/daemon/runner.d.ts +4 -0
- package/dist/runtime/daemon/runner.d.ts.map +1 -1
- package/dist/runtime/daemon/runner.js +14 -1
- package/dist/runtime/daemon/runner.js.map +1 -1
- package/dist/runtime/daemon/runtime-ownership.d.ts +9 -0
- package/dist/runtime/daemon/runtime-ownership.d.ts.map +1 -1
- package/dist/runtime/daemon/runtime-ownership.js +248 -1
- package/dist/runtime/daemon/runtime-ownership.js.map +1 -1
- package/dist/runtime/dream-sidecar-review.d.ts +92 -0
- package/dist/runtime/dream-sidecar-review.d.ts.map +1 -0
- package/dist/runtime/dream-sidecar-review.js +495 -0
- package/dist/runtime/dream-sidecar-review.js.map +1 -0
- package/dist/runtime/event/server-command-handler.d.ts +2 -4
- package/dist/runtime/event/server-command-handler.d.ts.map +1 -1
- package/dist/runtime/event/server-command-handler.js +36 -6
- package/dist/runtime/event/server-command-handler.js.map +1 -1
- package/dist/runtime/event/server-snapshot-reader.d.ts +15 -1
- package/dist/runtime/event/server-snapshot-reader.d.ts.map +1 -1
- package/dist/runtime/event/server-snapshot-reader.js +66 -2
- package/dist/runtime/event/server-snapshot-reader.js.map +1 -1
- package/dist/runtime/event/server-types.d.ts +7 -0
- package/dist/runtime/event/server-types.d.ts.map +1 -1
- package/dist/runtime/event/server.d.ts +5 -0
- package/dist/runtime/event/server.d.ts.map +1 -1
- package/dist/runtime/event/server.js +43 -11
- package/dist/runtime/event/server.js.map +1 -1
- package/dist/runtime/evidence-answer.d.ts +41 -0
- package/dist/runtime/evidence-answer.d.ts.map +1 -0
- package/dist/runtime/evidence-answer.js +366 -0
- package/dist/runtime/evidence-answer.js.map +1 -0
- package/dist/runtime/executor/goal-worker.d.ts +4 -1
- package/dist/runtime/executor/goal-worker.d.ts.map +1 -1
- package/dist/runtime/executor/goal-worker.js +5 -1
- package/dist/runtime/executor/goal-worker.js.map +1 -1
- package/dist/runtime/executor/loop-supervisor.d.ts +4 -0
- package/dist/runtime/executor/loop-supervisor.d.ts.map +1 -1
- package/dist/runtime/executor/loop-supervisor.js +35 -6
- package/dist/runtime/executor/loop-supervisor.js.map +1 -1
- package/dist/runtime/guardrails/backpressure-controller.d.ts +32 -0
- package/dist/runtime/guardrails/backpressure-controller.d.ts.map +1 -0
- package/dist/runtime/guardrails/backpressure-controller.js +88 -0
- package/dist/runtime/guardrails/backpressure-controller.js.map +1 -0
- package/dist/runtime/guardrails/circuit-breaker.d.ts +32 -0
- package/dist/runtime/guardrails/circuit-breaker.d.ts.map +1 -0
- package/dist/runtime/guardrails/circuit-breaker.js +88 -0
- package/dist/runtime/guardrails/circuit-breaker.js.map +1 -0
- package/dist/runtime/guardrails/guardrail-store.d.ts +23 -0
- package/dist/runtime/guardrails/guardrail-store.d.ts.map +1 -0
- package/dist/runtime/guardrails/guardrail-store.js +95 -0
- package/dist/runtime/guardrails/guardrail-store.js.map +1 -0
- package/dist/runtime/guardrails/index.d.ts +4 -0
- package/dist/runtime/guardrails/index.d.ts.map +1 -0
- package/dist/runtime/guardrails/index.js +4 -0
- package/dist/runtime/guardrails/index.js.map +1 -0
- package/dist/runtime/interactive-automation/browser-session-store.d.ts +43 -0
- package/dist/runtime/interactive-automation/browser-session-store.d.ts.map +1 -0
- package/dist/runtime/interactive-automation/browser-session-store.js +104 -0
- package/dist/runtime/interactive-automation/browser-session-store.js.map +1 -0
- package/dist/runtime/interactive-automation/failure-classifier.d.ts +12 -0
- package/dist/runtime/interactive-automation/failure-classifier.d.ts.map +1 -0
- package/dist/runtime/interactive-automation/failure-classifier.js +50 -0
- package/dist/runtime/interactive-automation/failure-classifier.js.map +1 -0
- package/dist/runtime/interactive-automation/index.d.ts +2 -0
- package/dist/runtime/interactive-automation/index.d.ts.map +1 -1
- package/dist/runtime/interactive-automation/index.js +2 -0
- package/dist/runtime/interactive-automation/index.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 +17 -1
- package/dist/runtime/interactive-automation/providers/manus-browser.js.map +1 -1
- package/dist/runtime/interactive-automation/types.d.ts +4 -0
- package/dist/runtime/interactive-automation/types.d.ts.map +1 -1
- package/dist/runtime/interactive-automation/types.js.map +1 -1
- package/dist/runtime/notification-routing.d.ts +45 -2
- package/dist/runtime/notification-routing.d.ts.map +1 -1
- package/dist/runtime/notification-routing.js +196 -79
- package/dist/runtime/notification-routing.js.map +1 -1
- package/dist/runtime/run-spec/confirmation.d.ts +34 -0
- package/dist/runtime/run-spec/confirmation.d.ts.map +1 -0
- package/dist/runtime/run-spec/confirmation.js +176 -0
- package/dist/runtime/run-spec/confirmation.js.map +1 -0
- package/dist/runtime/run-spec/derive.d.ts +284 -0
- package/dist/runtime/run-spec/derive.d.ts.map +1 -0
- package/dist/runtime/run-spec/derive.js +379 -0
- package/dist/runtime/run-spec/derive.js.map +1 -0
- package/dist/runtime/run-spec/index.d.ts +5 -0
- package/dist/runtime/run-spec/index.d.ts.map +1 -0
- package/dist/runtime/run-spec/index.js +5 -0
- package/dist/runtime/run-spec/index.js.map +1 -0
- package/dist/runtime/run-spec/store.d.ts +11 -0
- package/dist/runtime/run-spec/store.d.ts.map +1 -0
- package/dist/runtime/run-spec/store.js +36 -0
- package/dist/runtime/run-spec/store.js.map +1 -0
- package/dist/runtime/run-spec/types.d.ts +495 -0
- package/dist/runtime/run-spec/types.d.ts.map +1 -0
- package/dist/runtime/run-spec/types.js +87 -0
- package/dist/runtime/run-spec/types.js.map +1 -0
- package/dist/runtime/schedule/engine-execution.d.ts +2 -1
- package/dist/runtime/schedule/engine-execution.d.ts.map +1 -1
- package/dist/runtime/schedule/engine-execution.js +1 -1
- package/dist/runtime/schedule/engine-execution.js.map +1 -1
- package/dist/runtime/schedule/engine-layers.d.ts +2 -1
- package/dist/runtime/schedule/engine-layers.d.ts.map +1 -1
- package/dist/runtime/schedule/engine-layers.js +3 -1
- package/dist/runtime/schedule/engine-layers.js.map +1 -1
- package/dist/runtime/schedule/engine.d.ts +2 -1
- package/dist/runtime/schedule/engine.d.ts.map +1 -1
- package/dist/runtime/schedule/engine.js.map +1 -1
- package/dist/runtime/schedule/history.d.ts +4 -4
- package/dist/runtime/session-registry/registry.d.ts.map +1 -1
- package/dist/runtime/session-registry/registry.js +2 -0
- package/dist/runtime/session-registry/registry.js.map +1 -1
- package/dist/runtime/session-registry/types.d.ts +102 -94
- package/dist/runtime/session-registry/types.d.ts.map +1 -1
- package/dist/runtime/session-registry/types.js +2 -0
- package/dist/runtime/session-registry/types.js.map +1 -1
- package/dist/runtime/store/artifact-retention.d.ts +44 -0
- package/dist/runtime/store/artifact-retention.d.ts.map +1 -0
- package/dist/runtime/store/artifact-retention.js +263 -0
- package/dist/runtime/store/artifact-retention.js.map +1 -0
- 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 +442 -0
- package/dist/runtime/store/budget-store.d.ts.map +1 -0
- package/dist/runtime/store/budget-store.js +318 -0
- package/dist/runtime/store/budget-store.js.map +1 -0
- package/dist/runtime/store/dream-checkpoints.d.ts +9 -0
- package/dist/runtime/store/dream-checkpoints.d.ts.map +1 -0
- package/dist/runtime/store/dream-checkpoints.js +16 -0
- package/dist/runtime/store/dream-checkpoints.js.map +1 -0
- package/dist/runtime/store/evaluator-results.d.ts +97 -0
- package/dist/runtime/store/evaluator-results.d.ts.map +1 -0
- package/dist/runtime/store/evaluator-results.js +355 -0
- package/dist/runtime/store/evaluator-results.js.map +1 -0
- package/dist/runtime/store/evidence-ledger.d.ts +5298 -0
- package/dist/runtime/store/evidence-ledger.d.ts.map +1 -0
- package/dist/runtime/store/evidence-ledger.js +1452 -0
- package/dist/runtime/store/evidence-ledger.js.map +1 -0
- package/dist/runtime/store/experiment-queue-store.d.ts +1164 -0
- package/dist/runtime/store/experiment-queue-store.d.ts.map +1 -0
- package/dist/runtime/store/experiment-queue-store.js +341 -0
- package/dist/runtime/store/experiment-queue-store.js.map +1 -0
- package/dist/runtime/store/health-store.d.ts.map +1 -1
- package/dist/runtime/store/health-store.js +6 -0
- package/dist/runtime/store/health-store.js.map +1 -1
- package/dist/runtime/store/index.d.ts +25 -2
- package/dist/runtime/store/index.d.ts.map +1 -1
- package/dist/runtime/store/index.js +13 -1
- package/dist/runtime/store/index.js.map +1 -1
- package/dist/runtime/store/metric-history.d.ts +10 -0
- package/dist/runtime/store/metric-history.d.ts.map +1 -0
- package/dist/runtime/store/metric-history.js +56 -0
- package/dist/runtime/store/metric-history.js.map +1 -0
- package/dist/runtime/store/operator-handoff-store.d.ts +179 -0
- package/dist/runtime/store/operator-handoff-store.d.ts.map +1 -0
- package/dist/runtime/store/operator-handoff-store.js +120 -0
- package/dist/runtime/store/operator-handoff-store.js.map +1 -0
- package/dist/runtime/store/postmortem-report.d.ts +485 -0
- package/dist/runtime/store/postmortem-report.d.ts.map +1 -0
- package/dist/runtime/store/postmortem-report.js +561 -0
- package/dist/runtime/store/postmortem-report.js.map +1 -0
- package/dist/runtime/store/reproducibility-manifest.d.ts +565 -0
- package/dist/runtime/store/reproducibility-manifest.d.ts.map +1 -0
- package/dist/runtime/store/reproducibility-manifest.js +392 -0
- package/dist/runtime/store/reproducibility-manifest.js.map +1 -0
- package/dist/runtime/store/research-evidence.d.ts +8 -0
- package/dist/runtime/store/research-evidence.d.ts.map +1 -0
- package/dist/runtime/store/research-evidence.js +15 -0
- package/dist/runtime/store/research-evidence.js.map +1 -0
- package/dist/runtime/store/runtime-operation-schemas.d.ts +70 -24
- package/dist/runtime/store/runtime-operation-schemas.d.ts.map +1 -1
- package/dist/runtime/store/runtime-operation-schemas.js +16 -1
- package/dist/runtime/store/runtime-operation-schemas.js.map +1 -1
- package/dist/runtime/store/runtime-paths.d.ts +25 -0
- package/dist/runtime/store/runtime-paths.d.ts.map +1 -1
- package/dist/runtime/store/runtime-paths.js +73 -0
- package/dist/runtime/store/runtime-paths.js.map +1 -1
- package/dist/runtime/store/runtime-schemas.d.ts +1936 -17
- package/dist/runtime/store/runtime-schemas.d.ts.map +1 -1
- package/dist/runtime/store/runtime-schemas.js +201 -0
- package/dist/runtime/store/runtime-schemas.js.map +1 -1
- package/dist/runtime/store/safe-pause-store.d.ts +28 -0
- package/dist/runtime/store/safe-pause-store.d.ts.map +1 -0
- package/dist/runtime/store/safe-pause-store.js +103 -0
- package/dist/runtime/store/safe-pause-store.js.map +1 -0
- package/dist/runtime/types/daemon.d.ts +224 -14
- package/dist/runtime/types/daemon.d.ts.map +1 -1
- package/dist/runtime/types/daemon.js +27 -2
- package/dist/runtime/types/daemon.js.map +1 -1
- package/dist/runtime/types/envelope.d.ts +10 -10
- package/dist/runtime/types/hook.d.ts +9 -9
- package/dist/runtime/types/notification.d.ts +6 -6
- package/dist/runtime/types/plugin.d.ts +2 -2
- package/dist/runtime/types/schedule.d.ts +97 -54
- package/dist/runtime/types/schedule.d.ts.map +1 -1
- package/dist/runtime/types/schedule.js +10 -1
- package/dist/runtime/types/schedule.js.map +1 -1
- package/dist/runtime/types/trigger.d.ts +2 -2
- package/dist/tools/automation/InteractiveAutomationTools.d.ts +10 -0
- package/dist/tools/automation/InteractiveAutomationTools.d.ts.map +1 -1
- package/dist/tools/automation/InteractiveAutomationTools.js +139 -8
- package/dist/tools/automation/InteractiveAutomationTools.js.map +1 -1
- package/dist/tools/builtin/exports.d.ts +1 -1
- package/dist/tools/builtin/exports.d.ts.map +1 -1
- package/dist/tools/builtin/exports.js +1 -1
- package/dist/tools/builtin/exports.js.map +1 -1
- package/dist/tools/builtin/factory.d.ts +5 -0
- package/dist/tools/builtin/factory.d.ts.map +1 -1
- package/dist/tools/builtin/factory.js +18 -2
- package/dist/tools/builtin/factory.js.map +1 -1
- package/dist/tools/kaggle/KaggleExperimentTools.d.ts +792 -8
- package/dist/tools/kaggle/KaggleExperimentTools.d.ts.map +1 -1
- package/dist/tools/kaggle/KaggleExperimentTools.js +284 -19
- package/dist/tools/kaggle/KaggleExperimentTools.js.map +1 -1
- package/dist/tools/kaggle/KaggleSubmissionTools.d.ts +18 -12
- package/dist/tools/kaggle/KaggleSubmissionTools.d.ts.map +1 -1
- package/dist/tools/kaggle/KaggleSubmissionTools.js +23 -4
- package/dist/tools/kaggle/KaggleSubmissionTools.js.map +1 -1
- package/dist/tools/kaggle/KaggleWorkspacePrepareTool.d.ts +28 -9
- package/dist/tools/kaggle/KaggleWorkspacePrepareTool.d.ts.map +1 -1
- package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js +182 -4
- package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js.map +1 -1
- package/dist/tools/kaggle/index.d.ts +1 -1
- package/dist/tools/kaggle/index.d.ts.map +1 -1
- package/dist/tools/kaggle/index.js +1 -1
- package/dist/tools/kaggle/index.js.map +1 -1
- package/dist/tools/kaggle/metrics.d.ts +845 -4
- package/dist/tools/kaggle/metrics.d.ts.map +1 -1
- package/dist/tools/kaggle/metrics.js +410 -1
- package/dist/tools/kaggle/metrics.js.map +1 -1
- package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.d.ts +6 -0
- package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.d.ts.map +1 -1
- package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.js +9 -2
- package/dist/tools/mutation/ConfigureNotificationRoutingTool/ConfigureNotificationRoutingTool.js.map +1 -1
- package/dist/tools/mutation/TaskCreateTool/TaskCreateTool.d.ts +4 -4
- package/dist/tools/network/McpStdioTool/McpStdioTool.d.ts +4 -4
- package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.d.ts +2 -2
- package/dist/tools/query/runtime-dream-review-tool.d.ts +34 -0
- package/dist/tools/query/runtime-dream-review-tool.d.ts.map +1 -0
- package/dist/tools/query/runtime-dream-review-tool.js +62 -0
- package/dist/tools/query/runtime-dream-review-tool.js.map +1 -0
- package/dist/tools/query/runtime-session-tools.d.ts.map +1 -1
- package/dist/tools/query/runtime-session-tools.js +2 -0
- package/dist/tools/query/runtime-session-tools.js.map +1 -1
- package/dist/tools/runtime/LongRunningRuntimeTools.d.ts +103 -103
- package/dist/tools/runtime/LongRunningRuntimeTools.d.ts.map +1 -1
- package/dist/tools/runtime/LongRunningRuntimeTools.js +60 -0
- package/dist/tools/runtime/LongRunningRuntimeTools.js.map +1 -1
- package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts +62 -32
- package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts.map +1 -1
- package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts +78 -44
- package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts.map +1 -1
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.d.ts +4 -4
- package/package.json +2 -1
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { createRuntimeSessionRegistry } from "./session-registry/index.js";
|
|
3
|
+
import { coreLoopSessionFromLedgerRun } from "./session-registry/registry-helpers.js";
|
|
4
|
+
import { BackgroundRunLedger } from "./store/background-run-store.js";
|
|
5
|
+
import { RuntimeEvidenceLedger } from "./store/evidence-ledger.js";
|
|
6
|
+
export class RuntimeDreamSidecarReviewError extends Error {
|
|
7
|
+
code;
|
|
8
|
+
constructor(code, message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.name = "RuntimeDreamSidecarReviewError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export async function createRuntimeDreamSidecarReview(input) {
|
|
15
|
+
const runtimeRoot = path.join(input.stateManager.getBaseDir(), "runtime");
|
|
16
|
+
const ledgerRun = await new BackgroundRunLedger(runtimeRoot).load(input.runId);
|
|
17
|
+
const projected = await resolveProjectedRun(input.stateManager, input.runId);
|
|
18
|
+
const resolved = selectResolvedRun(ledgerRun, projected) ?? (ledgerRun
|
|
19
|
+
? {
|
|
20
|
+
run: ledgerRun,
|
|
21
|
+
runtimeSession: runtimeSessionFromLedgerRun(ledgerRun),
|
|
22
|
+
}
|
|
23
|
+
: null);
|
|
24
|
+
const run = resolved?.run ?? null;
|
|
25
|
+
if (!run) {
|
|
26
|
+
throw new RuntimeDreamSidecarReviewError("missing_run", `Background run not found: ${input.runId}`);
|
|
27
|
+
}
|
|
28
|
+
if (!isActiveRun(run)) {
|
|
29
|
+
throw new RuntimeDreamSidecarReviewError("stale_run", `Background run ${input.runId} is not active: ${run.status}`);
|
|
30
|
+
}
|
|
31
|
+
const runtimeSession = resolved?.runtimeSession ?? null;
|
|
32
|
+
const ledger = new RuntimeEvidenceLedger(runtimeRoot);
|
|
33
|
+
const evidenceSummary = await ledger.summarizeRun(run.id);
|
|
34
|
+
const reviewedAt = new Date().toISOString();
|
|
35
|
+
const trendState = summarizeTrendState(evidenceSummary);
|
|
36
|
+
const statusSummary = buildStatusSummary(run, evidenceSummary, trendState);
|
|
37
|
+
const suggestedNextMoves = buildSuggestedNextMoves(evidenceSummary);
|
|
38
|
+
const operatorDecisions = buildOperatorDecisions(evidenceSummary);
|
|
39
|
+
if (input.requestGuidanceInjection) {
|
|
40
|
+
operatorDecisions.push({
|
|
41
|
+
label: "Inject sidecar guidance into active run",
|
|
42
|
+
reason: "Sidecar guidance can influence the active run and requires explicit operator approval.",
|
|
43
|
+
approval_required: true,
|
|
44
|
+
source: "guidance_injection",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
schema_version: "runtime-dream-sidecar-review-v1",
|
|
49
|
+
sidecar_session: {
|
|
50
|
+
id: `sidecar:dream-review:${run.id}`,
|
|
51
|
+
attached_run_id: run.id,
|
|
52
|
+
mode: "read_only",
|
|
53
|
+
created_at: reviewedAt,
|
|
54
|
+
},
|
|
55
|
+
attach_status: "active",
|
|
56
|
+
reviewed_at: reviewedAt,
|
|
57
|
+
read_only_enforced: true,
|
|
58
|
+
run: {
|
|
59
|
+
id: run.id,
|
|
60
|
+
kind: run.kind,
|
|
61
|
+
status: run.status,
|
|
62
|
+
title: run.title,
|
|
63
|
+
workspace: run.workspace,
|
|
64
|
+
parent_session_id: run.parent_session_id,
|
|
65
|
+
child_session_id: run.child_session_id,
|
|
66
|
+
process_session_id: run.process_session_id,
|
|
67
|
+
started_at: run.started_at,
|
|
68
|
+
updated_at: run.updated_at,
|
|
69
|
+
},
|
|
70
|
+
runtime_session: runtimeSession
|
|
71
|
+
? {
|
|
72
|
+
id: runtimeSession.id,
|
|
73
|
+
kind: runtimeSession.kind,
|
|
74
|
+
status: runtimeSession.status,
|
|
75
|
+
attachable: runtimeSession.attachable,
|
|
76
|
+
state_ref: runtimeSession.state_ref,
|
|
77
|
+
source_refs: runtimeSession.source_refs,
|
|
78
|
+
}
|
|
79
|
+
: null,
|
|
80
|
+
status_summary: statusSummary,
|
|
81
|
+
best_evidence: evidenceSummary.best_evidence ? compactEvidence(evidenceSummary.best_evidence) : null,
|
|
82
|
+
promising_non_winners: buildPromisingNonWinners(evidenceSummary),
|
|
83
|
+
known_gaps: buildKnownGaps(evidenceSummary),
|
|
84
|
+
strategy_families: buildStrategyFamilies(evidenceSummary),
|
|
85
|
+
trend_state: trendState,
|
|
86
|
+
evidence_refs: buildEvidenceRefs(run, runtimeSession, evidenceSummary),
|
|
87
|
+
artifact_refs: run.artifacts,
|
|
88
|
+
advisory_memories: buildAdvisoryMemories(evidenceSummary),
|
|
89
|
+
suggested_next_moves: suggestedNextMoves,
|
|
90
|
+
operator_decisions: operatorDecisions,
|
|
91
|
+
guidance_injection: input.requestGuidanceInjection
|
|
92
|
+
? {
|
|
93
|
+
status: "approval_required",
|
|
94
|
+
approval_required: true,
|
|
95
|
+
target_run_id: run.id,
|
|
96
|
+
reason: "Guidance injection into an active run is mutation-prone and must be approved explicitly.",
|
|
97
|
+
}
|
|
98
|
+
: {
|
|
99
|
+
status: "not_requested",
|
|
100
|
+
approval_required: false,
|
|
101
|
+
target_run_id: run.id,
|
|
102
|
+
reason: "Sidecar review is read-only; no active-run guidance injection was requested.",
|
|
103
|
+
},
|
|
104
|
+
warnings: buildWarnings(run, runtimeSession, evidenceSummary),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function selectResolvedRun(ledgerRun, projected) {
|
|
108
|
+
if (!projected)
|
|
109
|
+
return null;
|
|
110
|
+
if (ledgerRun && projected.run.status === "unknown" && isActiveRun(ledgerRun)) {
|
|
111
|
+
return {
|
|
112
|
+
run: ledgerRun,
|
|
113
|
+
runtimeSession: runtimeSessionFromLedgerRun(ledgerRun) ?? projected.runtimeSession,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return projected;
|
|
117
|
+
}
|
|
118
|
+
async function resolveProjectedRun(stateManager, runId) {
|
|
119
|
+
const registry = createRuntimeSessionRegistry({
|
|
120
|
+
stateManager,
|
|
121
|
+
// Sidecar review must never signal/probe active process PIDs. If a run is
|
|
122
|
+
// not represented by the durable ledger, the registry projection remains
|
|
123
|
+
// conservative rather than using process.kill(pid, 0).
|
|
124
|
+
isPidAlive: () => "unknown",
|
|
125
|
+
});
|
|
126
|
+
const snapshot = await registry.snapshot();
|
|
127
|
+
const run = snapshot.background_runs.find((candidate) => candidate.id === runId);
|
|
128
|
+
if (!run)
|
|
129
|
+
return null;
|
|
130
|
+
return {
|
|
131
|
+
run,
|
|
132
|
+
runtimeSession: run.child_session_id
|
|
133
|
+
? snapshot.sessions.find((session) => session.id === run.child_session_id) ?? null
|
|
134
|
+
: null,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function runtimeSessionFromLedgerRun(run) {
|
|
138
|
+
if (run.kind === "coreloop_run" && run.child_session_id) {
|
|
139
|
+
return coreLoopSessionFromLedgerRun(run);
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
function isActiveRun(run) {
|
|
144
|
+
return run.status === "queued" || run.status === "running";
|
|
145
|
+
}
|
|
146
|
+
function summarizeTrendState(summary) {
|
|
147
|
+
const breakthrough = summary.metric_trends.find((trend) => trend.trend === "breakthrough");
|
|
148
|
+
if (breakthrough) {
|
|
149
|
+
return {
|
|
150
|
+
state: "breakthrough",
|
|
151
|
+
metric_key: breakthrough.metric_key,
|
|
152
|
+
summary: breakthrough.summary,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const plateau = summary.metric_trends.find((trend) => trend.trend === "stalled" || trend.trend === "regressing");
|
|
156
|
+
if (plateau) {
|
|
157
|
+
return {
|
|
158
|
+
state: "plateau",
|
|
159
|
+
metric_key: plateau.metric_key,
|
|
160
|
+
summary: plateau.summary,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const progressing = summary.metric_trends.find((trend) => trend.trend === "improving");
|
|
164
|
+
if (progressing) {
|
|
165
|
+
return {
|
|
166
|
+
state: "progressing",
|
|
167
|
+
metric_key: progressing.metric_key,
|
|
168
|
+
summary: progressing.summary,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return { state: "unknown" };
|
|
172
|
+
}
|
|
173
|
+
function buildStatusSummary(run, summary, trendState) {
|
|
174
|
+
const title = run.title ? `${run.title} ` : "";
|
|
175
|
+
const evidenceCount = `${summary.total_entries} evidence entr${summary.total_entries === 1 ? "y" : "ies"}`;
|
|
176
|
+
const trend = trendState.summary ?? `trend=${trendState.state}`;
|
|
177
|
+
const nearMissCount = summary.near_miss_candidates.length > 0
|
|
178
|
+
? ` ${summary.near_miss_candidates.length} promising non-winner${summary.near_miss_candidates.length === 1 ? "" : "s"}.`
|
|
179
|
+
: "";
|
|
180
|
+
return `${title}${run.kind} ${run.status}; ${evidenceCount}; ${trend}.${nearMissCount}`;
|
|
181
|
+
}
|
|
182
|
+
function compactEvidence(entry) {
|
|
183
|
+
return {
|
|
184
|
+
id: entry.id,
|
|
185
|
+
kind: entry.kind,
|
|
186
|
+
summary: entry.summary ?? entry.result?.summary ?? entry.verification?.summary ?? null,
|
|
187
|
+
outcome: entry.outcome ?? null,
|
|
188
|
+
occurred_at: entry.occurred_at,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function buildPromisingNonWinners(summary) {
|
|
192
|
+
return summary.near_miss_candidates.slice(0, 6).map((candidate) => ({
|
|
193
|
+
candidate_id: candidate.candidate_id,
|
|
194
|
+
...(candidate.label ? { label: candidate.label } : {}),
|
|
195
|
+
strategy_family: candidate.strategy_family,
|
|
196
|
+
raw_rank: candidate.raw_rank,
|
|
197
|
+
reason_to_keep: candidate.reason_to_keep,
|
|
198
|
+
...(candidate.follow_up?.title ? { follow_up_title: candidate.follow_up.title } : {}),
|
|
199
|
+
...(candidate.summary ? { summary: candidate.summary } : {}),
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
function buildKnownGaps(summary) {
|
|
203
|
+
const gaps = new Set();
|
|
204
|
+
for (const failure of summary.recent_failed_attempts) {
|
|
205
|
+
gaps.add(failure.summary ?? failure.result?.summary ?? failure.verification?.summary ?? `${failure.kind} failed`);
|
|
206
|
+
}
|
|
207
|
+
for (const memo of summary.research_memos.slice(0, 3)) {
|
|
208
|
+
for (const finding of memo.findings) {
|
|
209
|
+
if (finding.risks_constraints.length > 0) {
|
|
210
|
+
gaps.add(finding.risks_constraints.join("; "));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
for (const rejected of collectRejectedApproaches(summary).slice(0, 3)) {
|
|
215
|
+
gaps.add(`Rejected approach: ${rejected.approach} (${rejected.rejection_reason})`);
|
|
216
|
+
}
|
|
217
|
+
for (const lineage of summary.failed_lineages.filter((item) => item.count >= 2).slice(0, 3)) {
|
|
218
|
+
gaps.add(`Repeated failed lineage: ${lineageLabel(lineage)} (count=${lineage.count})`);
|
|
219
|
+
}
|
|
220
|
+
if (!summary.best_evidence)
|
|
221
|
+
gaps.add("No best evidence has been recorded for this run.");
|
|
222
|
+
if (summary.metric_trends.length === 0)
|
|
223
|
+
gaps.add("No progress metric history has been recorded for this run.");
|
|
224
|
+
return [...gaps].slice(0, 6);
|
|
225
|
+
}
|
|
226
|
+
function buildStrategyFamilies(summary) {
|
|
227
|
+
const families = new Set();
|
|
228
|
+
for (const checkpoint of summary.dream_checkpoints) {
|
|
229
|
+
for (const family of checkpoint.recent_strategy_families)
|
|
230
|
+
families.add(family);
|
|
231
|
+
}
|
|
232
|
+
for (const entry of summary.recent_entries) {
|
|
233
|
+
const candidate = entry.strategy ?? entry.task?.action ?? entry.task?.primary_dimension;
|
|
234
|
+
if (candidate)
|
|
235
|
+
families.add(candidate);
|
|
236
|
+
}
|
|
237
|
+
return [...families].slice(0, 8);
|
|
238
|
+
}
|
|
239
|
+
function buildSuggestedNextMoves(summary) {
|
|
240
|
+
const moves = [];
|
|
241
|
+
const rejectedApproaches = collectRejectedApproaches(summary);
|
|
242
|
+
const failedLineages = summary.failed_lineages.filter((lineage) => lineage.count >= 2);
|
|
243
|
+
for (const checkpoint of rankCheckpointsByMemory(summary).slice(0, 2)) {
|
|
244
|
+
for (const candidate of checkpoint.next_strategy_candidates) {
|
|
245
|
+
if (isRejectedDreamCandidate(candidate, rejectedApproaches))
|
|
246
|
+
continue;
|
|
247
|
+
if (!candidate.retry_reason && isFailedLineageMove(candidate.title, candidate.rationale, failedLineages))
|
|
248
|
+
continue;
|
|
249
|
+
moves.push({
|
|
250
|
+
title: candidate.title,
|
|
251
|
+
rationale: candidate.rationale,
|
|
252
|
+
source: "dream_checkpoint",
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
if (checkpoint.guidance && moves.length === 0) {
|
|
256
|
+
moves.push({
|
|
257
|
+
title: "Apply latest Dream checkpoint guidance",
|
|
258
|
+
rationale: checkpoint.guidance,
|
|
259
|
+
source: "dream_checkpoint",
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
for (const nearMiss of summary.near_miss_candidates.slice(0, 3)) {
|
|
264
|
+
const title = nearMiss.follow_up?.title ?? `Follow up near-miss candidate ${nearMiss.candidate_id}`;
|
|
265
|
+
const rationale = nearMiss.follow_up?.rationale
|
|
266
|
+
?? nearMiss.summary
|
|
267
|
+
?? `Candidate ${nearMiss.candidate_id} did not beat raw best but was retained for ${nearMiss.reason_to_keep.join(", ")}.`;
|
|
268
|
+
if (isRejectedMove(title, rationale, rejectedApproaches))
|
|
269
|
+
continue;
|
|
270
|
+
if (isFailedLineageMove(`${nearMiss.strategy_family} ${title}`, rationale, failedLineages))
|
|
271
|
+
continue;
|
|
272
|
+
moves.push({
|
|
273
|
+
title,
|
|
274
|
+
rationale,
|
|
275
|
+
source: "near_miss",
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
for (const memo of summary.research_memos.slice(0, 2)) {
|
|
279
|
+
for (const finding of memo.findings.slice(0, 2)) {
|
|
280
|
+
if (isRejectedMove(finding.proposed_experiment, finding.applicability, rejectedApproaches))
|
|
281
|
+
continue;
|
|
282
|
+
if (isFailedLineageMove(finding.proposed_experiment, finding.applicability, failedLineages))
|
|
283
|
+
continue;
|
|
284
|
+
moves.push({
|
|
285
|
+
title: finding.proposed_experiment,
|
|
286
|
+
rationale: finding.applicability,
|
|
287
|
+
source: "public_research",
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (summary.evaluator_summary.gap?.kind === "pending_external") {
|
|
292
|
+
moves.push({
|
|
293
|
+
title: "Resolve pending evaluator decision",
|
|
294
|
+
rationale: summary.evaluator_summary.gap.summary,
|
|
295
|
+
source: "evaluator",
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
if (moves.length === 0) {
|
|
299
|
+
moves.push({
|
|
300
|
+
title: "Continue read-only monitoring",
|
|
301
|
+
rationale: "No checkpoint, research, or evaluator action has produced a stronger next move yet.",
|
|
302
|
+
source: "fallback",
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
return moves.slice(0, 6);
|
|
306
|
+
}
|
|
307
|
+
function rankCheckpointsByMemory(summary) {
|
|
308
|
+
return [...summary.dream_checkpoints].sort((a, b) => checkpointMemoryScore(b) - checkpointMemoryScore(a)
|
|
309
|
+
|| b.occurred_at.localeCompare(a.occurred_at));
|
|
310
|
+
}
|
|
311
|
+
function checkpointMemoryScore(checkpoint) {
|
|
312
|
+
return Math.max(0, ...checkpoint.relevant_memories.map((memory) => memory.ranking_trace?.score ?? sidecarMemoryRankScore(memory)));
|
|
313
|
+
}
|
|
314
|
+
function isFailedLineageMove(title, rationale, failedLineages) {
|
|
315
|
+
if (failedLineages.length === 0)
|
|
316
|
+
return false;
|
|
317
|
+
const moveText = normalizeRejectedMoveText(`${title} ${rationale}`);
|
|
318
|
+
if (!moveText)
|
|
319
|
+
return false;
|
|
320
|
+
return failedLineages.some((lineage) => {
|
|
321
|
+
const lineageTexts = [
|
|
322
|
+
lineage.strategy_family,
|
|
323
|
+
lineage.hypothesis,
|
|
324
|
+
lineage.task_action,
|
|
325
|
+
].map((value) => normalizeRejectedMoveText(value ?? "")).filter(Boolean);
|
|
326
|
+
return lineageTexts.some((lineageText) => moveText.includes(lineageText) || lineageText.includes(moveText));
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
function lineageLabel(lineage) {
|
|
330
|
+
return lineage.strategy_family
|
|
331
|
+
?? lineage.task_action
|
|
332
|
+
?? lineage.hypothesis
|
|
333
|
+
?? lineage.primary_dimension
|
|
334
|
+
?? lineage.fingerprint;
|
|
335
|
+
}
|
|
336
|
+
function collectRejectedApproaches(summary) {
|
|
337
|
+
const seen = new Set();
|
|
338
|
+
const rejectedApproaches = [];
|
|
339
|
+
for (const checkpoint of summary.dream_checkpoints) {
|
|
340
|
+
for (const rejected of checkpoint.rejected_approaches ?? []) {
|
|
341
|
+
const key = normalizeRejectedMoveText(rejected.approach);
|
|
342
|
+
if (!key || seen.has(key))
|
|
343
|
+
continue;
|
|
344
|
+
seen.add(key);
|
|
345
|
+
rejectedApproaches.push(rejected);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return rejectedApproaches;
|
|
349
|
+
}
|
|
350
|
+
function isRejectedDreamCandidate(candidate, rejectedApproaches) {
|
|
351
|
+
return isRejectedMove(candidate.title, candidate.rationale, rejectedApproaches);
|
|
352
|
+
}
|
|
353
|
+
function isRejectedMove(title, rationale, rejectedApproaches) {
|
|
354
|
+
if (rejectedApproaches.length === 0)
|
|
355
|
+
return false;
|
|
356
|
+
const moveText = normalizeRejectedMoveText(`${title} ${rationale}`);
|
|
357
|
+
if (!moveText)
|
|
358
|
+
return false;
|
|
359
|
+
return rejectedApproaches.some((rejected) => {
|
|
360
|
+
const approachText = normalizeRejectedMoveText(rejected.approach);
|
|
361
|
+
if (!approachText)
|
|
362
|
+
return false;
|
|
363
|
+
const matchesApproach = moveText.includes(approachText) || approachText.includes(moveText);
|
|
364
|
+
if (!matchesApproach)
|
|
365
|
+
return false;
|
|
366
|
+
const revisitText = normalizeRejectedMoveText(rejected.revisit_condition ?? "");
|
|
367
|
+
return !revisitText || !moveText.includes(revisitText);
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
function normalizeRejectedMoveText(value) {
|
|
371
|
+
return value.normalize("NFKC").toLocaleLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu, " ").trim();
|
|
372
|
+
}
|
|
373
|
+
function buildOperatorDecisions(summary) {
|
|
374
|
+
const decisions = [];
|
|
375
|
+
for (const action of summary.evaluator_summary.approval_required_actions) {
|
|
376
|
+
decisions.push({
|
|
377
|
+
label: action.label,
|
|
378
|
+
reason: `External evaluator action for candidate ${action.candidate_id} requires approval.`,
|
|
379
|
+
approval_required: true,
|
|
380
|
+
source: "evaluator",
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
for (const memo of summary.research_memos) {
|
|
384
|
+
for (const action of memo.external_actions) {
|
|
385
|
+
decisions.push({
|
|
386
|
+
label: action.label,
|
|
387
|
+
reason: action.reason,
|
|
388
|
+
approval_required: true,
|
|
389
|
+
source: "public_research",
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return decisions.slice(0, 8);
|
|
394
|
+
}
|
|
395
|
+
function buildEvidenceRefs(run, runtimeSession, summary) {
|
|
396
|
+
const refs = [
|
|
397
|
+
...run.source_refs.map(convertSessionRef),
|
|
398
|
+
...(runtimeSession?.source_refs.map(convertSessionRef) ?? []),
|
|
399
|
+
...(runtimeSession?.state_ref ? [convertSessionRef(runtimeSession.state_ref)] : []),
|
|
400
|
+
...summary.recent_entries.flatMap((entry) => entry.raw_refs.map((ref) => ({
|
|
401
|
+
kind: ref.kind,
|
|
402
|
+
id: ref.id ?? null,
|
|
403
|
+
path: ref.path ?? null,
|
|
404
|
+
relative_path: ref.state_relative_path ?? null,
|
|
405
|
+
url: ref.url ?? null,
|
|
406
|
+
}))),
|
|
407
|
+
];
|
|
408
|
+
refs.push({
|
|
409
|
+
kind: "evidence_ledger",
|
|
410
|
+
id: run.id,
|
|
411
|
+
relative_path: `runtime/evidence-ledger/runs/${encodeURIComponent(run.id)}.jsonl`,
|
|
412
|
+
});
|
|
413
|
+
return dedupeRefs(refs).slice(0, 20);
|
|
414
|
+
}
|
|
415
|
+
function convertSessionRef(ref) {
|
|
416
|
+
return {
|
|
417
|
+
kind: ref.kind,
|
|
418
|
+
id: ref.id,
|
|
419
|
+
path: ref.path,
|
|
420
|
+
relative_path: ref.relative_path,
|
|
421
|
+
updated_at: ref.updated_at,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
function dedupeRefs(refs) {
|
|
425
|
+
const seen = new Set();
|
|
426
|
+
const deduped = [];
|
|
427
|
+
for (const ref of refs) {
|
|
428
|
+
const key = `${ref.kind}:${ref.id ?? ""}:${ref.path ?? ""}:${ref.relative_path ?? ""}:${ref.url ?? ""}`;
|
|
429
|
+
if (seen.has(key))
|
|
430
|
+
continue;
|
|
431
|
+
seen.add(key);
|
|
432
|
+
deduped.push(ref);
|
|
433
|
+
}
|
|
434
|
+
return deduped;
|
|
435
|
+
}
|
|
436
|
+
function buildAdvisoryMemories(summary) {
|
|
437
|
+
const memories = summary.dream_checkpoints.flatMap((checkpoint) => checkpoint.relevant_memories.map((memory) => ({
|
|
438
|
+
source_type: memory.source_type,
|
|
439
|
+
...(memory.ref ? { ref: memory.ref } : {}),
|
|
440
|
+
summary: memory.summary,
|
|
441
|
+
authority: "advisory_only",
|
|
442
|
+
ranking_trace: {
|
|
443
|
+
score: memory.ranking_trace?.score ?? sidecarMemoryRankScore(memory),
|
|
444
|
+
decision: "admitted",
|
|
445
|
+
reason: sidecarMemoryRankReason(memory, memory.ranking_trace?.decision),
|
|
446
|
+
},
|
|
447
|
+
})));
|
|
448
|
+
return memories
|
|
449
|
+
.sort((a, b) => (b.ranking_trace?.score ?? 0) - (a.ranking_trace?.score ?? 0))
|
|
450
|
+
.map((memory, index) => ({
|
|
451
|
+
...memory,
|
|
452
|
+
ranking_trace: {
|
|
453
|
+
score: memory.ranking_trace?.score ?? 0,
|
|
454
|
+
decision: index < 8 ? "admitted" : "rejected",
|
|
455
|
+
reason: index < 8 ? memory.ranking_trace?.reason ?? "Ranked into sidecar memory context." : "Rejected by sidecar memory cap 8.",
|
|
456
|
+
},
|
|
457
|
+
}));
|
|
458
|
+
}
|
|
459
|
+
function sidecarMemoryRankScore(memory) {
|
|
460
|
+
const retrievalKind = memory.retrieval?.kind ?? (memory.source_type === "soil" ? "route_hit" : "checkpoint");
|
|
461
|
+
const routeScore = retrievalKind === "route_hit" ? 0.2
|
|
462
|
+
: retrievalKind === "fallback_hit" ? 0.08
|
|
463
|
+
: retrievalKind === "checkpoint" ? 0.05
|
|
464
|
+
: 0;
|
|
465
|
+
const score = (memory.relevance_score ?? memory.retrieval?.score ?? 0.5) * 0.35
|
|
466
|
+
+ (memory.source_reliability ?? memory.retrieval?.confidence ?? 0.5) * 0.25
|
|
467
|
+
+ (memory.prior_success_contribution ?? 0) * 0.2
|
|
468
|
+
+ (memory.recency_score ?? 0.5) * 0.1
|
|
469
|
+
+ routeScore;
|
|
470
|
+
return Math.max(0, Math.min(1, Number(score.toFixed(4))));
|
|
471
|
+
}
|
|
472
|
+
function sidecarMemoryRankReason(memory, checkpointDecision) {
|
|
473
|
+
const retrievalKind = memory.retrieval?.kind ?? (memory.source_type === "soil" ? "route_hit" : "checkpoint");
|
|
474
|
+
return [
|
|
475
|
+
`sidecar_rank=advisory`,
|
|
476
|
+
...(checkpointDecision ? [`checkpoint_decision=${checkpointDecision}`] : []),
|
|
477
|
+
`kind=${retrievalKind}`,
|
|
478
|
+
`relevance=${memory.relevance_score ?? memory.retrieval?.score ?? "default"}`,
|
|
479
|
+
`reliability=${memory.source_reliability ?? memory.retrieval?.confidence ?? "default"}`,
|
|
480
|
+
`success=${memory.prior_success_contribution ?? 0}`,
|
|
481
|
+
`recency=${memory.recency_score ?? "default"}`,
|
|
482
|
+
].join("; ");
|
|
483
|
+
}
|
|
484
|
+
function buildWarnings(run, runtimeSession, summary) {
|
|
485
|
+
const warnings = [];
|
|
486
|
+
if (run.child_session_id && !runtimeSession) {
|
|
487
|
+
warnings.push(`Run child session ${run.child_session_id} was not found in the Runtime Session Catalog.`);
|
|
488
|
+
}
|
|
489
|
+
if (summary.total_entries === 0) {
|
|
490
|
+
warnings.push("No run-scoped Runtime Evidence Ledger entries were found.");
|
|
491
|
+
}
|
|
492
|
+
warnings.push(...summary.warnings.map((warning) => warning.message));
|
|
493
|
+
return warnings;
|
|
494
|
+
}
|
|
495
|
+
//# sourceMappingURL=dream-sidecar-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dream-sidecar-review.js","sourceRoot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a,EAAE,CAAC;IAC9B,IAAI,GAAG,CAAC,gBAAgB,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5C,QAAQ,CAAC,IAAI,CAAC,qBAAqB,GAAG,CAAC,gBAAgB,gDAAgD,CAAC,CAAC;IAC3G,CAAC;IACD,IAAI,OAAO,CAAC,aAAa,KAAK,CAAC,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;IAC7E,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type * as http from "node:http";
|
|
2
2
|
import { type Envelope } from "../types/envelope.js";
|
|
3
|
-
import type { ApprovalBroker } from "../approval-broker.js";
|
|
4
3
|
import type { SlackChannelAdapter } from "../gateway/slack-channel-adapter.js";
|
|
5
4
|
export declare class EventServerCommandHandler {
|
|
6
5
|
private readonly broadcast;
|
|
7
6
|
private readonly getCommandEnvelopeHook;
|
|
8
|
-
private readonly
|
|
7
|
+
private readonly canResolveApproval;
|
|
9
8
|
private readonly resolveApproval;
|
|
10
|
-
private readonly getApprovalBroker;
|
|
11
9
|
private readonly getSlackChannelAdapter;
|
|
12
|
-
constructor(broadcast: (eventType: string, data: unknown) => Promise<void>, getCommandEnvelopeHook: () => ((envelope: Envelope) => void | Promise<void>) | undefined,
|
|
10
|
+
constructor(broadcast: (eventType: string, data: unknown) => Promise<void>, getCommandEnvelopeHook: () => ((envelope: Envelope) => void | Promise<void>) | undefined, canResolveApproval: (requestId: string) => Promise<boolean>, resolveApproval: (requestId: string, approved: boolean) => Promise<boolean>, getSlackChannelAdapter: () => SlackChannelAdapter | undefined);
|
|
13
11
|
handleGoalAction(req: http.IncomingMessage, res: http.ServerResponse, goalId: string, action: string): Promise<void>;
|
|
14
12
|
handlePostDaemonRuntimeControl(req: http.IncomingMessage, res: http.ServerResponse): Promise<void>;
|
|
15
13
|
handlePostScheduleRunNow(req: http.IncomingMessage, res: http.ServerResponse, rawScheduleId: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-command-handler.d.ts","sourceRoot":"","sources":["../../../src/runtime/event/server-command-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"server-command-handler.d.ts","sourceRoot":"","sources":["../../../src/runtime/event/server-command-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI/E,qBAAa,yBAAyB;IAElC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;gBAJtB,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,EAC9D,sBAAsB,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,EACxF,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAC3D,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,EAC3E,sBAAsB,EAAE,MAAM,mBAAmB,GAAG,SAAS;IAG1E,gBAAgB,CACpB,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAuIV,8BAA8B,CAClC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IA6BV,wBAAwB,CAC5B,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IA2BV,qBAAqB,CACzB,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;YA0BF,uBAAuB;CAqBtC"}
|
|
@@ -4,16 +4,14 @@ import { readBody, writeJson, writeJsonError } from "./server-http.js";
|
|
|
4
4
|
export class EventServerCommandHandler {
|
|
5
5
|
broadcast;
|
|
6
6
|
getCommandEnvelopeHook;
|
|
7
|
-
|
|
7
|
+
canResolveApproval;
|
|
8
8
|
resolveApproval;
|
|
9
|
-
getApprovalBroker;
|
|
10
9
|
getSlackChannelAdapter;
|
|
11
|
-
constructor(broadcast, getCommandEnvelopeHook,
|
|
10
|
+
constructor(broadcast, getCommandEnvelopeHook, canResolveApproval, resolveApproval, getSlackChannelAdapter) {
|
|
12
11
|
this.broadcast = broadcast;
|
|
13
12
|
this.getCommandEnvelopeHook = getCommandEnvelopeHook;
|
|
14
|
-
this.
|
|
13
|
+
this.canResolveApproval = canResolveApproval;
|
|
15
14
|
this.resolveApproval = resolveApproval;
|
|
16
|
-
this.getApprovalBroker = getApprovalBroker;
|
|
17
15
|
this.getSlackChannelAdapter = getSlackChannelAdapter;
|
|
18
16
|
}
|
|
19
17
|
async handleGoalAction(req, res, goalId, action) {
|
|
@@ -68,11 +66,43 @@ export class EventServerCommandHandler {
|
|
|
68
66
|
}
|
|
69
67
|
return;
|
|
70
68
|
}
|
|
69
|
+
if (action === "pause") {
|
|
70
|
+
try {
|
|
71
|
+
await this.dispatchCommandEnvelope({
|
|
72
|
+
name: "goal_pause",
|
|
73
|
+
goalId,
|
|
74
|
+
dedupeKey: `goal_pause:${goalId}`,
|
|
75
|
+
payload: { goalId },
|
|
76
|
+
});
|
|
77
|
+
await this.broadcast("goal_pause_requested", { goalId });
|
|
78
|
+
writeJson(res, 200, { ok: true, goalId });
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
writeJsonError(res, 500, "Command accept failed", err);
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (action === "resume") {
|
|
86
|
+
try {
|
|
87
|
+
await this.dispatchCommandEnvelope({
|
|
88
|
+
name: "goal_resume",
|
|
89
|
+
goalId,
|
|
90
|
+
dedupeKey: `goal_resume:${goalId}`,
|
|
91
|
+
payload: { goalId },
|
|
92
|
+
});
|
|
93
|
+
await this.broadcast("goal_resume_requested", { goalId });
|
|
94
|
+
writeJson(res, 200, { ok: true, goalId });
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
writeJsonError(res, 500, "Command accept failed", err);
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
71
101
|
if (action === "approve") {
|
|
72
102
|
try {
|
|
73
103
|
const body = await readBody(req);
|
|
74
104
|
const { requestId, approved } = JSON.parse(body);
|
|
75
|
-
if (!
|
|
105
|
+
if (!(await this.canResolveApproval(requestId))) {
|
|
76
106
|
writeJson(res, 404, { ok: false });
|
|
77
107
|
return;
|
|
78
108
|
}
|