@openrig/cli 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/daemon/assets/claude-statusline-context.cjs +13 -3
- package/daemon/assets/guidance/openrig-seat-skills.md +1 -0
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/claude.json +11 -11
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +9 -8
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-health.cjs +2 -2
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +9 -6
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
- package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +13 -8
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +19 -4
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +167 -46
- package/daemon/assets/skills/rigs/SKILL.md +2 -1
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +206 -28
- package/daemon/context-packs/reference/getting-started.md +65 -6
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +82 -2
- package/daemon/context-packs/reference/whats-new.md +162 -113
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +19 -4
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +3 -0
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +2 -2
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +13 -8
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/SKILL.md +167 -46
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +94 -26
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +10 -3
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +10 -4
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +231 -41
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +21 -2
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +90 -8
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +11 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +59 -16
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +9 -6
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/stub-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/stub-runtime-adapter.js +9 -5
- package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +15 -4
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +68 -26
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +14 -0
- package/daemon/dist/attention-surface.d.ts.map +1 -1
- package/daemon/dist/attention-surface.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/daemon-db-path.d.ts +6 -0
- package/daemon/dist/daemon-db-path.d.ts.map +1 -1
- package/daemon/dist/daemon-db-path.js +65 -1
- package/daemon/dist/daemon-db-path.js.map +1 -1
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
- package/daemon/dist/daemon-shutdown.js +4 -2
- package/daemon/dist/daemon-shutdown.js.map +1 -1
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +16 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts +4 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.d.ts.map +1 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js +9 -0
- package/daemon/dist/db/migrations/124_context_usage_watchdog_units.js.map +1 -0
- package/daemon/dist/db/migrations/125_node_advisor.d.ts +3 -0
- package/daemon/dist/db/migrations/125_node_advisor.d.ts.map +1 -0
- package/daemon/dist/db/migrations/125_node_advisor.js +8 -0
- package/daemon/dist/db/migrations/125_node_advisor.js.map +1 -0
- package/daemon/dist/db/migrations/127_operation_correlation.d.ts +3 -0
- package/daemon/dist/db/migrations/127_operation_correlation.d.ts.map +1 -0
- package/daemon/dist/db/migrations/127_operation_correlation.js +10 -0
- package/daemon/dist/db/migrations/127_operation_correlation.js.map +1 -0
- package/daemon/dist/db/migrations/128_terminal_policy.d.ts +3 -0
- package/daemon/dist/db/migrations/128_terminal_policy.d.ts.map +1 -0
- package/daemon/dist/db/migrations/128_terminal_policy.js +37 -0
- package/daemon/dist/db/migrations/128_terminal_policy.js.map +1 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.d.ts +10 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.js +35 -0
- package/daemon/dist/db/migrations/129_stream_dispositions.js.map +1 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts +11 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.js +33 -0
- package/daemon/dist/db/migrations/130_stream_subscriptions.js.map +1 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts +8 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.d.ts.map +1 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.js +20 -0
- package/daemon/dist/db/migrations/131_stream_retention_floor.js.map +1 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts +3 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.d.ts.map +1 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js +16 -0
- package/daemon/dist/db/migrations/135_seat_identity_process_evidence.js.map +1 -0
- package/daemon/dist/domain/active-occupant.d.ts +3 -0
- package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
- package/daemon/dist/domain/active-occupant.js +6 -2
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
- package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
- package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +6 -2
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +13 -4
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
- package/daemon/dist/domain/agent-manifest.js +14 -2
- package/daemon/dist/domain/agent-manifest.js.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts +3 -0
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js +20 -6
- package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.js +2 -0
- package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
- package/daemon/dist/domain/bundle-behaviour.d.ts.map +1 -1
- package/daemon/dist/domain/bundle-behaviour.js +28 -1
- package/daemon/dist/domain/bundle-behaviour.js.map +1 -1
- package/daemon/dist/domain/claim-service.d.ts +19 -1
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +67 -19
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/classification-attempts.d.ts +4 -1
- package/daemon/dist/domain/classification-attempts.d.ts.map +1 -1
- package/daemon/dist/domain/classification-attempts.js +10 -1
- package/daemon/dist/domain/classification-attempts.js.map +1 -1
- package/daemon/dist/domain/classification-sources.d.ts +38 -0
- package/daemon/dist/domain/classification-sources.d.ts.map +1 -1
- package/daemon/dist/domain/classification-sources.js +24 -1
- package/daemon/dist/domain/classification-sources.js.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.d.ts +2 -2
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.js +8 -7
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +109 -7
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +447 -52
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +4 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +23 -12
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.d.ts +1 -1
- package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.js +33 -15
- package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts +26 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.js +187 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -0
- package/daemon/dist/domain/codex-rebuild-permissions.d.ts +54 -0
- package/daemon/dist/domain/codex-rebuild-permissions.d.ts.map +1 -0
- package/daemon/dist/domain/codex-rebuild-permissions.js +134 -0
- package/daemon/dist/domain/codex-rebuild-permissions.js.map +1 -0
- package/daemon/dist/domain/community-harness-launch-result.d.ts +33 -0
- package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -0
- package/daemon/dist/domain/community-harness-launch-result.js +93 -0
- package/daemon/dist/domain/community-harness-launch-result.js.map +1 -0
- package/daemon/dist/domain/community-harness-presets.d.ts +27 -2
- package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-presets.js +49 -5
- package/daemon/dist/domain/community-harness-presets.js.map +1 -1
- package/daemon/dist/domain/composer-prompts.d.ts +5 -2
- package/daemon/dist/domain/composer-prompts.d.ts.map +1 -1
- package/daemon/dist/domain/composer-prompts.js +2 -2
- package/daemon/dist/domain/composer-prompts.js.map +1 -1
- package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/context-monitor.js +2 -1
- package/daemon/dist/domain/context-monitor.js.map +1 -1
- package/daemon/dist/domain/continuity-policy-materializer.d.ts +1 -0
- package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
- package/daemon/dist/domain/continuity-policy-materializer.js +2 -0
- package/daemon/dist/domain/continuity-policy-materializer.js.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +7 -6
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/footprint-choice.d.ts +41 -0
- package/daemon/dist/domain/footprint-choice.d.ts.map +1 -0
- package/daemon/dist/domain/footprint-choice.js +42 -0
- package/daemon/dist/domain/footprint-choice.js.map +1 -0
- package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts +3 -0
- package/daemon/dist/domain/gateway/delivery-rules-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.js +1 -1
- package/daemon/dist/domain/gateway/delivery-rules-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.d.ts +32 -0
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +71 -4
- package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +52 -4
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +3 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +9 -2
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +7 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +14 -2
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -3
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +22 -22
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +4 -7
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/generated-file-hygiene.js +1 -1
- package/daemon/dist/domain/generated-file-hygiene.js.map +1 -1
- package/daemon/dist/domain/graph-projection.d.ts +3 -0
- package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
- package/daemon/dist/domain/graph-projection.js +2 -0
- package/daemon/dist/domain/graph-projection.js.map +1 -1
- package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +14 -6
- package/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
- package/daemon/dist/domain/human-questions.d.ts +2 -0
- package/daemon/dist/domain/human-questions.d.ts.map +1 -1
- package/daemon/dist/domain/human-questions.js +5 -0
- package/daemon/dist/domain/human-questions.js.map +1 -1
- package/daemon/dist/domain/kernel-boot.d.ts +5 -1
- package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
- package/daemon/dist/domain/kernel-boot.js +34 -4
- package/daemon/dist/domain/kernel-boot.js.map +1 -1
- package/daemon/dist/domain/managed-blocks.d.ts +32 -1
- package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
- package/daemon/dist/domain/managed-blocks.js +109 -11
- package/daemon/dist/domain/managed-blocks.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.js +3 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +21 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +110 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +2 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.js +7 -0
- package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +10 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.js +24 -5
- package/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
- package/daemon/dist/domain/native-process-lineage.d.ts +3 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +60 -2
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe-evidence.d.ts +19 -0
- package/daemon/dist/domain/native-resume-probe-evidence.d.ts.map +1 -0
- package/daemon/dist/domain/native-resume-probe-evidence.js +37 -0
- package/daemon/dist/domain/native-resume-probe-evidence.js.map +1 -0
- package/daemon/dist/domain/native-resume-probe.d.ts +7 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +12 -9
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +49 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +119 -45
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +9 -3
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts +16 -4
- package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.js +25 -5
- package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts +78 -0
- package/daemon/dist/domain/operation-correlation.d.ts.map +1 -0
- package/daemon/dist/domain/operation-correlation.js +54 -0
- package/daemon/dist/domain/operation-correlation.js.map +1 -0
- package/daemon/dist/domain/permission-account.d.ts +28 -0
- package/daemon/dist/domain/permission-account.d.ts.map +1 -0
- package/daemon/dist/domain/permission-account.js +102 -0
- package/daemon/dist/domain/permission-account.js.map +1 -0
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js +11 -7
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- package/daemon/dist/domain/pod-bundle-assembler.d.ts +1 -0
- package/daemon/dist/domain/pod-bundle-assembler.d.ts.map +1 -1
- package/daemon/dist/domain/pod-bundle-assembler.js +25 -0
- package/daemon/dist/domain/pod-bundle-assembler.js.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts +7 -0
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.js +8 -4
- package/daemon/dist/domain/policies/artifact-pool-helpers.js.map +1 -1
- package/daemon/dist/domain/policies/context-usage-threshold.d.ts.map +1 -1
- package/daemon/dist/domain/policies/context-usage-threshold.js +109 -21
- package/daemon/dist/domain/policies/context-usage-threshold.js.map +1 -1
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts +6 -1
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts.map +1 -1
- package/daemon/dist/domain/policies/edge-artifact-required.js +18 -13
- package/daemon/dist/domain/policies/edge-artifact-required.js.map +1 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +2 -0
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.js +5 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -1
- package/daemon/dist/domain/policies/periodic-reminder.d.ts +10 -0
- package/daemon/dist/domain/policies/periodic-reminder.d.ts.map +1 -1
- package/daemon/dist/domain/policies/periodic-reminder.js +11 -6
- package/daemon/dist/domain/policies/periodic-reminder.js.map +1 -1
- package/daemon/dist/domain/policies/types.d.ts +25 -0
- package/daemon/dist/domain/policies/types.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts +6 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.js +11 -5
- package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
- package/daemon/dist/domain/profile-resolution-worker.d.ts +7 -0
- package/daemon/dist/domain/profile-resolution-worker.d.ts.map +1 -0
- package/daemon/dist/domain/profile-resolution-worker.js +83 -0
- package/daemon/dist/domain/profile-resolution-worker.js.map +1 -0
- package/daemon/dist/domain/profile-resolver.d.ts +6 -0
- package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/profile-resolver.js +14 -2
- package/daemon/dist/domain/profile-resolver.js.map +1 -1
- package/daemon/dist/domain/project-classifier.d.ts +7 -0
- package/daemon/dist/domain/project-classifier.d.ts.map +1 -1
- package/daemon/dist/domain/project-classifier.js +26 -0
- package/daemon/dist/domain/project-classifier.js.map +1 -1
- package/daemon/dist/domain/provider/subscription-move-report.d.ts +86 -0
- package/daemon/dist/domain/provider/subscription-move-report.d.ts.map +1 -0
- package/daemon/dist/domain/provider/subscription-move-report.js +227 -0
- package/daemon/dist/domain/provider/subscription-move-report.js.map +1 -0
- package/daemon/dist/domain/ps-projection.d.ts +6 -35
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +14 -55
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-owner.d.ts +6 -3
- package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
- package/daemon/dist/domain/queue-owner.js +10 -5
- package/daemon/dist/domain/queue-owner.js.map +1 -1
- package/daemon/dist/domain/queue-pickup.d.ts +5 -2
- package/daemon/dist/domain/queue-pickup.d.ts.map +1 -1
- package/daemon/dist/domain/queue-pickup.js +19 -2
- package/daemon/dist/domain/queue-pickup.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +54 -21
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +257 -97
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-retention.d.ts +18 -0
- package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
- package/daemon/dist/domain/queue-retention.js +74 -0
- package/daemon/dist/domain/queue-retention.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +2 -0
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +37 -3
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-wait-backoff.d.ts +3 -0
- package/daemon/dist/domain/queue-wait-backoff.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wait-backoff.js +9 -0
- package/daemon/dist/domain/queue-wait-backoff.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts +2 -0
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +18 -6
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/reconciler.d.ts +23 -0
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +44 -1
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
- package/daemon/dist/domain/rehydrate-eligibility.js +2 -3
- package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
- package/daemon/dist/domain/restore-guidance.d.ts +7 -0
- package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
- package/daemon/dist/domain/restore-guidance.js +20 -8
- package/daemon/dist/domain/restore-guidance.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +13 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +151 -26
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +7 -2
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +28 -7
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/restore-policy.d.ts +4 -0
- package/daemon/dist/domain/restore-policy.d.ts.map +1 -1
- package/daemon/dist/domain/restore-policy.js +11 -0
- package/daemon/dist/domain/restore-policy.js.map +1 -1
- package/daemon/dist/domain/rig-edge-ops.d.ts +58 -0
- package/daemon/dist/domain/rig-edge-ops.d.ts.map +1 -0
- package/daemon/dist/domain/rig-edge-ops.js +113 -0
- package/daemon/dist/domain/rig-edge-ops.js.map +1 -0
- package/daemon/dist/domain/rig-name-override.d.ts +14 -0
- package/daemon/dist/domain/rig-name-override.d.ts.map +1 -0
- package/daemon/dist/domain/rig-name-override.js +38 -0
- package/daemon/dist/domain/rig-name-override.js.map +1 -0
- package/daemon/dist/domain/rig-repository.d.ts +10 -2
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +14 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-status-compose.d.ts +1 -1
- package/daemon/dist/domain/rig-status-compose.d.ts.map +1 -1
- package/daemon/dist/domain/rig-status-compose.js +3 -1
- package/daemon/dist/domain/rig-status-compose.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +19 -0
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +78 -8
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +10 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +3 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +22 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +30 -2
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +262 -47
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +15 -2
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts +3 -0
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +67 -3
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +20 -1
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js +5 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/scope/scope-view-projection.d.ts +6 -0
- package/daemon/dist/domain/scope/scope-view-projection.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-view-projection.js +26 -10
- package/daemon/dist/domain/scope/scope-view-projection.js.map +1 -1
- package/daemon/dist/domain/seat-activity-service.d.ts +4 -2
- package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-activity-service.js +13 -5
- package/daemon/dist/domain/seat-activity-service.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +19 -0
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +60 -6
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts +20 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +66 -11
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +8 -0
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +74 -4
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-store.d.ts +11 -1
- package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-store.js +29 -4
- package/daemon/dist/domain/seat-identity-store.js.map +1 -1
- package/daemon/dist/domain/seat-launch-additions.d.ts +115 -0
- package/daemon/dist/domain/seat-launch-additions.d.ts.map +1 -0
- package/daemon/dist/domain/seat-launch-additions.js +439 -0
- package/daemon/dist/domain/seat-launch-additions.js.map +1 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +1 -1
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +79 -4
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +202 -12
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts +139 -0
- package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -0
- package/daemon/dist/domain/seat-skill-apply.js +221 -0
- package/daemon/dist/domain/seat-skill-apply.js.map +1 -0
- package/daemon/dist/domain/seat-skill-storage.d.ts +295 -0
- package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -0
- package/daemon/dist/domain/seat-skill-storage.js +850 -0
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -0
- package/daemon/dist/domain/seat-status-service.d.ts +9 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +15 -3
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +4 -0
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +13 -0
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +52 -21
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +150 -47
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/skill-catalog.d.ts +16 -0
- package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
- package/daemon/dist/domain/skill-catalog.js +15 -6
- package/daemon/dist/domain/skill-catalog.js.map +1 -1
- package/daemon/dist/domain/skill-discovery.d.ts +17 -2
- package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/skill-discovery.js +44 -5
- package/daemon/dist/domain/skill-discovery.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +26 -2
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +226 -14
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/stream-dispositions.d.ts +51 -0
- package/daemon/dist/domain/stream-dispositions.d.ts.map +1 -0
- package/daemon/dist/domain/stream-dispositions.js +112 -0
- package/daemon/dist/domain/stream-dispositions.js.map +1 -0
- package/daemon/dist/domain/stream-store.d.ts +22 -0
- package/daemon/dist/domain/stream-store.d.ts.map +1 -1
- package/daemon/dist/domain/stream-store.js +49 -6
- package/daemon/dist/domain/stream-store.js.map +1 -1
- package/daemon/dist/domain/stream-subscriptions.d.ts +94 -0
- package/daemon/dist/domain/stream-subscriptions.d.ts.map +1 -0
- package/daemon/dist/domain/stream-subscriptions.js +160 -0
- package/daemon/dist/domain/stream-subscriptions.js.map +1 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts +6 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +5 -2
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +2 -0
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +104 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts +9 -0
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-sessions.js +23 -0
- package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +4 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +12 -3
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +42 -17
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.js +1 -0
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
- package/daemon/dist/domain/terminal-policy.d.ts +80 -0
- package/daemon/dist/domain/terminal-policy.d.ts.map +1 -0
- package/daemon/dist/domain/terminal-policy.js +117 -0
- package/daemon/dist/domain/terminal-policy.js.map +1 -0
- package/daemon/dist/domain/terminal-seat.d.ts +9 -0
- package/daemon/dist/domain/terminal-seat.d.ts.map +1 -0
- package/daemon/dist/domain/terminal-seat.js +37 -0
- package/daemon/dist/domain/terminal-seat.js.map +1 -0
- package/daemon/dist/domain/topology-converge.d.ts +25 -2
- package/daemon/dist/domain/topology-converge.d.ts.map +1 -1
- package/daemon/dist/domain/topology-converge.js +14 -1
- package/daemon/dist/domain/topology-converge.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +58 -2
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/urgent-line.d.ts +4 -0
- package/daemon/dist/domain/urgent-line.d.ts.map +1 -0
- package/daemon/dist/domain/urgent-line.js +7 -0
- package/daemon/dist/domain/urgent-line.js.map +1 -0
- package/daemon/dist/domain/usage-series.d.ts.map +1 -1
- package/daemon/dist/domain/usage-series.js +6 -2
- package/daemon/dist/domain/usage-series.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.js +2 -2
- package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +3 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +73 -1
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/view-projector.d.ts.map +1 -1
- package/daemon/dist/domain/view-projector.js +2 -1
- package/daemon/dist/domain/view-projector.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +1 -1
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-job-update.d.ts +21 -0
- package/daemon/dist/domain/watchdog-job-update.d.ts.map +1 -0
- package/daemon/dist/domain/watchdog-job-update.js +143 -0
- package/daemon/dist/domain/watchdog-job-update.js.map +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +63 -7
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +190 -21
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +23 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +46 -13
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.js +7 -3
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +5 -2
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +16 -7
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +8 -2
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +30 -7
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workspace/project-read.d.ts +2 -0
- package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/project-read.js +10 -1
- package/daemon/dist/domain/workspace/project-read.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +2 -0
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/router-line-surface.d.ts +2 -0
- package/daemon/dist/router-line-surface.d.ts.map +1 -0
- package/daemon/dist/router-line-surface.js +3 -0
- package/daemon/dist/router-line-surface.js.map +1 -0
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +3 -0
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/agent-images.d.ts.map +1 -1
- package/daemon/dist/routes/agent-images.js +10 -2
- package/daemon/dist/routes/agent-images.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +30 -3
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/bootstrap-failure-response.js +2 -2
- package/daemon/dist/routes/bootstrap-failure-response.js.map +1 -1
- package/daemon/dist/routes/bundles.js +1 -1
- package/daemon/dist/routes/bundles.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +31 -10
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +2 -0
- package/daemon/dist/routes/hosts.js.map +1 -1
- package/daemon/dist/routes/mission-control.d.ts.map +1 -1
- package/daemon/dist/routes/mission-control.js +5 -1
- package/daemon/dist/routes/mission-control.js.map +1 -1
- package/daemon/dist/routes/projects.d.ts.map +1 -1
- package/daemon/dist/routes/projects.js +59 -12
- package/daemon/dist/routes/projects.js.map +1 -1
- package/daemon/dist/routes/proof.js +2 -2
- package/daemon/dist/routes/proof.js.map +1 -1
- package/daemon/dist/routes/provider.d.ts.map +1 -1
- package/daemon/dist/routes/provider.js +87 -0
- package/daemon/dist/routes/provider.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +52 -3
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/rigs.d.ts.map +1 -1
- package/daemon/dist/routes/rigs.js +75 -10
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +38 -12
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/scopes.d.ts.map +1 -1
- package/daemon/dist/routes/scopes.js +30 -7
- package/daemon/dist/routes/scopes.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +19 -3
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +5 -0
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/skills.d.ts.map +1 -1
- package/daemon/dist/routes/skills.js +54 -1
- package/daemon/dist/routes/skills.js.map +1 -1
- package/daemon/dist/routes/stream.d.ts.map +1 -1
- package/daemon/dist/routes/stream.js +62 -13
- package/daemon/dist/routes/stream.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +20 -11
- package/daemon/dist/routes/terminal.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +24 -2
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/up.js +5 -0
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts +1 -0
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +52 -3
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +24 -13
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +2 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +4 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/skill-loadout-surface.d.ts +2 -0
- package/daemon/dist/skill-loadout-surface.d.ts.map +1 -1
- package/daemon/dist/skill-loadout-surface.js +2 -0
- package/daemon/dist/skill-loadout-surface.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +54 -21
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.js +9 -2
- package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
- package/daemon/docs/reference/a2a-agents.md +343 -0
- package/daemon/docs/reference/acp-agents.md +77 -0
- package/daemon/docs/reference/agent-spec.md +7 -5
- package/daemon/docs/reference/agent-startup-guide.md +46 -0
- package/daemon/docs/reference/agent-state-taxonomy.md +27 -2
- package/daemon/docs/reference/checked-seat-stop.md +11 -0
- package/daemon/docs/reference/community-harness-examples/cursor/cursor.yaml +13 -0
- package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +61 -0
- package/daemon/docs/reference/community-harness-examples/hermes/config.yaml.example +18 -0
- package/daemon/docs/reference/community-harness-examples/hermes/hermes.yaml +12 -0
- package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +34 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openclaw.yaml +13 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +38 -0
- package/daemon/docs/reference/community-harness-presets.md +179 -0
- package/daemon/docs/reference/getting-started.md +65 -6
- package/daemon/docs/reference/operation-correlation.md +9 -0
- package/daemon/docs/reference/project-workspace.md +6 -0
- package/daemon/docs/reference/quickstart.md +1 -1
- package/daemon/docs/reference/refocus-channel.md +6 -4
- package/daemon/docs/reference/rig-spec.md +82 -2
- package/daemon/docs/reference/seat-delivery.md +73 -2
- package/daemon/docs/reference/slack-app-setup.md +3 -1
- package/daemon/docs/reference/stream-classifier-worker.md +28 -0
- package/daemon/docs/reference/telemetry.md +3 -0
- package/daemon/docs/reference/terminal-sessions.md +90 -0
- package/daemon/docs/reference/topology-naming.md +1 -1
- package/daemon/docs/reference/whats-new.md +162 -113
- package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +0 -3
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +19 -4
- package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +3 -0
- package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +2 -2
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +36 -10
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +11 -0
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/startup/context.md +3 -1
- package/daemon/specs/rigs/launch/secrets-manager/secrets-manager.compose.yaml +1 -1
- package/dist/acp/connector.d.ts +72 -0
- package/dist/acp/connector.d.ts.map +1 -0
- package/dist/acp/connector.js +218 -0
- package/dist/acp/connector.js.map +1 -0
- package/dist/acp/json-rpc-stdio.d.ts +53 -0
- package/dist/acp/json-rpc-stdio.d.ts.map +1 -0
- package/dist/acp/json-rpc-stdio.js +141 -0
- package/dist/acp/json-rpc-stdio.js.map +1 -0
- package/dist/acp/run-processes.d.ts +10 -0
- package/dist/acp/run-processes.d.ts.map +1 -0
- package/dist/acp/run-processes.js +33 -0
- package/dist/acp/run-processes.js.map +1 -0
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +7 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +14 -7
- package/dist/client.js.map +1 -1
- package/dist/commands/acp.d.ts +11 -0
- package/dist/commands/acp.d.ts.map +1 -0
- package/dist/commands/acp.js +198 -0
- package/dist/commands/acp.js.map +1 -0
- package/dist/commands/attach.js +1 -1
- package/dist/commands/attach.js.map +1 -1
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +39 -10
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/compact-plan.d.ts +2 -0
- package/dist/commands/compact-plan.d.ts.map +1 -1
- package/dist/commands/compact-plan.js +38 -3
- package/dist/commands/compact-plan.js.map +1 -1
- package/dist/commands/compact.js +1 -1
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +7 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/create.js +2 -2
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +2 -0
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/down.d.ts +5 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +87 -3
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/edge.d.ts +4 -0
- package/dist/commands/edge.d.ts.map +1 -0
- package/dist/commands/edge.js +135 -0
- package/dist/commands/edge.js.map +1 -0
- package/dist/commands/export.d.ts +1 -0
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +51 -0
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +19 -2
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +2 -1
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/grow.js +2 -2
- package/dist/commands/grow.js.map +1 -1
- package/dist/commands/launch.js +1 -1
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +113 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/project-worker.d.ts +25 -1
- package/dist/commands/project-worker.d.ts.map +1 -1
- package/dist/commands/project-worker.js +9 -7
- package/dist/commands/project-worker.js.map +1 -1
- package/dist/commands/project.d.ts +2 -0
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +64 -1
- package/dist/commands/project.js.map +1 -1
- package/dist/commands/provider.d.ts.map +1 -1
- package/dist/commands/provider.js +101 -0
- package/dist/commands/provider.js.map +1 -1
- package/dist/commands/ps.d.ts +12 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +50 -47
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +4 -2
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +24 -15
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/reconcile-session.d.ts.map +1 -1
- package/dist/commands/reconcile-session.js +6 -0
- package/dist/commands/reconcile-session.js.map +1 -1
- package/dist/commands/seat.d.ts +2 -0
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +124 -6
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +62 -55
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts +24 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +160 -7
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +116 -3
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +18 -25
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +4 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/stream-outcome.d.ts +157 -0
- package/dist/commands/stream-outcome.d.ts.map +1 -0
- package/dist/commands/stream-outcome.js +81 -0
- package/dist/commands/stream-outcome.js.map +1 -0
- package/dist/commands/stream.d.ts.map +1 -1
- package/dist/commands/stream.js +64 -2
- package/dist/commands/stream.js.map +1 -1
- package/dist/commands/terminal.d.ts +1 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +35 -6
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/topology-default-agent.d.ts +2 -2
- package/dist/commands/topology-default-agent.d.ts.map +1 -1
- package/dist/commands/topology-default-agent.js +5 -3
- package/dist/commands/topology-default-agent.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +75 -30
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/watchdog.d.ts.map +1 -1
- package/dist/commands/watchdog.js +80 -5
- package/dist/commands/watchdog.js.map +1 -1
- package/dist/commands/workflow-errors.js +1 -1
- package/dist/commands/workflow-errors.js.map +1 -1
- package/dist/commands/workflow-render.js +4 -4
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +34 -15
- 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 +86 -4
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +4 -0
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +73 -21
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/decisions/decisions.d.ts +203 -0
- package/dist/decisions/decisions.d.ts.map +1 -0
- package/dist/decisions/decisions.js +374 -0
- package/dist/decisions/decisions.js.map +1 -0
- package/dist/decisions/stream-consumer.d.ts +255 -0
- package/dist/decisions/stream-consumer.d.ts.map +1 -0
- package/dist/decisions/stream-consumer.js +282 -0
- package/dist/decisions/stream-consumer.js.map +1 -0
- package/dist/decisions/templates.d.ts +8 -0
- package/dist/decisions/templates.d.ts.map +1 -0
- package/dist/decisions/templates.js +34 -0
- package/dist/decisions/templates.js.map +1 -0
- package/dist/fresh-seat-command.d.ts +18 -0
- package/dist/fresh-seat-command.d.ts.map +1 -0
- package/dist/fresh-seat-command.js +36 -0
- package/dist/fresh-seat-command.js.map +1 -0
- package/dist/front-door.d.ts +4 -0
- package/dist/front-door.d.ts.map +1 -1
- package/dist/front-door.js +8 -4
- package/dist/front-door.js.map +1 -1
- package/dist/host-bindings.d.ts.map +1 -1
- package/dist/host-bindings.js +16 -9
- package/dist/host-bindings.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lazy-program.d.ts.map +1 -1
- package/dist/lazy-program.js +2 -0
- package/dist/lazy-program.js.map +1 -1
- package/dist/lib/run-on-host.d.ts +29 -0
- package/dist/lib/run-on-host.d.ts.map +1 -0
- package/dist/lib/run-on-host.js +69 -0
- package/dist/lib/run-on-host.js.map +1 -0
- package/dist/lib/seat-activity.d.ts +17 -0
- package/dist/lib/seat-activity.d.ts.map +1 -0
- package/dist/lib/seat-activity.js +29 -0
- package/dist/lib/seat-activity.js.map +1 -0
- package/dist/local-daemon-owner.d.ts +4 -0
- package/dist/local-daemon-owner.d.ts.map +1 -1
- package/dist/local-daemon-owner.js +1 -1
- package/dist/local-daemon-owner.js.map +1 -1
- package/dist/mcp-http.d.ts +42 -0
- package/dist/mcp-http.d.ts.map +1 -0
- package/dist/mcp-http.js +232 -0
- package/dist/mcp-http.js.map +1 -0
- package/dist/mcp-server.d.ts +30 -2
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +1112 -436
- package/dist/mcp-server.js.map +1 -1
- package/dist/seat-launch-additions-lines.d.ts +11 -0
- package/dist/seat-launch-additions-lines.d.ts.map +1 -0
- package/dist/seat-launch-additions-lines.js +14 -0
- package/dist/seat-launch-additions-lines.js.map +1 -0
- package/dist/terminal-window.d.ts +1 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +50 -22
- package/dist/terminal-window.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/attention/attention-model.d.ts +3 -1
- package/tui/dist/attention/attention-model.d.ts.map +1 -1
- package/tui/dist/attention/attention-model.js +68 -1
- package/tui/dist/attention/attention-model.js.map +1 -1
- package/tui/dist/commands/registry.d.ts.map +1 -1
- package/tui/dist/commands/registry.js +2 -0
- package/tui/dist/commands/registry.js.map +1 -1
- package/tui/dist/config/config-model.d.ts.map +1 -1
- package/tui/dist/config/config-model.js +2 -0
- package/tui/dist/config/config-model.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +18 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +4 -0
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +9 -6
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/main.js +15 -1
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +10 -3
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/topology/fixture.js +1 -1
- package/tui/dist/topology/fixture.js.map +1 -1
- package/tui/dist/topology/glyphs.js +1 -1
- package/tui/dist/topology/glyphs.js.map +1 -1
- package/tui/dist/topology/graph-types.d.ts +1 -0
- package/tui/dist/topology/graph-types.d.ts.map +1 -1
- package/tui/dist/types.d.ts +25 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/ui/dist/assets/{index-CVgod3Pm.js → index-Blg-p32B.js} +92 -92
- package/ui/dist/index.html +1 -1
|
@@ -0,0 +1,850 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import nodePath from "node:path";
|
|
4
|
+
import { getOpenRigHome } from "../openrig-compat.js";
|
|
5
|
+
import { parseSkillFrontmatter } from "./skill-discovery.js";
|
|
6
|
+
import { MANAGED_BLOCK_APPEND_SEPARATOR, hasEditedManagedBlock, managedBlockText } from "./managed-blocks.js";
|
|
7
|
+
// OPR.0.7.0.13 — where a team seat's skills live: storage OpenRig owns, outside the person's project and their own
|
|
8
|
+
// skill folders, so a person's own agent opened in the project sees none of the team's skills.
|
|
9
|
+
//
|
|
10
|
+
// <openrig home>/state/seats/<rig id>/<logical seat>/<runtime>/
|
|
11
|
+
// plugin/.claude-plugin/plugin.json the generated plugin "openrig" (Claude shows its skills as openrig:<id>)
|
|
12
|
+
// plugin/skills/<id>/ the seat's complete skill trees, helpers included
|
|
13
|
+
// skill-loadout.json the loadout OpenRig wrote here: each skill's source, files and their hashes
|
|
14
|
+
// skill-projections.json every other skill file OpenRig wrote here: its hash and its source
|
|
15
|
+
//
|
|
16
|
+
// The key is the rig and the logical seat, never a session name: a native resume, a restore, a handover successor and
|
|
17
|
+
// an in-place restart are the same seat and find the same storage, while a fork is a new seat in a new rig with its own.
|
|
18
|
+
// Two seats never share one manifest (a rig's logical seats are unique). Every launch path derives the pointer to this
|
|
19
|
+
// storage from the node record, so a path that doesn't re-project skills still hands the seat its storage.
|
|
20
|
+
//
|
|
21
|
+
// Adapted from #1008's claude-seat-material.ts (Adam Dmitruczuk): the generated plugin, its name and manifest, and the
|
|
22
|
+
// skills-under-the-plugin layout. That design keyed the directory by session name and also moved settings, MCP and
|
|
23
|
+
// guidance; this keeps skills only, keyed by seat.
|
|
24
|
+
/** The generated plugin's name. Claude Code shows its skills as `openrig:<id>`. */
|
|
25
|
+
export const SEAT_SKILL_PLUGIN_NAME = "openrig";
|
|
26
|
+
const segment = (value) => value.replace(/[^A-Za-z0-9@._-]/g, "_");
|
|
27
|
+
export function seatSkillPaths(key, openrigHome = getOpenRigHome()) {
|
|
28
|
+
const root = nodePath.join(nodePath.resolve(openrigHome), "state", "seats", segment(key.rigId), segment(key.logicalId), segment(key.runtime));
|
|
29
|
+
const pluginDir = nodePath.join(root, "plugin");
|
|
30
|
+
return {
|
|
31
|
+
root,
|
|
32
|
+
pluginDir,
|
|
33
|
+
pluginManifestPath: nodePath.join(pluginDir, ".claude-plugin", "plugin.json"),
|
|
34
|
+
// Claude reads skills through the generated plugin; a Codex seat's trees sit beside its catalog (no plugin).
|
|
35
|
+
skillsRoot: key.runtime === "codex" ? nodePath.join(root, "skills") : nodePath.join(pluginDir, "skills"),
|
|
36
|
+
manifestPath: nodePath.join(root, "skill-loadout.json"),
|
|
37
|
+
projectionsPath: nodePath.join(root, "skill-projections.json"),
|
|
38
|
+
catalogPath: nodePath.join(root, "catalog.md"),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** The name Claude Code gives a skill delivered through the seat plugin. */
|
|
42
|
+
export function seatSkillName(skillId) {
|
|
43
|
+
return `${SEAT_SKILL_PLUGIN_NAME}:${skillId}`;
|
|
44
|
+
}
|
|
45
|
+
/** Where the skill loadout reconciler keeps this seat's skills, and the name each is recorded with. */
|
|
46
|
+
export function seatSkillLocation(paths, runtime = "claude-code") {
|
|
47
|
+
// A Codex seat reads its skills by path from its catalog, so they keep their own names.
|
|
48
|
+
return { targetRoot: paths.skillsRoot, manifestPath: paths.manifestPath, qualifiedName: runtime === "codex" ? (id) => id : seatSkillName,
|
|
49
|
+
// The reconciler stages beside the skills folder and writes its manifest at the seat's root, both on the skills
|
|
50
|
+
// folder's anchored path, so this one check covers every write and removal it makes there.
|
|
51
|
+
refuseMutation: () => anchored(seatsAnchor(paths.root), paths.skillsRoot, "folder") && anchored(seatsAnchor(paths.root), paths.manifestPath, "file")
|
|
52
|
+
? undefined
|
|
53
|
+
: `${paths.skillsRoot} is not inside this seat's storage (a link on the way from ${seatsAnchor(paths.root)}); the loadout changed nothing there` };
|
|
54
|
+
}
|
|
55
|
+
const PLUGIN_MANIFEST = `${JSON.stringify({
|
|
56
|
+
name: SEAT_SKILL_PLUGIN_NAME,
|
|
57
|
+
version: "0.0.0",
|
|
58
|
+
description: "Skills OpenRig keeps for this seat only.",
|
|
59
|
+
}, null, 2)}\n`;
|
|
60
|
+
/**
|
|
61
|
+
* Write the generated plugin's manifest, unless it's already there as written. A manifest that differs from the one
|
|
62
|
+
* OpenRig generates is someone's edit: it is kept and named (returned), never overwritten.
|
|
63
|
+
*/
|
|
64
|
+
export function ensureSeatSkillPlugin(paths) {
|
|
65
|
+
const file = paths.pluginManifestPath;
|
|
66
|
+
if (!insideSeatStorage(paths.root, file))
|
|
67
|
+
return [`seat_plugin_kept: ${file} is not inside this seat's storage (a link on the way); not written`];
|
|
68
|
+
if (lexists(file)) {
|
|
69
|
+
let current;
|
|
70
|
+
try {
|
|
71
|
+
current = fs.readFileSync(file, "utf8");
|
|
72
|
+
}
|
|
73
|
+
catch { }
|
|
74
|
+
return current === PLUGIN_MANIFEST ? [] : [`seat_plugin_kept: ${file} differs from the manifest OpenRig generates; kept as it is`];
|
|
75
|
+
}
|
|
76
|
+
writeInsideSeatStorage(paths.root, file, PLUGIN_MANIFEST);
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
// --- Where OpenRig may write or remove in a seat's storage --------------------------------------------------------
|
|
80
|
+
// What these checks establish: just before cleanup or repair acts on a path, every component from the anchor down was
|
|
81
|
+
// a real folder (no link), and a file, if present, a regular file. The anchor is `<home>/state/seats`, the folder
|
|
82
|
+
// OpenRig makes for every seat; it is checked too. (The OpenRig home and its `state` folder above the anchor are the
|
|
83
|
+
// operator's layout, and may be links.) The check and the filesystem call are separate operations (Node has no
|
|
84
|
+
// openat), so a namespace entry replaced by another process between them is outside what is established here; that
|
|
85
|
+
// window hasn't been measured.
|
|
86
|
+
const lexists = (file) => { try {
|
|
87
|
+
fs.lstatSync(file);
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return false;
|
|
92
|
+
} };
|
|
93
|
+
/** `<home>/state/seats` for a seat root `<home>/state/seats/<rig>/<seat>/<runtime>`. */
|
|
94
|
+
const seatsAnchor = (root) => nodePath.dirname(nodePath.dirname(nodePath.dirname(nodePath.resolve(root))));
|
|
95
|
+
/**
|
|
96
|
+
* Whether `target` is the anchor or below it with no link anywhere from the anchor down, the anchor included. A missing
|
|
97
|
+
* component ends the walk as contained (nothing below it exists to follow). `kind` is what the target must be if present.
|
|
98
|
+
*/
|
|
99
|
+
function anchored(anchor, target, kind) {
|
|
100
|
+
const base = nodePath.resolve(anchor);
|
|
101
|
+
const resolved = nodePath.resolve(target);
|
|
102
|
+
const relative = nodePath.relative(base, resolved);
|
|
103
|
+
if (relative === ".." || relative.startsWith(`..${nodePath.sep}`) || nodePath.isAbsolute(relative))
|
|
104
|
+
return false;
|
|
105
|
+
const parts = relative === "" ? [] : relative.split(nodePath.sep);
|
|
106
|
+
const chain = [base, ...parts.map((_, i) => nodePath.join(base, ...parts.slice(0, i + 1)))];
|
|
107
|
+
for (let i = 0; i < chain.length; i++) {
|
|
108
|
+
let stat;
|
|
109
|
+
try {
|
|
110
|
+
stat = fs.lstatSync(chain[i]);
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
return err.code === "ENOENT";
|
|
114
|
+
}
|
|
115
|
+
if (stat.isSymbolicLink())
|
|
116
|
+
return false;
|
|
117
|
+
const last = i === chain.length - 1;
|
|
118
|
+
if (!last || kind === "folder" ? !stat.isDirectory() : !stat.isFile())
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
/** Whether folder `dir` is inside the seat storage at `root`, with no link on the way, itself included. */
|
|
124
|
+
export function insideSeatStorageFolder(root, dir) {
|
|
125
|
+
const seatRoot = nodePath.resolve(root);
|
|
126
|
+
if (!nodePath.resolve(dir).startsWith(seatRoot + nodePath.sep))
|
|
127
|
+
return false;
|
|
128
|
+
return anchored(seatsAnchor(seatRoot), dir, "folder");
|
|
129
|
+
}
|
|
130
|
+
/** Whether `file` is inside the seat storage at `root`, with no link on the way from the anchor all seats share. */
|
|
131
|
+
export function insideSeatStorage(root, file) {
|
|
132
|
+
const seatRoot = nodePath.resolve(root);
|
|
133
|
+
if (!nodePath.resolve(file).startsWith(seatRoot + nodePath.sep))
|
|
134
|
+
return false;
|
|
135
|
+
return anchored(seatsAnchor(seatRoot), file, "file");
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Write a file inside the seat's storage without following a link: folders are made one at a time, a new file is
|
|
139
|
+
* created exclusively, and an existing one is replaced by a rename (which replaces the entry itself). Throws when the
|
|
140
|
+
* path isn't inside the seat's storage.
|
|
141
|
+
*/
|
|
142
|
+
export function writeInsideSeatStorage(root, file, bytes, mode) {
|
|
143
|
+
if (!insideSeatStorage(root, file))
|
|
144
|
+
throw new Error(`${file} is not inside this seat's storage`);
|
|
145
|
+
const base = seatsAnchor(root);
|
|
146
|
+
fs.mkdirSync(base, { recursive: true }); // the folder every seat shares, in the OpenRig home
|
|
147
|
+
if (!anchored(base, base, "folder"))
|
|
148
|
+
throw new Error(`${base} is not a folder OpenRig can write seat storage in`);
|
|
149
|
+
let current = base;
|
|
150
|
+
for (const part of nodePath.relative(base, nodePath.dirname(nodePath.resolve(file))).split(nodePath.sep)) {
|
|
151
|
+
current = nodePath.join(current, part);
|
|
152
|
+
try {
|
|
153
|
+
fs.mkdirSync(current);
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
if (err.code !== "EEXIST")
|
|
157
|
+
throw err;
|
|
158
|
+
}
|
|
159
|
+
if (!fs.lstatSync(current).isDirectory())
|
|
160
|
+
throw new Error(`${current} is not a folder inside this seat's storage`);
|
|
161
|
+
}
|
|
162
|
+
const temp = `${file}.openrig-${process.pid}-${Date.now()}`;
|
|
163
|
+
fs.writeFileSync(temp, bytes, { flag: "wx", ...(mode !== undefined ? { mode } : {}) });
|
|
164
|
+
try {
|
|
165
|
+
if (mode !== undefined)
|
|
166
|
+
fs.chmodSync(temp, mode);
|
|
167
|
+
if (lexists(file))
|
|
168
|
+
fs.renameSync(temp, file);
|
|
169
|
+
else
|
|
170
|
+
fs.linkSync(temp, file); // fails rather than replace anything that appeared since the check
|
|
171
|
+
}
|
|
172
|
+
finally {
|
|
173
|
+
try {
|
|
174
|
+
fs.unlinkSync(temp);
|
|
175
|
+
}
|
|
176
|
+
catch { }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** Remove a file inside the seat's storage, only while it's still there with no link on the way. */
|
|
180
|
+
function removeInsideSeatStorage(root, file) {
|
|
181
|
+
if (!insideSeatStorage(root, file))
|
|
182
|
+
return false;
|
|
183
|
+
fs.unlinkSync(file);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
/** The seat's root, from the skills root an adapter is handed: `<root>/plugin/skills` (Claude) or `<root>/skills`. */
|
|
187
|
+
export function seatRootOfSkills(skillsRoot) {
|
|
188
|
+
const parent = nodePath.dirname(nodePath.resolve(skillsRoot));
|
|
189
|
+
return nodePath.basename(parent) === "plugin" ? nodePath.dirname(parent) : parent;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* After an adapter copied a skill into a seat's storage: true when every file went in. When any destination was
|
|
193
|
+
* refused, the skill is reported incomplete (the caller lists it as skipped, not projected) and the files not delivered
|
|
194
|
+
* are named; those files were neither written nor recorded, and whatever was at them is left as it was.
|
|
195
|
+
*/
|
|
196
|
+
export function seatProjectionComplete(id, notProjected, warnings) {
|
|
197
|
+
if (notProjected.length === 0)
|
|
198
|
+
return true;
|
|
199
|
+
warnings.push(`${id}: incomplete in this seat's storage: ${notProjected.length} file(s) not projected (${notProjected.join(", ")}); the skill is not fully delivered`);
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
/** Whether an adapter may write this file into a seat's skills: only inside the seat's storage, with no link on the way. */
|
|
203
|
+
export function seatSkillWriteRefusal(skillsRoot, dest) {
|
|
204
|
+
return insideSeatStorage(seatRootOfSkills(skillsRoot), dest) ? undefined : `${dest} is not inside this seat's storage (a link on the way); not written`;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* A selected plugin's bundled skills, left out of the project's copy because a seat with storage gets them there: when
|
|
208
|
+
* that storage is refused (`refusal`, the reason the seat's storage was refused), they reach neither, so the loss is named.
|
|
209
|
+
*/
|
|
210
|
+
export function seatPluginSkillsLossNote(pluginId, skippedFiles, refusal) {
|
|
211
|
+
if (skippedFiles === 0)
|
|
212
|
+
return undefined;
|
|
213
|
+
return `${pluginId}: plugin_skills_not_delivered: its bundled skills (${skippedFiles} file(s)) are not copied to the project, and this seat's skill storage is refused (${refusal}); the plugin's other files are copied as before`;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The seat plugin to load into this node's Claude process, or undefined: not a Claude seat, or OpenRig has kept no
|
|
217
|
+
* skills for it. Derived from the node record alone, so every launch and continuation path finds the same storage.
|
|
218
|
+
*/
|
|
219
|
+
export function seatSkillPluginDir(node, openrigHome) {
|
|
220
|
+
if (node.runtime !== "claude-code")
|
|
221
|
+
return undefined;
|
|
222
|
+
const paths = seatSkillPaths({ rigId: node.rig_id, logicalId: node.logical_id, runtime: node.runtime }, openrigHome);
|
|
223
|
+
return fs.existsSync(paths.pluginManifestPath) ? paths.pluginDir : undefined;
|
|
224
|
+
}
|
|
225
|
+
/** The seat plugin for a node, read from its record: what every launch and continuation path calls. Seat storage is
|
|
226
|
+
* always under the OpenRig home, so launch, teardown and restore all find the same place. */
|
|
227
|
+
export function seatSkillPluginDirForNode(db, nodeId) {
|
|
228
|
+
try {
|
|
229
|
+
const row = db.prepare("SELECT rig_id, logical_id, runtime FROM nodes WHERE id = ?").get(nodeId);
|
|
230
|
+
return row ? seatSkillPluginDir(row) : undefined;
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
return undefined;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
237
|
+
/**
|
|
238
|
+
* Put back the seat's selected skills from what its manifest recorded, before a restore relaunches it. The saved
|
|
239
|
+
* selection is kept (nothing is re-resolved). A missing file comes back only from its recorded source, and only when
|
|
240
|
+
* that source still has the recorded bytes. A file that differs from the record is someone's edit: it is kept. Anything
|
|
241
|
+
* that can't be put back is named. Nothing is replayed into a conversation; this only repairs the seat's storage.
|
|
242
|
+
*/
|
|
243
|
+
export function rehydrateSeatSkills(paths) {
|
|
244
|
+
const out = { restored: [], kept: [], missing: [], refused: [] };
|
|
245
|
+
for (const [file, entry] of recordedSeatSkillFiles(paths)) {
|
|
246
|
+
if (!insideSeatStorage(paths.root, file)) {
|
|
247
|
+
out.refused.push(file);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (lexists(file)) {
|
|
251
|
+
try {
|
|
252
|
+
if (sha256(fs.readFileSync(file)) !== entry.sha256)
|
|
253
|
+
out.kept.push(file);
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
out.kept.push(file);
|
|
257
|
+
}
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
let bytes;
|
|
261
|
+
let mode;
|
|
262
|
+
try {
|
|
263
|
+
bytes = fs.readFileSync(entry.source);
|
|
264
|
+
mode = fs.statSync(entry.source).mode & 0o777;
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
out.missing.push(file);
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
if (sha256(bytes) !== entry.sha256) {
|
|
271
|
+
out.missing.push(file);
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
try {
|
|
275
|
+
// The recorded source still has the recorded bytes, so its mode (a helper's executable bit) comes back too.
|
|
276
|
+
writeInsideSeatStorage(paths.root, file, bytes, mode);
|
|
277
|
+
out.restored.push(file);
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
out.refused.push(file);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return out;
|
|
284
|
+
}
|
|
285
|
+
/** The storage of a seat that uses it (a Claude seat with its plugin, a Codex seat with its catalog), from its node
|
|
286
|
+
* record, or undefined (no storage: the project, as before). */
|
|
287
|
+
export function seatSkillPathsForNode(db, nodeId) {
|
|
288
|
+
try {
|
|
289
|
+
const row = db.prepare("SELECT rig_id, logical_id, runtime FROM nodes WHERE id = ?").get(nodeId);
|
|
290
|
+
if (!row || (row.runtime !== "claude-code" && row.runtime !== "codex"))
|
|
291
|
+
return undefined;
|
|
292
|
+
const paths = seatSkillPaths({ rigId: row.rig_id, logicalId: row.logical_id, runtime: row.runtime });
|
|
293
|
+
// A Claude seat uses its storage once its plugin exists; a Codex seat once its catalog does.
|
|
294
|
+
return fs.existsSync(row.runtime === "codex" ? paths.catalogPath : paths.pluginManifestPath) ? paths : undefined;
|
|
295
|
+
}
|
|
296
|
+
catch {
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* A Claude or Codex seat whose storage was refused by a link: its plugin manifest (Claude) or catalog (Codex) is missing
|
|
302
|
+
* because a link on the way out of its storage refused it, or (Codex) its projection record is a link, which the catalog
|
|
303
|
+
* writer refuses too. Gives the skills root its skills were meant for and the reason, so each is refused there and named
|
|
304
|
+
* rather than written into the project or where nothing reads it. Undefined for a seat whose storage is found the
|
|
305
|
+
* ordinary way, and for one with no storage and no link (one that never had it), which keeps the project, as before.
|
|
306
|
+
*/
|
|
307
|
+
export function refusedSeatSkillsRootForNode(db, nodeId) {
|
|
308
|
+
try {
|
|
309
|
+
const row = db.prepare("SELECT rig_id, logical_id, runtime FROM nodes WHERE id = ?").get(nodeId);
|
|
310
|
+
if (!row || (row.runtime !== "claude-code" && row.runtime !== "codex"))
|
|
311
|
+
return undefined;
|
|
312
|
+
const paths = seatSkillPaths({ rigId: row.rig_id, logicalId: row.logical_id, runtime: row.runtime });
|
|
313
|
+
const marker = row.runtime === "codex" ? paths.catalogPath : paths.pluginManifestPath;
|
|
314
|
+
if (fs.existsSync(marker))
|
|
315
|
+
return undefined; // the storage is found the ordinary way
|
|
316
|
+
// The same paths the writers refuse: the Claude manifest; the Codex catalog and its projection record.
|
|
317
|
+
const checked = row.runtime === "codex" ? [paths.catalogPath, paths.projectionsPath] : [paths.pluginManifestPath];
|
|
318
|
+
const linked = checked.find((file) => !insideSeatStorage(paths.root, file));
|
|
319
|
+
return linked
|
|
320
|
+
? { skillsRoot: paths.skillsRoot, reason: `${linked} is not inside this seat's storage (a link on the way); this seat's skills are not written` }
|
|
321
|
+
: undefined;
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/** Whether a seat's copy of a skill differs from its source (a file, or a whole skill folder compared file by file). */
|
|
328
|
+
export function seatSkillDiffers(source, target) {
|
|
329
|
+
const files = (root) => {
|
|
330
|
+
const out = new Map();
|
|
331
|
+
const walk = (dir) => {
|
|
332
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
333
|
+
const full = nodePath.join(dir, entry.name);
|
|
334
|
+
if (entry.isDirectory())
|
|
335
|
+
walk(full);
|
|
336
|
+
else if (entry.isFile())
|
|
337
|
+
out.set(nodePath.relative(root, full), sha256(fs.readFileSync(full)));
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
walk(root);
|
|
341
|
+
return out;
|
|
342
|
+
};
|
|
343
|
+
try {
|
|
344
|
+
if (!fs.statSync(source).isDirectory()) {
|
|
345
|
+
const copy = nodePath.join(target, nodePath.basename(source));
|
|
346
|
+
return !fs.existsSync(copy) || sha256(fs.readFileSync(copy)) !== sha256(fs.readFileSync(source));
|
|
347
|
+
}
|
|
348
|
+
const a = files(source);
|
|
349
|
+
const b = files(target);
|
|
350
|
+
return a.size !== b.size || [...a].some(([path, hash]) => b.get(path) !== hash);
|
|
351
|
+
}
|
|
352
|
+
catch {
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/** Every Claude seat's skill folder under this OpenRig home, for the skills audit. They are seat output, never a source. */
|
|
357
|
+
export function listSeatSkillRoots(openrigHome = getOpenRigHome()) {
|
|
358
|
+
const seats = nodePath.join(nodePath.resolve(openrigHome), "state", "seats");
|
|
359
|
+
const dirs = (dir) => {
|
|
360
|
+
try {
|
|
361
|
+
return fs.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
return [];
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
return dirs(seats).flatMap((rig) => dirs(nodePath.join(seats, rig)).map((seat) => nodePath.join(seats, rig, seat, "claude-code", "plugin", "skills")))
|
|
368
|
+
.filter((root) => fs.existsSync(root));
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* For a fresh relaunch of a Claude seat with storage: which replayed skill entries to leave alone. A skill already in
|
|
372
|
+
* the seat's storage is kept as it is (if it differs from its source, that is someone's edit, and it is named); only a
|
|
373
|
+
* missing one is projected again from its saved source.
|
|
374
|
+
*/
|
|
375
|
+
export function seatSkillsToKeep(entries, paths) {
|
|
376
|
+
const keep = new Set();
|
|
377
|
+
const warnings = [];
|
|
378
|
+
for (const entry of entries) {
|
|
379
|
+
if (entry.category !== "skill")
|
|
380
|
+
continue;
|
|
381
|
+
const target = nodePath.join(paths.skillsRoot, entry.effectiveId);
|
|
382
|
+
if (!fs.existsSync(target))
|
|
383
|
+
continue;
|
|
384
|
+
if (seatSkillDiffers(entry.absolutePath, target)) {
|
|
385
|
+
warnings.push(`Restore: kept ${target}: it differs from its source ${entry.absolutePath} (an edit is never overwritten)`);
|
|
386
|
+
}
|
|
387
|
+
keep.add(entry.effectiveId);
|
|
388
|
+
}
|
|
389
|
+
return { keep, warnings };
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* For a fresh relaunch's replay, after rehydration: which saved skill entries and startup skill files not to write
|
|
393
|
+
* again. A skill already in the seat's storage is left as it is (an edit is named), and so is a startup skill file whose
|
|
394
|
+
* target is there. A missing file whose recorded source is gone or has changed is not put back by projection or install
|
|
395
|
+
* either: that would substitute today's bytes for the saved selection. Everything else is projected or installed.
|
|
396
|
+
*/
|
|
397
|
+
export function seatSkillReplay(input) {
|
|
398
|
+
const { paths } = input;
|
|
399
|
+
const notPutBack = [...input.rehydration.missing, ...input.rehydration.refused].map((f) => nodePath.resolve(f));
|
|
400
|
+
const blocked = (target) => notPutBack.some((f) => f === target || f.startsWith(target + nodePath.sep));
|
|
401
|
+
const kept = seatSkillsToKeep(input.entries, paths);
|
|
402
|
+
const skipEntryIds = new Set(kept.keep);
|
|
403
|
+
const warnings = [...kept.warnings];
|
|
404
|
+
for (const entry of input.entries) {
|
|
405
|
+
if (entry.category !== "skill" || skipEntryIds.has(entry.effectiveId))
|
|
406
|
+
continue;
|
|
407
|
+
const target = nodePath.resolve(paths.skillsRoot, entry.effectiveId);
|
|
408
|
+
if (blocked(target)) {
|
|
409
|
+
skipEntryIds.add(entry.effectiveId);
|
|
410
|
+
warnings.push(`Restore: ${target} not projected again: its recorded source is gone or has changed`);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
const skipFiles = new Set();
|
|
414
|
+
const read = input.readFile ?? ((p) => fs.readFileSync(p, "utf8"));
|
|
415
|
+
for (const file of input.files) {
|
|
416
|
+
let hint = file.deliveryHint;
|
|
417
|
+
if (hint === "auto") {
|
|
418
|
+
try {
|
|
419
|
+
hint = file.path.endsWith("SKILL.md") || read(file.absolutePath).startsWith("# SKILL") ? "skill_install" : "other";
|
|
420
|
+
}
|
|
421
|
+
catch {
|
|
422
|
+
hint = "other";
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (hint !== "skill_install")
|
|
426
|
+
continue;
|
|
427
|
+
// The adapters' skill_install target: <skills root>/<the source's folder name>/<file name>.
|
|
428
|
+
const target = nodePath.resolve(paths.skillsRoot, nodePath.basename(nodePath.dirname(file.absolutePath)), nodePath.basename(file.path));
|
|
429
|
+
if (lexists(target)) {
|
|
430
|
+
skipFiles.add(file.absolutePath);
|
|
431
|
+
let differs = true;
|
|
432
|
+
try {
|
|
433
|
+
differs = !fs.readFileSync(target).equals(fs.readFileSync(file.absolutePath));
|
|
434
|
+
}
|
|
435
|
+
catch { }
|
|
436
|
+
if (differs)
|
|
437
|
+
warnings.push(`Restore: kept ${target}: it differs from its source ${file.absolutePath} (an edit is never overwritten)`);
|
|
438
|
+
}
|
|
439
|
+
else if (blocked(target)) {
|
|
440
|
+
skipFiles.add(file.absolutePath);
|
|
441
|
+
warnings.push(`Restore: ${target} not installed again: its recorded source is gone or has changed`);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return { skipEntryIds, skipFiles, warnings };
|
|
445
|
+
}
|
|
446
|
+
const readProjections = (path) => {
|
|
447
|
+
try {
|
|
448
|
+
const value = JSON.parse(fs.readFileSync(path, "utf8"));
|
|
449
|
+
return value && typeof value.files === "object" && value.files ? value : { files: {} };
|
|
450
|
+
}
|
|
451
|
+
catch {
|
|
452
|
+
return { files: {} };
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
function writeProjections(root, record) {
|
|
456
|
+
writeInsideSeatStorage(root, nodePath.join(root, "skill-projections.json"), `${JSON.stringify({ schema: "openrig.seat-skill-projections/v1", files: record.files, ...(record.generated ? { generated: record.generated } : {}) }, null, 2)}\n`);
|
|
457
|
+
}
|
|
458
|
+
/** Record a skill file the Claude adapter wrote (or found already identical) in a seat's storage, so cleanup can tell
|
|
459
|
+
* it from an edit and a restore can put it back. `skillsRoot` is the binding's `seatSkillsRoot`. */
|
|
460
|
+
export function recordSeatSkillWrite(skillsRoot, dest, source, bytes) {
|
|
461
|
+
// `<root>/plugin/skills` (Claude) or `<root>/skills` (Codex): the record sits at the seat's root.
|
|
462
|
+
const root = seatRootOfSkills(skillsRoot);
|
|
463
|
+
const record = readProjections(nodePath.join(root, "skill-projections.json"));
|
|
464
|
+
record.files[nodePath.resolve(dest)] = { sha256: sha256(Buffer.from(bytes)), source: nodePath.resolve(source) };
|
|
465
|
+
writeProjections(root, record);
|
|
466
|
+
}
|
|
467
|
+
/** OPR.0.7.0.9: the seat's launch additions' locations, beside its skills: `additions/` (the prompt file and plugin
|
|
468
|
+
* folders) and, for Claude, its generated plugin's `agents/`. The same record, restore and cleanup route covers them. */
|
|
469
|
+
export function seatAdditionLocations(paths) {
|
|
470
|
+
return [nodePath.join(paths.root, "additions"), ...(paths.skillsRoot === nodePath.join(paths.pluginDir, "skills") ? [nodePath.join(paths.pluginDir, "agents")] : [])];
|
|
471
|
+
}
|
|
472
|
+
/** Every file OpenRig recorded writing into this seat's skills or launch additions: its recorded hash and source. */
|
|
473
|
+
function recordedSeatSkillFiles(paths) {
|
|
474
|
+
const out = new Map();
|
|
475
|
+
const roots = [paths.skillsRoot, ...seatAdditionLocations(paths)].map((dir) => nodePath.resolve(dir) + nodePath.sep);
|
|
476
|
+
const inside = (file) => roots.some((root) => file.startsWith(root));
|
|
477
|
+
try {
|
|
478
|
+
const manifest = JSON.parse(fs.readFileSync(paths.manifestPath, "utf8"));
|
|
479
|
+
for (const skill of Array.isArray(manifest.skills) ? manifest.skills : []) {
|
|
480
|
+
if (typeof skill["target"] !== "string" || typeof skill["sourceDir"] !== "string" || !skill["files"] || typeof skill["files"] !== "object")
|
|
481
|
+
continue;
|
|
482
|
+
const target = nodePath.resolve(skill["target"]);
|
|
483
|
+
for (const [relative, digest] of Object.entries(skill["files"])) {
|
|
484
|
+
const file = nodePath.resolve(target, relative);
|
|
485
|
+
if (typeof digest === "string" && inside(file))
|
|
486
|
+
out.set(file, { sha256: digest, source: nodePath.resolve(skill["sourceDir"], relative) });
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
catch { }
|
|
491
|
+
for (const [file, entry] of Object.entries(readProjections(paths.projectionsPath).files)) {
|
|
492
|
+
if (entry && typeof entry.sha256 === "string" && typeof entry.source === "string" && inside(nodePath.resolve(file)))
|
|
493
|
+
out.set(nodePath.resolve(file), entry);
|
|
494
|
+
}
|
|
495
|
+
return out;
|
|
496
|
+
}
|
|
497
|
+
/** Whether OpenRig has a record of writing this seat's skills (so a restore can rebuild its storage). */
|
|
498
|
+
export function hasSeatSkillRecords(paths) {
|
|
499
|
+
return fs.existsSync(paths.manifestPath) || fs.existsSync(paths.projectionsPath);
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Remove what OpenRig wrote into a seat's skills once the seat's consumers have stopped: only recorded files whose
|
|
503
|
+
* bytes still match the record, and the generated plugin's manifest, so nothing points at the storage. Edited and
|
|
504
|
+
* unrecorded files are kept and reported. The records themselves stay, unless `dropRecords` (the rig is deleted), so a
|
|
505
|
+
* later restore can rebuild the seat's skills from their sources.
|
|
506
|
+
*/
|
|
507
|
+
export function cleanSeatSkills(paths, opts = {}) {
|
|
508
|
+
const out = { removed: [], kept: [], refused: [] };
|
|
509
|
+
if (!lexists(paths.root))
|
|
510
|
+
return out;
|
|
511
|
+
// Every file this cleanup removes; only the folders on their paths may be removed afterwards.
|
|
512
|
+
const removedFiles = [];
|
|
513
|
+
for (const [file, entry] of recordedSeatSkillFiles(paths)) {
|
|
514
|
+
if (!lexists(file))
|
|
515
|
+
continue;
|
|
516
|
+
if (!insideSeatStorage(paths.root, file)) {
|
|
517
|
+
out.refused.push(file);
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
try {
|
|
521
|
+
if (sha256(fs.readFileSync(file)) === entry.sha256 && removeInsideSeatStorage(paths.root, file)) {
|
|
522
|
+
out.removed.push(file);
|
|
523
|
+
removedFiles.push(file);
|
|
524
|
+
}
|
|
525
|
+
else
|
|
526
|
+
out.kept.push(file);
|
|
527
|
+
}
|
|
528
|
+
catch {
|
|
529
|
+
out.kept.push(file);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
const leftovers = (dir) => {
|
|
533
|
+
let found = [];
|
|
534
|
+
try {
|
|
535
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
536
|
+
const full = nodePath.join(dir, e.name);
|
|
537
|
+
if (e.isDirectory())
|
|
538
|
+
found = found.concat(leftovers(full));
|
|
539
|
+
else
|
|
540
|
+
found.push(full);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
catch { }
|
|
544
|
+
return found;
|
|
545
|
+
};
|
|
546
|
+
// The generated router, like the catalog below: removed only while it is exactly what OpenRig recorded writing.
|
|
547
|
+
const router = nodePath.join(paths.skillsRoot, SEAT_SKILL_ROUTER_ID, "SKILL.md");
|
|
548
|
+
if (lexists(router)) {
|
|
549
|
+
const recorded = readProjections(paths.projectionsPath).generated?.[router];
|
|
550
|
+
try {
|
|
551
|
+
if (insideSeatStorage(paths.root, router) && recorded === sha256(fs.readFileSync(router)) && removeInsideSeatStorage(paths.root, router))
|
|
552
|
+
removedFiles.push(router);
|
|
553
|
+
}
|
|
554
|
+
catch { }
|
|
555
|
+
}
|
|
556
|
+
for (const dir of [paths.skillsRoot, ...seatAdditionLocations(paths)]) {
|
|
557
|
+
// A linked location is refused above, file by file; nothing is walked through it.
|
|
558
|
+
if (dir !== paths.skillsRoot && lexists(dir) && !anchored(seatsAnchor(paths.root), dir, "folder"))
|
|
559
|
+
continue;
|
|
560
|
+
for (const file of leftovers(dir))
|
|
561
|
+
if (!out.kept.includes(file) && !out.refused.includes(file))
|
|
562
|
+
out.kept.push(file);
|
|
563
|
+
}
|
|
564
|
+
// Nothing points at the storage any more: no Claude plugin, no Codex catalog (both are rebuilt on a restore). Each is
|
|
565
|
+
// removed only while it is exactly what OpenRig wrote: the plugin manifest is a constant, and the catalog's digest
|
|
566
|
+
// is recorded when OpenRig writes it. A differing or unrecorded one is someone's: kept and named.
|
|
567
|
+
const generated = readProjections(paths.projectionsPath).generated ?? {};
|
|
568
|
+
const owned = (file, expected) => {
|
|
569
|
+
if (!lexists(file))
|
|
570
|
+
return;
|
|
571
|
+
try {
|
|
572
|
+
if (insideSeatStorage(paths.root, file) && expected(fs.readFileSync(file)) && removeInsideSeatStorage(paths.root, file)) {
|
|
573
|
+
removedFiles.push(file);
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
catch { }
|
|
578
|
+
out.kept.push(file);
|
|
579
|
+
};
|
|
580
|
+
owned(paths.pluginManifestPath, (bytes) => bytes.toString("utf8") === PLUGIN_MANIFEST);
|
|
581
|
+
owned(paths.catalogPath, (bytes) => generated[paths.catalogPath] === sha256(bytes));
|
|
582
|
+
if (opts.dropRecords && out.kept.length === 0 && out.refused.length === 0) {
|
|
583
|
+
for (const record of [paths.manifestPath, paths.projectionsPath, nodePath.join(paths.root, "launch-additions.json")]) {
|
|
584
|
+
try {
|
|
585
|
+
if (removeInsideSeatStorage(paths.root, record))
|
|
586
|
+
removedFiles.push(record);
|
|
587
|
+
}
|
|
588
|
+
catch { }
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
// Remove only the folders this cleanup emptied: those on the path of a file it removed, from the deepest up to the
|
|
592
|
+
// rig's folder, each while it is still an empty real folder under the anchor. An empty folder OpenRig never wrote a
|
|
593
|
+
// file into is not recorded ownership, so it stays; nothing is walked through a refused (linked) path.
|
|
594
|
+
const anchor = seatsAnchor(paths.root);
|
|
595
|
+
const emptied = new Set();
|
|
596
|
+
for (const file of removedFiles) {
|
|
597
|
+
for (let dir = nodePath.dirname(nodePath.resolve(file)); dir.startsWith(anchor + nodePath.sep); dir = nodePath.dirname(dir))
|
|
598
|
+
emptied.add(dir);
|
|
599
|
+
}
|
|
600
|
+
for (const dir of [...emptied].sort((a, b) => b.split(nodePath.sep).length - a.split(nodePath.sep).length)) {
|
|
601
|
+
try {
|
|
602
|
+
if (anchored(anchor, dir, "folder") && fs.readdirSync(dir).length === 0)
|
|
603
|
+
fs.rmdirSync(dir);
|
|
604
|
+
}
|
|
605
|
+
catch { }
|
|
606
|
+
}
|
|
607
|
+
out.kept.sort();
|
|
608
|
+
out.refused.sort();
|
|
609
|
+
return out;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Copies a Claude seat's earlier launches put in the project, once the seat uses its own storage. They go only when the
|
|
613
|
+
* project's loadout record names this seat as the sole owner and they are unchanged: that is the reconciler's own rule
|
|
614
|
+
* for a skill no seat selects any more, run with this seat's selection emptied. A skill the person installed for the
|
|
615
|
+
* project stays selected. While another seat still shares the copies, nothing is removed. Returns launch notes.
|
|
616
|
+
*/
|
|
617
|
+
export function migrateLegacyProjectSkills(input) {
|
|
618
|
+
let owners;
|
|
619
|
+
try {
|
|
620
|
+
const manifest = JSON.parse(fs.readFileSync(nodePath.join(input.cwd, ".openrig", "skill-loadouts", "claude-code.json"), "utf8"));
|
|
621
|
+
owners = Object.keys(manifest.topologySelections ?? {});
|
|
622
|
+
}
|
|
623
|
+
catch {
|
|
624
|
+
return [];
|
|
625
|
+
}
|
|
626
|
+
if (owners.length === 0)
|
|
627
|
+
return [];
|
|
628
|
+
const others = owners.filter((owner) => owner !== input.owner);
|
|
629
|
+
if (others.length > 0)
|
|
630
|
+
return [`legacy_project_skills_kept: other seats still share the project's copies (${others.join(", ")})`];
|
|
631
|
+
const migrated = input.reconcile({
|
|
632
|
+
loadout: { ...input.loadout, projectSelectionDeclared: false, projectSelection: [], entries: [], skipped: [] },
|
|
633
|
+
runtime: "claude-code", cwd: input.cwd, apply: true, topologyOwner: input.owner,
|
|
634
|
+
});
|
|
635
|
+
if (!migrated.ok)
|
|
636
|
+
return [`legacy_project_skills_kept: ${migrated.errors.map((e) => `${e.code}: ${e.message}`).join("; ")}`];
|
|
637
|
+
return migrated.removed.length > 0 ? [`legacy_project_skills_removed: ${migrated.removed.join(", ")} (now in this seat's own storage)`] : [];
|
|
638
|
+
}
|
|
639
|
+
/** The launch or restore warning for a catalog that wasn't written, naming why. */
|
|
640
|
+
export function seatCatalogKeptNote(catalog) {
|
|
641
|
+
return catalog.reason === "linked"
|
|
642
|
+
? `seat_catalog_refused: ${catalog.path} is not inside this seat's storage (a link on the way); nothing was written there`
|
|
643
|
+
: `seat_catalog_kept: ${catalog.path} differs from what OpenRig last wrote; kept as it is`;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* OPR.0.7.0.13 (Codex C2): write the seat's skill catalog from what is in its own storage: each skill's original
|
|
647
|
+
* description (its trigger) and the exact SKILL.md to read, never the skill bodies. It is delivered to the seat through
|
|
648
|
+
* its per-seat startup text, so it says plainly that it replaces any earlier list (a fork child carries its parent's).
|
|
649
|
+
*/
|
|
650
|
+
export function writeSeatSkillCatalog(paths) {
|
|
651
|
+
const lines = [];
|
|
652
|
+
let ids = [];
|
|
653
|
+
// The generated router isn't one of the seat's skills; anything else under its reserved name (a team skill named so,
|
|
654
|
+
// or an edited router) is listed like any skill, never hidden.
|
|
655
|
+
const routerGenerated = resolveSeatSkillRouter(paths).written;
|
|
656
|
+
try {
|
|
657
|
+
ids = fs.readdirSync(paths.skillsRoot, { withFileTypes: true }).filter((e) => e.isDirectory() && !(e.name === SEAT_SKILL_ROUTER_ID && routerGenerated)).map((e) => e.name).sort();
|
|
658
|
+
}
|
|
659
|
+
catch { }
|
|
660
|
+
for (const id of ids) {
|
|
661
|
+
const file = nodePath.join(paths.skillsRoot, id, "SKILL.md");
|
|
662
|
+
let parsed;
|
|
663
|
+
try {
|
|
664
|
+
parsed = parseSkillFrontmatter(fs.readFileSync(file, "utf8"));
|
|
665
|
+
}
|
|
666
|
+
catch {
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
if (!parsed.ok)
|
|
670
|
+
continue;
|
|
671
|
+
const description = String(parsed.frontmatter.description).replace(/\s+/g, " ").trim();
|
|
672
|
+
lines.push(`- **${parsed.frontmatter.name}**: ${description}`, ` Read before you use it: \`${file}\``);
|
|
673
|
+
}
|
|
674
|
+
const text = [
|
|
675
|
+
"OpenRig: this seat's skills. This list replaces any earlier OpenRig skill list in this conversation.",
|
|
676
|
+
"",
|
|
677
|
+
lines.length > 0
|
|
678
|
+
? "Each skill says when to use it. When that moment comes, read its SKILL.md, then follow it."
|
|
679
|
+
: "No OpenRig skills are kept for this seat.",
|
|
680
|
+
"",
|
|
681
|
+
...lines,
|
|
682
|
+
"",
|
|
683
|
+
].join("\n");
|
|
684
|
+
const digest = sha256(Buffer.from(text));
|
|
685
|
+
const count = lines.length / 2;
|
|
686
|
+
// A linked catalog or record path anywhere from the anchor down: neither is read or written through it, and the reason
|
|
687
|
+
// is named. (The skills folder listed above is read where it is, link or not; this guards the two files written here.)
|
|
688
|
+
if (!insideSeatStorage(paths.root, paths.catalogPath) || !insideSeatStorage(paths.root, paths.projectionsPath)) {
|
|
689
|
+
return { path: paths.catalogPath, digest, count, kept: true, reason: "linked" };
|
|
690
|
+
}
|
|
691
|
+
const record = readProjections(paths.projectionsPath);
|
|
692
|
+
if (lexists(paths.catalogPath)) {
|
|
693
|
+
let current;
|
|
694
|
+
try {
|
|
695
|
+
if (insideSeatStorage(paths.root, paths.catalogPath))
|
|
696
|
+
current = fs.readFileSync(paths.catalogPath);
|
|
697
|
+
}
|
|
698
|
+
catch { }
|
|
699
|
+
const ours = current !== undefined && (sha256(current) === digest || record.generated?.[paths.catalogPath] === sha256(current));
|
|
700
|
+
if (!ours)
|
|
701
|
+
return { path: paths.catalogPath, digest: current ? sha256(current) : digest, count, kept: true, reason: "edited" };
|
|
702
|
+
}
|
|
703
|
+
writeInsideSeatStorage(paths.root, paths.catalogPath, text);
|
|
704
|
+
writeProjections(paths.root, { ...record, generated: { ...record.generated, [paths.catalogPath]: digest } });
|
|
705
|
+
return { path: paths.catalogPath, digest, count };
|
|
706
|
+
}
|
|
707
|
+
/** The startup file, and the managed block id, that carry the bootstrap line into a seat's guidance file. */
|
|
708
|
+
export const SEAT_SKILLS_BOOTSTRAP_BLOCK_ID = "openrig-seat-skills.md";
|
|
709
|
+
/** OPR.0.7.0.13 (router, R1.1): the one constant bootstrap line, verbatim. The guidance asset carries exactly this text. */
|
|
710
|
+
export const SEAT_SKILLS_BOOTSTRAP_LINE = "OpenRig seat skills: if `OPENRIG_SESSION_NAME` is set, run `rig skill loadout --seat self` and use the router skill it names; if it isn't set, this line doesn't apply to you.";
|
|
711
|
+
/** Whether guidance text holds the seat-skills block with anything but the line: a person edited it. A start leaves such a
|
|
712
|
+
* block as it is, and down keeps it (both by `managedBlockBodyMatches`). */
|
|
713
|
+
export function seatSkillsLineEdited(content) {
|
|
714
|
+
return hasEditedManagedBlock(content, SEAT_SKILLS_BOOTSTRAP_BLOCK_ID, SEAT_SKILLS_BOOTSTRAP_LINE);
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Slice 20 seam: the exact preview of the bootstrap line's footprint, before any write: the line verbatim, the exact text
|
|
718
|
+
* written (the line between OpenRig's markers) and where it goes, and each file
|
|
719
|
+
* it would go into (a Claude seat's rig file, `CLAUDE.md` or `CLAUDE.local.md`; a Codex seat's `AGENTS.md`), one entry
|
|
720
|
+
* per file with every seat sharing it. Pure: no filesystem or settings read. The file rule is main's
|
|
721
|
+
* `seatGuidanceFile` (restore-guidance.ts), repeated here until this branch carries it.
|
|
722
|
+
*/
|
|
723
|
+
export function describeSkillRouterFootprint(seats) {
|
|
724
|
+
const byPath = new Map();
|
|
725
|
+
const notCovered = [];
|
|
726
|
+
for (const s of seats) {
|
|
727
|
+
const name = s.runtime === "claude-code" ? (s.claudeManagedBlockFile ?? "CLAUDE.md") : s.runtime === "codex" ? "AGENTS.md" : null;
|
|
728
|
+
if (!name) {
|
|
729
|
+
notCovered.push({ seat: s.seat, runtime: s.runtime, reason: "this runtime has no managed guidance file for the line" });
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
const path = nodePath.join(s.cwd, name);
|
|
733
|
+
const entry = byPath.get(path) ?? { path, runtime: s.runtime, seats: [] };
|
|
734
|
+
entry.seats.push(s.seat);
|
|
735
|
+
byPath.set(path, entry);
|
|
736
|
+
}
|
|
737
|
+
// The guidance asset carries the line and a newline; the managed-block writer puts its markers around that.
|
|
738
|
+
const written = managedBlockText(SEAT_SKILLS_BOOTSTRAP_BLOCK_ID, `${SEAT_SKILLS_BOOTSTRAP_LINE}\n`);
|
|
739
|
+
return {
|
|
740
|
+
line: SEAT_SKILLS_BOOTSTRAP_LINE,
|
|
741
|
+
written,
|
|
742
|
+
placement: "Added at the end of the file after two newlines. A file that doesn't exist yet holds only this, and a file that already has it gets it replaced in place.",
|
|
743
|
+
appended: `${MANAGED_BLOCK_APPEND_SEPARATOR}${written}`,
|
|
744
|
+
files: [...byPath.values()],
|
|
745
|
+
notCovered,
|
|
746
|
+
ifNo: "Nothing is written into these files. Each seat still has its own skills and router; a Codex seat still gets its skill list in its startup text, and any agent can run `rig skill loadout --seat self`, but nothing in the project points there.",
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
/** OPR.0.7.0.13 (router): the id of the one router skill OpenRig generates for each seat. */
|
|
750
|
+
export const SEAT_SKILL_ROUTER_ID = "openrig-seat-router";
|
|
751
|
+
/** The router's place in the seat's own storage, and whether it is there as OpenRig wrote it. Reads only. */
|
|
752
|
+
export function resolveSeatSkillRouter(paths) {
|
|
753
|
+
const file = nodePath.join(paths.skillsRoot, SEAT_SKILL_ROUTER_ID, "SKILL.md");
|
|
754
|
+
if (!insideSeatStorage(paths.root, file) || !insideSeatStorage(paths.root, paths.projectionsPath)) {
|
|
755
|
+
return { id: SEAT_SKILL_ROUTER_ID, path: file, written: false, kept: "linked" };
|
|
756
|
+
}
|
|
757
|
+
if (!lexists(file))
|
|
758
|
+
return { id: SEAT_SKILL_ROUTER_ID, path: file, written: false };
|
|
759
|
+
let written = false;
|
|
760
|
+
try {
|
|
761
|
+
written = readProjections(paths.projectionsPath).generated?.[file] === sha256(fs.readFileSync(file));
|
|
762
|
+
}
|
|
763
|
+
catch { }
|
|
764
|
+
return { id: SEAT_SKILL_ROUTER_ID, path: file, written, ...(written ? {} : { kept: "edited" }) };
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* OPR.0.7.0.13 (router, R1.1): write the one router skill OpenRig generates for this seat, in the seat's own storage,
|
|
768
|
+
* with every other skill's trigger and the exact SKILL.md to read in its body. It is a skill like the others (for Claude,
|
|
769
|
+
* `openrig:openrig-seat-router` through the seat plugin), so it is never listed in the Codex catalog, which stays as it
|
|
770
|
+
* was. A router edited since OpenRig wrote it, or on a linked path, is kept and named, never overwritten.
|
|
771
|
+
*/
|
|
772
|
+
export function writeSeatSkillRouter(paths) {
|
|
773
|
+
const router = resolveSeatSkillRouter(paths);
|
|
774
|
+
// A link on the way: nothing is read through it, and nothing written.
|
|
775
|
+
if (router.kept === "linked")
|
|
776
|
+
return { id: router.id, path: router.path, written: false, kept: "linked" };
|
|
777
|
+
const lines = [];
|
|
778
|
+
let ids = [];
|
|
779
|
+
try {
|
|
780
|
+
ids = fs.readdirSync(paths.skillsRoot, { withFileTypes: true })
|
|
781
|
+
.filter((e) => e.isDirectory() && e.name !== SEAT_SKILL_ROUTER_ID).map((e) => e.name).sort();
|
|
782
|
+
}
|
|
783
|
+
catch { }
|
|
784
|
+
for (const id of ids) {
|
|
785
|
+
const file = nodePath.join(paths.skillsRoot, id, "SKILL.md");
|
|
786
|
+
let parsed;
|
|
787
|
+
try {
|
|
788
|
+
parsed = parseSkillFrontmatter(fs.readFileSync(file, "utf8"));
|
|
789
|
+
}
|
|
790
|
+
catch {
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
if (!parsed.ok)
|
|
794
|
+
continue;
|
|
795
|
+
const description = String(parsed.frontmatter.description).replace(/\s+/g, " ").trim();
|
|
796
|
+
lines.push(`- **${parsed.frontmatter.name}**: ${description}`, ` Read before you use it: \`${file}\``);
|
|
797
|
+
}
|
|
798
|
+
const text = [
|
|
799
|
+
"---",
|
|
800
|
+
`name: ${SEAT_SKILL_ROUTER_ID}`,
|
|
801
|
+
"description: Use first whenever you might need one of this OpenRig seat's own skills. It lists each skill, when to use it, and the exact file to read.",
|
|
802
|
+
"---",
|
|
803
|
+
"",
|
|
804
|
+
"# This seat's OpenRig skills",
|
|
805
|
+
"",
|
|
806
|
+
lines.length > 0
|
|
807
|
+
? "Each skill says when to use it. When that moment comes, read its SKILL.md, then follow it."
|
|
808
|
+
: "No other OpenRig skills are kept for this seat.",
|
|
809
|
+
"",
|
|
810
|
+
...lines,
|
|
811
|
+
"",
|
|
812
|
+
].join("\n");
|
|
813
|
+
const digest = sha256(Buffer.from(text));
|
|
814
|
+
if (!insideSeatStorage(paths.root, router.path) || !insideSeatStorage(paths.root, paths.projectionsPath)) {
|
|
815
|
+
return { ...router, written: false, kept: "linked" };
|
|
816
|
+
}
|
|
817
|
+
const record = readProjections(paths.projectionsPath);
|
|
818
|
+
if (lexists(router.path)) {
|
|
819
|
+
let current;
|
|
820
|
+
try {
|
|
821
|
+
current = fs.readFileSync(router.path);
|
|
822
|
+
}
|
|
823
|
+
catch { }
|
|
824
|
+
const ours = current !== undefined && (sha256(current) === digest || record.generated?.[router.path] === sha256(current));
|
|
825
|
+
if (!ours)
|
|
826
|
+
return { ...router, written: false, kept: "edited" };
|
|
827
|
+
}
|
|
828
|
+
writeInsideSeatStorage(paths.root, router.path, text);
|
|
829
|
+
writeProjections(paths.root, { ...record, generated: { ...record.generated, [router.path]: digest } });
|
|
830
|
+
return { id: router.id, path: router.path, written: true };
|
|
831
|
+
}
|
|
832
|
+
/** The launch or restore warning for a router that wasn't written, naming why. */
|
|
833
|
+
export function seatRouterKeptNote(router) {
|
|
834
|
+
return router.kept === "linked"
|
|
835
|
+
? `seat_router_refused: ${router.path} is not inside this seat's storage (a link on the way); nothing was written there`
|
|
836
|
+
: `seat_router_kept: ${router.path} differs from what OpenRig last wrote; kept as it is`;
|
|
837
|
+
}
|
|
838
|
+
/** Claude Code reads a seat's plugin from CLAUDE_CODE_PLUGIN_DIRS from v2.1.280; OpenRig doesn't check the version. */
|
|
839
|
+
export const TEAM_SKILLS_VERSION_NOTE = "team_skills_need_claude_2.1.280: this seat's skills reach Claude Code through CLAUDE_CODE_PLUGIN_DIRS, which Claude Code reads from v2.1.280; OpenRig doesn't check the version, and an older Claude starts without them";
|
|
840
|
+
/**
|
|
841
|
+
* The version limit, named for a Claude seat with its own storage whenever any writer puts a skill there: its loadout,
|
|
842
|
+
* a profile skill, or a startup skill file. A seat with no skills gets no note.
|
|
843
|
+
*/
|
|
844
|
+
export function claudeSeatSkillsNote(input) {
|
|
845
|
+
const writesSkills = input.loadoutReceipts > 0
|
|
846
|
+
|| input.planEntries.some((e) => e.category === "skill")
|
|
847
|
+
|| input.startupFiles.some((f) => f.deliveryHint === "skill_install" || (f.deliveryHint === "auto" && f.path.endsWith("SKILL.md")));
|
|
848
|
+
return writesSkills ? TEAM_SKILLS_VERSION_NOTE : undefined;
|
|
849
|
+
}
|
|
850
|
+
//# sourceMappingURL=seat-skill-storage.js.map
|