@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
|
@@ -56,6 +56,19 @@ export class ClaudeResumeAdapter {
|
|
|
56
56
|
message: "Claude resume failed: no conversation found for the requested session",
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
+
// L3: Claude resume-selection prompt → attention_required (not failed).
|
|
60
|
+
// The runtime is alive and recoverable but blocked on operator selection.
|
|
61
|
+
// Decision 2 forbids auto-answering; surface evidence and let the
|
|
62
|
+
// operator/UI act, then later reconciliation may upgrade to
|
|
63
|
+
// operator_recovered when the pane reaches usable state.
|
|
64
|
+
if (probe.status === "attention_required") {
|
|
65
|
+
return {
|
|
66
|
+
ok: false,
|
|
67
|
+
code: "attention_required",
|
|
68
|
+
message: probe.detail,
|
|
69
|
+
evidence: paneContent.split("\n").slice(-12).join("\n"),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
59
72
|
if (probe.status === "resumed") {
|
|
60
73
|
return { ok: true };
|
|
61
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-resume.js","sourceRoot":"","sources":["../../src/adapters/claude-resume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-resume.js","sourceRoot":"","sources":["../../src/adapters/claude-resume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAU3E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;AAC3D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAQ5E,MAAM,OAAO,mBAAmB;IAEpB;IACA;IAFV,YACU,IAAiB,EACjB,UAA+B,EAAE;QADjC,SAAI,GAAJ,IAAI,CAAa;QACjB,YAAO,GAAP,OAAO,CAA0B;IACxC,CAAC;IAEJ,SAAS,CAAC,UAAyB,EAAE,WAA0B;QAC7D,IAAI,CAAC,UAAU,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU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ResumeResult };
|
|
4
|
+
interface CodexResumeOptions {
|
|
5
|
+
pollMs?: number;
|
|
6
|
+
maxWaitMs?: number;
|
|
7
|
+
sleep?: (ms: number) => Promise<void>;
|
|
8
|
+
}
|
|
4
9
|
export declare class CodexResumeAdapter {
|
|
5
10
|
private tmux;
|
|
6
|
-
|
|
11
|
+
private options;
|
|
12
|
+
constructor(tmux: TmuxAdapter, options?: CodexResumeOptions);
|
|
7
13
|
canResume(resumeType: string | null, resumeToken: string | null): boolean;
|
|
8
14
|
resume(tmuxSessionName: string, resumeType: string | null, resumeToken: string | null, _cwd: string): Promise<ResumeResult>;
|
|
15
|
+
private verifyResume;
|
|
9
16
|
}
|
|
10
17
|
//# sourceMappingURL=codex-resume.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-resume.d.ts","sourceRoot":"","sources":["../../src/adapters/codex-resume.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-resume.d.ts","sourceRoot":"","sources":["../../src/adapters/codex-resume.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOvD,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC;AAE7B,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;gBADP,IAAI,EAAE,WAAW,EACjB,OAAO,GAAE,kBAAuB;IAG1C,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IASnE,MAAM,CACV,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC;YA+BV,YAAY;CAuE3B"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
1
2
|
import { shellQuote } from "./shell-quote.js";
|
|
3
|
+
import { assessNativeResumeProbe } from "../domain/native-resume-probe.js";
|
|
2
4
|
const CODEX_TYPES = new Set(["codex_id", "codex_last"]);
|
|
5
|
+
const SHELL_COMMANDS = new Set(["bash", "fish", "nu", "sh", "tmux", "zsh"]);
|
|
3
6
|
export class CodexResumeAdapter {
|
|
4
7
|
tmux;
|
|
5
|
-
|
|
8
|
+
options;
|
|
9
|
+
constructor(tmux, options = {}) {
|
|
6
10
|
this.tmux = tmux;
|
|
11
|
+
this.options = options;
|
|
7
12
|
}
|
|
8
13
|
canResume(resumeType, resumeToken) {
|
|
9
14
|
if (!resumeType || !CODEX_TYPES.has(resumeType))
|
|
@@ -16,9 +21,6 @@ export class CodexResumeAdapter {
|
|
|
16
21
|
return false;
|
|
17
22
|
return true;
|
|
18
23
|
}
|
|
19
|
-
// NOTE: Resume success is fire-and-forget. sendText succeeding means the
|
|
20
|
-
// command was typed into the tmux pane, NOT that the harness actually resumed.
|
|
21
|
-
// TODO(Phase 3): Add resume verification (e.g., poll harness status endpoint).
|
|
22
24
|
async resume(tmuxSessionName, resumeType, resumeToken, _cwd) {
|
|
23
25
|
if (!this.canResume(resumeType, resumeToken)) {
|
|
24
26
|
return { ok: false, code: "no_resume", message: "Codex resume not available" };
|
|
@@ -38,7 +40,74 @@ export class CodexResumeAdapter {
|
|
|
38
40
|
await this.tmux.sendKeys(tmuxSessionName, ["C-c"]);
|
|
39
41
|
return { ok: false, code: "resume_failed", message: keyResult.message };
|
|
40
42
|
}
|
|
41
|
-
return
|
|
43
|
+
return this.verifyResume(tmuxSessionName);
|
|
44
|
+
}
|
|
45
|
+
// Mirrors ClaudeResumeAdapter.verifyResume: poll the pane, run the native
|
|
46
|
+
// probe, return resumed / retry_fresh / attention_required / resume_failed
|
|
47
|
+
// based on observable runtime state. The `attention_required` outcome
|
|
48
|
+
// (Codex auth refusal — stored OAuth token can no longer be refreshed)
|
|
49
|
+
// closes the deferral recorded by the lifecycle scenario matrix slice.
|
|
50
|
+
async verifyResume(tmuxSessionName) {
|
|
51
|
+
const pollMs = this.options.pollMs ?? 200;
|
|
52
|
+
const maxWaitMs = this.options.maxWaitMs ?? 5_000;
|
|
53
|
+
const sleepFn = this.options.sleep ?? sleep;
|
|
54
|
+
const attempts = Math.max(1, Math.floor(maxWaitMs / Math.max(pollMs, 1)) + 1);
|
|
55
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
56
|
+
const paneCommand = await this.tmux.getPaneCommand(tmuxSessionName);
|
|
57
|
+
const paneContent = (await this.tmux.capturePaneContent(tmuxSessionName, 40)) ?? "";
|
|
58
|
+
const probe = assessNativeResumeProbe({
|
|
59
|
+
runtime: "codex",
|
|
60
|
+
paneCommand,
|
|
61
|
+
paneContent,
|
|
62
|
+
});
|
|
63
|
+
if (probe.code === "no_saved_session") {
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
code: "retry_fresh",
|
|
67
|
+
message: "Codex resume failed: no saved session found for the requested token",
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
// Codex auth-refusal is alive-but-recoverable: the stored access token
|
|
71
|
+
// can no longer be refreshed. Surface evidence (last 12 pane lines) so
|
|
72
|
+
// the operator/UI can decide whether to `codex login` and continue, or
|
|
73
|
+
// mark the seat permanently rebuilt. Mirror Claude's evidence shape.
|
|
74
|
+
if (probe.status === "attention_required") {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
code: "attention_required",
|
|
78
|
+
message: probe.detail,
|
|
79
|
+
evidence: paneContent.split("\n").slice(-12).join("\n"),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (probe.status === "resumed") {
|
|
83
|
+
return { ok: true };
|
|
84
|
+
}
|
|
85
|
+
if (attempt < attempts - 1) {
|
|
86
|
+
await sleepFn(pollMs);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const finalCommand = await this.tmux.getPaneCommand(tmuxSessionName);
|
|
90
|
+
const finalContent = (await this.tmux.capturePaneContent(tmuxSessionName, 40)) ?? "";
|
|
91
|
+
const finalProbe = assessNativeResumeProbe({
|
|
92
|
+
runtime: "codex",
|
|
93
|
+
paneCommand: finalCommand,
|
|
94
|
+
paneContent: finalContent,
|
|
95
|
+
});
|
|
96
|
+
if (finalProbe.status === "resumed") {
|
|
97
|
+
return { ok: true };
|
|
98
|
+
}
|
|
99
|
+
if (finalCommand && SHELL_COMMANDS.has(finalCommand)) {
|
|
100
|
+
return {
|
|
101
|
+
ok: false,
|
|
102
|
+
code: "retry_fresh",
|
|
103
|
+
message: "Codex resume failed: pane returned to shell instead of entering Codex",
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
ok: false,
|
|
108
|
+
code: "resume_failed",
|
|
109
|
+
message: "Codex resume failed: timed out waiting for Codex to become active",
|
|
110
|
+
};
|
|
42
111
|
}
|
|
43
112
|
}
|
|
44
113
|
//# sourceMappingURL=codex-resume.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-resume.js","sourceRoot":"","sources":["../../src/adapters/codex-resume.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-resume.js","sourceRoot":"","sources":["../../src/adapters/codex-resume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E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EAAE,CAAC;QACrF,MAAM,UAAU,GAAG,uBAAuB,CAAC;YACzC,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,YAAY;SAC1B,CAAC,CAAC;QAEH,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QACtB,CAAC;QAED,IAAI,YAAY,IAAI,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YACrD,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,uEAAuE;aACjF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,mEAAmE;SAC7E,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -22,6 +22,7 @@ export declare class CodexRuntimeAdapter implements RuntimeAdapter {
|
|
|
22
22
|
private readThreadIdByPid;
|
|
23
23
|
private sleep;
|
|
24
24
|
private resolveHomeDirByPid;
|
|
25
|
+
private activityHookRelayAssetPath;
|
|
25
26
|
constructor(deps: {
|
|
26
27
|
tmux: TmuxAdapter;
|
|
27
28
|
fsOps: CodexAdapterFsOps;
|
|
@@ -33,6 +34,7 @@ export declare class CodexRuntimeAdapter implements RuntimeAdapter {
|
|
|
33
34
|
readThreadIdByPid?: (pid: number) => string | undefined;
|
|
34
35
|
resolveHomeDirByPid?: ResolveHomeDirByPid;
|
|
35
36
|
sleep?: (ms: number) => Promise<void>;
|
|
37
|
+
activityHookRelayAssetPath?: string;
|
|
36
38
|
});
|
|
37
39
|
listInstalled(binding: NodeBinding): Promise<InstalledResource[]>;
|
|
38
40
|
project(plan: ProjectionPlan, binding: NodeBinding): Promise<ProjectionResult>;
|
|
@@ -40,13 +42,17 @@ export declare class CodexRuntimeAdapter implements RuntimeAdapter {
|
|
|
40
42
|
launchHarness(binding: NodeBinding, opts: {
|
|
41
43
|
name: string;
|
|
42
44
|
resumeToken?: string;
|
|
45
|
+
forkSource?: import("../domain/runtime-adapter.js").ForkSource;
|
|
43
46
|
}): Promise<HarnessLaunchResult>;
|
|
47
|
+
private buildQueueStateAddDirArg;
|
|
44
48
|
checkReady(binding: NodeBinding): Promise<ReadinessResult>;
|
|
49
|
+
private dismissSkippableCodexUpdatePrompt;
|
|
45
50
|
ensureManagedBootstrap(binding: {
|
|
46
51
|
cwd?: string | null;
|
|
47
52
|
}): void;
|
|
48
53
|
private projectEntry;
|
|
49
54
|
private resolveTargetDir;
|
|
55
|
+
private applyRuntimeResource;
|
|
50
56
|
/**
|
|
51
57
|
* Merge a managed block into the target guidance file. Returns `true` when
|
|
52
58
|
* the merge happened, `false` when intentionally skipped (rig-role). Callers
|
|
@@ -56,11 +62,9 @@ export declare class CodexRuntimeAdapter implements RuntimeAdapter {
|
|
|
56
62
|
private mergeGuidance;
|
|
57
63
|
private detectDeliveryHint;
|
|
58
64
|
private provisionWorkspaceTrust;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*/
|
|
63
|
-
private provisionMcps;
|
|
65
|
+
private provisionActivityHooks;
|
|
66
|
+
private readJsonObject;
|
|
67
|
+
private readJsonObjectField;
|
|
64
68
|
private workspaceTrustKeys;
|
|
65
69
|
private captureFreshThreadId;
|
|
66
70
|
private verifyResumeLaunch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-runtime-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/codex-runtime-adapter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EACV,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAChD,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAC3E,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAA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AE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0B9E,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAsDlG,aAAa,CACjB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,8BAA8B,EAAE,UAAU,CAAA;KAAE,GAC3G,OAAO,CAAC,mBAAmB,CAAC;IAiF/B,OAAO,CAAC,wBAAwB;IAU1B,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC;YAqBlD,iCAAiC;IAiC/C,sBAAsB,CAAC,OAAO,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI;IAI9D,OAAO,CAAC,YAAY;IAmCpB,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,oBAAoB;IAe5B;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,uBAAuB;IAsB/B,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,kBAAkB;YAUZ,oBAAoB;YAsBpB,kBAAkB;IAqEhC,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,oBAAoB;CAO7B"}
|
|
@@ -20,6 +20,7 @@ export class CodexRuntimeAdapter {
|
|
|
20
20
|
readThreadIdByPid;
|
|
21
21
|
sleep;
|
|
22
22
|
resolveHomeDirByPid;
|
|
23
|
+
activityHookRelayAssetPath;
|
|
23
24
|
constructor(deps) {
|
|
24
25
|
this.tmux = deps.tmux;
|
|
25
26
|
this.fs = deps.fsOps;
|
|
@@ -27,6 +28,7 @@ export class CodexRuntimeAdapter {
|
|
|
27
28
|
this.readThreadIdByPid = deps.readThreadIdByPid ?? ((pid) => this.readThreadIdFromLogs(pid));
|
|
28
29
|
this.resolveHomeDirByPid = deps.resolveHomeDirByPid ?? defaultResolveHomeDirByPid;
|
|
29
30
|
this.sleep = deps.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
31
|
+
this.activityHookRelayAssetPath = deps.activityHookRelayAssetPath ?? null;
|
|
30
32
|
}
|
|
31
33
|
async listInstalled(binding) {
|
|
32
34
|
const results = [];
|
|
@@ -69,12 +71,13 @@ export class CodexRuntimeAdapter {
|
|
|
69
71
|
catch (err) {
|
|
70
72
|
console.error(`[openrig] codex bootstrap warning: ${err.message}`);
|
|
71
73
|
}
|
|
72
|
-
// Best-effort: provision
|
|
74
|
+
// Best-effort: provision project-local provider hooks. The hook token is
|
|
75
|
+
// supplied through tmux session env, never written to provider config.
|
|
73
76
|
try {
|
|
74
|
-
this.
|
|
77
|
+
this.provisionActivityHooks(binding);
|
|
75
78
|
}
|
|
76
79
|
catch (err) {
|
|
77
|
-
console.error(`[openrig] codex
|
|
80
|
+
console.error(`[openrig] codex activity hook provisioning warning: ${err.message}`);
|
|
78
81
|
}
|
|
79
82
|
let delivered = 0;
|
|
80
83
|
const failed = [];
|
|
@@ -123,9 +126,53 @@ export class CodexRuntimeAdapter {
|
|
|
123
126
|
if (!binding.tmuxSession) {
|
|
124
127
|
return { ok: false, error: "No tmux session bound — cannot launch Codex harness" };
|
|
125
128
|
}
|
|
129
|
+
if (opts.resumeToken && opts.forkSource) {
|
|
130
|
+
return { ok: false, error: "resumeToken and forkSource are mutually exclusive — pick one" };
|
|
131
|
+
}
|
|
132
|
+
const model = binding.model?.trim();
|
|
133
|
+
const modelArg = model ? ` -m ${shellQuote(model)}` : "";
|
|
134
|
+
const profile = binding.codexConfigProfile?.trim();
|
|
135
|
+
const profileArg = profile ? ` -p ${shellQuote(profile)}` : "";
|
|
136
|
+
const gitDirArg = ` --add-dir ${shellQuote(nodePath.join(binding.cwd, ".git"))}`;
|
|
137
|
+
const queueStateDirArg = this.buildQueueStateAddDirArg(opts.name);
|
|
138
|
+
// Fork branch: `codex fork <parent_thread_id>`. Captures the NEW thread id
|
|
139
|
+
// post-fork. Parent thread id is NOT persisted onto the new seat record
|
|
140
|
+
// (identity-honesty bedrock).
|
|
141
|
+
if (opts.forkSource) {
|
|
142
|
+
if (opts.forkSource.kind !== "native_id") {
|
|
143
|
+
return {
|
|
144
|
+
ok: false,
|
|
145
|
+
error: `codex fork: ref.kind="${opts.forkSource.kind}" is not supported in v1; use ref.kind="native_id" with the prior conversation's thread id`,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const parentId = opts.forkSource.value?.trim();
|
|
149
|
+
if (!parentId) {
|
|
150
|
+
return { ok: false, error: "codex fork: forkSource.value is required (parent native_id)" };
|
|
151
|
+
}
|
|
152
|
+
const cmd = `codex${profileArg} fork${queueStateDirArg} ${shellQuote(parentId)}`;
|
|
153
|
+
const textResult = await this.tmux.sendText(binding.tmuxSession, cmd);
|
|
154
|
+
if (!textResult.ok) {
|
|
155
|
+
return { ok: false, error: `Failed to send launch command: ${textResult.message}` };
|
|
156
|
+
}
|
|
157
|
+
const enterResult = await this.tmux.sendKeys(binding.tmuxSession, ["Enter"]);
|
|
158
|
+
if (!enterResult.ok) {
|
|
159
|
+
return { ok: false, error: `Failed to send Enter: ${enterResult.message}` };
|
|
160
|
+
}
|
|
161
|
+
await this.dismissSkippableCodexUpdatePrompt(binding.tmuxSession);
|
|
162
|
+
const threadId = await this.captureFreshThreadId(binding);
|
|
163
|
+
if (!threadId) {
|
|
164
|
+
return {
|
|
165
|
+
ok: false,
|
|
166
|
+
error: "codex fork: could not capture new post-fork thread id",
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
return { ok: true, resumeToken: threadId, resumeType: "codex_id" };
|
|
170
|
+
}
|
|
126
171
|
const cmd = opts.resumeToken
|
|
127
|
-
? `codex resume ${opts.resumeToken}`
|
|
128
|
-
:
|
|
172
|
+
? `codex${profileArg} resume${queueStateDirArg} ${shellQuote(opts.resumeToken)}`
|
|
173
|
+
: profile
|
|
174
|
+
? `codex${profileArg} -C ${shellQuote(binding.cwd)}${gitDirArg}${queueStateDirArg}${modelArg}`
|
|
175
|
+
: `codex -C ${shellQuote(binding.cwd)}${gitDirArg}${queueStateDirArg}${modelArg} -a on-request -s danger-full-access`;
|
|
129
176
|
const textResult = await this.tmux.sendText(binding.tmuxSession, cmd);
|
|
130
177
|
if (!textResult.ok) {
|
|
131
178
|
return { ok: false, error: `Failed to send launch command: ${textResult.message}` };
|
|
@@ -134,6 +181,7 @@ export class CodexRuntimeAdapter {
|
|
|
134
181
|
if (!enterResult.ok) {
|
|
135
182
|
return { ok: false, error: `Failed to send Enter: ${enterResult.message}` };
|
|
136
183
|
}
|
|
184
|
+
await this.dismissSkippableCodexUpdatePrompt(binding.tmuxSession);
|
|
137
185
|
if (opts.resumeToken) {
|
|
138
186
|
const verification = await this.verifyResumeLaunch(binding.tmuxSession);
|
|
139
187
|
if (!verification.ok)
|
|
@@ -146,6 +194,15 @@ export class CodexRuntimeAdapter {
|
|
|
146
194
|
}
|
|
147
195
|
return { ok: true };
|
|
148
196
|
}
|
|
197
|
+
buildQueueStateAddDirArg(sessionName) {
|
|
198
|
+
const identity = parseCanonicalSessionName(sessionName);
|
|
199
|
+
if (!identity)
|
|
200
|
+
return "";
|
|
201
|
+
const sharedDocsRoot = process.env.OPENRIG_SHARED_DOCS_ROOT?.trim()
|
|
202
|
+
|| nodePath.join(this.fs.homedir ?? os.homedir(), "code", "substrate", "shared-docs");
|
|
203
|
+
const queueStateRoot = nodePath.join(sharedDocsRoot, "rigs", identity.rig, "state", identity.pod);
|
|
204
|
+
return ` --add-dir ${shellQuote(queueStateRoot)}`;
|
|
205
|
+
}
|
|
149
206
|
async checkReady(binding) {
|
|
150
207
|
if (!binding.tmuxSession) {
|
|
151
208
|
return { ready: false, reason: "No tmux session bound" };
|
|
@@ -165,10 +222,43 @@ export class CodexRuntimeAdapter {
|
|
|
165
222
|
return { ready: true };
|
|
166
223
|
return { ready: false, reason: probe.detail, code: probe.code };
|
|
167
224
|
}
|
|
225
|
+
async dismissSkippableCodexUpdatePrompt(tmuxSession, attempts = 6) {
|
|
226
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
227
|
+
const paneCommand = await this.tmux.getPaneCommand(tmuxSession);
|
|
228
|
+
const paneContent = (await this.tmux.capturePaneContent(tmuxSession, 40)) ?? "";
|
|
229
|
+
const probe = assessNativeResumeProbe({
|
|
230
|
+
runtime: "codex",
|
|
231
|
+
paneCommand,
|
|
232
|
+
paneContent,
|
|
233
|
+
});
|
|
234
|
+
if (probe.code === "update_gate") {
|
|
235
|
+
if (!isSkippableCodexUpdatePrompt(paneContent))
|
|
236
|
+
return false;
|
|
237
|
+
const textResult = await this.tmux.sendText(tmuxSession, "3");
|
|
238
|
+
if (!textResult.ok)
|
|
239
|
+
return false;
|
|
240
|
+
const enterResult = await this.tmux.sendKeys(tmuxSession, ["Enter"]);
|
|
241
|
+
if (!enterResult.ok)
|
|
242
|
+
return false;
|
|
243
|
+
await this.sleep(500);
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
if (probe.status === "resumed" || probe.code === "trust_gate") {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
if (attempt < attempts - 1) {
|
|
250
|
+
await this.sleep(200);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
168
255
|
ensureManagedBootstrap(binding) {
|
|
169
256
|
this.provisionWorkspaceTrust(binding.cwd ?? null);
|
|
170
257
|
}
|
|
171
258
|
projectEntry(entry, cwd) {
|
|
259
|
+
if (entry.category === "runtime_resource" && this.applyRuntimeResource(entry)) {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
172
262
|
if (entry.category === "guidance" && entry.mergeStrategy === "managed_block") {
|
|
173
263
|
const targetPath = nodePath.join(cwd, "AGENTS.md");
|
|
174
264
|
const content = this.fs.readFile(entry.absolutePath);
|
|
@@ -209,6 +299,18 @@ export class CodexRuntimeAdapter {
|
|
|
209
299
|
default: return null;
|
|
210
300
|
}
|
|
211
301
|
}
|
|
302
|
+
applyRuntimeResource(entry) {
|
|
303
|
+
if (entry.resourceType !== "codex_config_fragment") {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
const home = this.fs.homedir ?? os.homedir();
|
|
307
|
+
const configPath = nodePath.join(home, ".codex", "config.toml");
|
|
308
|
+
this.fs.mkdirp(nodePath.dirname(configPath));
|
|
309
|
+
const existing = this.fs.exists(configPath) ? this.fs.readFile(configPath) : "";
|
|
310
|
+
const fragment = this.fs.readFile(entry.absolutePath);
|
|
311
|
+
this.fs.writeFile(configPath, upsertManagedCodexConfigFragment(existing, entry.effectiveId, fragment));
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
212
314
|
/**
|
|
213
315
|
* Merge a managed block into the target guidance file. Returns `true` when
|
|
214
316
|
* the merge happened, `false` when intentionally skipped (rig-role). Callers
|
|
@@ -254,33 +356,45 @@ export class CodexRuntimeAdapter {
|
|
|
254
356
|
}
|
|
255
357
|
this.fs.writeFile(configPath, content);
|
|
256
358
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
* Appends to ~/.codex/config.toml if the MCP entries don't already exist.
|
|
260
|
-
*/
|
|
261
|
-
provisionMcps() {
|
|
262
|
-
const home = this.fs.homedir ?? os.homedir();
|
|
263
|
-
if (!home)
|
|
359
|
+
provisionActivityHooks(binding) {
|
|
360
|
+
if (!binding.cwd || !this.activityHookRelayAssetPath)
|
|
264
361
|
return;
|
|
265
|
-
const
|
|
266
|
-
this.fs.mkdirp(nodePath.dirname(
|
|
267
|
-
|
|
362
|
+
const relayDest = nodePath.join(binding.cwd, ".openrig", "activity-hook-relay.cjs");
|
|
363
|
+
this.fs.mkdirp(nodePath.dirname(relayDest));
|
|
364
|
+
this.fs.writeFile(relayDest, this.fs.readFile(this.activityHookRelayAssetPath));
|
|
365
|
+
const codexDir = nodePath.join(binding.cwd, ".codex");
|
|
366
|
+
this.fs.mkdirp(codexDir);
|
|
367
|
+
const hooksPath = nodePath.join(codexDir, "hooks.json");
|
|
368
|
+
const hooksConfig = this.readJsonObject(hooksPath);
|
|
369
|
+
const hooks = this.readJsonObjectField(hooksConfig, "hooks");
|
|
370
|
+
const command = `node ${shellQuote(relayDest)}`;
|
|
371
|
+
for (const event of ["SessionStart", "UserPromptSubmit", "Stop"]) {
|
|
372
|
+
upsertCommandHook(hooks, event, command);
|
|
373
|
+
}
|
|
374
|
+
hooksConfig["hooks"] = hooks;
|
|
375
|
+
this.fs.writeFile(hooksPath, `${JSON.stringify(hooksConfig, null, 2)}\n`);
|
|
376
|
+
const configPath = nodePath.join(codexDir, "config.toml");
|
|
377
|
+
const existingConfig = this.fs.exists(configPath) ? this.fs.readFile(configPath) : "";
|
|
378
|
+
this.fs.writeFile(configPath, upsertCodexHooksFeature(existingConfig));
|
|
379
|
+
}
|
|
380
|
+
readJsonObject(path) {
|
|
268
381
|
try {
|
|
269
|
-
if (this.fs.exists(
|
|
270
|
-
|
|
382
|
+
if (!this.fs.exists(path))
|
|
383
|
+
return {};
|
|
384
|
+
const parsed = JSON.parse(this.fs.readFile(path));
|
|
385
|
+
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)
|
|
386
|
+
? parsed
|
|
387
|
+
: {};
|
|
271
388
|
}
|
|
272
389
|
catch {
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
// Add Exa if not present
|
|
276
|
-
if (!content.includes('[mcp_servers.exa]')) {
|
|
277
|
-
content += '\n[mcp_servers.exa]\nurl = "https://mcp.exa.ai/mcp"\n';
|
|
278
|
-
}
|
|
279
|
-
// Add Context7 if not present
|
|
280
|
-
if (!content.includes('[mcp_servers.context7]')) {
|
|
281
|
-
content += '\n[mcp_servers.context7]\nurl = "https://mcp.context7.com/mcp"\n';
|
|
390
|
+
return {};
|
|
282
391
|
}
|
|
283
|
-
|
|
392
|
+
}
|
|
393
|
+
readJsonObjectField(source, key) {
|
|
394
|
+
const value = source[key];
|
|
395
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
396
|
+
? value
|
|
397
|
+
: {};
|
|
284
398
|
}
|
|
285
399
|
workspaceTrustKeys(cwd) {
|
|
286
400
|
const keys = new Set([nodePath.resolve(cwd)]);
|
|
@@ -306,6 +420,9 @@ export class CodexRuntimeAdapter {
|
|
|
306
420
|
return threadId;
|
|
307
421
|
}
|
|
308
422
|
}
|
|
423
|
+
if (binding.tmuxSession) {
|
|
424
|
+
await this.dismissSkippableCodexUpdatePrompt(binding.tmuxSession, 1);
|
|
425
|
+
}
|
|
309
426
|
await this.sleep(250);
|
|
310
427
|
}
|
|
311
428
|
return undefined;
|
|
@@ -334,10 +451,33 @@ export class CodexRuntimeAdapter {
|
|
|
334
451
|
recovery: "retry_fresh",
|
|
335
452
|
};
|
|
336
453
|
}
|
|
454
|
+
// Codex auth-refusal: stored OAuth token can no longer be refreshed.
|
|
455
|
+
// Recoverable — operator runs `codex login` and the seat continues.
|
|
456
|
+
// Mirror Claude's evidence shape (last 12 pane lines per
|
|
457
|
+
// claude-resume.ts:97). Closes the guard-blocked pod-aware-path gap
|
|
458
|
+
// alongside the legacy CodexResumeAdapter path patched at 63ee206.
|
|
459
|
+
if (probe.status === "attention_required") {
|
|
460
|
+
return {
|
|
461
|
+
ok: false,
|
|
462
|
+
error: probe.detail,
|
|
463
|
+
recovery: "attention_required",
|
|
464
|
+
evidence: paneContent.split("\n").slice(-12).join("\n"),
|
|
465
|
+
};
|
|
466
|
+
}
|
|
337
467
|
if (probe.status === "resumed") {
|
|
338
468
|
return { ok: true };
|
|
339
469
|
}
|
|
340
|
-
if (probe.code === "
|
|
470
|
+
if (probe.code === "update_gate") {
|
|
471
|
+
const dismissed = await this.dismissSkippableCodexUpdatePrompt(tmuxSession, 1);
|
|
472
|
+
if (dismissed) {
|
|
473
|
+
if (attempt < attempts - 1) {
|
|
474
|
+
await this.sleep(200);
|
|
475
|
+
}
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
return { ok: true };
|
|
479
|
+
}
|
|
480
|
+
if (probe.code === "trust_gate") {
|
|
341
481
|
return { ok: true };
|
|
342
482
|
}
|
|
343
483
|
if (attempt < attempts - 1) {
|
|
@@ -382,6 +522,89 @@ function upsertCodexProjectTrust(content, projectPath) {
|
|
|
382
522
|
}
|
|
383
523
|
return `${lines.join("\n").replace(/\n*$/, "\n")}`;
|
|
384
524
|
}
|
|
525
|
+
function parseCanonicalSessionName(sessionName) {
|
|
526
|
+
const trimmed = sessionName.trim();
|
|
527
|
+
const atIndex = trimmed.indexOf("@");
|
|
528
|
+
if (atIndex <= 0 || atIndex !== trimmed.lastIndexOf("@") || atIndex === trimmed.length - 1)
|
|
529
|
+
return null;
|
|
530
|
+
const local = trimmed.slice(0, atIndex);
|
|
531
|
+
const rig = trimmed.slice(atIndex + 1);
|
|
532
|
+
const separatorIndex = local.indexOf("-");
|
|
533
|
+
if (separatorIndex <= 0 || separatorIndex === local.length - 1)
|
|
534
|
+
return null;
|
|
535
|
+
const pod = local.slice(0, separatorIndex);
|
|
536
|
+
const member = local.slice(separatorIndex + 1);
|
|
537
|
+
if (!isSafeQueueSegment(pod) || !isSafeQueueSegment(member) || !isSafeQueueSegment(rig))
|
|
538
|
+
return null;
|
|
539
|
+
return { pod, member, rig };
|
|
540
|
+
}
|
|
541
|
+
function isSafeQueueSegment(segment) {
|
|
542
|
+
return /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(segment);
|
|
543
|
+
}
|
|
544
|
+
function upsertCodexHooksFeature(content) {
|
|
545
|
+
const lines = content.length > 0 ? content.replace(/\n*$/, "").split("\n") : [];
|
|
546
|
+
const featuresIndex = lines.findIndex((line) => line.trim() === "[features]");
|
|
547
|
+
if (featuresIndex === -1) {
|
|
548
|
+
const prefix = lines.length > 0 ? `${lines.join("\n")}\n\n` : "";
|
|
549
|
+
return `${prefix}[features]\ncodex_hooks = true\n`;
|
|
550
|
+
}
|
|
551
|
+
let nextSectionIndex = lines.length;
|
|
552
|
+
for (let i = featuresIndex + 1; i < lines.length; i++) {
|
|
553
|
+
if (lines[i].trim().startsWith("[")) {
|
|
554
|
+
nextSectionIndex = i;
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
const flagIndex = lines.findIndex((line, index) => index > featuresIndex &&
|
|
559
|
+
index < nextSectionIndex &&
|
|
560
|
+
line.trim().startsWith("codex_hooks"));
|
|
561
|
+
if (flagIndex >= 0) {
|
|
562
|
+
lines[flagIndex] = "codex_hooks = true";
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
lines.splice(featuresIndex + 1, 0, "codex_hooks = true");
|
|
566
|
+
}
|
|
567
|
+
return `${lines.join("\n")}\n`;
|
|
568
|
+
}
|
|
569
|
+
function upsertManagedCodexConfigFragment(content, id, fragment) {
|
|
570
|
+
const start = `# BEGIN OPENRIG MANAGED CODEX CONFIG FRAGMENT: ${id}`;
|
|
571
|
+
const end = `# END OPENRIG MANAGED CODEX CONFIG FRAGMENT: ${id}`;
|
|
572
|
+
const block = `${start}\n${fragment.replace(/\n*$/, "")}\n${end}\n`;
|
|
573
|
+
const pattern = new RegExp(`${escapeRegExp(start)}[\\s\\S]*?${escapeRegExp(end)}\\n?`, "m");
|
|
574
|
+
if (pattern.test(content)) {
|
|
575
|
+
return content.replace(pattern, block);
|
|
576
|
+
}
|
|
577
|
+
const prefix = content.replace(/\n*$/, "");
|
|
578
|
+
return prefix.length > 0 ? `${prefix}\n\n${block}` : block;
|
|
579
|
+
}
|
|
580
|
+
function escapeRegExp(value) {
|
|
581
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
582
|
+
}
|
|
583
|
+
function upsertCommandHook(hooks, event, command) {
|
|
584
|
+
const eventEntries = Array.isArray(hooks[event]) ? hooks[event] : [];
|
|
585
|
+
if (eventEntries.some((entry) => hookEntryContainsCommand(entry, command))) {
|
|
586
|
+
hooks[event] = eventEntries;
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
eventEntries.push({
|
|
590
|
+
hooks: [
|
|
591
|
+
{ type: "command", command, timeout: 5 },
|
|
592
|
+
],
|
|
593
|
+
});
|
|
594
|
+
hooks[event] = eventEntries;
|
|
595
|
+
}
|
|
596
|
+
function hookEntryContainsCommand(entry, command) {
|
|
597
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry))
|
|
598
|
+
return false;
|
|
599
|
+
const hooks = entry["hooks"];
|
|
600
|
+
if (!Array.isArray(hooks))
|
|
601
|
+
return false;
|
|
602
|
+
return hooks.some((hook) => typeof hook === "object" &&
|
|
603
|
+
hook !== null &&
|
|
604
|
+
!Array.isArray(hook) &&
|
|
605
|
+
hook["type"] === "command" &&
|
|
606
|
+
hook["command"] === command);
|
|
607
|
+
}
|
|
385
608
|
function defaultListProcesses() {
|
|
386
609
|
try {
|
|
387
610
|
const output = execFileSync("ps", ["-Ao", "pid,ppid,command"], { encoding: "utf-8" });
|
|
@@ -433,4 +656,8 @@ function commandLooksLikeCodex(command) {
|
|
|
433
656
|
return base === "codex";
|
|
434
657
|
});
|
|
435
658
|
}
|
|
659
|
+
function isSkippableCodexUpdatePrompt(paneContent) {
|
|
660
|
+
return paneContent.includes("Update available!")
|
|
661
|
+
&& paneContent.includes("Skip until next version");
|
|
662
|
+
}
|
|
436
663
|
//# sourceMappingURL=codex-runtime-adapter.js.map
|