@openrig/cli 0.4.4 → 0.4.6
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/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +6 -8
- package/daemon/assets/plugins/openrig-core/skills/openrig-cmux/SKILL.md +86 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-herdr/SKILL.md +158 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +744 -96
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +12 -8
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-resume.d.ts +32 -0
- package/daemon/dist/adapters/pi-resume.d.ts.map +1 -0
- package/daemon/dist/adapters/pi-resume.js +125 -0
- package/daemon/dist/adapters/pi-resume.js.map +1 -0
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +88 -0
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -0
- package/daemon/dist/adapters/pi-runner-protocol.js +153 -0
- package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -0
- package/daemon/dist/adapters/pi-runner.d.ts +99 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -0
- package/daemon/dist/adapters/pi-runner.js +519 -0
- package/daemon/dist/adapters/pi-runner.js.map +1 -0
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts +61 -0
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -0
- package/daemon/dist/adapters/pi-runtime-adapter.js +356 -0
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -0
- package/daemon/dist/adapters/tmux.d.ts +22 -1
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +40 -1
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/builtins/workflow-specs/branched-remediation.yaml +31 -0
- package/daemon/dist/builtins/workflow-specs/factory-rsi.yaml +152 -0
- package/daemon/dist/builtins/workflow-specs/gated-release.yaml +26 -0
- package/daemon/dist/builtins/workflow-specs/linear-build.yaml +21 -0
- package/daemon/dist/db/migrations/049_workflow_instance_version.d.ts +20 -0
- package/daemon/dist/db/migrations/049_workflow_instance_version.d.ts.map +1 -0
- package/daemon/dist/db/migrations/049_workflow_instance_version.js +24 -0
- package/daemon/dist/db/migrations/049_workflow_instance_version.js.map +1 -0
- package/daemon/dist/db/migrations/050_workflow_spec_json.d.ts +22 -0
- package/daemon/dist/db/migrations/050_workflow_spec_json.d.ts.map +1 -0
- package/daemon/dist/db/migrations/050_workflow_spec_json.js +26 -0
- package/daemon/dist/db/migrations/050_workflow_spec_json.js.map +1 -0
- package/daemon/dist/db/migrations/051_workflow_resume.d.ts +22 -0
- package/daemon/dist/db/migrations/051_workflow_resume.d.ts.map +1 -0
- package/daemon/dist/db/migrations/051_workflow_resume.js +27 -0
- package/daemon/dist/db/migrations/051_workflow_resume.js.map +1 -0
- package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.d.ts +26 -0
- package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.d.ts.map +1 -0
- package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.js +30 -0
- package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.js.map +1 -0
- package/daemon/dist/db/migrations/053_sessions_node_id_index.d.ts +48 -0
- package/daemon/dist/db/migrations/053_sessions_node_id_index.d.ts.map +1 -0
- package/daemon/dist/db/migrations/053_sessions_node_id_index.js +53 -0
- package/daemon/dist/db/migrations/053_sessions_node_id_index.js.map +1 -0
- package/daemon/dist/db/migrations/054_queue_transitions_archive.d.ts +34 -0
- package/daemon/dist/db/migrations/054_queue_transitions_archive.d.ts.map +1 -0
- package/daemon/dist/db/migrations/054_queue_transitions_archive.js +49 -0
- package/daemon/dist/db/migrations/054_queue_transitions_archive.js.map +1 -0
- package/daemon/dist/domain/claim-service.d.ts +11 -0
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +3 -1
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/discovery-types.d.ts +1 -1
- package/daemon/dist/domain/discovery-types.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts +1 -0
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-reader.js +19 -0
- package/daemon/dist/domain/hosts/hosts-registry-reader.js.map +1 -1
- package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts +11 -0
- package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/hosts-registry-writer.js +54 -0
- package/daemon/dist/domain/hosts/hosts-registry-writer.js.map +1 -0
- package/daemon/dist/domain/hosts/read-through.d.ts +28 -0
- package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/read-through.js +139 -0
- package/daemon/dist/domain/hosts/read-through.js.map +1 -0
- package/daemon/dist/domain/hosts/remote-daemon-http.d.ts +21 -0
- package/daemon/dist/domain/hosts/remote-daemon-http.d.ts.map +1 -1
- package/daemon/dist/domain/hosts/remote-daemon-http.js +49 -0
- package/daemon/dist/domain/hosts/remote-daemon-http.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +18 -0
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +206 -95
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +11 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +10 -0
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts +7 -0
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.js +93 -13
- package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +37 -26
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +105 -0
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +193 -4
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-retention.d.ts +130 -0
- package/daemon/dist/domain/queue-retention.d.ts.map +1 -0
- package/daemon/dist/domain/queue-retention.js +224 -0
- package/daemon/dist/domain/queue-retention.js.map +1 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts +5 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +29 -2
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/resume-token-capture.d.ts +13 -0
- package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-capture.js +14 -1
- package/daemon/dist/domain/resume-token-capture.js.map +1 -1
- package/daemon/dist/domain/resume-token-validation.d.ts +1 -1
- package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-validation.js +58 -10
- package/daemon/dist/domain/resume-token-validation.js.map +1 -1
- package/daemon/dist/domain/review/compose.d.ts +50 -1
- package/daemon/dist/domain/review/compose.d.ts.map +1 -1
- package/daemon/dist/domain/review/compose.js +92 -3
- package/daemon/dist/domain/review/compose.js.map +1 -1
- package/daemon/dist/domain/review/fleet-compose.d.ts +52 -0
- package/daemon/dist/domain/review/fleet-compose.d.ts.map +1 -0
- package/daemon/dist/domain/review/fleet-compose.js +294 -0
- package/daemon/dist/domain/review/fleet-compose.js.map +1 -0
- package/daemon/dist/domain/review/gather.d.ts +16 -1
- package/daemon/dist/domain/review/gather.d.ts.map +1 -1
- package/daemon/dist/domain/review/gather.js +177 -41
- package/daemon/dist/domain/review/gather.js.map +1 -1
- package/daemon/dist/domain/review/types.d.ts +104 -1
- package/daemon/dist/domain/review/types.d.ts.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.js +3 -0
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +7 -6
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +33 -11
- 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 +3 -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 +4 -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 +11 -0
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts +6 -0
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +26 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +20 -1
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runtime-verifier.d.ts +7 -1
- package/daemon/dist/domain/runtime-verifier.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-verifier.js +39 -1
- package/daemon/dist/domain/runtime-verifier.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +9 -0
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +2 -0
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-store.d.ts +7 -0
- package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-store.js +27 -0
- package/daemon/dist/domain/seat-identity-store.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +6 -4
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/session-name.d.ts +22 -0
- package/daemon/dist/domain/session-name.d.ts.map +1 -1
- package/daemon/dist/domain/session-name.js +29 -0
- package/daemon/dist/domain/session-name.js.map +1 -1
- package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
- package/daemon/dist/domain/slices/slice-detail-projector.js +4 -5
- package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
- package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +18 -2
- package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
- package/daemon/dist/domain/spec-library-workflow-scanner.js +23 -1
- package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
- package/daemon/dist/domain/startup-proof.d.ts +10 -6
- package/daemon/dist/domain/startup-proof.d.ts.map +1 -1
- package/daemon/dist/domain/startup-proof.js +35 -7
- package/daemon/dist/domain/startup-proof.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +16 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +13 -0
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/cmux-provider-adapter.d.ts +27 -0
- package/daemon/dist/domain/terminal/cmux-provider-adapter.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/cmux-provider-adapter.js +67 -0
- package/daemon/dist/domain/terminal/cmux-provider-adapter.js.map +1 -0
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +77 -0
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-adapter.js +266 -0
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -0
- package/daemon/dist/domain/terminal/herdr-transport.d.ts +50 -0
- package/daemon/dist/domain/terminal/herdr-transport.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-transport.js +145 -0
- package/daemon/dist/domain/terminal/herdr-transport.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +88 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.js +17 -0
- package/daemon/dist/domain/terminal/terminal-provider.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-service.d.ts +60 -0
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/terminal-service.js +174 -0
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-views-store.d.ts +77 -0
- package/daemon/dist/domain/terminal/terminal-views-store.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/terminal-views-store.js +146 -0
- package/daemon/dist/domain/terminal/terminal-views-store.js.map +1 -0
- package/daemon/dist/domain/terminal/view-composer.d.ts +42 -0
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/view-composer.js +137 -0
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -0
- package/daemon/dist/domain/tmux-option-defaults.d.ts +89 -0
- package/daemon/dist/domain/tmux-option-defaults.d.ts.map +1 -0
- package/daemon/dist/domain/tmux-option-defaults.js +132 -0
- package/daemon/dist/domain/tmux-option-defaults.js.map +1 -0
- package/daemon/dist/domain/types.d.ts +34 -1
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +92 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/workflow/slice-workflow-projection.d.ts.map +1 -1
- package/daemon/dist/domain/workflow/slice-workflow-projection.js +6 -2
- package/daemon/dist/domain/workflow/slice-workflow-projection.js.map +1 -1
- package/daemon/dist/domain/workflow-boot-sweep.d.ts +28 -0
- package/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-boot-sweep.js +102 -0
- package/daemon/dist/domain/workflow-boot-sweep.js.map +1 -0
- package/daemon/dist/domain/workflow-deadline.d.ts +74 -0
- package/daemon/dist/domain/workflow-deadline.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-deadline.js +165 -0
- package/daemon/dist/domain/workflow-deadline.js.map +1 -0
- package/daemon/dist/domain/workflow-exception-escalation.d.ts +33 -0
- package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-exception-escalation.js +104 -0
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -0
- package/daemon/dist/domain/workflow-exception-router.d.ts +33 -0
- package/daemon/dist/domain/workflow-exception-router.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-exception-router.js +96 -0
- package/daemon/dist/domain/workflow-exception-router.js.map +1 -0
- package/daemon/dist/domain/workflow-exception.d.ts +90 -0
- package/daemon/dist/domain/workflow-exception.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-exception.js +122 -0
- package/daemon/dist/domain/workflow-exception.js.map +1 -0
- package/daemon/dist/domain/workflow-frontier-guard.d.ts +24 -0
- package/daemon/dist/domain/workflow-frontier-guard.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-frontier-guard.js +30 -0
- package/daemon/dist/domain/workflow-frontier-guard.js.map +1 -0
- package/daemon/dist/domain/workflow-instance-store.d.ts +28 -0
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +66 -10
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/domain/workflow-keepalive-arming.d.ts +35 -0
- package/daemon/dist/domain/workflow-keepalive-arming.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-keepalive-arming.js +87 -0
- package/daemon/dist/domain/workflow-keepalive-arming.js.map +1 -0
- package/daemon/dist/domain/workflow-projector.d.ts +117 -2
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +672 -41
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-role-context.d.ts +57 -0
- package/daemon/dist/domain/workflow-role-context.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-role-context.js +120 -0
- package/daemon/dist/domain/workflow-role-context.js.map +1 -0
- package/daemon/dist/domain/workflow-role-resolver.d.ts +65 -0
- package/daemon/dist/domain/workflow-role-resolver.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-role-resolver.js +108 -0
- package/daemon/dist/domain/workflow-role-resolver.js.map +1 -0
- package/daemon/dist/domain/workflow-runtime.d.ts +157 -1
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +718 -11
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.d.ts +26 -1
- package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.js +327 -13
- package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
- package/daemon/dist/domain/workflow-types.d.ts +143 -8
- package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-types.js +14 -1
- package/daemon/dist/domain/workflow-types.js.map +1 -1
- package/daemon/dist/domain/workflow-validator.d.ts +11 -1
- package/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-validator.js +246 -1
- package/daemon/dist/domain/workflow-validator.js.map +1 -1
- package/daemon/dist/index.d.ts +17 -0
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +44 -0
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.js +22 -0
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/hosts.d.ts +5 -0
- package/daemon/dist/routes/hosts.d.ts.map +1 -0
- package/daemon/dist/routes/hosts.js +346 -0
- package/daemon/dist/routes/hosts.js.map +1 -0
- package/daemon/dist/routes/queue.d.ts +2 -7
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +264 -9
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/review.d.ts.map +1 -1
- package/daemon/dist/routes/review.js +26 -0
- package/daemon/dist/routes/review.js.map +1 -1
- package/daemon/dist/routes/seat.js +13 -0
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts +11 -0
- package/daemon/dist/routes/terminal.d.ts.map +1 -0
- package/daemon/dist/routes/terminal.js +104 -0
- package/daemon/dist/routes/terminal.js.map +1 -0
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +102 -10
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +5 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +22 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +221 -12
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/specs/agents/factory-rsi/dogfood/agent.yaml +29 -0
- package/daemon/specs/agents/factory-rsi/dogfood/guidance/role.md +37 -0
- package/daemon/specs/agents/factory-rsi/release-manager/agent.yaml +29 -0
- package/daemon/specs/agents/factory-rsi/release-manager/guidance/role.md +40 -0
- package/daemon/specs/agents/shared/skills/core/mission-slice-sop/SKILL.md +6 -8
- package/daemon/specs/agents/shared/skills/core/openrig-cmux/SKILL.md +86 -0
- package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +158 -0
- package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +6 -6
- package/daemon/specs/rigs/launch/factory-rsi/CULTURE.md +47 -0
- package/daemon/specs/rigs/launch/factory-rsi/rig.yaml +115 -0
- package/dist/build-info.js +3 -3
- package/dist/commands/broadcast.d.ts +6 -1
- package/dist/commands/broadcast.d.ts.map +1 -1
- package/dist/commands/broadcast.js +101 -15
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +99 -8
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +4 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +5 -0
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/host.d.ts +14 -0
- package/dist/commands/host.d.ts.map +1 -1
- package/dist/commands/host.js +338 -14
- package/dist/commands/host.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +5 -0
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +10 -4
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +36 -0
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +73 -7
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/restore-packet.d.ts.map +1 -1
- package/dist/commands/restore-packet.js +13 -2
- package/dist/commands/restore-packet.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +114 -9
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/terminal.d.ts +6 -0
- package/dist/commands/terminal.d.ts.map +1 -0
- package/dist/commands/terminal.js +116 -0
- package/dist/commands/terminal.js.map +1 -0
- package/dist/commands/transcript.d.ts +6 -1
- package/dist/commands/transcript.d.ts.map +1 -1
- package/dist/commands/transcript.js +113 -30
- package/dist/commands/transcript.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +9 -0
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +11 -0
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/workflow-errors.d.ts +23 -0
- package/dist/commands/workflow-errors.d.ts.map +1 -0
- package/dist/commands/workflow-errors.js +100 -0
- package/dist/commands/workflow-errors.js.map +1 -0
- package/dist/commands/workflow-follow.d.ts +71 -0
- package/dist/commands/workflow-follow.d.ts.map +1 -0
- package/dist/commands/workflow-follow.js +259 -0
- package/dist/commands/workflow-follow.js.map +1 -0
- package/dist/commands/workflow-render.d.ts +114 -0
- package/dist/commands/workflow-render.d.ts.map +1 -0
- package/dist/commands/workflow-render.js +223 -0
- package/dist/commands/workflow-render.js.map +1 -0
- package/dist/commands/workflow.d.ts +1 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +278 -14
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +15 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +103 -0
- package/dist/config-store.js.map +1 -1
- package/dist/cross-host-cli-helpers.d.ts +13 -0
- package/dist/cross-host-cli-helpers.d.ts.map +1 -1
- package/dist/cross-host-cli-helpers.js +27 -0
- package/dist/cross-host-cli-helpers.js.map +1 -1
- package/dist/cross-host-target.d.ts +49 -0
- package/dist/cross-host-target.d.ts.map +1 -0
- package/dist/cross-host-target.js +35 -0
- package/dist/cross-host-target.js.map +1 -0
- package/dist/host-registry.d.ts +8 -0
- package/dist/host-registry.d.ts.map +1 -1
- package/dist/host-registry.js +32 -0
- package/dist/host-registry.js.map +1 -1
- package/dist/host-selection.d.ts +13 -0
- package/dist/host-selection.d.ts.map +1 -0
- package/dist/host-selection.js +54 -0
- package/dist/host-selection.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/remote-host-ops.d.ts +1 -0
- package/dist/remote-host-ops.d.ts.map +1 -1
- package/dist/remote-host-ops.js +11 -4
- package/dist/remote-host-ops.js.map +1 -1
- package/dist/session-name.d.ts +23 -0
- package/dist/session-name.d.ts.map +1 -0
- package/dist/session-name.js +61 -0
- package/dist/session-name.js.map +1 -0
- package/package.json +1 -1
- package/ui/dist/assets/index-CFqxa0zW.css +32 -0
- package/ui/dist/assets/index-zrFqS7gL.js +623 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-D69ZhNIr.js +0 -598
- package/ui/dist/assets/index-DJYun-8d.css +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"successor-session-launcher.js","sourceRoot":"","sources":["../../src/domain/successor-session-launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAK5B,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"successor-session-launcher.js","sourceRoot":"","sources":["../../src/domain/successor-session-launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAK5B,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAuDxE,MAAM,OAAO,wBAAwB;IAC3B,WAAW,CAAc;IACzB,aAAa,CAAsB;IACnC,UAAU,CAAqC;IAC/C,KAAK,CAAe;IACpB,eAAe,CAAiC;IAChD,kBAAkB,CAAS;IAC3B,KAAK,CAAgC;IACrC,kBAAkB,CAAmC;IAE7D,YACE,WAAwB,EACxB,aAAkC,EAClC,OAiBI,EAAE;QAEN,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAA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,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,YAA2B;QAC5D,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChD,IAAI,YAAY;YAAE,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,WAAmB;QAC9C,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,8CAA8C;QAChD,CAAC;IACH,CAAC;CACF;AAED,SAAS,UAAU,CAAC,KAAyC;IAC3D,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CmuxAdapter } from "../../adapters/cmux.js";
|
|
2
|
+
import type { NodeCmuxService } from "../node-cmux-service.js";
|
|
3
|
+
import type { ComposedView, OpenViewResult, ProviderLiveness, ProviderStatus, TerminalProvider } from "./terminal-provider.js";
|
|
4
|
+
/** Rig + node coordinates the shipped NodeCmuxService needs to open a surface. */
|
|
5
|
+
export interface SeatNodeRef {
|
|
6
|
+
rigId: string;
|
|
7
|
+
logicalId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CmuxProviderDeps {
|
|
10
|
+
cmuxAdapter: CmuxAdapter;
|
|
11
|
+
nodeCmuxService: NodeCmuxService;
|
|
12
|
+
/**
|
|
13
|
+
* Map a seat (canonical session name) to its rig + node so the shipped
|
|
14
|
+
* NodeCmuxService can open/focus its surface. A seat that does not resolve to
|
|
15
|
+
* a managed local node degrades honestly (cmux tiles managed nodes only).
|
|
16
|
+
*/
|
|
17
|
+
resolveSeatNode(seat: string): SeatNodeRef | null;
|
|
18
|
+
}
|
|
19
|
+
export declare class CmuxProviderAdapter implements TerminalProvider {
|
|
20
|
+
private readonly deps;
|
|
21
|
+
readonly name = "cmux";
|
|
22
|
+
constructor(deps: CmuxProviderDeps);
|
|
23
|
+
status(): Promise<ProviderStatus>;
|
|
24
|
+
liveness(): Promise<ProviderLiveness>;
|
|
25
|
+
openView(view: ComposedView): Promise<OpenViewResult>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=cmux-provider-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmux-provider-adapter.d.ts","sourceRoot":"","sources":["../../../src/domain/terminal/cmux-provider-adapter.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAEV,YAAY,EAEZ,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;CACnD;AAKD,qBAAa,mBAAoB,YAAW,gBAAgB;IAG9C,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,QAAQ,CAAC,IAAI,UAAU;gBAEM,IAAI,EAAE,gBAAgB;IAE7C,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;IAKjC,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKrC,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;CAuC5D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// OPR.0.4.6.02 C2 — the cmux TerminalProvider facade.
|
|
2
|
+
//
|
|
3
|
+
// A THIN facade over the SHIPPED `NodeCmuxService` + `CmuxAdapter`. It wraps,
|
|
4
|
+
// it does not rewrite: `openView` delegates each pane to the existing
|
|
5
|
+
// `openOrFocusNodeSurface` (the shipped open/focus semantics, unchanged), and
|
|
6
|
+
// `status`/`liveness` read the shipped `CmuxAdapter` status. cmux stays
|
|
7
|
+
// best-effort / non-gating / no-regression — a seat cmux can't tile is
|
|
8
|
+
// degraded honestly (never a hard failure, never a silent drop).
|
|
9
|
+
//
|
|
10
|
+
// cmux surfaces are always LOCAL (cmux runs on the operator's machine), so a
|
|
11
|
+
// cmux-level degrade stamps the `local` host sentinel.
|
|
12
|
+
/** Sentinel host for cmux-level degrades (cmux surfaces are always local). */
|
|
13
|
+
const CMUX_LOCAL_HOST = "local";
|
|
14
|
+
export class CmuxProviderAdapter {
|
|
15
|
+
deps;
|
|
16
|
+
name = "cmux";
|
|
17
|
+
constructor(deps) {
|
|
18
|
+
this.deps = deps;
|
|
19
|
+
}
|
|
20
|
+
async status() {
|
|
21
|
+
const s = this.deps.cmuxAdapter.getStatus();
|
|
22
|
+
return { provider: this.name, available: s.available, capabilities: s.capabilities };
|
|
23
|
+
}
|
|
24
|
+
async liveness() {
|
|
25
|
+
const alive = this.deps.cmuxAdapter.isAvailable();
|
|
26
|
+
return alive ? { alive: true } : { alive: false, detail: "cmux is not connected" };
|
|
27
|
+
}
|
|
28
|
+
async openView(view) {
|
|
29
|
+
// Carry forward the composer's honest-partial classification verbatim.
|
|
30
|
+
const absent = [...view.absent];
|
|
31
|
+
const degraded = [...view.degraded];
|
|
32
|
+
const opened = [];
|
|
33
|
+
for (const pane of view.opened) {
|
|
34
|
+
const ref = this.deps.resolveSeatNode(pane.seat);
|
|
35
|
+
if (!ref) {
|
|
36
|
+
degraded.push({
|
|
37
|
+
seat: pane.seat,
|
|
38
|
+
host: CMUX_LOCAL_HOST,
|
|
39
|
+
reason: "cmux: seat is not a managed local node (cmux tiles managed nodes only)",
|
|
40
|
+
});
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const res = await this.deps.nodeCmuxService.openOrFocusNodeSurface(ref.rigId, ref.logicalId);
|
|
44
|
+
if (res.ok) {
|
|
45
|
+
opened.push(pane.seat);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
degraded.push({
|
|
49
|
+
seat: pane.seat,
|
|
50
|
+
host: CMUX_LOCAL_HOST,
|
|
51
|
+
reason: `cmux: ${res.error ?? res.code ?? "open failed"}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// cmux is non-gating: a partial render is still ok=true (the honest-partial
|
|
56
|
+
// detail lives in absent/degraded). Only an unexpected throw is a failure.
|
|
57
|
+
return {
|
|
58
|
+
provider: this.name,
|
|
59
|
+
ok: true,
|
|
60
|
+
opened,
|
|
61
|
+
absent,
|
|
62
|
+
degraded,
|
|
63
|
+
pages: view.pages.length,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=cmux-provider-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmux-provider-adapter.js","sourceRoot":"","sources":["../../../src/domain/terminal/cmux-provider-adapter.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E;AAC9E,wEAAwE;AACxE,uEAAuE;AACvE,iEAAiE;AACjE,EAAE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Ae;oBACrB,MAAM,EAAE,wEAAwE;iBACjF,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;YAC7F,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,IAAI,EAAE,eAAe;oBACrB,MAAM,EAAE,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,IAAI,aAAa,EAAE;iBAC1D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,4EAA4E;QAC5E,2EAA2E;QAC3E,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,EAAE,EAAE,IAAI;YACR,MAAM;YACN,MAAM;YACN,QAAQ;YACR,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;SACzB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ComposedPane, ComposedView, OpenViewResult, ProviderLiveness, ProviderStatus, TerminalProvider } from "./terminal-provider.js";
|
|
2
|
+
import type { HerdrResult, HerdrTransportFactory } from "./herdr-transport.js";
|
|
3
|
+
/** A herdr layout-tree pane leaf — `command` is an ARGV array (capture-verified). */
|
|
4
|
+
export interface HerdrPaneNode {
|
|
5
|
+
type: "pane";
|
|
6
|
+
label: string;
|
|
7
|
+
command: string[];
|
|
8
|
+
}
|
|
9
|
+
/** A herdr layout-tree binary split (capture-verified shape). */
|
|
10
|
+
export interface HerdrSplitNode {
|
|
11
|
+
type: "split";
|
|
12
|
+
direction: "right" | "down";
|
|
13
|
+
ratio: number;
|
|
14
|
+
first: HerdrLayoutNode;
|
|
15
|
+
second: HerdrLayoutNode;
|
|
16
|
+
}
|
|
17
|
+
export type HerdrLayoutNode = HerdrPaneNode | HerdrSplitNode;
|
|
18
|
+
/**
|
|
19
|
+
* Build the balanced BSP layout tree for one page of panes. PURE. Splits
|
|
20
|
+
* alternate right/down by depth at ratio 0.5 → same-size tiles (the documented
|
|
21
|
+
* v1 layout; asymmetric layouts are out of scope). Each leaf runs the
|
|
22
|
+
* composer's shell `paneCommand` via `["sh","-c",…]` so the composed quoting
|
|
23
|
+
* (read-only `-r`, ssh-wrap) is preserved untouched.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildBspRoot(panes: ComposedPane[], depth?: number): HerdrLayoutNode;
|
|
26
|
+
/** The per-page socket request plan — pure, so it is asserted directly in tests. */
|
|
27
|
+
export interface HerdrPagePlan {
|
|
28
|
+
/** Fresh tab label for this page (embeds the launch token → fresh-on-relaunch). */
|
|
29
|
+
tabLabel: string;
|
|
30
|
+
/** The whole page's layout tree — ONE atomic layout.apply request body. */
|
|
31
|
+
root: HerdrLayoutNode;
|
|
32
|
+
}
|
|
33
|
+
export interface HerdrLayoutPlan {
|
|
34
|
+
/** The label for the fresh per-open workspace (same token discipline as tabs). */
|
|
35
|
+
workspaceLabel: string;
|
|
36
|
+
pages: HerdrPagePlan[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Build the herdr socket plan for a composed view. PURE — no I/O. Each page
|
|
40
|
+
* gets a fresh tab labeled `${tabPrefix}:${view.id}#${launchToken}/<pageIndex>`;
|
|
41
|
+
* two calls with different `launchToken`s produce DIFFERENT labels, which is
|
|
42
|
+
* exactly the fresh-tab-on-relaunch (not-replace) invariant.
|
|
43
|
+
*/
|
|
44
|
+
export declare function planHerdrLayout(view: ComposedView, launchToken: string, tabPrefix?: string): HerdrLayoutPlan;
|
|
45
|
+
/**
|
|
46
|
+
* Extract the created workspace's id from a `workspace.create` result body.
|
|
47
|
+
* DEFENSIVE — this envelope was not captured verbatim, so the known plausible
|
|
48
|
+
* homes are tried in order: a top-level `workspace_id`, then a nested
|
|
49
|
+
* `workspace`/`layout` object's `workspace_id`/`id`, then a top-level string
|
|
50
|
+
* `id`. Returns null when nothing string-shaped is found (the caller degrades
|
|
51
|
+
* honestly rather than guessing).
|
|
52
|
+
*/
|
|
53
|
+
export declare function extractWorkspaceId(result: HerdrResult): string | null;
|
|
54
|
+
export interface HerdrAdapterDeps {
|
|
55
|
+
transportFactory: HerdrTransportFactory;
|
|
56
|
+
/**
|
|
57
|
+
* Mint a fresh launch token per `openView` so a relaunch creates a new tab
|
|
58
|
+
* (BR-5). Injectable for deterministic tests. Default: a per-instance
|
|
59
|
+
* monotonic counter (unique within a daemon lifetime).
|
|
60
|
+
*/
|
|
61
|
+
newLaunchToken?: () => string;
|
|
62
|
+
/** Tab-name prefix (default `openrig`). */
|
|
63
|
+
tabPrefix?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare class HerdrAdapter implements TerminalProvider {
|
|
66
|
+
private readonly deps;
|
|
67
|
+
readonly name = "herdr";
|
|
68
|
+
private readonly transport;
|
|
69
|
+
private readonly newLaunchToken;
|
|
70
|
+
private readonly tabPrefix;
|
|
71
|
+
private launchCounter;
|
|
72
|
+
constructor(deps: HerdrAdapterDeps);
|
|
73
|
+
status(): Promise<ProviderStatus>;
|
|
74
|
+
liveness(): Promise<ProviderLiveness>;
|
|
75
|
+
openView(view: ComposedView): Promise<OpenViewResult>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=herdr-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"herdr-adapter.d.ts","sourceRoot":"","sources":["../../../src/domain/terminal/herdr-adapter.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAEV,YAAY,EACZ,YAAY,EAEZ,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAA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gBAAgB;IAOvC,OAAO,CAAC,QAAQ,CAAC,IAAI;IANjC,QAAQ,CAAC,IAAI,WAAW;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,aAAa,CAAK;gBAEG,IAAI,EAAE,gBAAgB;IAO7C,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;IAkBjC,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAYrC,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;CAyH5D"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
// OPR.0.4.6.02 C2+FB4 — the herdr TerminalProvider (the proof-gated primary
|
|
2
|
+
// provider). Arm's-length AGPL: it drives the installed herdr's local control
|
|
3
|
+
// SOCKET through the injected `HerdrTransport` (see herdr-transport.ts) and
|
|
4
|
+
// never links herdr.
|
|
5
|
+
//
|
|
6
|
+
// FB4 (the VM-RED correction): herdr 0.7.1 has NO `layout` CLI command — the
|
|
7
|
+
// prior CLI shape (`herdr layout apply …`) could never tile (proven RED in the
|
|
8
|
+
// VM at e373f741). herdr's real layout mechanism is the socket `layout.apply`,
|
|
9
|
+
// validated verbatim in research/herdr-socket-captures/herdr-phase3-*.json:
|
|
10
|
+
// request {id, method:"layout.apply",
|
|
11
|
+
// params:{workspace_id, tab_label, focus, root}}
|
|
12
|
+
// root = {type:"split", direction:"right"|"down", ratio, first, second}
|
|
13
|
+
// | {type:"pane", label, command:[argv…]}
|
|
14
|
+
// response {id, result:{type:"layout_apply", layout:{workspace_id, tab_id,…}}}
|
|
15
|
+
//
|
|
16
|
+
// Behavior contract (unchanged from the guard-cleared shape):
|
|
17
|
+
// - ONE atomic `layout.apply` per grid page — the whole page's panes land in
|
|
18
|
+
// a single request so a page is never half-tiled.
|
|
19
|
+
// - FRESH tab/workspace on every relaunch (BR-5, not-replace-idempotent):
|
|
20
|
+
// each open creates its own workspace (`workspace.create`) and the tab
|
|
21
|
+
// label embeds a per-launch token — and `layout.apply` itself is
|
|
22
|
+
// empirically non-idempotent (the four-reapply capture shows a re-apply
|
|
23
|
+
// minting tab t3, never replacing t2), so a re-open can never clobber a
|
|
24
|
+
// previous view.
|
|
25
|
+
// - Pane labels ride the layout.apply pane nodes' `label` field (AC-7
|
|
26
|
+
// `<agent> · <slice>`) — the captures show the label echoed per pane, so
|
|
27
|
+
// no separate `pane rename` pass is needed (there is no `pane rename` CLI
|
|
28
|
+
// to shell anyway).
|
|
29
|
+
// - The composer's `paneCommand` is a SHELL string (`tmux attach -r -t 's'`,
|
|
30
|
+
// `ssh 'dest' tmux attach …`); the pane node's `command` is an ARGV array —
|
|
31
|
+
// so it is carried as `["sh", "-c", paneCommand]`, preserving the composed
|
|
32
|
+
// quoting byte-for-byte without the adapter re-parsing shell.
|
|
33
|
+
// - Liveness/availability = the socket `ping` (is the multiplexer's OWN
|
|
34
|
+
// control socket answering — NOT a daemon server ping; HERDR-FINDINGS #3's
|
|
35
|
+
// intent, carried to the socket transport). No "layout command" probe: the
|
|
36
|
+
// CLI help surface is irrelevant to the socket API.
|
|
37
|
+
// - SAME-SIZE panes only. The BSP tree below splits 0.5/0.5 alternating
|
|
38
|
+
// right/down; asymmetric pane layouts are a DOCUMENTED limitation, not
|
|
39
|
+
// faked here (the inherent tmux multi-client resize limit).
|
|
40
|
+
//
|
|
41
|
+
// The `workspace.create` response envelope was NOT captured verbatim (only
|
|
42
|
+
// layout.apply/ping were); the workspace id is therefore extracted
|
|
43
|
+
// DEFENSIVELY (see extractWorkspaceId) — to be confirmed by the fresh VM
|
|
44
|
+
// re-proof (unproven until that proof artifact lands).
|
|
45
|
+
/** Sentinel host for herdr-surface degrades (a pane herdr itself failed to render). */
|
|
46
|
+
const HERDR_SURFACE_HOST = "herdr";
|
|
47
|
+
/**
|
|
48
|
+
* Build the balanced BSP layout tree for one page of panes. PURE. Splits
|
|
49
|
+
* alternate right/down by depth at ratio 0.5 → same-size tiles (the documented
|
|
50
|
+
* v1 layout; asymmetric layouts are out of scope). Each leaf runs the
|
|
51
|
+
* composer's shell `paneCommand` via `["sh","-c",…]` so the composed quoting
|
|
52
|
+
* (read-only `-r`, ssh-wrap) is preserved untouched.
|
|
53
|
+
*/
|
|
54
|
+
export function buildBspRoot(panes, depth = 0) {
|
|
55
|
+
if (panes.length === 1) {
|
|
56
|
+
const pane = panes[0];
|
|
57
|
+
return { type: "pane", label: pane.label, command: ["sh", "-c", pane.paneCommand] };
|
|
58
|
+
}
|
|
59
|
+
const mid = Math.ceil(panes.length / 2);
|
|
60
|
+
return {
|
|
61
|
+
type: "split",
|
|
62
|
+
direction: depth % 2 === 0 ? "right" : "down",
|
|
63
|
+
ratio: 0.5,
|
|
64
|
+
first: buildBspRoot(panes.slice(0, mid), depth + 1),
|
|
65
|
+
second: buildBspRoot(panes.slice(mid), depth + 1),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build the herdr socket plan for a composed view. PURE — no I/O. Each page
|
|
70
|
+
* gets a fresh tab labeled `${tabPrefix}:${view.id}#${launchToken}/<pageIndex>`;
|
|
71
|
+
* two calls with different `launchToken`s produce DIFFERENT labels, which is
|
|
72
|
+
* exactly the fresh-tab-on-relaunch (not-replace) invariant.
|
|
73
|
+
*/
|
|
74
|
+
export function planHerdrLayout(view, launchToken, tabPrefix = "openrig") {
|
|
75
|
+
const base = `${tabPrefix}:${view.id}#${launchToken}`;
|
|
76
|
+
const pages = view.pages.map((page, pageIndex) => ({
|
|
77
|
+
tabLabel: view.pages.length > 1 ? `${base}/${pageIndex + 1}` : base,
|
|
78
|
+
root: buildBspRoot(page),
|
|
79
|
+
}));
|
|
80
|
+
return { workspaceLabel: base, pages };
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Extract the created workspace's id from a `workspace.create` result body.
|
|
84
|
+
* DEFENSIVE — this envelope was not captured verbatim, so the known plausible
|
|
85
|
+
* homes are tried in order: a top-level `workspace_id`, then a nested
|
|
86
|
+
* `workspace`/`layout` object's `workspace_id`/`id`, then a top-level string
|
|
87
|
+
* `id`. Returns null when nothing string-shaped is found (the caller degrades
|
|
88
|
+
* honestly rather than guessing).
|
|
89
|
+
*/
|
|
90
|
+
export function extractWorkspaceId(result) {
|
|
91
|
+
const direct = result["workspace_id"];
|
|
92
|
+
if (typeof direct === "string" && direct)
|
|
93
|
+
return direct;
|
|
94
|
+
for (const key of ["workspace", "layout"]) {
|
|
95
|
+
const nested = result[key];
|
|
96
|
+
if (nested && typeof nested === "object") {
|
|
97
|
+
const obj = nested;
|
|
98
|
+
const id = obj["workspace_id"] ?? obj["id"];
|
|
99
|
+
if (typeof id === "string" && id)
|
|
100
|
+
return id;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const bare = result["id"];
|
|
104
|
+
if (typeof bare === "string" && bare)
|
|
105
|
+
return bare;
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
export class HerdrAdapter {
|
|
109
|
+
deps;
|
|
110
|
+
name = "herdr";
|
|
111
|
+
transport;
|
|
112
|
+
newLaunchToken;
|
|
113
|
+
tabPrefix;
|
|
114
|
+
launchCounter = 0;
|
|
115
|
+
constructor(deps) {
|
|
116
|
+
this.deps = deps;
|
|
117
|
+
this.transport = deps.transportFactory();
|
|
118
|
+
this.tabPrefix = deps.tabPrefix ?? "openrig";
|
|
119
|
+
this.newLaunchToken =
|
|
120
|
+
deps.newLaunchToken ?? (() => `l${(this.launchCounter += 1)}`);
|
|
121
|
+
}
|
|
122
|
+
async status() {
|
|
123
|
+
try {
|
|
124
|
+
const probe = await this.transport.probe();
|
|
125
|
+
return {
|
|
126
|
+
provider: this.name,
|
|
127
|
+
available: probe.alive,
|
|
128
|
+
...(probe.version ? { version: probe.version } : {}),
|
|
129
|
+
// The socket answering ping IS the capability surface: layout.apply is
|
|
130
|
+
// the protocol's layout verb (there is no per-command discovery on
|
|
131
|
+
// 0.7.1 — `api schema` is absent; HERDR-FINDINGS §3).
|
|
132
|
+
capabilities: { socket: probe.alive, "layout.apply": probe.alive },
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
// An unreachable socket (herdr not running) = honestly unavailable.
|
|
137
|
+
return { provider: this.name, available: false, capabilities: {} };
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async liveness() {
|
|
141
|
+
// Liveness is the multiplexer's OWN control socket answering ping.
|
|
142
|
+
try {
|
|
143
|
+
const probe = await this.transport.probe();
|
|
144
|
+
return probe.alive
|
|
145
|
+
? { alive: true }
|
|
146
|
+
: { alive: false, detail: "herdr control socket is not answering ping" };
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
return { alive: false, detail: err instanceof Error ? err.message : String(err) };
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async openView(view) {
|
|
153
|
+
const absent = [...view.absent];
|
|
154
|
+
const degraded = [...view.degraded];
|
|
155
|
+
const opened = [];
|
|
156
|
+
// Gate on the socket being alive — the honest "herdr isn't running" refuse.
|
|
157
|
+
// (No CLI-help "layout command" probe: the socket API is the layout surface.)
|
|
158
|
+
const probe = await this.transport.probe();
|
|
159
|
+
if (!probe.alive) {
|
|
160
|
+
return {
|
|
161
|
+
provider: this.name,
|
|
162
|
+
ok: false,
|
|
163
|
+
opened,
|
|
164
|
+
absent,
|
|
165
|
+
degraded,
|
|
166
|
+
pages: 0,
|
|
167
|
+
error: "herdr control socket is not answering ping; is herdr running?",
|
|
168
|
+
code: "herdr_unavailable",
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
const launchToken = this.newLaunchToken();
|
|
172
|
+
const plan = planHerdrLayout(view, launchToken, this.tabPrefix);
|
|
173
|
+
// Nothing to tile (an all-absent/degraded view) → no workspace side effect.
|
|
174
|
+
if (plan.pages.length === 0) {
|
|
175
|
+
return {
|
|
176
|
+
provider: this.name,
|
|
177
|
+
ok: view.opened.length === 0,
|
|
178
|
+
opened,
|
|
179
|
+
absent,
|
|
180
|
+
degraded,
|
|
181
|
+
pages: 0,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
// A fresh workspace per open (BR-5 fresh-on-relaunch, strongest form).
|
|
185
|
+
// The labeled create is tried first; because the label param is an
|
|
186
|
+
// uncaptured assumption, a failure falls back ONCE to a bare create
|
|
187
|
+
// before degrading (defensive; to be confirmed by the fresh VM re-proof).
|
|
188
|
+
let workspaceId = null;
|
|
189
|
+
let createErr = null;
|
|
190
|
+
try {
|
|
191
|
+
workspaceId = extractWorkspaceId(await this.transport.request("workspace.create", {
|
|
192
|
+
focus: false,
|
|
193
|
+
label: plan.workspaceLabel,
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
catch (err) {
|
|
197
|
+
createErr = err;
|
|
198
|
+
}
|
|
199
|
+
if (workspaceId == null) {
|
|
200
|
+
try {
|
|
201
|
+
workspaceId = extractWorkspaceId(await this.transport.request("workspace.create", { focus: false }));
|
|
202
|
+
createErr = null;
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
createErr = createErr ?? err;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (workspaceId == null) {
|
|
209
|
+
// No workspace → nothing can tile. Degrade every pane honestly.
|
|
210
|
+
const reason = `herdr workspace.create failed: ${createErr instanceof Error
|
|
211
|
+
? createErr.message
|
|
212
|
+
: createErr != null
|
|
213
|
+
? String(createErr)
|
|
214
|
+
: "no workspace id in the response"}`;
|
|
215
|
+
for (const page of view.pages) {
|
|
216
|
+
for (const pane of page) {
|
|
217
|
+
degraded.push({ seat: pane.seat, host: HERDR_SURFACE_HOST, reason });
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
provider: this.name,
|
|
222
|
+
ok: view.opened.length === 0,
|
|
223
|
+
opened,
|
|
224
|
+
absent,
|
|
225
|
+
degraded,
|
|
226
|
+
pages: 0,
|
|
227
|
+
error: reason,
|
|
228
|
+
code: "herdr_workspace_failed",
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
for (let pageIndex = 0; pageIndex < plan.pages.length; pageIndex++) {
|
|
232
|
+
const pagePlan = plan.pages[pageIndex];
|
|
233
|
+
const pagePanes = view.pages[pageIndex];
|
|
234
|
+
try {
|
|
235
|
+
// ONE atomic layout.apply for the whole page (capture-verified shape).
|
|
236
|
+
await this.transport.request("layout.apply", {
|
|
237
|
+
workspace_id: workspaceId,
|
|
238
|
+
tab_label: pagePlan.tabLabel,
|
|
239
|
+
focus: true,
|
|
240
|
+
root: pagePlan.root,
|
|
241
|
+
});
|
|
242
|
+
for (const pane of pagePanes)
|
|
243
|
+
opened.push(pane.seat);
|
|
244
|
+
}
|
|
245
|
+
catch (err) {
|
|
246
|
+
// The whole page failed to apply — degrade its seats honestly.
|
|
247
|
+
for (const pane of pagePanes) {
|
|
248
|
+
degraded.push({
|
|
249
|
+
seat: pane.seat,
|
|
250
|
+
host: HERDR_SURFACE_HOST,
|
|
251
|
+
reason: `herdr layout.apply failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
provider: this.name,
|
|
258
|
+
ok: opened.length > 0 || view.opened.length === 0,
|
|
259
|
+
opened,
|
|
260
|
+
absent,
|
|
261
|
+
degraded,
|
|
262
|
+
pages: plan.pages.length,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=herdr-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"herdr-adapter.js","sourceRoot":"","sources":["../../../src/domain/terminal/herdr-adapter.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,qBAAqB;AACrB,E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BAC5B,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,QAAQ,CAAC,IAAI;iBACpB,CAAC,CAAC;gBACH,KAAK,MAAM,IAAI,IAAI,SAAS;oBAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,+DAA+D;gBAC/D,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;oBAC7B,QAAQ,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,IAAI,EAAE,kBAAkB;wBACxB,MAAM,EAAE,8BAA8B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;qBACzF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,EAAE,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACjD,MAAM;YACN,MAAM;YACN,QAAQ;YACR,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;SACzB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** A herdr socket result body — always carries a `type` discriminator. */
|
|
2
|
+
export interface HerdrResult {
|
|
3
|
+
type: string;
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface HerdrProbeResult {
|
|
7
|
+
/** Is the herdr control socket reachable + answering `ping`? */
|
|
8
|
+
alive: boolean;
|
|
9
|
+
version: string | null;
|
|
10
|
+
protocol: number | null;
|
|
11
|
+
}
|
|
12
|
+
/** One socket round-trip: send {id,method,params}, resolve the matching response body. */
|
|
13
|
+
export type HerdrSocketRpc = (req: {
|
|
14
|
+
id: string;
|
|
15
|
+
method: string;
|
|
16
|
+
params: unknown;
|
|
17
|
+
}) => Promise<HerdrResult>;
|
|
18
|
+
export interface HerdrTransport {
|
|
19
|
+
/** Liveness + version/protocol via the socket `ping` (not the absent CLI). */
|
|
20
|
+
probe(): Promise<HerdrProbeResult>;
|
|
21
|
+
/** Send a socket request; resolve the `result` body, reject on error / no result / unreachable. */
|
|
22
|
+
request(method: string, params: unknown): Promise<HerdrResult>;
|
|
23
|
+
}
|
|
24
|
+
export type HerdrTransportFactory = () => HerdrTransport;
|
|
25
|
+
/** Resolve the herdr control socket path: env override → per-session → default. */
|
|
26
|
+
export declare function resolveHerdrSocketPath(env?: NodeJS.ProcessEnv): string;
|
|
27
|
+
/** Extract a version token (e.g. from a ping result's `version`, or `herdr --version`). */
|
|
28
|
+
export declare function parseHerdrVersion(out: unknown): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Normalize a parsed response line to its result body. Accepts BOTH the wrapped
|
|
31
|
+
* `{id,result:{type,…}}` (layout.apply/workspace.create) and a bare `{type,…}`
|
|
32
|
+
* (ping) shape, and treats an `{…,error:…}` (uncaptured shape, handled
|
|
33
|
+
* defensively) or a shapeless line as an error.
|
|
34
|
+
*/
|
|
35
|
+
export declare function unwrapHerdrResponse(raw: unknown): HerdrResult;
|
|
36
|
+
/**
|
|
37
|
+
* The REAL unix-socket RPC (node:net). One-shot per request: connect, send one
|
|
38
|
+
* newline-delimited JSON line, read lines until the one whose `id` matches (or a
|
|
39
|
+
* bare typed response), then close. Rejects on ENOENT (herdr not running),
|
|
40
|
+
* timeout, connection error, socket close before a response, or a herdr error.
|
|
41
|
+
* Injectable so the adapter/tests never open a real socket.
|
|
42
|
+
*/
|
|
43
|
+
export declare function createHerdrSocketRpc(socketPath?: string, timeoutMs?: number): HerdrSocketRpc;
|
|
44
|
+
/**
|
|
45
|
+
* The socket transport. `request` sends through the injected RPC with a fresh
|
|
46
|
+
* id; `probe` sends `ping` and reads `{type:"pong",version,protocol}`
|
|
47
|
+
* (unreachable / non-pong → alive:false, the honest answer).
|
|
48
|
+
*/
|
|
49
|
+
export declare function createHerdrSocketTransport(rpc: HerdrSocketRpc): HerdrTransportFactory;
|
|
50
|
+
//# sourceMappingURL=herdr-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"herdr-transport.d.ts","sourceRoot":"","sources":["../../../src/domain/terminal/herdr-transport.ts"],"names":[],"mappings":"AA6BA,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,0FAA0F;AAC1F,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAE5G,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,KAAK,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC,mGAAmG;IACnG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAChE;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,cAAc,CAAC;AAEzD,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAKnF;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI7D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,C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