@openrig/cli 0.7.2 → 0.7.4
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 +5 -5
- 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 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +13 -9
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +2 -2
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +37 -3
- package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +4 -0
- package/daemon/context-packs/help/help.md +6 -3
- 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 +100 -15
- package/daemon/context-packs/reference/getting-started.md +12 -8
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +89 -3
- package/daemon/context-packs/reference/whats-new.md +109 -282
- 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/SKILL.md +2 -2
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +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 +37 -3
- 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 +5 -2
- 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-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/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/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/SKILL.md +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/systematic-debugging/root-cause-tracing.md +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/SKILL.md +4 -0
- 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 +1 -0
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +17 -4
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +18 -6
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-resume.d.ts +2 -1
- package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-resume.js +20 -8
- package/daemon/dist/adapters/codex-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +10 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +381 -50
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-openrouter-charge.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-openrouter-charge.js +3 -0
- package/daemon/dist/adapters/pi-openrouter-charge.js.map +1 -1
- package/daemon/dist/adapters/pi-resume.js +1 -1
- package/daemon/dist/adapters/pi-resume.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +3 -3
- package/daemon/dist/adapters/pi-runner-protocol.js +2 -2
- package/daemon/dist/adapters/pi-runner.d.ts +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +13 -4
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +0 -3
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +0 -5
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +13 -0
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +62 -4
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +16 -1
- 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/context-pack-taxonomy-surface.js +1 -1
- package/daemon/dist/context-pack-taxonomy-surface.js.map +1 -1
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +4 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/137_node_codex_permissions.d.ts +3 -0
- package/daemon/dist/db/migrations/137_node_codex_permissions.d.ts.map +1 -0
- package/daemon/dist/db/migrations/137_node_codex_permissions.js +7 -0
- package/daemon/dist/db/migrations/137_node_codex_permissions.js.map +1 -0
- package/daemon/dist/db/migrations/140_identity_principal.d.ts +12 -0
- package/daemon/dist/db/migrations/140_identity_principal.d.ts.map +1 -0
- package/daemon/dist/db/migrations/140_identity_principal.js +20 -0
- package/daemon/dist/db/migrations/140_identity_principal.js.map +1 -0
- package/daemon/dist/domain/active-occupant.js +1 -1
- package/daemon/dist/domain/active-occupant.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +5 -3
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-resolver.js +1 -1
- package/daemon/dist/domain/agent-resolver.js.map +1 -1
- package/daemon/dist/domain/bind-plan.js +1 -1
- package/daemon/dist/domain/bind-plan.js.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
- package/daemon/dist/domain/bundle-skills-router.js +2 -2
- package/daemon/dist/domain/bundle-skills-router.js.map +1 -1
- package/daemon/dist/domain/codex-member-permissions.d.ts +56 -0
- package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -0
- package/daemon/dist/domain/codex-member-permissions.js +140 -0
- package/daemon/dist/domain/codex-member-permissions.js.map +1 -0
- package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.js +2 -1
- package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -1
- package/daemon/dist/domain/context-packs/context-pack-library-service.js +2 -2
- package/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -1
- package/daemon/dist/domain/current-restore-snapshot.d.ts +8 -0
- package/daemon/dist/domain/current-restore-snapshot.d.ts.map +1 -0
- package/daemon/dist/domain/current-restore-snapshot.js +26 -0
- package/daemon/dist/domain/current-restore-snapshot.js.map +1 -0
- 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-candidate-reader.d.ts +16 -0
- package/daemon/dist/domain/execution-candidate-reader.d.ts.map +1 -0
- package/daemon/dist/domain/execution-candidate-reader.js +77 -0
- package/daemon/dist/domain/execution-candidate-reader.js.map +1 -0
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +16 -6
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/feed-perspective.d.ts +14 -0
- package/daemon/dist/domain/feed-perspective.d.ts.map +1 -0
- package/daemon/dist/domain/feed-perspective.js +36 -0
- package/daemon/dist/domain/feed-perspective.js.map +1 -0
- package/daemon/dist/domain/gateway/channel-operations.d.ts +1 -1
- package/daemon/dist/domain/gateway/channel-operations.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.d.ts +6 -0
- package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.js +8 -1
- package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.d.ts +11 -4
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +36 -5
- package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +5 -2
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/participants.d.ts +180 -0
- package/daemon/dist/domain/gateway/participants.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/participants.js +434 -0
- package/daemon/dist/domain/gateway/participants.js.map +1 -0
- package/daemon/dist/domain/gateway/slack/inbound-admission.d.ts +2 -2
- package/daemon/dist/domain/gateway/slack/inbound-admission.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound-admission.js +73 -6
- package/daemon/dist/domain/gateway/slack/inbound-admission.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +18 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +27 -11
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +14 -6
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/open-asks.d.ts +50 -0
- package/daemon/dist/domain/gateway/slack/open-asks.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/slack/open-asks.js +215 -0
- package/daemon/dist/domain/gateway/slack/open-asks.js.map +1 -0
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.js +1 -0
- package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +15 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +98 -29
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +1 -0
- 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 +59 -4
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/state-store.d.ts +3 -0
- package/daemon/dist/domain/gateway/slack/state-store.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/state-store.js +18 -0
- package/daemon/dist/domain/gateway/slack/state-store.js.map +1 -1
- package/daemon/dist/domain/hosted-wake.d.ts +19 -0
- package/daemon/dist/domain/hosted-wake.d.ts.map +1 -0
- package/daemon/dist/domain/hosted-wake.js +56 -0
- package/daemon/dist/domain/hosted-wake.js.map +1 -0
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
- package/daemon/dist/domain/kernel-boot.d.ts +10 -4
- package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
- package/daemon/dist/domain/kernel-boot.js +14 -7
- package/daemon/dist/domain/kernel-boot.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-read-layer.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-read-layer.js +3 -1
- package/daemon/dist/domain/mission-control/mission-control-read-layer.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +16 -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 +64 -16
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/native-permission-store.d.ts +3 -2
- package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
- package/daemon/dist/domain/native-permission-store.js +14 -1
- package/daemon/dist/domain/native-permission-store.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts +9 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +37 -2
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +2 -2
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +10 -5
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +5 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +35 -1
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +3 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +10 -4
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/permission-account.d.ts.map +1 -1
- package/daemon/dist/domain/permission-account.js +44 -9
- package/daemon/dist/domain/permission-account.js.map +1 -1
- package/daemon/dist/domain/permission-drift-observer.js +1 -1
- package/daemon/dist/domain/permission-drift-observer.js.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts +3 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.d.ts.map +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.js +1 -1
- package/daemon/dist/domain/policies/artifact-pool-helpers.js.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.d.ts +6 -2
- package/daemon/dist/domain/policies/delivery-digest-flush.d.ts.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.js +34 -9
- package/daemon/dist/domain/policies/delivery-digest-flush.js.map +1 -1
- package/daemon/dist/domain/policies/edge-artifact-required.d.ts.map +1 -1
- package/daemon/dist/domain/policies/edge-artifact-required.js +3 -0
- package/daemon/dist/domain/policies/edge-artifact-required.js.map +1 -1
- package/daemon/dist/domain/policies/quiet-release.d.ts +14 -0
- package/daemon/dist/domain/policies/quiet-release.d.ts.map +1 -1
- package/daemon/dist/domain/policies/quiet-release.js +13 -2
- package/daemon/dist/domain/policies/quiet-release.js.map +1 -1
- package/daemon/dist/domain/profile-resolution-worker.d.ts +1 -1
- package/daemon/dist/domain/profile-resolution-worker.d.ts.map +1 -1
- package/daemon/dist/domain/profile-resolution-worker.js +5 -5
- package/daemon/dist/domain/profile-resolution-worker.js.map +1 -1
- package/daemon/dist/domain/provider/claude-interruption.d.ts +3 -0
- package/daemon/dist/domain/provider/claude-interruption.d.ts.map +1 -0
- package/daemon/dist/domain/provider/claude-interruption.js +5 -0
- package/daemon/dist/domain/provider/claude-interruption.js.map +1 -0
- package/daemon/dist/domain/provider/host-usage-rollup.js +18 -8
- package/daemon/dist/domain/provider/host-usage-rollup.js.map +1 -1
- package/daemon/dist/domain/provider/provider-signals.d.ts +12 -5
- package/daemon/dist/domain/provider/provider-signals.d.ts.map +1 -1
- package/daemon/dist/domain/provider/provider-signals.js +31 -8
- package/daemon/dist/domain/provider/provider-signals.js.map +1 -1
- package/daemon/dist/domain/provider/reactive-tap.d.ts +4 -4
- package/daemon/dist/domain/provider/reactive-tap.d.ts.map +1 -1
- package/daemon/dist/domain/provider/reactive-tap.js +20 -4
- package/daemon/dist/domain/provider/reactive-tap.js.map +1 -1
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +3 -2
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-destination-check.d.ts +5 -0
- package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
- package/daemon/dist/domain/queue-destination-check.js +5 -1
- package/daemon/dist/domain/queue-destination-check.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +38 -6
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +115 -33
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
- package/daemon/dist/domain/queue-retention.js +4 -2
- package/daemon/dist/domain/queue-retention.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +35 -0
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +6 -0
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +11 -2
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +2 -1
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/reconciler.d.ts +2 -0
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +5 -2
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +21 -2
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +182 -43
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +27 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +51 -29
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/review/compose.js +1 -1
- package/daemon/dist/domain/review/compose.js.map +1 -1
- package/daemon/dist/domain/review/gather.d.ts +11 -0
- package/daemon/dist/domain/review/gather.d.ts.map +1 -1
- package/daemon/dist/domain/review/gather.js +65 -27
- package/daemon/dist/domain/review/gather.js.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-expansion-service.js +1 -0
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +1 -0
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +15 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +3 -0
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +3 -0
- 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 +4 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +12 -1
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +2 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +150 -128
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +24 -1
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +46 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -0
- package/daemon/dist/domain/rosters.js +80 -0
- package/daemon/dist/domain/rosters.js.map +1 -0
- package/daemon/dist/domain/runtime-adapter.d.ts +4 -0
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js +2 -0
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/scope/dot-id.js +2 -2
- package/daemon/dist/domain/scope/dot-id.js.map +1 -1
- package/daemon/dist/domain/scope/scaffold-placeholder.d.ts +1 -1
- package/daemon/dist/domain/scope/scaffold-placeholder.js +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +1 -1
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/scope/types.d.ts.map +1 -1
- package/daemon/dist/domain/scope/types.js +2 -3
- package/daemon/dist/domain/scope/types.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +2 -0
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +10 -1
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +7 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +89 -4
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +23 -8
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +153 -12
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +2 -2
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +2 -2
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts +9 -2
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +53 -5
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +1 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +11 -0
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.js +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +2 -0
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +3 -1
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +45 -1
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +205 -29
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/shared-history-selection.d.ts +34 -0
- package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -0
- package/daemon/dist/domain/shared-history-selection.js +74 -0
- package/daemon/dist/domain/shared-history-selection.js.map +1 -0
- package/daemon/dist/domain/skill-library-discovery.js +2 -2
- package/daemon/dist/domain/skill-library-discovery.js.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts +4 -4
- package/daemon/dist/domain/slices/slice-indexer.js +17 -17
- package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts +1 -0
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +43 -1
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +2 -16
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +15 -64
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.d.ts +32 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +60 -0
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +1 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +1 -0
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/task-terminal-view.d.ts +50 -0
- package/daemon/dist/domain/terminal/task-terminal-view.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/task-terminal-view.js +227 -0
- package/daemon/dist/domain/terminal/task-terminal-view.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +9 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-provider.js +0 -15
- package/daemon/dist/domain/terminal/terminal-provider.js.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +7 -2
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +25 -3
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/toml-tables.d.ts +20 -0
- package/daemon/dist/domain/toml-tables.d.ts.map +1 -0
- package/daemon/dist/domain/toml-tables.js +101 -0
- package/daemon/dist/domain/toml-tables.js.map +1 -0
- package/daemon/dist/domain/types.d.ts +32 -0
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/usage-series.d.ts.map +1 -1
- package/daemon/dist/domain/usage-series.js +17 -3
- package/daemon/dist/domain/usage-series.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +5 -6
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/view-projector.d.ts +1 -0
- package/daemon/dist/domain/view-projector.d.ts.map +1 -1
- package/daemon/dist/domain/view-projector.js +15 -2
- package/daemon/dist/domain/view-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-human-destination.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-human-destination.js +5 -3
- package/daemon/dist/domain/workflow-human-destination.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +1 -0
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +19 -3
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +2 -2
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +6 -4
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/gateway-human-registry-surface.d.ts +1 -0
- package/daemon/dist/gateway-human-registry-surface.d.ts.map +1 -1
- package/daemon/dist/gateway-human-registry-surface.js +1 -0
- package/daemon/dist/gateway-human-registry-surface.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +6 -3
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/lib/pane-envelope.d.ts +4 -0
- package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
- package/daemon/dist/lib/pane-envelope.js +1 -1
- package/daemon/dist/lib/pane-envelope.js.map +1 -1
- package/daemon/dist/rosters-surface.d.ts +2 -0
- package/daemon/dist/rosters-surface.d.ts.map +1 -0
- package/daemon/dist/rosters-surface.js +4 -0
- package/daemon/dist/rosters-surface.js.map +1 -0
- package/daemon/dist/routes/activity.js +1 -1
- 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 -0
- 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 +15 -3
- package/daemon/dist/routes/attention.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/gateway.d.ts.map +1 -1
- package/daemon/dist/routes/gateway.js +42 -0
- package/daemon/dist/routes/gateway.js.map +1 -1
- package/daemon/dist/routes/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +5 -2
- 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/plugins.js +1 -1
- package/daemon/dist/routes/plugins.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +41 -14
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/require-sender-identity.d.ts +26 -0
- package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/daemon/dist/routes/require-sender-identity.js +54 -0
- package/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/daemon/dist/routes/rigs.js +2 -0
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/runtime-switch-custody.js +1 -1
- package/daemon/dist/routes/scope-audit.js +1 -1
- package/daemon/dist/routes/scope-audit.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +49 -15
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +15 -3
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/skills.js +1 -1
- package/daemon/dist/routes/skills.js.map +1 -1
- package/daemon/dist/routes/slices.js +1 -1
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/startup.d.ts.map +1 -1
- package/daemon/dist/routes/startup.js +269 -3
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/transcripts.js +2 -2
- package/daemon/dist/routes/transcripts.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +21 -6
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/workflow.js +1 -1
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +17 -2
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.d.ts +18 -2
- package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
- package/daemon/dist/terminal/TerminalSessionBroker.js +55 -9
- package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
- package/daemon/dist/terminal/window-pin.d.ts +41 -0
- package/daemon/dist/terminal/window-pin.d.ts.map +1 -0
- package/daemon/dist/terminal/window-pin.js +103 -0
- package/daemon/dist/terminal/window-pin.js.map +1 -0
- package/daemon/docs/reference/a2a-agents.md +16 -4
- package/daemon/docs/reference/agent-startup-guide.md +34 -2
- package/daemon/docs/reference/agent-state-taxonomy.md +7 -0
- package/daemon/docs/reference/claude-status-line.md +42 -0
- package/daemon/docs/reference/community-harness-examples/hermes/config.yaml.example +2 -1
- package/daemon/docs/reference/community-harness-examples/hermes/hermes.yaml +1 -1
- package/daemon/docs/reference/community-harness-presets.md +83 -3
- package/daemon/docs/reference/gateway-participants.md +165 -0
- package/daemon/docs/reference/getting-started.md +12 -8
- package/daemon/docs/reference/help.md +6 -3
- package/daemon/docs/reference/hosted-members.md +110 -0
- package/daemon/docs/reference/quickstart.md +13 -1
- package/daemon/docs/reference/rig-spec.md +89 -3
- package/daemon/docs/reference/rosters.md +6 -0
- package/daemon/docs/reference/seat-delivery.md +10 -1
- package/daemon/docs/reference/seat-node-targeting.md +17 -0
- package/daemon/docs/reference/slack-app-setup.md +20 -2
- package/daemon/docs/reference/terminal-sessions.md +45 -0
- package/daemon/docs/reference/whats-new.md +109 -282
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +37 -3
- package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +5 -2
- package/daemon/specs/agents/shared/skills/process/agent-browser/SKILL.md +1 -1
- package/daemon/specs/agents/shared/skills/process/systematic-debugging/root-cause-tracing.md +1 -1
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +20 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +57 -26
- package/dist/client.js.map +1 -1
- package/dist/commands/acp.js +1 -1
- package/dist/commands/capture.d.ts +27 -0
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +62 -4
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +6 -1
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/doctor.d.ts +9 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +18 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +3 -0
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +10 -5
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +309 -23
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +58 -14
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +30 -10
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/rig-mode.d.ts +1 -2
- package/dist/commands/rig-mode.d.ts.map +1 -1
- package/dist/commands/rig-mode.js +2 -2
- package/dist/commands/rig-mode.js.map +1 -1
- package/dist/commands/roster.d.ts +7 -27
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/roster.js +17 -52
- package/dist/commands/roster.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +12 -4
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +76 -5
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts +3 -0
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +16 -18
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +10 -2
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skill.js +1 -1
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/slack.d.ts +10 -0
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +70 -2
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +3 -6
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/terminal.js +1 -1
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +2 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +3 -2
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +5 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +13 -2
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/fetch-with-timeout.d.ts.map +1 -1
- package/dist/fetch-with-timeout.js +3 -1
- package/dist/fetch-with-timeout.js.map +1 -1
- package/dist/lib/scope/dot-id.js +2 -2
- package/dist/lib/scope/dot-id.js.map +1 -1
- package/dist/lib/scope/scaffold-placeholder.d.ts +1 -1
- package/dist/lib/scope/scaffold-placeholder.js +1 -1
- package/dist/lib/scope/scope-audit.js +1 -1
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/lib/scope/types.d.ts.map +1 -1
- package/dist/lib/scope/types.js +2 -3
- package/dist/lib/scope/types.js.map +1 -1
- package/dist/long-request-fetch.d.ts +9 -0
- package/dist/long-request-fetch.d.ts.map +1 -0
- package/dist/long-request-fetch.js +48 -0
- package/dist/long-request-fetch.js.map +1 -0
- package/dist/mcp-http.d.ts +38 -2
- package/dist/mcp-http.d.ts.map +1 -1
- package/dist/mcp-http.js +303 -36
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp-presence.d.ts +14 -0
- package/dist/mcp-presence.d.ts.map +1 -0
- package/dist/mcp-presence.js +50 -0
- package/dist/mcp-presence.js.map +1 -0
- package/dist/mcp-server.d.ts +12 -2
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +620 -204
- package/dist/mcp-server.js.map +1 -1
- package/dist/release-surface/affected-skills.d.ts.map +1 -1
- package/dist/release-surface/affected-skills.js +1 -2
- package/dist/release-surface/affected-skills.js.map +1 -1
- package/dist/remote-host-ops.d.ts +1 -0
- package/dist/remote-host-ops.d.ts.map +1 -1
- package/dist/remote-host-ops.js +2 -2
- package/dist/remote-host-ops.js.map +1 -1
- package/dist/rig-handle.d.ts +1 -0
- package/dist/rig-handle.d.ts.map +1 -1
- package/dist/rig-handle.js +9 -0
- package/dist/rig-handle.js.map +1 -1
- package/dist/tmux-health.d.ts +26 -0
- package/dist/tmux-health.d.ts.map +1 -1
- package/dist/tmux-health.js +42 -0
- package/dist/tmux-health.js.map +1 -1
- package/package.json +5 -2
- package/tui/dist/attention/attention-model.d.ts +19 -0
- package/tui/dist/attention/attention-model.d.ts.map +1 -1
- package/tui/dist/attention/attention-model.js +38 -6
- 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 +4 -1
- package/tui/dist/commands/registry.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +15 -9
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +21 -12
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/demo-data.js +17 -17
- package/tui/dist/demo-data.js.map +1 -1
- package/tui/dist/hydrate.d.ts +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +37 -11
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/live-events.js +1 -1
- package/tui/dist/live-events.js.map +1 -1
- package/tui/dist/main.js +34 -10
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/page-read.js +1 -1
- package/tui/dist/page-read.js.map +1 -1
- package/tui/dist/render.d.ts +6 -0
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +57 -7
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/state.d.ts.map +1 -1
- package/tui/dist/state.js +5 -1
- package/tui/dist/state.js.map +1 -1
- package/tui/dist/terminals/open-window.d.ts +8 -3
- package/tui/dist/terminals/open-window.d.ts.map +1 -1
- package/tui/dist/terminals/open-window.js +21 -6
- package/tui/dist/terminals/open-window.js.map +1 -1
- package/tui/dist/terminals/terminal-model.d.ts +1 -1
- package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
- package/tui/dist/terminals/terminal-model.js +1 -1
- package/tui/dist/terminals/terminal-model.js.map +1 -1
- package/tui/dist/types.d.ts +10 -1
- package/tui/dist/types.d.ts.map +1 -1
- package/ui/dist/assets/{index-DLP1ipGq.js → index-DV0UNxFw.js} +1 -1
- package/ui/dist/index.html +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { codexEnvelopeArgs } from "../domain/codex-rebuild-permissions.js";
|
|
2
|
+
import { codexMemberEnvelope, observeCodexEnvelope, readProfileFingerprint } from "../domain/codex-member-permissions.js";
|
|
2
3
|
import { operationalLaunchArg } from "./kernel-authority.js";
|
|
3
4
|
import nodePath from "node:path";
|
|
4
5
|
import fs from "node:fs";
|
|
@@ -36,6 +37,7 @@ const codexHookTrust = createRequire(import.meta.url)("../../assets/plugins/open
|
|
|
36
37
|
import { listNativeProcesses, observeCodexPaneProcess, observeCodexForkProcess, verifyCodexPaneProcess, verifyPaneIdleShell } from "../domain/native-process-lineage.js";
|
|
37
38
|
import { recordSeatSkillWrite, seatPluginSkillsLossNote, seatProjectionComplete, seatSkillWriteRefusal } from "../domain/seat-skill-storage.js";
|
|
38
39
|
import { codexPluginContentHash, planOwnedCodexContentApproval, recordOwnedCodexApproval } from "../domain/codex-owned-plugin-trust.js";
|
|
40
|
+
import { findTomlTable, opensTomlTable, parseTomlRoot, tomlArrayTableHeaderPath, tomlDefines, tomlTableHeaderPath } from "../domain/toml-tables.js";
|
|
39
41
|
// The managed resume check's poll window: a quick phase, then an extended one for a slow boot.
|
|
40
42
|
const RESUME_QUICK_ATTEMPTS = 6;
|
|
41
43
|
const RESUME_EXTENDED_ATTEMPTS = 24;
|
|
@@ -70,6 +72,7 @@ export class CodexRuntimeAdapter {
|
|
|
70
72
|
// so no real codex subprocess runs. Contract not weakened — production uses
|
|
71
73
|
// the real probe by default.
|
|
72
74
|
verifyProfilePreflight;
|
|
75
|
+
profileFingerprint;
|
|
73
76
|
// #69: whether the installed Codex supports --no-daemon. Startup wires the real probe;
|
|
74
77
|
// absent (unit tests, other embedders) keeps the existing invocation unchanged.
|
|
75
78
|
detectDaemonSupport;
|
|
@@ -113,6 +116,7 @@ export class CodexRuntimeAdapter {
|
|
|
113
116
|
this.fs = deps.fsOps;
|
|
114
117
|
this.codexHome = deps.codexHome;
|
|
115
118
|
this.seatHome = deps.seatHome;
|
|
119
|
+
this.profileFingerprint = deps.profileFingerprint ?? readProfileFingerprint;
|
|
116
120
|
this.launchPath = deps.launchPath;
|
|
117
121
|
this.detectDaemonSupport = deps.detectDaemonSupport;
|
|
118
122
|
this.readNetworkDefault = deps.readNetworkDefault;
|
|
@@ -491,6 +495,10 @@ export class CodexRuntimeAdapter {
|
|
|
491
495
|
return;
|
|
492
496
|
}
|
|
493
497
|
const withHooks = upsertCodexActivityHooks(existing, relay);
|
|
498
|
+
if (!changesOnlyOpenRigActivityHooks(existing, withHooks, `node "${relay}"`)) {
|
|
499
|
+
console.error(`[openrig] codex activity hooks skipped: ${configPath} can't be read as TOML, or writing OpenRig's hooks would change anything else; left untouched`);
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
494
502
|
if (withHooks !== existing) {
|
|
495
503
|
this.fs.mkdirp(nodePath.dirname(configPath));
|
|
496
504
|
this.fs.writeFile(configPath, withHooks);
|
|
@@ -527,7 +535,7 @@ export class CodexRuntimeAdapter {
|
|
|
527
535
|
}
|
|
528
536
|
const command = `node "${relay}"`;
|
|
529
537
|
const keySource = canonicalCodexHookSource(hooksPath);
|
|
530
|
-
const stripped = upsertCodexFeaturesHooksEnabled(stripCodexActivityHooks(existing));
|
|
538
|
+
const stripped = upsertCodexFeaturesHooksEnabled(stripCodexActivityHooks(existing, command));
|
|
531
539
|
let before = null;
|
|
532
540
|
let expected = null;
|
|
533
541
|
try {
|
|
@@ -601,10 +609,14 @@ export class CodexRuntimeAdapter {
|
|
|
601
609
|
// group's position among this event's groups, not its position inside our block.
|
|
602
610
|
// Count only the groups before the marker: a person's groups after it do not
|
|
603
611
|
// move ours, and their trust/disable records must not be written as ours.
|
|
604
|
-
|
|
612
|
+
// Without a marker (Codex's save left our groups where they sit), each group's own position.
|
|
613
|
+
const begin = content.indexOf(OPENRIG_ACTIVITY_HOOKS_BEGIN);
|
|
614
|
+
const parsed = parseToml(begin >= 0 ? content.slice(0, begin) : content);
|
|
605
615
|
let next = content;
|
|
606
616
|
for (const event of OPENRIG_ACTIVITY_HOOK_EVENTS) {
|
|
607
|
-
const groupIndex =
|
|
617
|
+
const groupIndex = begin >= 0 ? parsed.hooks?.[event]?.length ?? 0 : openRigInlineGroupIndex(parsed, event);
|
|
618
|
+
if (groupIndex < 0)
|
|
619
|
+
continue;
|
|
608
620
|
const { key, hash } = computeCodexHookTrust(event, { keySource, command, timeoutSec: 5, groupIndex });
|
|
609
621
|
next = upsertCodexHookTrust(next, key, hash);
|
|
610
622
|
}
|
|
@@ -621,7 +633,12 @@ export class CodexRuntimeAdapter {
|
|
|
621
633
|
const configPath = this.resolveCodexConfigPath(home);
|
|
622
634
|
const hooksPath = nodePath.join(nodePath.dirname(configPath), "hooks.json");
|
|
623
635
|
const existing = this.fs.exists(configPath) ? this.fs.readFile(configPath) : null;
|
|
624
|
-
|
|
636
|
+
const current = this.activityRelayPath ? `node "${this.activityRelayPath}"` : undefined;
|
|
637
|
+
let updated = existing === null ? null : stripCodexActivityHooks(existing, current);
|
|
638
|
+
if (existing !== null && updated !== existing && !changesOnlyOpenRigActivityHooks(existing, updated, current)) {
|
|
639
|
+
console.error(`[openrig] codex activity hook removal skipped for ${configPath}: it can't be read as TOML, or removing OpenRig's hooks would change anything else; left untouched`);
|
|
640
|
+
updated = existing;
|
|
641
|
+
}
|
|
625
642
|
if (this.fs.exists(hooksPath)) {
|
|
626
643
|
// Only OpenRig's groups leave. Codex keys trust and disables by position, so each later group's state moves with it.
|
|
627
644
|
try {
|
|
@@ -831,7 +848,13 @@ export class CodexRuntimeAdapter {
|
|
|
831
848
|
// grounding map assumed codex parity with the claude adapter, but only fresh emitted -m).
|
|
832
849
|
? this.resumeCore(prepared, opts.resumeToken, binding)
|
|
833
850
|
: `codex${daemonArg}${postureArg}${networkArg} -C ${shellQuote(binding.cwd)}${gitDirArg}${seatFolderArg}${queueStateDirArg}${modelArg}${effortArg}`;
|
|
834
|
-
const
|
|
851
|
+
const staged = await this.seatCommand(binding, cmd);
|
|
852
|
+
if (opts.beforeNativeDispatch && !opts.beforeNativeDispatch())
|
|
853
|
+
return { ok: false, error: "Selected history changed during Codex launch preparation; no native command was sent.", recovery: "attention_required" };
|
|
854
|
+
const textResult = opts.beforeNativeDispatch
|
|
855
|
+
? await this.tmux.sendShellCommand(binding.tmuxSession, staged, () => { if (!opts.beforeNativeDispatch())
|
|
856
|
+
throw new Error("Selected history changed before Codex input"); })
|
|
857
|
+
: await this.tmux.sendShellCommand(binding.tmuxSession, staged);
|
|
835
858
|
if (!textResult.ok) {
|
|
836
859
|
return { ok: false, error: `Failed to send launch command: ${textResult.message}` };
|
|
837
860
|
}
|
|
@@ -884,6 +907,35 @@ export class CodexRuntimeAdapter {
|
|
|
884
907
|
return updatePrompt.failure;
|
|
885
908
|
return this.verifyResumeLaunch(tmuxSession, updatePrompt, { resumeToken, ...(home ? { home } : this.ownHomeOpt({ nodeId })) });
|
|
886
909
|
}
|
|
910
|
+
/** The setter's check of a profile, in the config home this seat's launches use: its own CODEX_HOME, else the
|
|
911
|
+
* daemon's, resolved as launch resolves it. An absent file is reported, not refused: Codex loads a missing profile as
|
|
912
|
+
* an empty layer. A real load failure fails here as it does at launch. */
|
|
913
|
+
async observeProfile(profile, cwd, nodeId) {
|
|
914
|
+
const observedAt = new Date().toISOString();
|
|
915
|
+
const home = this.homeFor({ nodeId });
|
|
916
|
+
const own = this.ownHome({ nodeId });
|
|
917
|
+
if (!home) {
|
|
918
|
+
return { vantage: "unestablished", home: null, file: "unverified", load: "not_run", observedAt,
|
|
919
|
+
detail: "Neither this seat's env: nor the daemon sets CODEX_HOME, so this seat's pane keeps its own; OpenRig didn't check the profile there. Each launch still runs the native profile check." };
|
|
920
|
+
}
|
|
921
|
+
const path = nodePath.join(home, `${profile}.config.toml`);
|
|
922
|
+
// The hash is optional evidence, read without blocking; the native loader check below decides.
|
|
923
|
+
const print = await this.profileFingerprint(path).catch((error) => ({ state: "unreadable", reason: error.message }));
|
|
924
|
+
const base = { vantage: "configured_codex_home", home, file: print.state,
|
|
925
|
+
...(print.state === "present" ? { sha256: print.sha256 } : {}), observedAt };
|
|
926
|
+
let probe;
|
|
927
|
+
// Only a confirmed native load failure is refused; a check that couldn't run is reported, not refused.
|
|
928
|
+
try {
|
|
929
|
+
probe = await (own ? this.verifyProfilePreflight(profile, cwd, own) : this.verifyProfilePreflight(profile, cwd));
|
|
930
|
+
}
|
|
931
|
+
catch (error) {
|
|
932
|
+
return { ...base, load: "not_run", detail: `The native profile check couldn't run (${error.message}); each launch runs it again.` };
|
|
933
|
+
}
|
|
934
|
+
if (!probe.ok)
|
|
935
|
+
return { ...base, load: "failed", detail: `${probe.error}${probe.migrationHint ? `\n Fix: ${probe.migrationHint}` : ""}` };
|
|
936
|
+
const unread = print.state === "unreadable" ? ` Its bytes weren't read for a hash (${print.reason}).` : "";
|
|
937
|
+
return { ...base, load: "ok", detail: print.state === "absent" ? `${path} is absent; Codex loads it as an empty layer, so base config applies.` : `${path} loads.${unread}` };
|
|
938
|
+
}
|
|
887
939
|
/** Launch flags shared by fresh, fork and resume, decided once per launch. With `running`, the probed and
|
|
888
940
|
* prepared parts come from the running Codex instead, and no Codex process is started to decide them. */
|
|
889
941
|
async prepareLaunch(binding, name, running, opts) {
|
|
@@ -909,14 +961,15 @@ export class CodexRuntimeAdapter {
|
|
|
909
961
|
const effortArg = effort ? ` -c ${shellQuote(`model_reasoning_effort="${effort}"`)}` : "";
|
|
910
962
|
const profile = binding.codexConfigProfile?.trim();
|
|
911
963
|
const profileArg = profile ? ` -p ${shellQuote(profile)}` : "";
|
|
912
|
-
|
|
913
|
-
|
|
964
|
+
// A handover rebuild's observed predecessor envelope, else the seat's own envelope, replaces the posture decision.
|
|
965
|
+
const memberEnvelope = binding.codexRebuildPermissions || !binding.codexPermissions ? undefined : codexMemberEnvelope(binding.codexPermissions);
|
|
966
|
+
const envelope = binding.codexRebuildPermissions ?? memberEnvelope;
|
|
967
|
+
const posture = envelope
|
|
968
|
+
? profileArg + codexEnvelopeArgs(envelope)
|
|
914
969
|
: codexPostureArg(profileArg, process.env, binding.launchPosture);
|
|
915
|
-
const appliedLaunch =
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
: observeCodexSandbox(posture);
|
|
919
|
-
const postureArg = posture + operationalLaunchArg(this.runtime, binding);
|
|
970
|
+
const appliedLaunch = envelope ? observeCodexEnvelope(envelope) : observeCodexSandbox(posture);
|
|
971
|
+
// The seat's envelope is not full access, so a policy's full_bypass extras don't follow it.
|
|
972
|
+
const postureArg = posture + operationalLaunchArg(this.runtime, memberEnvelope ? { ...binding, kernelAuthority: false, launchPosture: undefined } : binding);
|
|
920
973
|
if (running) {
|
|
921
974
|
// The running Codex already loaded its profile; drift in -p is the caller's to compare.
|
|
922
975
|
// Its own --add-dirs, git dirs included, carry over as they ran; none are resolved again. They follow the
|
|
@@ -943,8 +996,9 @@ export class CodexRuntimeAdapter {
|
|
|
943
996
|
}
|
|
944
997
|
// Codex rejects writable --add-dir roots under a read-only sandbox. Only
|
|
945
998
|
// suppress OpenRig's generated roots when later project layers cannot make it writable.
|
|
946
|
-
|
|
947
|
-
|
|
999
|
+
// A seat envelope states its sandbox: read-only gets no generated roots; workspace-write keeps them.
|
|
1000
|
+
const suppressAutoAddDirs = memberEnvelope ? memberEnvelope.sandboxPolicy.type === "read-only"
|
|
1001
|
+
: Boolean(!binding.codexRebuildPermissions && profile && posture === profileArg && this.profileRemainsReadOnly(profile, binding.cwd, home));
|
|
948
1002
|
// Issue #121: fresh, resume and fork get the same git metadata dirs, so a restored or forked seat can still commit.
|
|
949
1003
|
// A rebuild keeps the writable roots its observed envelope names instead.
|
|
950
1004
|
const gitDirArg = binding.codexRebuildPermissions || suppressAutoAddDirs
|
|
@@ -952,7 +1006,7 @@ export class CodexRuntimeAdapter {
|
|
|
952
1006
|
// The seat's own topology folder, so it can keep its LEARNED.md and recap: the same launches and the same suppression.
|
|
953
1007
|
const seatFolder = binding.codexRebuildPermissions || suppressAutoAddDirs ? undefined : this.prepareSeatFolder?.(name);
|
|
954
1008
|
const seatFolderArg = seatFolder ? ` --add-dir ${shellQuote(seatFolder)}` : "";
|
|
955
|
-
const teamWorkspaceArg = !
|
|
1009
|
+
const teamWorkspaceArg = !envelope && binding.teamPermissionDefault && !profile
|
|
956
1010
|
&& appliedLaunch.state === "observed" && appliedLaunch.value === "workspace-write"
|
|
957
1011
|
? codexTeamWorkspaceArg(this.prepareTeamWorkspace, name) : "";
|
|
958
1012
|
const queueStateDirArg = binding.codexRebuildPermissions || suppressAutoAddDirs
|
|
@@ -965,8 +1019,8 @@ export class CodexRuntimeAdapter {
|
|
|
965
1019
|
}
|
|
966
1020
|
const daemonOptOut = daemonSupport?.kind === "supported";
|
|
967
1021
|
const daemonArg = daemonOptOut ? " --no-daemon" : "";
|
|
968
|
-
// #275: on the plain floor, network access unless Codex reports an opt-out or policy.
|
|
969
|
-
const networkArg =
|
|
1022
|
+
// #275: on the plain floor, network access unless Codex reports an opt-out or policy. An envelope states its own.
|
|
1023
|
+
const networkArg = envelope ? ""
|
|
970
1024
|
: await codexNetworkDefaultArg(own && this.readNetworkDefault ? ((cwd) => this.readNetworkDefault(cwd, own)) : this.readNetworkDefault, appliedLaunch, binding.cwd, name);
|
|
971
1025
|
// The launch facts keep the probed daemon choice, so a printed recovery command can repeat it; no probe, no fact.
|
|
972
1026
|
const launchFacts = daemonSupport ? { ...appliedLaunch, daemonOptOut } : appliedLaunch;
|
|
@@ -1361,6 +1415,9 @@ export class CodexRuntimeAdapter {
|
|
|
1361
1415
|
assertFragmentOpensWithTable(fragment, entry.absolutePath, entry.effectiveId);
|
|
1362
1416
|
const rendered = upsertManagedCodexConfigFragment(existing, entry.effectiveId, fragment);
|
|
1363
1417
|
assertRendersAsLoadableToml(rendered, configPath, entry.effectiveId);
|
|
1418
|
+
if (!changesOnlyFragmentTables(existing, rendered, entry.effectiveId, fragment)) {
|
|
1419
|
+
throw new Error(`Codex config projection '${entry.effectiveId}' would change more than its own tables in ${configPath}; left unchanged.`);
|
|
1420
|
+
}
|
|
1364
1421
|
this.fs.writeFile(configPath, rendered);
|
|
1365
1422
|
return true;
|
|
1366
1423
|
}
|
|
@@ -1791,10 +1848,13 @@ function hashContent(content) {
|
|
|
1791
1848
|
return createHash("sha256").update(content).digest("hex");
|
|
1792
1849
|
}
|
|
1793
1850
|
function upsertCodexProjectTrust(content, projectPath) {
|
|
1851
|
+
const path = ["projects", projectPath];
|
|
1794
1852
|
const header = `[projects.${JSON.stringify(projectPath)}]`;
|
|
1795
1853
|
const lines = content.length > 0 ? content.split("\n") : [];
|
|
1796
|
-
const headerIndex = lines
|
|
1854
|
+
const headerIndex = findTomlTable(lines, path);
|
|
1797
1855
|
if (headerIndex === -1) {
|
|
1856
|
+
if (tomlDefines(content, path))
|
|
1857
|
+
return content;
|
|
1798
1858
|
const trimmed = content.trimEnd();
|
|
1799
1859
|
const prefix = trimmed.length > 0 ? `${trimmed}\n\n` : "";
|
|
1800
1860
|
return `${prefix}${header}\ntrust_level = "trusted"\n`;
|
|
@@ -1885,16 +1945,19 @@ export function computeCodexHookTrust(event, input) {
|
|
|
1885
1945
|
/**
|
|
1886
1946
|
* OPR.0.4.3.33 — idempotent, non-clobbering, section-scoped writer for a single
|
|
1887
1947
|
* `[hooks.state."<key>"] trusted_hash = "<hash>"` record. Mirrors upsertCodexProjectTrust:
|
|
1888
|
-
* find
|
|
1948
|
+
* find the table by its key in any spelling (or create it), splice ONLY its `trusted_hash` line, leave every other
|
|
1889
1949
|
* `[hooks.state]` / `[projects]` entry and the managed hook block byte-identical. Same key+hash
|
|
1890
1950
|
* ⇒ no-op. Only called for our authored inline or verified owned plugin keys (never blanket trust).
|
|
1891
1951
|
*/
|
|
1892
1952
|
export function upsertCodexHookTrust(content, key, hash, field = "trusted_hash") {
|
|
1953
|
+
const path = ["hooks", "state", key];
|
|
1893
1954
|
const header = `[hooks.state.${JSON.stringify(key)}]`;
|
|
1894
1955
|
const trustLine = `${field} = ${JSON.stringify(hash)}`;
|
|
1895
1956
|
const lines = content.length > 0 ? content.split("\n") : [];
|
|
1896
|
-
const headerIndex = lines
|
|
1957
|
+
const headerIndex = findTomlTable(lines, path);
|
|
1897
1958
|
if (headerIndex === -1) {
|
|
1959
|
+
if (tomlDefines(content, path))
|
|
1960
|
+
return content;
|
|
1898
1961
|
const trimmed = content.trimEnd();
|
|
1899
1962
|
const prefix = trimmed.length > 0 ? `${trimmed}\n\n` : "";
|
|
1900
1963
|
return `${prefix}${header}\n${trustLine}\n`;
|
|
@@ -1996,13 +2059,103 @@ function upsertCodexActivityHooks(content, relayPath) {
|
|
|
1996
2059
|
.join("\n\n");
|
|
1997
2060
|
const block = `${OPENRIG_ACTIVITY_HOOKS_BEGIN}\n${stanzas}\n${OPENRIG_ACTIVITY_HOOKS_END}\n`;
|
|
1998
2061
|
let next = upsertCodexFeaturesHooksEnabled(content);
|
|
1999
|
-
const pattern = new RegExp(`${escapeRegExp(OPENRIG_ACTIVITY_HOOKS_BEGIN)}[\\s\\S]
|
|
2062
|
+
const pattern = new RegExp(`${escapeRegExp(OPENRIG_ACTIVITY_HOOKS_BEGIN)}([\\s\\S]*?)${escapeRegExp(OPENRIG_ACTIVITY_HOOKS_END)}\\n?`, "m");
|
|
2000
2063
|
if (pattern.test(next)) {
|
|
2001
|
-
|
|
2064
|
+
// literal: a string would expand `$` patterns in the path
|
|
2065
|
+
return next.replace(pattern, (_span, inner) => {
|
|
2066
|
+
const kept = keptInActivityBlock(inner, `node "${relayPath}"`);
|
|
2067
|
+
return kept ? `${block}\n${kept}\n` : block;
|
|
2068
|
+
});
|
|
2002
2069
|
}
|
|
2070
|
+
// Codex's own saves can leave our markers apart from our groups. Groups that already run OpenRig's relay are ours
|
|
2071
|
+
// where they sit: point them at this relay rather than append a second set, which Codex would run twice.
|
|
2072
|
+
const relayGroups = retargetOpenRigRelayGroups(next, command, `node "${relayPath}"`);
|
|
2073
|
+
if (relayGroups !== null)
|
|
2074
|
+
return relayGroups;
|
|
2003
2075
|
const prefix = next.replace(/\n*$/, "");
|
|
2004
2076
|
return prefix.length > 0 ? `${prefix}\n\n${block}` : block;
|
|
2005
2077
|
}
|
|
2078
|
+
/**
|
|
2079
|
+
* What else sits between OpenRig's activity-hook markers. When Codex saves config.toml (its "Trust all", say), a
|
|
2080
|
+
* table it rewrites loses its file position and is printed after the last hook group, which can be inside our
|
|
2081
|
+
* block: Codex 0.164.0 rewrites all of `[hooks.state]` this way. Every section but OpenRig's own activity groups is
|
|
2082
|
+
* kept whole, with the comments just above it.
|
|
2083
|
+
*/
|
|
2084
|
+
function keptInActivityBlock(inner, current) {
|
|
2085
|
+
const lines = inner.split("\n");
|
|
2086
|
+
return tomlSections(inner, current).filter((section) => !section.openRig)
|
|
2087
|
+
.map(({ start, end }) => lines.slice(start, end).join("\n")).join("\n").trim();
|
|
2088
|
+
}
|
|
2089
|
+
/** Point every inline group that runs OpenRig's relay (from any install) at `command` (TOML text), in place; null when
|
|
2090
|
+
* there's none, or the file can't be read as TOML. Only those groups' own `command` lines change: a person's groups,
|
|
2091
|
+
* their other text and every position stay as they are. */
|
|
2092
|
+
function retargetOpenRigRelayGroups(content, command, current) {
|
|
2093
|
+
let document;
|
|
2094
|
+
try {
|
|
2095
|
+
document = parseToml(content);
|
|
2096
|
+
}
|
|
2097
|
+
catch {
|
|
2098
|
+
return null;
|
|
2099
|
+
}
|
|
2100
|
+
if (!OPENRIG_ACTIVITY_HOOK_EVENTS.some((event) => openRigInlineGroupIndex(document, event) >= 0))
|
|
2101
|
+
return null;
|
|
2102
|
+
const lines = content.split("\n");
|
|
2103
|
+
const topLevel = lineStartsAtDocumentLevel(content);
|
|
2104
|
+
for (const { header, end, path, openRig } of tomlSections(content, current)) {
|
|
2105
|
+
if (!openRig || path.length !== 3)
|
|
2106
|
+
continue;
|
|
2107
|
+
for (let at = header + 1; at < end; at++)
|
|
2108
|
+
if (topLevel[at] && /^\s*command\s*=/.test(lines[at]))
|
|
2109
|
+
lines[at] = `command = ${command}`;
|
|
2110
|
+
}
|
|
2111
|
+
return lines.join("\n");
|
|
2112
|
+
}
|
|
2113
|
+
/** `text` split at its real table headers, never at text inside a string or an array. Lines before the first header
|
|
2114
|
+
* belong to no section. */
|
|
2115
|
+
function tomlSections(text, current) {
|
|
2116
|
+
const lines = text.split("\n");
|
|
2117
|
+
const topLevel = lineStartsAtDocumentLevel(text);
|
|
2118
|
+
const sections = [];
|
|
2119
|
+
for (const [at, line] of lines.entries()) {
|
|
2120
|
+
if (!topLevel[at] || !line.trim().startsWith("["))
|
|
2121
|
+
continue;
|
|
2122
|
+
const path = tomlArrayTableHeaderPath(line) ?? tomlTableHeaderPath(line);
|
|
2123
|
+
if (!path)
|
|
2124
|
+
continue;
|
|
2125
|
+
let start = at;
|
|
2126
|
+
while (start > 0 && topLevel[start - 1] && /^\s*(?:#.*)?$/.test(lines[start - 1]))
|
|
2127
|
+
start--;
|
|
2128
|
+
const previous = sections.at(-1);
|
|
2129
|
+
if (previous)
|
|
2130
|
+
previous.end = start;
|
|
2131
|
+
sections.push({ start, header: at, end: lines.length, path, openRig: false });
|
|
2132
|
+
}
|
|
2133
|
+
const events = OPENRIG_ACTIVITY_HOOK_EVENTS;
|
|
2134
|
+
const under = (section, event) => section.path[0] === "hooks" && section.path[1] === event;
|
|
2135
|
+
for (let first = 0; first < sections.length; first++) {
|
|
2136
|
+
const { path } = sections[first];
|
|
2137
|
+
const event = path[1];
|
|
2138
|
+
if (path[0] !== "hooks" || !events.includes(event) || path.length > 3 || (path.length === 3 && path[2] !== "hooks"))
|
|
2139
|
+
continue;
|
|
2140
|
+
let last = first;
|
|
2141
|
+
while (path.length === 2 && last + 1 < sections.length && sections[last + 1].path.length > 2 && under(sections[last + 1], event))
|
|
2142
|
+
last++;
|
|
2143
|
+
let group;
|
|
2144
|
+
try {
|
|
2145
|
+
const hooks = parseToml(lines.slice(sections[first].start, sections[last].end).join("\n")).hooks?.[event];
|
|
2146
|
+
// A group's own header gives a list holding it; a handler stanza on its own reads as the group it adds to.
|
|
2147
|
+
group = path.length === 2 ? (Array.isArray(hooks) && hooks.length === 1 ? hooks[0] : null) : hooks;
|
|
2148
|
+
}
|
|
2149
|
+
catch {
|
|
2150
|
+
group = null;
|
|
2151
|
+
}
|
|
2152
|
+
if (runsOnlyOpenRigRelay(group, current))
|
|
2153
|
+
for (let at = first; at <= last; at++)
|
|
2154
|
+
sections[at].openRig = true;
|
|
2155
|
+
first = last;
|
|
2156
|
+
}
|
|
2157
|
+
return sections;
|
|
2158
|
+
}
|
|
2006
2159
|
function canonicalCodexHookSource(path) {
|
|
2007
2160
|
// Codex keys hook trust by the canonical source path; a file not on the real filesystem keeps its plain path.
|
|
2008
2161
|
try {
|
|
@@ -2077,13 +2230,45 @@ function openRigInlineGroupIndex(document, event) {
|
|
|
2077
2230
|
return !!handler && handler.type === "command" && Number(handler.timeout) === 5 && isOpenRigRelayCommand(handler.command);
|
|
2078
2231
|
});
|
|
2079
2232
|
}
|
|
2233
|
+
/** An inline group that runs nothing but OpenRig's relay: every command on it or its handlers is OpenRig's shipped relay,
|
|
2234
|
+
* from any install, or `current`. A person's group with a command of their own is theirs. */
|
|
2235
|
+
function runsOnlyOpenRigRelay(group, current) {
|
|
2236
|
+
if (group === null || typeof group !== "object")
|
|
2237
|
+
return false;
|
|
2238
|
+
const { command, hooks } = group;
|
|
2239
|
+
const commands = [...(command === undefined ? [] : [command]),
|
|
2240
|
+
...(Array.isArray(hooks) ? hooks.map((handler) => handler?.command) : [])];
|
|
2241
|
+
return commands.length > 0 && commands.every((value) => isOpenRigRelayCommand(value) || (current !== undefined && value === current));
|
|
2242
|
+
}
|
|
2243
|
+
/** Whether `next` changes nothing in `content` but OpenRig's inline activity groups and the `[features].hooks` flag
|
|
2244
|
+
* OpenRig sets, and still parses. A config that doesn't parse is left as it is. */
|
|
2245
|
+
function changesOnlyOpenRigActivityHooks(content, next, current) {
|
|
2246
|
+
const rest = (text) => {
|
|
2247
|
+
const { hooks, features, ...other } = parseToml(text);
|
|
2248
|
+
const { hooks: _flag, ...otherFeatures } = features ?? {};
|
|
2249
|
+
const otherHooks = Object.fromEntries(Object.entries(hooks ?? {}).flatMap(([event, value]) => {
|
|
2250
|
+
const groups = OPENRIG_ACTIVITY_HOOK_EVENTS.includes(event) && Array.isArray(value)
|
|
2251
|
+
? value.filter((group) => !runsOnlyOpenRigRelay(group, current)) : value;
|
|
2252
|
+
return Array.isArray(groups) && groups.length === 0 ? [] : [[event, groups]];
|
|
2253
|
+
}));
|
|
2254
|
+
return { ...other, ...(Object.keys(otherFeatures).length > 0 ? { features: otherFeatures } : {}),
|
|
2255
|
+
...(Object.keys(otherHooks).length > 0 ? { hooks: otherHooks } : {}) };
|
|
2256
|
+
};
|
|
2257
|
+
try {
|
|
2258
|
+
return isDeepStrictEqual(rest(content), rest(next));
|
|
2259
|
+
}
|
|
2260
|
+
catch {
|
|
2261
|
+
return false;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2080
2264
|
/** Write `enabled = false` into one `[hooks.state."<key>"]` table (the trust write creates it first). */
|
|
2081
2265
|
function upsertCodexHookDisabled(content, key) {
|
|
2266
|
+
const path = ["hooks", "state", key];
|
|
2082
2267
|
const header = `[hooks.state.${JSON.stringify(key)}]`;
|
|
2083
2268
|
const lines = content.split("\n");
|
|
2084
|
-
const at = lines
|
|
2269
|
+
const at = findTomlTable(lines, path);
|
|
2085
2270
|
if (at < 0)
|
|
2086
|
-
return `${content.replace(/\n*$/, "")}\n\n${header}\nenabled = false\n`;
|
|
2271
|
+
return tomlDefines(content, path) ? content : `${content.replace(/\n*$/, "")}\n\n${header}\nenabled = false\n`;
|
|
2087
2272
|
let end = lines.length;
|
|
2088
2273
|
for (let i = at + 1; i < lines.length; i++)
|
|
2089
2274
|
if (lines[i].trim().startsWith("[")) {
|
|
@@ -2112,23 +2297,19 @@ function rekeyCodexHookState(state, prefix, newIndexOf) {
|
|
|
2112
2297
|
}
|
|
2113
2298
|
return next;
|
|
2114
2299
|
}
|
|
2115
|
-
/** The same move on config.toml's text: rename each moved group's `[hooks.state
|
|
2116
|
-
* group's table.
|
|
2300
|
+
/** The same move on config.toml's text: rename each moved group's `[hooks.state.<key>]` header (any key spelling), and
|
|
2301
|
+
* drop a removed group's table. An inline or dotted entry isn't touched; the caller compares the parsed result before writing. */
|
|
2117
2302
|
function rekeyCodexHookStateText(content, prefix, newIndexOf) {
|
|
2118
2303
|
const out = [];
|
|
2119
2304
|
let dropping = false;
|
|
2120
|
-
|
|
2305
|
+
const lines = content.split("\n");
|
|
2306
|
+
const root = parseTomlRoot(lines);
|
|
2307
|
+
for (const [at, line] of lines.entries()) {
|
|
2121
2308
|
const trimmed = line.trim();
|
|
2122
2309
|
if (trimmed.startsWith("[")) {
|
|
2123
2310
|
dropping = false;
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2126
|
-
try {
|
|
2127
|
-
key = quoted ? JSON.parse(quoted) : undefined;
|
|
2128
|
-
}
|
|
2129
|
-
catch {
|
|
2130
|
-
key = undefined;
|
|
2131
|
-
}
|
|
2311
|
+
const path = tomlTableHeaderPath(trimmed);
|
|
2312
|
+
const key = path?.length === 3 && path[0] === "hooks" && path[1] === "state" && opensTomlTable(lines, at, root) ? path[2] : undefined;
|
|
2132
2313
|
const tail = key?.startsWith(prefix) ? /^(\d+):(\d+)$/.exec(key.slice(prefix.length)) : null;
|
|
2133
2314
|
if (tail) {
|
|
2134
2315
|
const index = newIndexOf(Number(tail[1]));
|
|
@@ -2151,11 +2332,15 @@ function rekeyCodexHookStateText(content, prefix, newIndexOf) {
|
|
|
2151
2332
|
* leaves all other content — user-owned hooks, [features], project trust — untouched. Returns the
|
|
2152
2333
|
* input unchanged when the block is absent.
|
|
2153
2334
|
*/
|
|
2154
|
-
function stripCodexActivityHooks(content) {
|
|
2155
|
-
const pattern = new RegExp(`\\n*${escapeRegExp(OPENRIG_ACTIVITY_HOOKS_BEGIN)}[\\s\\S]
|
|
2335
|
+
function stripCodexActivityHooks(content, current) {
|
|
2336
|
+
const pattern = new RegExp(`\\n*${escapeRegExp(OPENRIG_ACTIVITY_HOOKS_BEGIN)}([\\s\\S]*?)${escapeRegExp(OPENRIG_ACTIVITY_HOOKS_END)}[ \\t]*\\n?`, "m");
|
|
2156
2337
|
if (!pattern.test(content))
|
|
2157
2338
|
return content;
|
|
2158
|
-
|
|
2339
|
+
// Tables Codex printed inside the block (its rewritten `[hooks.state]`) aren't ours to remove.
|
|
2340
|
+
return content.replace(pattern, (_span, inner) => {
|
|
2341
|
+
const kept = keptInActivityBlock(inner, current);
|
|
2342
|
+
return kept ? `\n\n${kept}\n` : "\n";
|
|
2343
|
+
});
|
|
2159
2344
|
}
|
|
2160
2345
|
/** Ensure `[features].hooks = true` (canonical key; not the deprecated codex_hooks alias). */
|
|
2161
2346
|
function upsertCodexFeaturesHooksEnabled(content) {
|
|
@@ -2399,23 +2584,169 @@ function dropCollidingFragmentTables(fragment, userOwned) {
|
|
|
2399
2584
|
dropped,
|
|
2400
2585
|
};
|
|
2401
2586
|
}
|
|
2402
|
-
|
|
2587
|
+
/** `content`'s lines and this fragment's marker pair: the first document-level BEGIN and the first END after it. */
|
|
2588
|
+
function fragmentMarkerPair(content, id) {
|
|
2403
2589
|
const start = `# BEGIN OPENRIG MANAGED CODEX CONFIG FRAGMENT: ${id}`;
|
|
2404
2590
|
const end = `# END OPENRIG MANAGED CODEX CONFIG FRAGMENT: ${id}`;
|
|
2405
|
-
const
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2591
|
+
const lines = content.split("\n");
|
|
2592
|
+
const topLevel = lineStartsAtDocumentLevel(content);
|
|
2593
|
+
const isMarker = (at) => topLevel[at] === true && (lines[at].trim() === start || lines[at].trim() === end);
|
|
2594
|
+
const begin = lines.findIndex((line, at) => isMarker(at) && line.trim() === start);
|
|
2595
|
+
const close = begin < 0 ? -1 : lines.findIndex((line, at) => at > begin && isMarker(at) && line.trim() === end);
|
|
2596
|
+
return { start, end, lines, isMarker, begin, close };
|
|
2597
|
+
}
|
|
2598
|
+
function upsertManagedCodexConfigFragment(content, id, fragment) {
|
|
2599
|
+
const { start, end, lines, isMarker, begin, close } = fragmentMarkerPair(content, id);
|
|
2600
|
+
const inBlock = (at) => close >= 0 && at > begin && at < close;
|
|
2601
|
+
// Codex 0.164.0 prints every table it rewrites (all of `[mcp_servers]` on `codex mcp add`) after the others, and the
|
|
2602
|
+
// comment above the first goes with it, so a save can leave our markers apart from our tables. Outside the block, a
|
|
2603
|
+
// fragment table still holding exactly the fragment's values is ours where Codex left it, and our stray markers go.
|
|
2604
|
+
const ours = fragmentTableValues(fragment);
|
|
2605
|
+
const drop = new Set();
|
|
2606
|
+
for (const section of tomlSections(content)) {
|
|
2607
|
+
const value = ours.get(JSON.stringify(section.path));
|
|
2608
|
+
if (inBlock(section.header) || value === undefined)
|
|
2609
|
+
continue;
|
|
2610
|
+
let stop = section.end;
|
|
2611
|
+
while (stop - 1 > section.header && /^\s*(?:#.*)?$/.test(lines[stop - 1]))
|
|
2612
|
+
stop--;
|
|
2613
|
+
if (!isDeepStrictEqual(tomlTableValue(lines.slice(section.header, stop).join("\n"), section.path), value))
|
|
2614
|
+
continue;
|
|
2615
|
+
for (let at = section.start; at < stop; at++)
|
|
2616
|
+
if (at >= section.header || !/\S/.test(lines[at]))
|
|
2617
|
+
drop.add(at);
|
|
2618
|
+
}
|
|
2619
|
+
lines.forEach((_, at) => { if (isMarker(at) && !(close >= 0 && (at === begin || at === close)))
|
|
2620
|
+
drop.add(at); });
|
|
2621
|
+
const outside = (from, to) => lines.slice(from, to).filter((_, offset) => !drop.has(from + offset));
|
|
2622
|
+
if (close >= 0) {
|
|
2623
|
+
// Codex can print a table of its own between our markers (a new `[features]`, say): that's the person's, and it's
|
|
2624
|
+
// kept after the block. Our tables and array-of-tables entries inside are replaced whole.
|
|
2625
|
+
const inner = lines.slice(begin + 1, close);
|
|
2626
|
+
const roots = fragmentArrayRoots(fragment);
|
|
2627
|
+
const theirs = tomlSections(inner.join("\n"))
|
|
2628
|
+
.filter((section) => !ours.has(JSON.stringify(section.path)) && !underTomlRoot(section.path, roots))
|
|
2629
|
+
.map(({ start: from, end: to }) => inner.slice(from, to).join("\n")).join("\n").trim();
|
|
2630
|
+
const before = outside(0, begin);
|
|
2631
|
+
const after = outside(close + 1, lines.length);
|
|
2632
|
+
const { kept } = dropCollidingFragmentTables(fragment, [...before, theirs, ...after].join("\n"));
|
|
2633
|
+
const block = `${start}\n${kept}\n${end}${theirs ? `\n\n${theirs}` : ""}`;
|
|
2634
|
+
return [...before, block, ...(after.length > 0 ? after : [""])].join("\n");
|
|
2635
|
+
}
|
|
2636
|
+
const rest = outside(0, lines.length).join("\n");
|
|
2637
|
+
const { kept } = dropCollidingFragmentTables(fragment, rest);
|
|
2412
2638
|
const block = `${start}\n${kept}\n${end}\n`;
|
|
2413
|
-
|
|
2414
|
-
return content.replace(pattern, () => block); // literal: a string would expand `$` patterns in the fragment
|
|
2415
|
-
}
|
|
2416
|
-
const prefix = content.replace(/\n*$/, "");
|
|
2639
|
+
const prefix = rest.replace(/\n*$/, "");
|
|
2417
2640
|
return prefix.length > 0 ? `${prefix}\n\n${block}` : block;
|
|
2418
2641
|
}
|
|
2642
|
+
/** The fragment's tables by key path (JSON), each with the values it sets. A table under one of its array-of-tables
|
|
2643
|
+
* roots is part of that entry, not a table of its own. */
|
|
2644
|
+
function fragmentTableValues(fragment) {
|
|
2645
|
+
const roots = fragmentArrayRoots(fragment);
|
|
2646
|
+
const values = new Map();
|
|
2647
|
+
for (const block of splitAtTableHeaders(fragment)) {
|
|
2648
|
+
const path = block.header === null ? null : tomlTableHeaderPath(block.header);
|
|
2649
|
+
if (path && !underTomlRoot(path, roots))
|
|
2650
|
+
values.set(JSON.stringify(path), tomlTableValue(block.text, path));
|
|
2651
|
+
}
|
|
2652
|
+
return values;
|
|
2653
|
+
}
|
|
2654
|
+
/** The fragment's array-of-tables roots: each `[[path]]` that isn't under another (`[[hooks.Stop]]`, whose
|
|
2655
|
+
* `[[hooks.Stop.hooks]]` belong to its entry). An entry has no single path, so it's only ever recognized between our
|
|
2656
|
+
* markers. */
|
|
2657
|
+
function fragmentArrayRoots(fragment) {
|
|
2658
|
+
const roots = [];
|
|
2659
|
+
for (const { header } of splitAtTableHeaders(fragment)) {
|
|
2660
|
+
const path = header === null ? null : tomlArrayTableHeaderPath(header);
|
|
2661
|
+
if (path && !underTomlRoot(path, roots))
|
|
2662
|
+
roots.push(path);
|
|
2663
|
+
}
|
|
2664
|
+
return roots;
|
|
2665
|
+
}
|
|
2666
|
+
function underTomlRoot(path, roots) {
|
|
2667
|
+
return roots.some((root) => root.length <= path.length && root.every((key, at) => path[at] === key));
|
|
2668
|
+
}
|
|
2669
|
+
/** The array-of-tables entries between this fragment's markers in `content`, by root (JSON): OpenRig's, whatever they
|
|
2670
|
+
* now hold. */
|
|
2671
|
+
function blockArrayEntries(content, id, roots) {
|
|
2672
|
+
const entries = new Map();
|
|
2673
|
+
const { lines, begin, close } = fragmentMarkerPair(content, id);
|
|
2674
|
+
if (close < 0 || roots.length === 0)
|
|
2675
|
+
return entries;
|
|
2676
|
+
const inner = lines.slice(begin + 1, close);
|
|
2677
|
+
const text = tomlSections(inner.join("\n")).filter((section) => underTomlRoot(section.path, roots))
|
|
2678
|
+
.map(({ start: from, end: to }) => inner.slice(from, to).join("\n")).join("\n");
|
|
2679
|
+
for (const root of roots) {
|
|
2680
|
+
const value = tomlTableValue(text, root);
|
|
2681
|
+
if (Array.isArray(value))
|
|
2682
|
+
entries.set(JSON.stringify(root), value);
|
|
2683
|
+
}
|
|
2684
|
+
return entries;
|
|
2685
|
+
}
|
|
2686
|
+
/** The value one table's text sets at `path`, or undefined when it doesn't parse. */
|
|
2687
|
+
function tomlTableValue(text, path) {
|
|
2688
|
+
let node;
|
|
2689
|
+
try {
|
|
2690
|
+
node = parseToml(text);
|
|
2691
|
+
}
|
|
2692
|
+
catch {
|
|
2693
|
+
return undefined;
|
|
2694
|
+
}
|
|
2695
|
+
for (const key of path)
|
|
2696
|
+
node = node !== null && typeof node === "object" ? node[key] : undefined;
|
|
2697
|
+
return node;
|
|
2698
|
+
}
|
|
2699
|
+
/** Whether `next` changes nothing in `content` but the fragment's own tables and the array-of-tables entries between
|
|
2700
|
+
* its markers: the person's settings, and every table and entry Codex wrote, read the same. Both must parse. */
|
|
2701
|
+
function changesOnlyFragmentTables(content, next, id, fragment) {
|
|
2702
|
+
const paths = [...fragmentTableValues(fragment).keys()].map((key) => JSON.parse(key));
|
|
2703
|
+
const roots = fragmentArrayRoots(fragment);
|
|
2704
|
+
const rest = (text) => {
|
|
2705
|
+
const root = parseToml(text);
|
|
2706
|
+
for (const path of paths)
|
|
2707
|
+
withoutTomlPath(root, path);
|
|
2708
|
+
for (const [key, entries] of blockArrayEntries(text, id, roots))
|
|
2709
|
+
withoutTomlPath(root, JSON.parse(key), entries);
|
|
2710
|
+
return root;
|
|
2711
|
+
};
|
|
2712
|
+
try {
|
|
2713
|
+
return isDeepStrictEqual(rest(content), rest(next));
|
|
2714
|
+
}
|
|
2715
|
+
catch {
|
|
2716
|
+
return false;
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
/** Delete `path` from a parsed document in place, or with `entries`, one equal entry for each from the array there; and
|
|
2720
|
+
* any table that leaves empty. */
|
|
2721
|
+
function withoutTomlPath(node, path, entries) {
|
|
2722
|
+
const [key, ...more] = path;
|
|
2723
|
+
if (key === undefined || !Object.hasOwn(node, key))
|
|
2724
|
+
return;
|
|
2725
|
+
const child = node[key];
|
|
2726
|
+
if (more.length === 0) {
|
|
2727
|
+
if (entries === undefined) {
|
|
2728
|
+
delete node[key];
|
|
2729
|
+
return;
|
|
2730
|
+
}
|
|
2731
|
+
if (!Array.isArray(child))
|
|
2732
|
+
return;
|
|
2733
|
+
for (const entry of entries) {
|
|
2734
|
+
for (let at = child.length - 1; at >= 0; at--)
|
|
2735
|
+
if (isDeepStrictEqual(child[at], entry)) {
|
|
2736
|
+
child.splice(at, 1);
|
|
2737
|
+
break;
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
if (child.length === 0)
|
|
2741
|
+
delete node[key];
|
|
2742
|
+
return;
|
|
2743
|
+
}
|
|
2744
|
+
if (child === null || typeof child !== "object" || Array.isArray(child))
|
|
2745
|
+
return;
|
|
2746
|
+
withoutTomlPath(child, more, entries);
|
|
2747
|
+
if (Object.keys(child).length === 0)
|
|
2748
|
+
delete node[key];
|
|
2749
|
+
}
|
|
2419
2750
|
/**
|
|
2420
2751
|
* Refuse to hand Codex a config it cannot load. Throwing here (rather than
|
|
2421
2752
|
* writing and hoping) is what keeps a malformed render off disk entirely:
|