@openrig/cli 0.1.12 → 0.2.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/daemon/assets/openrig-activity-hook-relay.cjs +104 -0
- package/daemon/dist/adapters/claude-code-adapter.d.ts +14 -6
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +183 -65
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +5 -0
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +13 -0
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-resume.d.ts +8 -1
- package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-resume.js +74 -5
- package/daemon/dist/adapters/codex-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +9 -5
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +255 -28
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/terminal-adapter.d.ts +2 -1
- package/daemon/dist/adapters/terminal-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/terminal-adapter.js +7 -1
- package/daemon/dist/adapters/terminal-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +53 -5
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/db/migrations/021_seat_handover_observability.d.ts +3 -0
- package/daemon/dist/db/migrations/021_seat_handover_observability.d.ts.map +1 -0
- package/daemon/dist/db/migrations/021_seat_handover_observability.js +11 -0
- package/daemon/dist/db/migrations/021_seat_handover_observability.js.map +1 -0
- package/daemon/dist/db/migrations/022_node_codex_config_profile.d.ts +3 -0
- package/daemon/dist/db/migrations/022_node_codex_config_profile.d.ts.map +1 -0
- package/daemon/dist/db/migrations/022_node_codex_config_profile.js +7 -0
- package/daemon/dist/db/migrations/022_node_codex_config_profile.js.map +1 -0
- package/daemon/dist/db/migrations/023_stream_items.d.ts +16 -0
- package/daemon/dist/db/migrations/023_stream_items.d.ts.map +1 -0
- package/daemon/dist/db/migrations/023_stream_items.js +37 -0
- package/daemon/dist/db/migrations/023_stream_items.js.map +1 -0
- package/daemon/dist/db/migrations/024_queue_items.d.ts +19 -0
- package/daemon/dist/db/migrations/024_queue_items.d.ts.map +1 -0
- package/daemon/dist/db/migrations/024_queue_items.js +52 -0
- package/daemon/dist/db/migrations/024_queue_items.js.map +1 -0
- package/daemon/dist/db/migrations/025_queue_transitions.d.ts +13 -0
- package/daemon/dist/db/migrations/025_queue_transitions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/025_queue_transitions.js +28 -0
- package/daemon/dist/db/migrations/025_queue_transitions.js.map +1 -0
- package/daemon/dist/db/migrations/026_inbox_entries.d.ts +14 -0
- package/daemon/dist/db/migrations/026_inbox_entries.d.ts.map +1 -0
- package/daemon/dist/db/migrations/026_inbox_entries.js +35 -0
- package/daemon/dist/db/migrations/026_inbox_entries.js.map +1 -0
- package/daemon/dist/db/migrations/027_outbox_entries.d.ts +12 -0
- package/daemon/dist/db/migrations/027_outbox_entries.d.ts.map +1 -0
- package/daemon/dist/db/migrations/027_outbox_entries.js +30 -0
- package/daemon/dist/db/migrations/027_outbox_entries.js.map +1 -0
- package/daemon/dist/db/migrations/028_project_classifications.d.ts +26 -0
- package/daemon/dist/db/migrations/028_project_classifications.d.ts.map +1 -0
- package/daemon/dist/db/migrations/028_project_classifications.js +44 -0
- package/daemon/dist/db/migrations/028_project_classifications.js.map +1 -0
- package/daemon/dist/db/migrations/029_classifier_leases.d.ts +22 -0
- package/daemon/dist/db/migrations/029_classifier_leases.d.ts.map +1 -0
- package/daemon/dist/db/migrations/029_classifier_leases.js +41 -0
- package/daemon/dist/db/migrations/029_classifier_leases.js.map +1 -0
- package/daemon/dist/db/migrations/030_views_custom.d.ts +15 -0
- package/daemon/dist/db/migrations/030_views_custom.d.ts.map +1 -0
- package/daemon/dist/db/migrations/030_views_custom.js +27 -0
- package/daemon/dist/db/migrations/030_views_custom.js.map +1 -0
- package/daemon/dist/db/migrations/031_watchdog_jobs.d.ts +34 -0
- package/daemon/dist/db/migrations/031_watchdog_jobs.d.ts.map +1 -0
- package/daemon/dist/db/migrations/031_watchdog_jobs.js +59 -0
- package/daemon/dist/db/migrations/031_watchdog_jobs.js.map +1 -0
- package/daemon/dist/db/migrations/032_watchdog_history.d.ts +28 -0
- package/daemon/dist/db/migrations/032_watchdog_history.d.ts.map +1 -0
- package/daemon/dist/db/migrations/032_watchdog_history.js +46 -0
- package/daemon/dist/db/migrations/032_watchdog_history.js.map +1 -0
- package/daemon/dist/db/migrations/033_workflow_specs.d.ts +30 -0
- package/daemon/dist/db/migrations/033_workflow_specs.d.ts.map +1 -0
- package/daemon/dist/db/migrations/033_workflow_specs.js +50 -0
- package/daemon/dist/db/migrations/033_workflow_specs.js.map +1 -0
- package/daemon/dist/db/migrations/034_workflow_instances.d.ts +42 -0
- package/daemon/dist/db/migrations/034_workflow_instances.d.ts.map +1 -0
- package/daemon/dist/db/migrations/034_workflow_instances.js +63 -0
- package/daemon/dist/db/migrations/034_workflow_instances.js.map +1 -0
- package/daemon/dist/db/migrations/035_workflow_step_trails.d.ts +29 -0
- package/daemon/dist/db/migrations/035_workflow_step_trails.d.ts.map +1 -0
- package/daemon/dist/db/migrations/035_workflow_step_trails.js +48 -0
- package/daemon/dist/db/migrations/035_workflow_step_trails.js.map +1 -0
- package/daemon/dist/db/migrations/036_watchdog_policy_enum_extension.d.ts +35 -0
- package/daemon/dist/db/migrations/036_watchdog_policy_enum_extension.d.ts.map +1 -0
- package/daemon/dist/db/migrations/036_watchdog_policy_enum_extension.js +43 -0
- package/daemon/dist/db/migrations/036_watchdog_policy_enum_extension.js.map +1 -0
- package/daemon/dist/domain/agent-activity-store.d.ts +42 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -0
- package/daemon/dist/domain/agent-activity-store.js +177 -0
- package/daemon/dist/domain/agent-activity-store.js.map +1 -0
- package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
- package/daemon/dist/domain/agent-manifest.js +3 -0
- package/daemon/dist/domain/agent-manifest.js.map +1 -1
- package/daemon/dist/domain/agent-starter-resolver.d.ts +100 -0
- package/daemon/dist/domain/agent-starter-resolver.d.ts.map +1 -0
- package/daemon/dist/domain/agent-starter-resolver.js +200 -0
- package/daemon/dist/domain/agent-starter-resolver.js.map +1 -0
- package/daemon/dist/domain/classifier-lease-manager.d.ts +130 -0
- package/daemon/dist/domain/classifier-lease-manager.d.ts.map +1 -0
- package/daemon/dist/domain/classifier-lease-manager.js +285 -0
- package/daemon/dist/domain/classifier-lease-manager.js.map +1 -0
- package/daemon/dist/domain/context-usage-store.d.ts +1 -1
- package/daemon/dist/domain/context-usage-store.js +1 -1
- package/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +45 -0
- package/daemon/dist/domain/hot-potato-enforcer.d.ts.map +1 -0
- package/daemon/dist/domain/hot-potato-enforcer.js +94 -0
- package/daemon/dist/domain/hot-potato-enforcer.js.map +1 -0
- package/daemon/dist/domain/inbox-handler.d.ts +68 -0
- package/daemon/dist/domain/inbox-handler.d.ts.map +1 -0
- package/daemon/dist/domain/inbox-handler.js +177 -0
- package/daemon/dist/domain/inbox-handler.js.map +1 -0
- package/daemon/dist/domain/native-resume-probe.d.ts +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +67 -0
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +29 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +160 -38
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +2 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +14 -2
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +48 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -0
- package/daemon/dist/domain/outbox-handler.js +106 -0
- package/daemon/dist/domain/outbox-handler.js.map +1 -0
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts +64 -0
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts.map +1 -0
- package/daemon/dist/domain/policies/artifact-pool-helpers.js +226 -0
- package/daemon/dist/domain/policies/artifact-pool-helpers.js.map +1 -0
- package/daemon/dist/domain/policies/artifact-pool-ready.d.ts +3 -0
- package/daemon/dist/domain/policies/artifact-pool-ready.d.ts.map +1 -0
- package/daemon/dist/domain/policies/artifact-pool-ready.js +41 -0
- package/daemon/dist/domain/policies/artifact-pool-ready.js.map +1 -0
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts +3 -0
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts.map +1 -0
- package/daemon/dist/domain/policies/edge-artifact-required.js +90 -0
- package/daemon/dist/domain/policies/edge-artifact-required.js.map +1 -0
- package/daemon/dist/domain/policies/periodic-reminder.d.ts +3 -0
- package/daemon/dist/domain/policies/periodic-reminder.d.ts.map +1 -0
- package/daemon/dist/domain/policies/periodic-reminder.js +30 -0
- package/daemon/dist/domain/policies/periodic-reminder.js.map +1 -0
- package/daemon/dist/domain/policies/types.d.ts +51 -0
- package/daemon/dist/domain/policies/types.d.ts.map +1 -0
- package/daemon/dist/domain/policies/types.js +9 -0
- package/daemon/dist/domain/policies/types.js.map +1 -0
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts +7 -0
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -0
- package/daemon/dist/domain/policies/workflow-keepalive.js +123 -0
- package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -0
- package/daemon/dist/domain/project-classifier.d.ts +75 -0
- package/daemon/dist/domain/project-classifier.d.ts.map +1 -0
- package/daemon/dist/domain/project-classifier.js +132 -0
- package/daemon/dist/domain/project-classifier.js.map +1 -0
- package/daemon/dist/domain/projection-planner.d.ts +1 -0
- package/daemon/dist/domain/projection-planner.d.ts.map +1 -1
- package/daemon/dist/domain/projection-planner.js +3 -0
- package/daemon/dist/domain/projection-planner.js.map +1 -1
- package/daemon/dist/domain/ps-projection.d.ts +31 -0
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +38 -0
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +322 -0
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -0
- package/daemon/dist/domain/queue-repository.js +686 -0
- package/daemon/dist/domain/queue-repository.js.map +1 -0
- package/daemon/dist/domain/queue-transition-log.d.ts +38 -0
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -0
- package/daemon/dist/domain/queue-transition-log.js +52 -0
- package/daemon/dist/domain/queue-transition-log.js.map +1 -0
- package/daemon/dist/domain/restore-check-service.d.ts +203 -0
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -0
- package/daemon/dist/domain/restore-check-service.js +1047 -0
- package/daemon/dist/domain/restore-check-service.js.map +1 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts +49 -3
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +460 -62
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.js +13 -0
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +17 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +63 -5
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +13 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +2 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +61 -1
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +196 -0
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +27 -2
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js +5 -0
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/seat-handover-planner.d.ts +84 -0
- package/daemon/dist/domain/seat-handover-planner.d.ts.map +1 -0
- package/daemon/dist/domain/seat-handover-planner.js +188 -0
- package/daemon/dist/domain/seat-handover-planner.js.map +1 -0
- package/daemon/dist/domain/seat-handover-service.d.ts +104 -0
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -0
- package/daemon/dist/domain/seat-handover-service.js +343 -0
- package/daemon/dist/domain/seat-handover-service.js.map +1 -0
- package/daemon/dist/domain/seat-status-service.d.ts +50 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -0
- package/daemon/dist/domain/seat-status-service.js +66 -0
- package/daemon/dist/domain/seat-status-service.js.map +1 -0
- package/daemon/dist/domain/session-source-rebuild-resolver.d.ts +53 -0
- package/daemon/dist/domain/session-source-rebuild-resolver.d.ts.map +1 -0
- package/daemon/dist/domain/session-source-rebuild-resolver.js +59 -0
- package/daemon/dist/domain/session-source-rebuild-resolver.js.map +1 -0
- package/daemon/dist/domain/session-transport.d.ts +30 -0
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +322 -12
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/snapshot-repository.d.ts +18 -0
- package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-repository.js +77 -0
- package/daemon/dist/domain/snapshot-repository.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +22 -3
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +31 -5
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/stream-store.d.ts +56 -0
- package/daemon/dist/domain/stream-store.d.ts.map +1 -0
- package/daemon/dist/domain/stream-store.js +108 -0
- package/daemon/dist/domain/stream-store.js.map +1 -0
- package/daemon/dist/domain/transcript-redaction.d.ts +13 -0
- package/daemon/dist/domain/transcript-redaction.d.ts.map +1 -0
- package/daemon/dist/domain/transcript-redaction.js +34 -0
- package/daemon/dist/domain/transcript-redaction.js.map +1 -0
- package/daemon/dist/domain/transcript-store.d.ts +15 -0
- package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-store.js +57 -1
- package/daemon/dist/domain/transcript-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +316 -3
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/view-event-bridge.d.ts +12 -0
- package/daemon/dist/domain/view-event-bridge.d.ts.map +1 -0
- package/daemon/dist/domain/view-event-bridge.js +92 -0
- package/daemon/dist/domain/view-event-bridge.js.map +1 -0
- package/daemon/dist/domain/view-projector.d.ts +83 -0
- package/daemon/dist/domain/view-projector.d.ts.map +1 -0
- package/daemon/dist/domain/view-projector.js +296 -0
- package/daemon/dist/domain/view-projector.js.map +1 -0
- package/daemon/dist/domain/watchdog-history-log.d.ts +49 -0
- package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-history-log.js +67 -0
- package/daemon/dist/domain/watchdog-history-log.js.map +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +81 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js +164 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +92 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-policy-engine.js +442 -0
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -0
- package/daemon/dist/domain/watchdog-scheduler.d.ts +76 -0
- package/daemon/dist/domain/watchdog-scheduler.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-scheduler.js +112 -0
- package/daemon/dist/domain/watchdog-scheduler.js.map +1 -0
- package/daemon/dist/domain/workflow-instance-store.d.ts +46 -0
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-instance-store.js +116 -0
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -0
- package/daemon/dist/domain/workflow-projector.d.ts +64 -0
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-projector.js +424 -0
- package/daemon/dist/domain/workflow-projector.js.map +1 -0
- package/daemon/dist/domain/workflow-runtime.d.ts +63 -0
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-runtime.js +150 -0
- package/daemon/dist/domain/workflow-runtime.js.map +1 -0
- package/daemon/dist/domain/workflow-spec-cache.d.ts +35 -0
- package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-spec-cache.js +171 -0
- package/daemon/dist/domain/workflow-spec-cache.js.map +1 -0
- package/daemon/dist/domain/workflow-step-trail-log.d.ts +27 -0
- package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-step-trail-log.js +73 -0
- package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -0
- package/daemon/dist/domain/workflow-types.d.ts +108 -0
- package/daemon/dist/domain/workflow-types.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-types.js +11 -0
- package/daemon/dist/domain/workflow-types.js.map +1 -0
- package/daemon/dist/domain/workflow-validator.d.ts +31 -0
- package/daemon/dist/domain/workflow-validator.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-validator.js +115 -0
- package/daemon/dist/domain/workflow-validator.js.map +1 -0
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +21 -2
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts +3 -0
- package/daemon/dist/routes/activity.d.ts.map +1 -0
- package/daemon/dist/routes/activity.js +47 -0
- package/daemon/dist/routes/activity.js.map +1 -0
- package/daemon/dist/routes/projects.d.ts +12 -0
- package/daemon/dist/routes/projects.d.ts.map +1 -0
- package/daemon/dist/routes/projects.js +178 -0
- package/daemon/dist/routes/projects.js.map +1 -0
- package/daemon/dist/routes/queue.d.ts +10 -0
- package/daemon/dist/routes/queue.d.ts.map +1 -0
- package/daemon/dist/routes/queue.js +374 -0
- package/daemon/dist/routes/queue.js.map +1 -0
- package/daemon/dist/routes/restore-check.d.ts +3 -0
- package/daemon/dist/routes/restore-check.d.ts.map +1 -0
- package/daemon/dist/routes/restore-check.js +200 -0
- package/daemon/dist/routes/restore-check.js.map +1 -0
- package/daemon/dist/routes/rigs.d.ts.map +1 -1
- package/daemon/dist/routes/rigs.js +60 -4
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts +3 -0
- package/daemon/dist/routes/seat.d.ts.map +1 -0
- package/daemon/dist/routes/seat.js +69 -0
- package/daemon/dist/routes/seat.js.map +1 -0
- package/daemon/dist/routes/sessions.d.ts.map +1 -1
- package/daemon/dist/routes/sessions.js +25 -4
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/snapshots.js +66 -29
- package/daemon/dist/routes/snapshots.js.map +1 -1
- package/daemon/dist/routes/stream.d.ts +9 -0
- package/daemon/dist/routes/stream.d.ts.map +1 -0
- package/daemon/dist/routes/stream.js +119 -0
- package/daemon/dist/routes/stream.js.map +1 -0
- package/daemon/dist/routes/transcripts.d.ts.map +1 -1
- package/daemon/dist/routes/transcripts.js +38 -0
- package/daemon/dist/routes/transcripts.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +21 -0
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/up.js +24 -3
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/views.d.ts +13 -0
- package/daemon/dist/routes/views.d.ts.map +1 -0
- package/daemon/dist/routes/views.js +120 -0
- package/daemon/dist/routes/views.js.map +1 -0
- package/daemon/dist/routes/watchdog.d.ts +18 -0
- package/daemon/dist/routes/watchdog.d.ts.map +1 -0
- package/daemon/dist/routes/watchdog.js +148 -0
- package/daemon/dist/routes/watchdog.js.map +1 -0
- package/daemon/dist/routes/workflow.d.ts +20 -0
- package/daemon/dist/routes/workflow.d.ts.map +1 -0
- package/daemon/dist/routes/workflow.js +184 -0
- package/daemon/dist/routes/workflow.js.map +1 -0
- package/daemon/dist/server.d.ts +30 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +33 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +202 -8
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-spec.md +12 -5
- package/daemon/docs/reference/agent-startup-guide.md +9 -9
- package/daemon/specs/agents/apps/vault-specialist/agent.yaml +1 -1
- package/daemon/specs/agents/design/product-designer/agent.yaml +1 -1
- package/daemon/specs/agents/development/implementer/agent.yaml +1 -1
- package/daemon/specs/agents/development/qa/agent.yaml +1 -1
- package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +1 -1
- package/daemon/specs/agents/product-management/pm/agent.yaml +4 -0
- package/daemon/specs/agents/research/analyst/agent.yaml +1 -1
- package/daemon/specs/agents/research/synthesizer/agent.yaml +1 -1
- package/daemon/specs/agents/review/independent-reviewer/agent.yaml +1 -1
- package/daemon/specs/agents/shared/agent.yaml +17 -0
- package/daemon/specs/agents/shared/runtime/claude-mcp.fragment.json +12 -0
- package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +16 -0
- package/daemon/specs/agents/shared/runtime/codex-config.fragment.toml +5 -0
- package/daemon/specs/agents/shared/skills/claude-compact-in-place/SKILL.md +100 -0
- package/daemon/specs/agents/shared/skills/core/openrig-operator/SKILL.md +110 -0
- package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +44 -1
- package/daemon/specs/agents/shared/skills/mental-model-ha/SKILL.md +3 -0
- package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +3 -0
- package/daemon/specs/agents/shared/skills/rig-architect/SKILL.md +11 -1
- package/dist/bin-wrapper.js +0 -0
- package/dist/commands/capture.d.ts +7 -1
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +59 -1
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/compact-plan.d.ts +9 -0
- package/dist/commands/compact-plan.d.ts.map +1 -0
- package/dist/commands/compact-plan.js +354 -0
- package/dist/commands/compact-plan.js.map +1 -0
- package/dist/commands/context.d.ts +9 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +220 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/expand.d.ts.map +1 -1
- package/dist/commands/expand.js +15 -4
- package/dist/commands/expand.js.map +1 -1
- package/dist/commands/heartbeat.d.ts +99 -0
- package/dist/commands/heartbeat.d.ts.map +1 -0
- package/dist/commands/heartbeat.js +393 -0
- package/dist/commands/heartbeat.js.map +1 -0
- package/dist/commands/project.d.ts +14 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +157 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/ps.d.ts +20 -3
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +455 -33
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +16 -0
- package/dist/commands/queue.d.ts.map +1 -0
- package/dist/commands/queue.js +401 -0
- package/dist/commands/queue.js.map +1 -0
- package/dist/commands/restore-check.d.ts +9 -0
- package/dist/commands/restore-check.d.ts.map +1 -0
- package/dist/commands/restore-check.js +234 -0
- package/dist/commands/restore-check.js.map +1 -0
- package/dist/commands/restore-packet.d.ts +9 -0
- package/dist/commands/restore-packet.d.ts.map +1 -0
- package/dist/commands/restore-packet.js +383 -0
- package/dist/commands/restore-packet.js.map +1 -0
- package/dist/commands/restore.d.ts.map +1 -1
- package/dist/commands/restore.js +44 -1
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/seat.d.ts +5 -0
- package/dist/commands/seat.d.ts.map +1 -0
- package/dist/commands/seat.js +170 -0
- package/dist/commands/seat.js.map +1 -0
- package/dist/commands/send.d.ts +12 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +93 -5
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.js +3 -3
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/specs.d.ts.map +1 -1
- package/dist/commands/specs.js +99 -16
- package/dist/commands/specs.js.map +1 -1
- package/dist/commands/stream.d.ts +12 -0
- package/dist/commands/stream.d.ts.map +1 -0
- package/dist/commands/stream.js +111 -0
- package/dist/commands/stream.js.map +1 -0
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +63 -3
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/view.d.ts +12 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +82 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/commands/watchdog.d.ts +15 -0
- package/dist/commands/watchdog.d.ts.map +1 -0
- package/dist/commands/watchdog.js +120 -0
- package/dist/commands/watchdog.js.map +1 -0
- package/dist/commands/whoami.d.ts +8 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +60 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/workflow.d.ts +17 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +138 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/cross-host-cli-helpers.d.ts +12 -0
- package/dist/cross-host-cli-helpers.d.ts.map +1 -0
- package/dist/cross-host-cli-helpers.js +48 -0
- package/dist/cross-host-cli-helpers.js.map +1 -0
- package/dist/cross-host-executor.d.ts +84 -0
- package/dist/cross-host-executor.d.ts.map +1 -0
- package/dist/cross-host-executor.js +138 -0
- package/dist/cross-host-executor.js.map +1 -0
- package/dist/host-registry.d.ts +50 -0
- package/dist/host-registry.d.ts.map +1 -0
- package/dist/host-registry.js +116 -0
- package/dist/host-registry.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +22 -2
- package/dist/mcp-server.js.map +1 -1
- package/dist/restore-packet/claude-transcript-parser.d.ts +12 -0
- package/dist/restore-packet/claude-transcript-parser.d.ts.map +1 -0
- package/dist/restore-packet/claude-transcript-parser.js +221 -0
- package/dist/restore-packet/claude-transcript-parser.js.map +1 -0
- package/dist/restore-packet/codex-jsonl-parser.d.ts +11 -0
- package/dist/restore-packet/codex-jsonl-parser.d.ts.map +1 -0
- package/dist/restore-packet/codex-jsonl-parser.js +159 -0
- package/dist/restore-packet/codex-jsonl-parser.js.map +1 -0
- package/dist/restore-packet/omitted-records.d.ts +60 -0
- package/dist/restore-packet/omitted-records.d.ts.map +1 -0
- package/dist/restore-packet/omitted-records.js +116 -0
- package/dist/restore-packet/omitted-records.js.map +1 -0
- package/dist/restore-packet/packet-writer.d.ts +59 -0
- package/dist/restore-packet/packet-writer.d.ts.map +1 -0
- package/dist/restore-packet/packet-writer.js +224 -0
- package/dist/restore-packet/packet-writer.js.map +1 -0
- package/dist/restore-packet/redaction.d.ts +30 -0
- package/dist/restore-packet/redaction.d.ts.map +1 -0
- package/dist/restore-packet/redaction.js +71 -0
- package/dist/restore-packet/redaction.js.map +1 -0
- package/dist/restore-packet/runtime-detect.d.ts +19 -0
- package/dist/restore-packet/runtime-detect.d.ts.map +1 -0
- package/dist/restore-packet/runtime-detect.js +81 -0
- package/dist/restore-packet/runtime-detect.js.map +1 -0
- package/dist/restore-packet/schema-validator.d.ts +13 -0
- package/dist/restore-packet/schema-validator.d.ts.map +1 -0
- package/dist/restore-packet/schema-validator.js +245 -0
- package/dist/restore-packet/schema-validator.js.map +1 -0
- package/dist/restore-packet/types.d.ts +76 -0
- package/dist/restore-packet/types.d.ts.map +1 -0
- package/dist/restore-packet/types.js +15 -0
- package/dist/restore-packet/types.js.map +1 -0
- package/dist/schemas/restore-summary.schema.json +98 -0
- package/package.json +10 -3
- package/scripts/check-abi.mjs +123 -0
- package/ui/dist/assets/{index-DlMH-REm.css → index-Dec25siz.css} +1 -1
- package/ui/dist/assets/{index-Ccd-jwRN.js → index-GNYaWmBj.js} +2 -2
- package/ui/dist/index.html +2 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface ArtifactPoolSpec {
|
|
2
|
+
/** Absolute path to the pool directory. POC contract: one path per pool. */
|
|
3
|
+
path?: string;
|
|
4
|
+
/** Convenience array form; expanded to one pool per path. */
|
|
5
|
+
paths?: string[];
|
|
6
|
+
/** File extensions to include (default: ['.md']). */
|
|
7
|
+
extensions?: string[];
|
|
8
|
+
/** Filter on frontmatter `status:` field. Empty/absent = include all. */
|
|
9
|
+
include_statuses?: string[];
|
|
10
|
+
/** Frontmatter field used for keying artifacts (default: 'entry'). */
|
|
11
|
+
key_field?: string;
|
|
12
|
+
/** Per-pool extra ignore names (added to defaults). */
|
|
13
|
+
ignore_names?: string[];
|
|
14
|
+
/** When true, descend into subdirectories. Default false. */
|
|
15
|
+
recursive?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* When true, artifacts whose frontmatter cannot be parsed are still
|
|
18
|
+
* included with empty frontmatter. Default false: malformed frontmatter
|
|
19
|
+
* causes the artifact to be excluded (matches POC behavior so that
|
|
20
|
+
* agents do not get woken about half-written drafts).
|
|
21
|
+
*/
|
|
22
|
+
include_malformed_frontmatter?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ScannedArtifact {
|
|
25
|
+
/** Absolute path to the artifact file. */
|
|
26
|
+
path: string;
|
|
27
|
+
/** The pool path that produced this artifact. */
|
|
28
|
+
pool_path: string;
|
|
29
|
+
/** Full file content (used by edge-artifact-required body-match). */
|
|
30
|
+
raw: string;
|
|
31
|
+
/**
|
|
32
|
+
* Parsed YAML frontmatter (top-level keys). Values are kept as `unknown`
|
|
33
|
+
* because YAML scalars are heterogeneous: timestamps parse to Date,
|
|
34
|
+
* URLs to string, numbers to number, etc. Frontmatter consumers in
|
|
35
|
+
* the policy layer (status filter, key_field lookup) coerce to string.
|
|
36
|
+
*/
|
|
37
|
+
frontmatter: Record<string, unknown>;
|
|
38
|
+
/** Parse error message when include_malformed_frontmatter=true; else null. */
|
|
39
|
+
frontmatter_parse_error: string | null;
|
|
40
|
+
/** Convenience accessor for frontmatter.status; null when absent. */
|
|
41
|
+
status: string | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Scan one or more artifact pools per spec(s). Mirrors POC
|
|
45
|
+
* `scanArtifactPools(pools)`. Returns the flat union of matches across
|
|
46
|
+
* all pools, sorted by absolute path. Missing pools yield empty.
|
|
47
|
+
*
|
|
48
|
+
* Throws if `pools` is undefined / empty / shapeless — POC contract:
|
|
49
|
+
* the policy spec MUST declare at least one pool.
|
|
50
|
+
*/
|
|
51
|
+
export declare function scanArtifactPools(pools: ArtifactPoolSpec | ArtifactPoolSpec[] | undefined): Promise<ScannedArtifact[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Format an artifact list as bullet lines. Mirrors POC formatArtifactList:
|
|
54
|
+
* `- /full/absolute/path`. The POC favors the full path so receivers can
|
|
55
|
+
* cd / open / cat the artifact directly without further lookup.
|
|
56
|
+
*/
|
|
57
|
+
export declare function formatArtifactList(artifacts: ScannedArtifact[], maxItems: number): string;
|
|
58
|
+
/**
|
|
59
|
+
* Compute the source-key for an artifact. Mirrors POC sourceKeyFor:
|
|
60
|
+
* prefer frontmatter[keyField], else basename sans .md extension.
|
|
61
|
+
* Coerces non-string scalars (Date, number) to string for comparison.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sourceKeyFor(artifact: ScannedArtifact, keyField: string): string;
|
|
64
|
+
//# sourceMappingURL=artifact-pool-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-pool-helpers.d.ts","sourceRoot":"","sources":["../../../src/domain/policies/artifact-pool-helpers.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,8EAA8E;IAC9E,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qEAAqE;IACrE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAyGD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,GAAG,SAAS,GACvD,OAAO,CAAC,eAAe,EAAE,CAAC,CA0C5B;AAsBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKzF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQhF"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// PL-004 Phase C R1: shared artifact-pool helpers (TypeScript port of
|
|
2
|
+
// POC `lib/policies/artifact-pool.js`).
|
|
3
|
+
//
|
|
4
|
+
// R1 fix (guard blocker 3): full POC parity for the scanner. The
|
|
5
|
+
// artifact-pool-ready and edge-artifact-required policies depend on:
|
|
6
|
+
// - Default ignores: README.md and .DS_Store always excluded.
|
|
7
|
+
// - Configured ignore_names: per-pool extra exclusions.
|
|
8
|
+
// - Recursive scan when pool.recursive=true.
|
|
9
|
+
// - Malformed-frontmatter exclusion unless pool.include_malformed_frontmatter.
|
|
10
|
+
// - Raw content preserved on every artifact (used by edge-artifact-required
|
|
11
|
+
// for body-reference target satisfaction).
|
|
12
|
+
// - Missing pool path returns empty (ENOENT-tolerant).
|
|
13
|
+
//
|
|
14
|
+
// Pure filesystem scanner; no event-bus, no DB, no Hono.
|
|
15
|
+
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
16
|
+
import { basename, join } from "node:path";
|
|
17
|
+
import { parse as parseYaml } from "yaml";
|
|
18
|
+
const DEFAULT_EXTENSIONS = [".md"];
|
|
19
|
+
const DEFAULT_IGNORE_NAMES = ["README.md", ".DS_Store"];
|
|
20
|
+
const FRONTMATTER_OPEN = "---\n";
|
|
21
|
+
/**
|
|
22
|
+
* Parse top-level YAML frontmatter from a markdown-style document.
|
|
23
|
+
* Returns { raw, frontmatter, parseError } so callers can decide whether
|
|
24
|
+
* to include malformed artifacts.
|
|
25
|
+
*
|
|
26
|
+
* R2 fix (guard blocker 2): use the `yaml` package (already a daemon
|
|
27
|
+
* dep) rather than a local key/value parser. Mirrors POC's
|
|
28
|
+
* `lib/policies/artifact-pool.js:21-30` which delegates to the shared
|
|
29
|
+
* YAML loader. Valid YAML scalars containing colons (ISO timestamps,
|
|
30
|
+
* URLs) parse cleanly. Only true YAML parse failures (e.g.,
|
|
31
|
+
* `broken: value: still broken` which is genuinely invalid YAML) cause
|
|
32
|
+
* exclusion when `include_malformed_frontmatter` is unset.
|
|
33
|
+
*/
|
|
34
|
+
function readFrontmatter(filePath) {
|
|
35
|
+
const raw = readFileSync(filePath, "utf-8");
|
|
36
|
+
if (!raw.startsWith(FRONTMATTER_OPEN)) {
|
|
37
|
+
return { raw, frontmatter: {}, frontmatter_parse_error: null };
|
|
38
|
+
}
|
|
39
|
+
const endIdx = raw.indexOf("\n---\n", FRONTMATTER_OPEN.length);
|
|
40
|
+
if (endIdx === -1) {
|
|
41
|
+
return { raw, frontmatter: {}, frontmatter_parse_error: null };
|
|
42
|
+
}
|
|
43
|
+
const block = raw.slice(FRONTMATTER_OPEN.length, endIdx);
|
|
44
|
+
let parsed;
|
|
45
|
+
try {
|
|
46
|
+
parsed = parseYaml(block);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
return {
|
|
50
|
+
raw,
|
|
51
|
+
frontmatter: {},
|
|
52
|
+
frontmatter_parse_error: err instanceof Error ? err.message : "frontmatter parse error",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// YAML parsed but produced a non-object root (string, array, null) —
|
|
56
|
+
// treat as empty frontmatter, NOT a parse error. Matches POC behavior
|
|
57
|
+
// (lib/policies/artifact-pool.js:35-38): non-object root yields {}.
|
|
58
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
59
|
+
return { raw, frontmatter: {}, frontmatter_parse_error: null };
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
raw,
|
|
63
|
+
frontmatter: parsed,
|
|
64
|
+
frontmatter_parse_error: null,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function listFiles(rootDir, recursive) {
|
|
68
|
+
let entries;
|
|
69
|
+
try {
|
|
70
|
+
entries = readdirSync(rootDir, { withFileTypes: true });
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
if (err.code === "ENOENT")
|
|
74
|
+
return [];
|
|
75
|
+
throw err;
|
|
76
|
+
}
|
|
77
|
+
const out = [];
|
|
78
|
+
for (const entry of entries) {
|
|
79
|
+
const full = join(rootDir, entry.name);
|
|
80
|
+
if (entry.isDirectory()) {
|
|
81
|
+
if (recursive)
|
|
82
|
+
out.push(...listFiles(full, recursive));
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (entry.isFile())
|
|
86
|
+
out.push(full);
|
|
87
|
+
}
|
|
88
|
+
return out.sort((a, b) => a.localeCompare(b));
|
|
89
|
+
}
|
|
90
|
+
function shouldIncludeFile(filePath, pool) {
|
|
91
|
+
const name = basename(filePath);
|
|
92
|
+
const ignoreNames = new Set([
|
|
93
|
+
...DEFAULT_IGNORE_NAMES,
|
|
94
|
+
...(Array.isArray(pool.ignore_names) ? pool.ignore_names : []),
|
|
95
|
+
]);
|
|
96
|
+
if (ignoreNames.has(name))
|
|
97
|
+
return false;
|
|
98
|
+
const exts = Array.isArray(pool.extensions) ? pool.extensions : DEFAULT_EXTENSIONS;
|
|
99
|
+
return exts.some((e) => name.endsWith(e));
|
|
100
|
+
}
|
|
101
|
+
function statusAllowed(status, pool) {
|
|
102
|
+
const include = pool.include_statuses;
|
|
103
|
+
if (!Array.isArray(include) || include.length === 0)
|
|
104
|
+
return true;
|
|
105
|
+
return status !== null && include.includes(status);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Coerce a YAML-parsed frontmatter status field to a comparable string.
|
|
109
|
+
* YAML loaders may parse unquoted statuses as identifiers (string),
|
|
110
|
+
* but a status like `2026-05-03` would parse as Date. We coerce to ISO
|
|
111
|
+
* for non-string scalars so include_statuses comparisons remain stable.
|
|
112
|
+
*/
|
|
113
|
+
function statusFromFrontmatter(fm) {
|
|
114
|
+
const v = fm.status;
|
|
115
|
+
if (v === undefined || v === null)
|
|
116
|
+
return null;
|
|
117
|
+
if (typeof v === "string")
|
|
118
|
+
return v;
|
|
119
|
+
if (v instanceof Date)
|
|
120
|
+
return v.toISOString();
|
|
121
|
+
return String(v);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Scan one or more artifact pools per spec(s). Mirrors POC
|
|
125
|
+
* `scanArtifactPools(pools)`. Returns the flat union of matches across
|
|
126
|
+
* all pools, sorted by absolute path. Missing pools yield empty.
|
|
127
|
+
*
|
|
128
|
+
* Throws if `pools` is undefined / empty / shapeless — POC contract:
|
|
129
|
+
* the policy spec MUST declare at least one pool.
|
|
130
|
+
*/
|
|
131
|
+
export async function scanArtifactPools(pools) {
|
|
132
|
+
const expanded = expandPools(pools);
|
|
133
|
+
if (expanded.length === 0) {
|
|
134
|
+
throw new Error("artifact pool policy: context pool list is required");
|
|
135
|
+
}
|
|
136
|
+
const out = [];
|
|
137
|
+
for (const pool of expanded) {
|
|
138
|
+
if (!pool.path) {
|
|
139
|
+
throw new Error("artifact pool policy: every pool requires a path");
|
|
140
|
+
}
|
|
141
|
+
const files = listFiles(pool.path, Boolean(pool.recursive));
|
|
142
|
+
for (const filePath of files) {
|
|
143
|
+
if (!shouldIncludeFile(filePath, pool))
|
|
144
|
+
continue;
|
|
145
|
+
let st;
|
|
146
|
+
try {
|
|
147
|
+
st = statSync(filePath);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (!st.isFile())
|
|
153
|
+
continue;
|
|
154
|
+
let parsed;
|
|
155
|
+
try {
|
|
156
|
+
parsed = readFrontmatter(filePath);
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (parsed.frontmatter_parse_error && !pool.include_malformed_frontmatter) {
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const status = statusFromFrontmatter(parsed.frontmatter);
|
|
165
|
+
if (!statusAllowed(status, pool))
|
|
166
|
+
continue;
|
|
167
|
+
out.push({
|
|
168
|
+
path: filePath,
|
|
169
|
+
pool_path: pool.path,
|
|
170
|
+
raw: parsed.raw,
|
|
171
|
+
frontmatter: parsed.frontmatter,
|
|
172
|
+
frontmatter_parse_error: parsed.frontmatter_parse_error,
|
|
173
|
+
status,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return out.sort((a, b) => a.path.localeCompare(b.path));
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Expand the convenience input shape (single object, array of objects,
|
|
181
|
+
* or `paths: [...]` shorthand) into a flat array of single-path pools.
|
|
182
|
+
*/
|
|
183
|
+
function expandPools(pools) {
|
|
184
|
+
if (!pools)
|
|
185
|
+
return [];
|
|
186
|
+
const list = Array.isArray(pools) ? pools : [pools];
|
|
187
|
+
const out = [];
|
|
188
|
+
for (const spec of list) {
|
|
189
|
+
if (spec.path) {
|
|
190
|
+
out.push(spec);
|
|
191
|
+
}
|
|
192
|
+
else if (Array.isArray(spec.paths)) {
|
|
193
|
+
for (const p of spec.paths)
|
|
194
|
+
out.push({ ...spec, path: p, paths: undefined });
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return out;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Format an artifact list as bullet lines. Mirrors POC formatArtifactList:
|
|
201
|
+
* `- /full/absolute/path`. The POC favors the full path so receivers can
|
|
202
|
+
* cd / open / cat the artifact directly without further lookup.
|
|
203
|
+
*/
|
|
204
|
+
export function formatArtifactList(artifacts, maxItems) {
|
|
205
|
+
return artifacts
|
|
206
|
+
.slice(0, maxItems)
|
|
207
|
+
.map((a) => `- ${a.path}`)
|
|
208
|
+
.join("\n");
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Compute the source-key for an artifact. Mirrors POC sourceKeyFor:
|
|
212
|
+
* prefer frontmatter[keyField], else basename sans .md extension.
|
|
213
|
+
* Coerces non-string scalars (Date, number) to string for comparison.
|
|
214
|
+
*/
|
|
215
|
+
export function sourceKeyFor(artifact, keyField) {
|
|
216
|
+
const value = artifact.frontmatter[keyField];
|
|
217
|
+
if (value === undefined || value === null || value === "") {
|
|
218
|
+
return basename(artifact.path).replace(/\.md$/, "");
|
|
219
|
+
}
|
|
220
|
+
if (typeof value === "string")
|
|
221
|
+
return value;
|
|
222
|
+
if (value instanceof Date)
|
|
223
|
+
return value.toISOString();
|
|
224
|
+
return String(value);
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=artifact-pool-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-pool-helpers.js","sourceRoot":"","sources":["../../../src/domain/policies/artifact-pool-helpers.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wCAAwC;AACxC,EAAE;AACF,iEAAiE;AACjE,qEAAqE;AACrE,gEAAgE;AAChE,0DAA0D;AAC1D,+CAA+C;AAC/C,iFAAiF;AACjF,8EAA8E;AAC9E,+CAA+C;AAC/C,yDAAyD;AACzD,EAAE;AACF,yDAAyD;AAEzD,OAAO,E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AC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAA4B,EAAE,QAAgB;IAC/E,OAAO,SAAS;SACb,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC;SAClB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;SACzB,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,QAAyB,EAAE,QAAgB;IACtE,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAC1D,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IACtD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-pool-ready.d.ts","sourceRoot":"","sources":["../../../src/domain/policies/artifact-pool-ready.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAA+B,MAAM,YAAY,CAAC;AAiBtE,eAAO,MAAM,uBAAuB,EAAE,MA8BrC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// PL-004 Phase C R1: artifact-pool-ready policy (TypeScript port of
|
|
2
|
+
// POC `lib/policies/artifact-pool-ready.mjs`).
|
|
3
|
+
//
|
|
4
|
+
// POC contract: target.session is required (top-level `target:`).
|
|
5
|
+
// Scans context.pools (array). Empty → skip(no_actionable_artifacts).
|
|
6
|
+
// Otherwise sends a formatted message ending with the standard POC
|
|
7
|
+
// pool-ready instruction line.
|
|
8
|
+
import { formatArtifactList, scanArtifactPools, } from "./artifact-pool-helpers.js";
|
|
9
|
+
const POC_POOL_READY_TRAILER = "Claim and process the next artifact, or terminally classify it with evidence. " +
|
|
10
|
+
"This is a pool-ready wake, not an approval gate, and it should not require orch to bridge the edge.";
|
|
11
|
+
export const artifactPoolReadyPolicy = {
|
|
12
|
+
name: "artifact-pool-ready",
|
|
13
|
+
async evaluate(job) {
|
|
14
|
+
if (!job.target?.session) {
|
|
15
|
+
throw Object.assign(new Error("artifact-pool-ready: target.session is required"), {
|
|
16
|
+
code: "policy_spec_invalid",
|
|
17
|
+
policy: "artifact-pool-ready",
|
|
18
|
+
field: "target.session",
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const context = job.context;
|
|
22
|
+
const artifacts = await scanArtifactPools(context.pools);
|
|
23
|
+
if (artifacts.length === 0) {
|
|
24
|
+
return { action: "skip", reason: "no_actionable_artifacts" };
|
|
25
|
+
}
|
|
26
|
+
const label = context.label ?? "artifact pool";
|
|
27
|
+
const maxItems = Number(context.max_items ?? 5);
|
|
28
|
+
const list = formatArtifactList(artifacts, maxItems);
|
|
29
|
+
const hiddenCount = Math.max(0, artifacts.length - maxItems);
|
|
30
|
+
const suffix = hiddenCount > 0 ? `\n- ... ${hiddenCount} more` : "";
|
|
31
|
+
const message = job.message ??
|
|
32
|
+
`Artifact pool ready: ${label} has ${artifacts.length} actionable artifact(s).\n${list}${suffix}\n\n${POC_POOL_READY_TRAILER}`;
|
|
33
|
+
return {
|
|
34
|
+
action: "send",
|
|
35
|
+
target: job.target,
|
|
36
|
+
message,
|
|
37
|
+
notes: { artifact_count: artifacts.length, label },
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=artifact-pool-ready.js.map
|
|
@@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S,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,WAAW,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,MAAM,OAAO,GACX,GAAG,CAAC,OAAO;YACX,wBAAwB,KAAK,QAAQ,SAAS,CAAC,MAAM,6BAA6B,IAAI,GAAG,MAAM,OAAO,sBAAsB,EAAE,CAAC;QACjI,OAAO;YACL,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,OAAO;YACP,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE;SACnD,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-artifact-required.d.ts","sourceRoot":"","sources":["../../../src/domain/policies/edge-artifact-required.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAA+B,MAAM,YAAY,CAAC;AA6BtE,eAAO,MAAM,0BAA0B,EAAE,MAsExC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// PL-004 Phase C R1: edge-artifact-required policy (TypeScript port of
|
|
2
|
+
// POC `lib/policies/edge-artifact-required.mjs`).
|
|
3
|
+
//
|
|
4
|
+
// R1 fix (guard blocker 2): preserves the POC contract.
|
|
5
|
+
// - Spec uses `context.source` (singular) and `context.target`
|
|
6
|
+
// (singular) pool specs. Each may have `path` or `paths`.
|
|
7
|
+
// - Edge-satisfaction: a downstream target artifact satisfies a
|
|
8
|
+
// source iff target.raw CONTAINS the source key. NOT a frontmatter
|
|
9
|
+
// match — body reference suffices.
|
|
10
|
+
// - Target scan overrides include_statuses to [] so any downstream
|
|
11
|
+
// state counts as "exists".
|
|
12
|
+
// - Delivery target is `job.target.session` (top-level).
|
|
13
|
+
// - Label key is `context.edge_label` (matches POC).
|
|
14
|
+
import { scanArtifactPools, sourceKeyFor, } from "./artifact-pool-helpers.js";
|
|
15
|
+
function targetContainsKey(targets, key) {
|
|
16
|
+
return targets.some((t) => t.raw.includes(key));
|
|
17
|
+
}
|
|
18
|
+
function expandPoolSides(spec) {
|
|
19
|
+
if (!spec)
|
|
20
|
+
return [];
|
|
21
|
+
if (Array.isArray(spec.paths)) {
|
|
22
|
+
return spec.paths.map((p) => ({ ...spec, path: p, paths: undefined }));
|
|
23
|
+
}
|
|
24
|
+
return [spec];
|
|
25
|
+
}
|
|
26
|
+
export const edgeArtifactRequiredPolicy = {
|
|
27
|
+
name: "edge-artifact-required",
|
|
28
|
+
async evaluate(job) {
|
|
29
|
+
if (!job.target?.session) {
|
|
30
|
+
throw Object.assign(new Error("edge-artifact-required: target.session is required"), {
|
|
31
|
+
code: "policy_spec_invalid",
|
|
32
|
+
policy: "edge-artifact-required",
|
|
33
|
+
field: "target.session",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const context = job.context;
|
|
37
|
+
const source = context.source;
|
|
38
|
+
const target = context.target;
|
|
39
|
+
if (!source?.path && !Array.isArray(source?.paths)) {
|
|
40
|
+
throw Object.assign(new Error("edge-artifact-required: context.source.path is required"), {
|
|
41
|
+
code: "policy_spec_invalid",
|
|
42
|
+
policy: "edge-artifact-required",
|
|
43
|
+
field: "context.source.path",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (!target?.path && !Array.isArray(target?.paths)) {
|
|
47
|
+
throw Object.assign(new Error("edge-artifact-required: context.target.path is required"), {
|
|
48
|
+
code: "policy_spec_invalid",
|
|
49
|
+
policy: "edge-artifact-required",
|
|
50
|
+
field: "context.target.path",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const sourcePools = expandPoolSides(source);
|
|
54
|
+
const targetPools = expandPoolSides(target).map((p) => ({
|
|
55
|
+
...p,
|
|
56
|
+
include_statuses: [],
|
|
57
|
+
}));
|
|
58
|
+
const keyField = source?.key_field ?? "entry";
|
|
59
|
+
const sources = await scanArtifactPools(sourcePools);
|
|
60
|
+
const targets = await scanArtifactPools(targetPools);
|
|
61
|
+
const missing = [];
|
|
62
|
+
for (const s of sources) {
|
|
63
|
+
const key = sourceKeyFor(s, keyField);
|
|
64
|
+
if (!targetContainsKey(targets, key))
|
|
65
|
+
missing.push(s);
|
|
66
|
+
}
|
|
67
|
+
if (missing.length === 0) {
|
|
68
|
+
return { action: "skip", reason: "no_missing_edge_artifacts" };
|
|
69
|
+
}
|
|
70
|
+
const label = context.edge_label ?? "artifact edge";
|
|
71
|
+
const maxItems = Number(context.max_items ?? 5);
|
|
72
|
+
const list = missing
|
|
73
|
+
.slice(0, maxItems)
|
|
74
|
+
.map((a) => `- ${sourceKeyFor(a, keyField)} (${a.path})`)
|
|
75
|
+
.join("\n");
|
|
76
|
+
const hiddenCount = Math.max(0, missing.length - maxItems);
|
|
77
|
+
const suffix = hiddenCount > 0 ? `\n- ... ${hiddenCount} more` : "";
|
|
78
|
+
const message = job.message ??
|
|
79
|
+
`Artifact edge repair needed: ${label} has ${missing.length} upstream artifact(s) with no matching downstream artifact.\n${list}${suffix}\n\n` +
|
|
80
|
+
"Producer loop owns creating the missing downstream artifact. " +
|
|
81
|
+
"Do not wait for orch to bridge this manually; repair the edge or record the blocker with evidence.";
|
|
82
|
+
return {
|
|
83
|
+
action: "send",
|
|
84
|
+
target: job.target,
|
|
85
|
+
message,
|
|
86
|
+
notes: { missing_count: missing.length, label },
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=edge-artifact-required.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-artifact-required.js","sourceRoot":"","sources":["../../../src/domain/policies/edge-artifact-required.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,kDAAkD;AAClD,EAAE;AACF,wDAAwD;AACxD,iEAAiE;AACjE,8DAA8D;AAC9D,kEAAkE;AAClE,uEAAuE;AACvE,uCAA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,EAA+B,MAAM,YAAY,CAAC;AAMtE,eAAO,MAAM,sBAAsB,EAAE,MAqBpC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// PL-004 Phase C: periodic-reminder policy (TypeScript port of
|
|
2
|
+
// POC `lib/policies/periodic-reminder.mjs`).
|
|
3
|
+
//
|
|
4
|
+
// POC contract: target.session is required (top-level `target:` in
|
|
5
|
+
// spec_yaml). Message comes from `job.message` (top-level) OR
|
|
6
|
+
// `context.message`. Returns action=send unconditionally when invoked
|
|
7
|
+
// (the scheduler gates on interval; this policy itself is stateless).
|
|
8
|
+
export const periodicReminderPolicy = {
|
|
9
|
+
name: "periodic-reminder",
|
|
10
|
+
async evaluate(job) {
|
|
11
|
+
if (!job.target?.session) {
|
|
12
|
+
throw Object.assign(new Error("periodic-reminder: target.session is required"), {
|
|
13
|
+
code: "policy_spec_invalid",
|
|
14
|
+
policy: "periodic-reminder",
|
|
15
|
+
field: "target.session",
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const context = job.context;
|
|
19
|
+
const message = job.message ?? context.message;
|
|
20
|
+
if (!message) {
|
|
21
|
+
throw Object.assign(new Error("periodic-reminder: message is required (top-level message or context.message)"), {
|
|
22
|
+
code: "policy_spec_invalid",
|
|
23
|
+
policy: "periodic-reminder",
|
|
24
|
+
field: "message",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return { action: "send", target: job.target, message };
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=periodic-reminder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"periodic-reminder.js","sourceRoot":"","sources":["../../../src/domain/policies/periodic-reminder.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6CAA6C;AAC7C,EAAE;AACF,mEAAmE;AACnE,8DAA8D;AAC9D,sEAAsE;AACtE,sEAAsE;AAQtE,MAAM,CAAC,MAAM,sBAAsB,GAAW;IAC5C,IAAI,EAAE,mBAAmB;IACzB,KAAK,CAAC,QAAQ,CAAC,GAAc;QAC3B,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;YACzB,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+CAA+C,CAAC,EAAE;gBAC9E,IAAI,EAAE,qBAAqB;gBAC3B,MAAM,EAAE,mBAAmB;gBAC3B,KAAK,EAAE,gBAAgB;aACxB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,OAAkC,CAAC;QACvD,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+EAA+E,CAAC,EAAE;gBAC9G,IAAI,EAAE,qBAAqB;gBAC3B,MAAM,EAAE,mBAAmB;gBAC3B,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;IACzD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface PolicyJob {
|
|
2
|
+
jobId: string;
|
|
3
|
+
policy: string;
|
|
4
|
+
/**
|
|
5
|
+
* POC-shape target object. Built from spec_yaml top-level `target:`
|
|
6
|
+
* block when present; otherwise falls back to `{session: registered
|
|
7
|
+
* targetSession}`. Policies access `job.target.session` per POC.
|
|
8
|
+
*/
|
|
9
|
+
target: {
|
|
10
|
+
session: string;
|
|
11
|
+
};
|
|
12
|
+
/** Optional top-level message override (POC pattern: `job.message`). */
|
|
13
|
+
message?: string;
|
|
14
|
+
intervalSeconds: number;
|
|
15
|
+
activeWakeIntervalSeconds: number | null;
|
|
16
|
+
scanIntervalSeconds: number | null;
|
|
17
|
+
/** Parsed `context:` block from the operator-supplied spec_yaml. */
|
|
18
|
+
context: Record<string, unknown>;
|
|
19
|
+
lastEvaluationAt: string | null;
|
|
20
|
+
lastFireAt: string | null;
|
|
21
|
+
registeredBySession: string;
|
|
22
|
+
registeredAt: string;
|
|
23
|
+
}
|
|
24
|
+
export type PolicyEvaluation = {
|
|
25
|
+
action: "send";
|
|
26
|
+
target: {
|
|
27
|
+
session: string;
|
|
28
|
+
};
|
|
29
|
+
message: string;
|
|
30
|
+
notes?: Record<string, unknown>;
|
|
31
|
+
} | {
|
|
32
|
+
action: "skip";
|
|
33
|
+
reason: string;
|
|
34
|
+
notes?: Record<string, unknown>;
|
|
35
|
+
} | {
|
|
36
|
+
action: "terminal";
|
|
37
|
+
reason: string;
|
|
38
|
+
notes?: Record<string, unknown>;
|
|
39
|
+
};
|
|
40
|
+
export interface Policy {
|
|
41
|
+
/** Stable identifier matching watchdog_jobs.policy enum. */
|
|
42
|
+
readonly name: string;
|
|
43
|
+
/**
|
|
44
|
+
* Pure evaluation. No I/O beyond filesystem reads (artifact-pool
|
|
45
|
+
* scans). Throws only for hard contract violations (missing required
|
|
46
|
+
* spec fields); recoverable conditions (no actionable artifacts,
|
|
47
|
+
* recent successful run) MUST return action=skip.
|
|
48
|
+
*/
|
|
49
|
+
evaluate(job: PolicyJob): Promise<PolicyEvaluation>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/domain/policies/types.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACjG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACnE;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAE5E,MAAM,WAAW,MAAM;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// PL-004 Phase C: shared policy contract types.
|
|
2
|
+
//
|
|
3
|
+
// Each watchdog policy implements `evaluate(job)` returning a
|
|
4
|
+
// PolicyEvaluation. Pure: no side-effects, no event-bus, no DB.
|
|
5
|
+
// The watchdog-policy-engine maps `action: send` to a delivery call,
|
|
6
|
+
// records meaningful outcomes via watchdog-history-log, and emits
|
|
7
|
+
// the corresponding RigEvent.
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/domain/policies/types.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,8DAA8D;AAC9D,gEAAgE;AAChE,qEAAqE;AACrE,kEAAkE;AAClE,8BAA8B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type Database from "better-sqlite3";
|
|
2
|
+
import type { Policy } from "./types.js";
|
|
3
|
+
export interface WorkflowKeepaliveDeps {
|
|
4
|
+
db: Database.Database;
|
|
5
|
+
}
|
|
6
|
+
export declare function makeWorkflowKeepalivePolicy(deps: WorkflowKeepaliveDeps): Policy;
|
|
7
|
+
//# sourceMappingURL=workflow-keepalive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-keepalive.d.ts","sourceRoot":"","sources":["../../../src/domain/policies/workflow-keepalive.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAA+B,MAAM,YAAY,CAAC;AAuBtE,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;CACvB;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAoG/E"}
|