@openrig/cli 0.7.18 → 0.7.19
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 +7 -6
- package/daemon/assets/claude-hook-bridge.cjs +146 -0
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- 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/README.md +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/claude.json +14 -14
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +43 -22
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +1 -0
- package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +1 -1
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +70 -2
- package/daemon/assets/skills/rigs/SKILL.md +40 -19
- 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 +16 -7
- package/daemon/context-packs/reference/getting-started.md +9 -4
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +56 -26
- package/daemon/context-packs/reference/whats-new.md +82 -11
- 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/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/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/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/core/working-with-an-openrig-team/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/SKILL.md +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/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/refocusing/scripts/trace-to-root.py +70 -2
- 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 +9 -0
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +41 -4
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -0
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +3 -1
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +5 -0
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +45 -10
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts +7 -0
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +24 -1
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-resume.js +5 -7
- package/daemon/dist/adapters/pi-resume.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +5 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +34 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +359 -26
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts +7 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +29 -19
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +54 -34
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +183 -57
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +6 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts +5 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.js +25 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.js.map +1 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts +6 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts.map +1 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.js +8 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.js.map +1 -0
- package/daemon/dist/db/migrations/175_core_app_access.d.ts +3 -0
- package/daemon/dist/db/migrations/175_core_app_access.d.ts.map +1 -0
- package/daemon/dist/db/migrations/175_core_app_access.js +26 -0
- package/daemon/dist/db/migrations/175_core_app_access.js.map +1 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
- package/daemon/dist/domain/activity-grants.js +6 -4
- package/daemon/dist/domain/activity-grants.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +23 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +62 -5
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.d.ts +4 -2
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.js +5 -3
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +64 -3
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +203 -6
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.js +22 -3
- package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
- package/daemon/dist/domain/configured-account.d.ts +3 -0
- package/daemon/dist/domain/configured-account.d.ts.map +1 -0
- package/daemon/dist/domain/configured-account.js +10 -0
- package/daemon/dist/domain/configured-account.js.map +1 -0
- package/daemon/dist/domain/core-app-access.d.ts +51 -0
- package/daemon/dist/domain/core-app-access.d.ts.map +1 -0
- package/daemon/dist/domain/core-app-access.js +107 -0
- package/daemon/dist/domain/core-app-access.js.map +1 -0
- package/daemon/dist/domain/core-app-job.d.ts +411 -0
- package/daemon/dist/domain/core-app-job.d.ts.map +1 -0
- package/daemon/dist/domain/core-app-job.js +537 -0
- package/daemon/dist/domain/core-app-job.js.map +1 -0
- package/daemon/dist/domain/current-park-arm.d.ts +4 -0
- package/daemon/dist/domain/current-park-arm.d.ts.map +1 -0
- package/daemon/dist/domain/current-park-arm.js +14 -0
- package/daemon/dist/domain/current-park-arm.js.map +1 -0
- package/daemon/dist/domain/cwd-resolution.d.ts +12 -0
- package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
- package/daemon/dist/domain/cwd-resolution.js +21 -1
- package/daemon/dist/domain/cwd-resolution.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +9 -3
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/gateway/participants.d.ts +2 -0
- package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/participants.js +5 -1
- package/daemon/dist/domain/gateway/participants.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +37 -17
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +26 -2
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/hook-bridge.d.ts +345 -0
- package/daemon/dist/domain/hook-bridge.d.ts.map +1 -0
- package/daemon/dist/domain/hook-bridge.js +547 -0
- package/daemon/dist/domain/hook-bridge.js.map +1 -0
- package/daemon/dist/domain/hosted-wake.d.ts +9 -0
- package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
- package/daemon/dist/domain/hosted-wake.js +45 -6
- package/daemon/dist/domain/hosted-wake.js.map +1 -1
- package/daemon/dist/domain/human-ask-attention.d.ts +10 -0
- package/daemon/dist/domain/human-ask-attention.d.ts.map +1 -0
- package/daemon/dist/domain/human-ask-attention.js +22 -0
- package/daemon/dist/domain/human-ask-attention.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +4 -0
- 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 +8 -1
- 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 +10 -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 -12
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/native-continuation-notice.d.ts +16 -0
- package/daemon/dist/domain/native-continuation-notice.d.ts.map +1 -0
- package/daemon/dist/domain/native-continuation-notice.js +79 -0
- package/daemon/dist/domain/native-continuation-notice.js.map +1 -0
- package/daemon/dist/domain/native-process-lineage.d.ts +16 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +48 -3
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +27 -6
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +6 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +16 -2
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +21 -3
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +88 -8
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/park-wake-text.d.ts +18 -0
- package/daemon/dist/domain/park-wake-text.d.ts.map +1 -1
- package/daemon/dist/domain/park-wake-text.js +44 -0
- package/daemon/dist/domain/park-wake-text.js.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +3 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.js +15 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +28 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/process-limits.d.ts +21 -11
- package/daemon/dist/domain/process-limits.d.ts.map +1 -1
- package/daemon/dist/domain/process-limits.js +74 -20
- package/daemon/dist/domain/process-limits.js.map +1 -1
- package/daemon/dist/domain/process-table.d.ts +15 -0
- package/daemon/dist/domain/process-table.d.ts.map +1 -1
- package/daemon/dist/domain/process-table.js +39 -0
- package/daemon/dist/domain/process-table.js.map +1 -1
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
- package/daemon/dist/domain/queue-erasure.js +3 -0
- package/daemon/dist/domain/queue-erasure.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +60 -7
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +178 -36
- package/daemon/dist/domain/queue-repository.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 +29 -0
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js +28 -3
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +12 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +115 -14
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +8 -0
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +48 -8
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/reconciler.d.ts +18 -2
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +40 -0
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
- package/daemon/dist/domain/restore-attempt-receipt.js +3 -2
- package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +5 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +73 -8
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-topology.d.ts +7 -1
- package/daemon/dist/domain/restore-topology.d.ts.map +1 -1
- package/daemon/dist/domain/restore-topology.js +21 -0
- package/daemon/dist/domain/restore-topology.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -3
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +6 -25
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +7 -6
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +16 -3
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +73 -9
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +2 -2
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +5 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +17 -7
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +11 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +21 -2
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-channel.d.ts +35 -3
- package/daemon/dist/domain/runner-channel.d.ts.map +1 -1
- package/daemon/dist/domain/runner-channel.js +177 -8
- package/daemon/dist/domain/runner-channel.js.map +1 -1
- package/daemon/dist/domain/runner-permissions.d.ts +26 -3
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/runner-permissions.js +160 -39
- package/daemon/dist/domain/runner-permissions.js.map +1 -1
- package/daemon/dist/domain/scope/mission-parent.d.ts +19 -0
- package/daemon/dist/domain/scope/mission-parent.d.ts.map +1 -0
- package/daemon/dist/domain/scope/mission-parent.js +134 -0
- package/daemon/dist/domain/scope/mission-parent.js.map +1 -0
- package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +8 -0
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/scope/types.d.ts +3 -1
- package/daemon/dist/domain/scope/types.d.ts.map +1 -1
- package/daemon/dist/domain/scope/types.js +5 -1
- package/daemon/dist/domain/scope/types.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts +14 -2
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +53 -14
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +9 -4
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +4 -3
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +40 -5
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +14 -6
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +104 -22
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +4 -1
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +2 -0
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.js +3 -2
- package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +5 -1
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +12 -1
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +40 -1
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +211 -10
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
- package/daemon/dist/domain/shared-history-selection.js +9 -5
- package/daemon/dist/domain/shared-history-selection.js.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.js +4 -0
- package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +6 -4
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +10 -4
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +35 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +231 -33
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.js +2 -1
- package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -1
- package/daemon/dist/domain/terminal/rig-viewer-records.d.ts +59 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.js +210 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +99 -4
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +556 -36
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/tile-layout.js +1 -1
- package/daemon/dist/domain/terminal/tile-layout.js.map +1 -1
- package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts +25 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.js +70 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.js.map +1 -0
- package/daemon/dist/domain/transcript-grep-worker.d.ts +2 -0
- package/daemon/dist/domain/transcript-grep-worker.d.ts.map +1 -0
- package/daemon/dist/domain/transcript-grep-worker.js +108 -0
- package/daemon/dist/domain/transcript-grep-worker.js.map +1 -0
- package/daemon/dist/domain/transcript-grep.d.ts +26 -0
- package/daemon/dist/domain/transcript-grep.d.ts.map +1 -0
- package/daemon/dist/domain/transcript-grep.js +90 -0
- package/daemon/dist/domain/transcript-grep.js.map +1 -0
- package/daemon/dist/domain/transcript-store.d.ts +8 -2
- package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-store.js +10 -60
- package/daemon/dist/domain/transcript-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +69 -2
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +4 -0
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.js +35 -2
- package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +44 -0
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +60 -2
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.d.ts +12 -0
- package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.js +19 -1
- package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +32 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +78 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +17 -3
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +19 -5
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +1 -1
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +12 -0
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +64 -7
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workflow-step-trail-log.d.ts +2 -2
- package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -1
- package/daemon/dist/domain/workflow-types.d.ts +3 -1
- package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-types.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +5 -1
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/lib/pane-envelope.d.ts +3 -0
- package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
- package/daemon/dist/lib/pane-envelope.js +3 -1
- package/daemon/dist/lib/pane-envelope.js.map +1 -1
- package/daemon/dist/mission-parent-surface.d.ts +2 -0
- package/daemon/dist/mission-parent-surface.d.ts.map +1 -0
- package/daemon/dist/mission-parent-surface.js +2 -0
- package/daemon/dist/mission-parent-surface.js.map +1 -0
- package/daemon/dist/routes/activity.d.ts +18 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +47 -9
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +194 -177
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/core-app.d.ts +10 -0
- package/daemon/dist/routes/core-app.d.ts.map +1 -0
- package/daemon/dist/routes/core-app.js +175 -0
- package/daemon/dist/routes/core-app.js.map +1 -0
- package/daemon/dist/routes/hook-bridge.d.ts +3 -0
- package/daemon/dist/routes/hook-bridge.d.ts.map +1 -0
- package/daemon/dist/routes/hook-bridge.js +158 -0
- package/daemon/dist/routes/hook-bridge.js.map +1 -0
- package/daemon/dist/routes/missions.d.ts.map +1 -1
- package/daemon/dist/routes/missions.js +14 -2
- package/daemon/dist/routes/missions.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +8 -5
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/rigspec.js +1 -1
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
- package/daemon/dist/routes/scope-audit.js +7 -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 +30 -4
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/slices.d.ts.map +1 -1
- package/daemon/dist/routes/slices.js +21 -2
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/startup.js +2 -1
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +47 -6
- package/daemon/dist/routes/terminal.js.map +1 -1
- package/daemon/dist/routes/transcripts.d.ts.map +1 -1
- package/daemon/dist/routes/transcripts.js +16 -1
- package/daemon/dist/routes/transcripts.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +3 -2
- 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 +5 -0
- 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 +11 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +90 -33
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal-viewer-guard-surface.d.ts +2 -0
- package/daemon/dist/terminal-viewer-guard-surface.d.ts.map +1 -0
- package/daemon/dist/terminal-viewer-guard-surface.js +2 -0
- package/daemon/dist/terminal-viewer-guard-surface.js.map +1 -0
- package/daemon/docs/reference/agent-startup-guide.md +4 -1
- package/daemon/docs/reference/claude-status-line.md +3 -2
- package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +1 -1
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +186 -30
- package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/openshell/README.md +2 -0
- package/daemon/docs/reference/community-harness-examples/pi-tui/openrig-pi-tui-launch +6 -0
- package/daemon/docs/reference/community-harness-presets.md +6 -5
- package/daemon/docs/reference/core-app.md +212 -0
- package/daemon/docs/reference/daemon-http-clients.md +6 -0
- package/daemon/docs/reference/getting-started.md +9 -4
- package/daemon/docs/reference/harness-runner-contract.md +50 -4
- package/daemon/docs/reference/hosted-members.md +21 -1
- package/daemon/docs/reference/quickstart.md +4 -3
- package/daemon/docs/reference/rig-spec.md +56 -26
- package/daemon/docs/reference/rosters.md +8 -0
- package/daemon/docs/reference/sdlc-conventions.md +42 -5
- package/daemon/docs/reference/seat-delivery.md +87 -6
- package/daemon/docs/reference/terminal-sessions.md +99 -1
- package/daemon/docs/reference/whats-new.md +82 -11
- package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +4 -3
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +13 -3
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +4 -3
- package/dist/ask-wake.d.ts.map +1 -1
- package/dist/ask-wake.js +8 -1
- package/dist/ask-wake.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/commands/archive.js +1 -1
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +7 -0
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +5 -0
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/ps.d.ts +2 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +9 -4
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.js +4 -4
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.d.ts +5 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +346 -9
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +90 -8
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts +2 -0
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +3 -1
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/terminal.d.ts +56 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +194 -4
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/transcript.js +1 -1
- package/dist/commands/transcript.js.map +1 -1
- package/dist/commands/unarchive.js +1 -1
- package/dist/commands/unarchive.js.map +1 -1
- package/dist/commands/workflow-follow.d.ts +3 -1
- package/dist/commands/workflow-follow.d.ts.map +1 -1
- package/dist/commands/workflow-follow.js +25 -6
- package/dist/commands/workflow-follow.js.map +1 -1
- package/dist/commands/workflow-render.d.ts.map +1 -1
- package/dist/commands/workflow-render.js +5 -1
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +14 -4
- package/dist/commands/workflow.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +11 -0
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/lib/scope/mission-composition.d.ts +1 -0
- package/dist/lib/scope/mission-composition.d.ts.map +1 -1
- package/dist/lib/scope/mission-composition.js +14 -0
- package/dist/lib/scope/mission-composition.js.map +1 -1
- package/dist/lib/scope/scope-audit.d.ts.map +1 -1
- package/dist/lib/scope/scope-audit.js +8 -0
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/lib/scope/scope-fs.d.ts +10 -0
- package/dist/lib/scope/scope-fs.d.ts.map +1 -1
- package/dist/lib/scope/scope-fs.js +60 -0
- package/dist/lib/scope/scope-fs.js.map +1 -1
- package/dist/lib/scope/types.d.ts +3 -1
- package/dist/lib/scope/types.d.ts.map +1 -1
- package/dist/lib/scope/types.js +5 -1
- package/dist/lib/scope/types.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +18 -8
- package/dist/mcp-server.js.map +1 -1
- package/dist/restore-packet/packet-writer.d.ts.map +1 -1
- package/dist/restore-packet/packet-writer.js +8 -5
- package/dist/restore-packet/packet-writer.js.map +1 -1
- package/dist/terminal-window.d.ts +2 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +567 -41
- package/dist/terminal-window.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/daemon-client.d.ts +4 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/execution/execution-model.d.ts.map +1 -1
- package/tui/dist/execution/execution-model.js +22 -5
- package/tui/dist/execution/execution-model.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +6 -3
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/navigator.d.ts +1 -1
- package/tui/dist/navigator.d.ts.map +1 -1
- package/tui/dist/navigator.js +4 -2
- package/tui/dist/navigator.js.map +1 -1
- package/tui/dist/pulse/render-pulse.d.ts.map +1 -1
- package/tui/dist/pulse/render-pulse.js +7 -14
- package/tui/dist/pulse/render-pulse.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +29 -21
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/stylize.d.ts.map +1 -1
- package/tui/dist/stylize.js +3 -3
- package/tui/dist/stylize.js.map +1 -1
- package/tui/dist/terminals/terminal-model.d.ts +1 -0
- package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
- package/tui/dist/terminals/terminal-model.js +4 -2
- package/tui/dist/terminals/terminal-model.js.map +1 -1
- package/tui/dist/types.d.ts +1 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/tui/dist/visual-layout.d.ts +3 -0
- package/tui/dist/visual-layout.d.ts.map +1 -1
- package/tui/dist/visual-layout.js +17 -0
- package/tui/dist/visual-layout.js.map +1 -1
- package/ui/dist/assets/{index-1O1f3A7K.js → index-B-sMy02c.js} +107 -107
- package/ui/dist/assets/{index-BX8TUZ0E.css → index-DiN7RwWg.css} +1 -1
- package/ui/dist/index.html +2 -2
|
@@ -215,6 +215,8 @@ function execStderrText(error) {
|
|
|
215
215
|
const NO_EXPAND_ENVIRONMENT = /(?:unrecognized|unknown) option[^\n]*--expand-environment/i;
|
|
216
216
|
/** The user manager's refusal of OOMPolicy= for a scope (before 253), read from systemd-run's stderr only. */
|
|
217
217
|
const NO_OOM_POLICY = /Cannot set property OOMPolicy|Unknown (?:property|assignment)[^\n]*OOMPolicy/i;
|
|
218
|
+
/** systemd-run's or the user manager's refusal of MemoryMax= for a scope, read from systemd-run's stderr only. */
|
|
219
|
+
const NO_MEMORY_MAX = /Unknown (?:property|assignment)[^\n]*MemoryMax|Failed to parse MemoryMax/i;
|
|
218
220
|
/** A systemd too old for a seat scope: systemctl without --value (before 230) or systemd-run without --collect (before
|
|
219
221
|
* 236), read from their stderr only. */
|
|
220
222
|
const SYSTEMD_TOO_OLD = /(?:unrecognized|unknown) option[^\n]*--(?:value|collect)\b/i;
|
|
@@ -364,14 +366,16 @@ export function restoreEnvArgv(values) {
|
|
|
364
366
|
}
|
|
365
367
|
/** The systemd-run options of a seat scope, up to (not including) the `--` before the command. `systemdRun` is the
|
|
366
368
|
* absolute path the check resolved, so the check and the launch run the same binary whatever PATH the seat has. */
|
|
367
|
-
function seatScopeArgv(opts, unit, description,
|
|
369
|
+
function seatScopeArgv(opts, unit, description, limits, systemdRun) {
|
|
368
370
|
return [systemdRun, "--user", "--scope", "--quiet", "--collect", "--slice", SEAT_SCOPE_SLICE, "--unit", unit,
|
|
369
371
|
"--description", description,
|
|
370
372
|
// As for the server's scope: the command's arguments must reach /bin/sh exactly as written (254+).
|
|
371
373
|
...(opts.literal ? ["--expand-environment=no"] : []),
|
|
372
374
|
// As for the server's scope: one OOM kill must not stop every process of the seat (253+).
|
|
373
375
|
...(opts.oomPolicy ? ["-p", "OOMPolicy=continue"] : []),
|
|
374
|
-
"-p", `TasksMax=${tasksMax}`]
|
|
376
|
+
...(limits.tasksMax !== undefined ? ["-p", `TasksMax=${limits.tasksMax}`] : []),
|
|
377
|
+
// Bytes, as memory.max reads back: the probe and the status compare the two as written.
|
|
378
|
+
...(limits.memoryMax !== undefined ? ["-p", `MemoryMax=${limits.memoryMax}`] : [])];
|
|
375
379
|
}
|
|
376
380
|
/** The command that runs first inside a seat scope: it empties the launch's marker file (a builtin and a redirection, no
|
|
377
381
|
* fork, so it works under TasksMax=1), then execs the seat's command. A pane that died with the marker still pending
|
|
@@ -407,6 +411,12 @@ function createdIdentity(printed) {
|
|
|
407
411
|
const m = /^(%\d+) (\$\d+) (\d+) (\d+)$/.exec(printed);
|
|
408
412
|
return m ? { pane: m[1], session: m[2], server: { pid: m[3], start: m[4] } } : null;
|
|
409
413
|
}
|
|
414
|
+
/** A command that ended by SIGKILL: the signal itself (the shell replaced by the command) or 137 (128 + 9, from a shell
|
|
415
|
+
* that ran it, or from timeout, which exits that way when the command it ran was killed). */
|
|
416
|
+
function killedBySigkill(error) {
|
|
417
|
+
const e = error;
|
|
418
|
+
return e.signal === "SIGKILL" || e.code === 137;
|
|
419
|
+
}
|
|
410
420
|
/** A check's failure, classified (#3253): `unsupported` only on a positive answer that the facility is not there. */
|
|
411
421
|
function classifyScopeFailure(error, what) {
|
|
412
422
|
const reason = execFailureReason(error);
|
|
@@ -417,6 +427,9 @@ function classifyScopeFailure(error, what) {
|
|
|
417
427
|
if (SYSTEMD_TOO_OLD.test(execStderrText(error))) {
|
|
418
428
|
return { kind: "unsupported", reason: `${what}: systemd is too old for seat scopes (it needs 236+ for --collect, 230+ for --value): ${reason}` };
|
|
419
429
|
}
|
|
430
|
+
if (NO_MEMORY_MAX.test(execStderrText(error))) {
|
|
431
|
+
return { kind: "unsupported", limit: "memory_max", reason: `${what}: systemd refused MemoryMax= for the seat's scope: ${reason}` };
|
|
432
|
+
}
|
|
420
433
|
// Only a message that names the tool: an exit status of 127 alone does not say which program was missing.
|
|
421
434
|
if (/(?:systemd-run|systemctl)\S{0,2}: (?:(?:command )?not found|No such file or directory)|No such file or directory[^\n]*(?:systemd-run|systemctl)/i.test(reason)) {
|
|
422
435
|
return { kind: "unsupported", reason: `${what}: systemd-run or systemctl is not installed (${reason})` };
|
|
@@ -431,6 +444,54 @@ function classifyScopeFailure(error, what) {
|
|
|
431
444
|
}
|
|
432
445
|
return { kind: "unverified", reason: `${what} failed: ${reason}` };
|
|
433
446
|
}
|
|
447
|
+
/** What a throwaway scope with memory_max printed (proveSeatScope), checked limit by limit against the request: null
|
|
448
|
+
* when each requested limit reads back as its value, else the first that doesn't, named. */
|
|
449
|
+
/** A host with no cgroup v2 for the user manager's scopes: no limit can be made, whatever is asked. */
|
|
450
|
+
const NO_CGROUP2 = "the user manager's scopes have no cgroup v2 path (a cgroup v1 host)";
|
|
451
|
+
/** The limits a positive inability is about: the one a probe's answer names; from the tasks-only probe, whose answers
|
|
452
|
+
* name none, the task limit when it is about the pids controller; any other (no cgroup v2, no systemd tools or user
|
|
453
|
+
* manager, a systemd too old) is about the host, so about every limit. */
|
|
454
|
+
function inabilityLimits(problem, probed) {
|
|
455
|
+
if (problem.limit)
|
|
456
|
+
return [problem.limit];
|
|
457
|
+
if (probed.memoryMax === undefined && problem.reason !== NO_CGROUP2 && /\bpids\b/.test(problem.reason)) {
|
|
458
|
+
return ["tasks_max"];
|
|
459
|
+
}
|
|
460
|
+
return ["tasks_max", "memory_max"];
|
|
461
|
+
}
|
|
462
|
+
function scopeProbeProblem(got, limits) {
|
|
463
|
+
if (got === "nocgroup2")
|
|
464
|
+
return { kind: "unsupported", reason: NO_CGROUP2 };
|
|
465
|
+
const read = new Map();
|
|
466
|
+
for (const line of got.split("\n")) {
|
|
467
|
+
const m = /^(memory|pids) (.*)$/.exec(line.trim());
|
|
468
|
+
if (m)
|
|
469
|
+
read.set(m[1], m[2]);
|
|
470
|
+
}
|
|
471
|
+
const asked = [
|
|
472
|
+
["memory_max", "memory", "MemoryMax", limits.memoryMax], ["tasks_max", "pids", "TasksMax", limits.tasksMax]
|
|
473
|
+
];
|
|
474
|
+
for (const [limit, controller, property, value] of asked) {
|
|
475
|
+
if (value === undefined)
|
|
476
|
+
continue;
|
|
477
|
+
const file = `${controller}.max`;
|
|
478
|
+
const seen = read.get(controller);
|
|
479
|
+
if (seen === undefined)
|
|
480
|
+
return { kind: "unverified", limit, reason: `a throwaway seat scope read no ${file}` };
|
|
481
|
+
if (seen === `no${controller}`) {
|
|
482
|
+
return { kind: "unsupported", limit, reason: `a throwaway seat scope has no ${file}: the ${controller} controller is not delegated to the user manager` };
|
|
483
|
+
}
|
|
484
|
+
// Only a readable limit that isn't the one asked for is a positive answer; anything else can't be read.
|
|
485
|
+
if (!/^(\d+|max)$/.test(seen)) {
|
|
486
|
+
return { kind: "unverified", limit, reason: `a throwaway seat scope's ${file} read could not be understood ("${seen.slice(0, 80)}")` };
|
|
487
|
+
}
|
|
488
|
+
if (seen !== String(value)) {
|
|
489
|
+
return { kind: "unsupported", limit,
|
|
490
|
+
reason: `a throwaway seat scope got ${file} "${seen}" for ${property}=${value}: the ${controller} limit is not enforced here (is the ${controller} controller delegated to the user manager?)` };
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return null;
|
|
494
|
+
}
|
|
434
495
|
/** The cgroup v2 path of a process, from the `0::` line of /proc/<pid>/cgroup; null on cgroup v1 or no such line. */
|
|
435
496
|
export function cgroupV2Path(procCgroup) {
|
|
436
497
|
const line = procCgroup.split(/\r?\n/).find((l) => l.startsWith("0::"));
|
|
@@ -475,11 +536,12 @@ export class TmuxAdapter {
|
|
|
475
536
|
return false;
|
|
476
537
|
}
|
|
477
538
|
};
|
|
478
|
-
/** systemd-run's options proven by a throwaway scope, per systemd-run binary and
|
|
539
|
+
/** systemd-run's options proven by a throwaway scope, per systemd-run binary and pair of limits (memoized on success
|
|
540
|
+
* only). */
|
|
479
541
|
seatScopeProven = new Map();
|
|
480
542
|
/** The last check that failed without a positive answer (a timeout, an empty probe, an error not recognized), and when,
|
|
481
|
-
* per step ("bus", or the probe of one tasks_max
|
|
482
|
-
* `unverified`, with its age, never as a fresh result; the first launch after that asks again. A positive answer is
|
|
543
|
+
* per step ("bus", or the probe of one tasks_max and memory_max pair): a launch within SEAT_SCOPE_RETRY_MS reads it
|
|
544
|
+
* as `unverified`, with its age, never as a fresh result; the first launch after that asks again. A positive answer is
|
|
483
545
|
* not cached: every launch asks again, so a setup fixed since is seen at once. */
|
|
484
546
|
seatScopeFailedAt = new Map();
|
|
485
547
|
/** The last positive inability, for the status only (as `unsupported`, with its age, for SEAT_SCOPE_RETRY_MS). */
|
|
@@ -488,7 +550,8 @@ export class TmuxAdapter {
|
|
|
488
550
|
seatLimitsLookup(nodeId) {
|
|
489
551
|
try {
|
|
490
552
|
const limits = this.seatProcessLimits?.(nodeId);
|
|
491
|
-
|
|
553
|
+
// A value with neither limit is no request (the stored value's parse refuses it anyway).
|
|
554
|
+
return limits && (limits.tasksMax !== undefined || limits.memoryMax !== undefined) ? { limits } : undefined;
|
|
492
555
|
}
|
|
493
556
|
catch (error) {
|
|
494
557
|
return { invalid: error.message };
|
|
@@ -521,7 +584,7 @@ export class TmuxAdapter {
|
|
|
521
584
|
const report = await this.readSeatProcessLimits(paneTarget, lookup.limits, nodeId);
|
|
522
585
|
if (report.state === "applied")
|
|
523
586
|
return null;
|
|
524
|
-
const requested = {
|
|
587
|
+
const requested = { ...lookup.limits };
|
|
525
588
|
// The restart keeps this process: a readback that failed can't say whether it is under the limit.
|
|
526
589
|
if (report.state === "unknown") {
|
|
527
590
|
return unknownNotice({ kind: "unverified", requested,
|
|
@@ -556,7 +619,7 @@ export class TmuxAdapter {
|
|
|
556
619
|
return null;
|
|
557
620
|
if ("invalid" in lookup)
|
|
558
621
|
return { keep: false, notice: notAppliedNotice({ kind: "invalid", reason: lookup.invalid }) };
|
|
559
|
-
const requested = {
|
|
622
|
+
const requested = { ...lookup.limits };
|
|
560
623
|
const report = await this.readSeatProcessLimits(paneTarget, lookup.limits, nodeId);
|
|
561
624
|
if (report.state === "applied") {
|
|
562
625
|
const outcome = await this.seatScope(lookup.limits, { OPENRIG_NODE_ID: nodeId }, this.readLaunchPolicy());
|
|
@@ -626,16 +689,16 @@ export class TmuxAdapter {
|
|
|
626
689
|
}
|
|
627
690
|
return { systemdRun, systemctl, timeout };
|
|
628
691
|
}
|
|
629
|
-
/** The prefix that starts a seat's pane command in a systemd user scope of its own with TasksMax
|
|
630
|
-
* stays where it is, and only this seat's processes are under the
|
|
631
|
-
* new scope and then execs the command, so the pane's process is the seat's. Or why it
|
|
632
|
-
* silent start without the limit. */
|
|
692
|
+
/** The prefix that starts a seat's pane command in a systemd user scope of its own with TasksMax and/or MemoryMax:
|
|
693
|
+
* the tmux server stays where it is, and only this seat's processes are under the limits (#3253). systemd-run
|
|
694
|
+
* registers itself in the new scope and then execs the command, so the pane's process is the seat's. Or why it
|
|
695
|
+
* can't, classified: never a silent start without the limit. */
|
|
633
696
|
async seatScope(limits, seatEnv, policy) {
|
|
634
|
-
const requested = {
|
|
697
|
+
const requested = { ...limits };
|
|
635
698
|
const fail = (problem) => ({ ok: false, problem: { ...problem, requested } });
|
|
636
699
|
const positive = (problem) => {
|
|
637
700
|
if (problem.kind === "unsupported")
|
|
638
|
-
this.seatScopeLastPositive = { at: Date.now(), problem };
|
|
701
|
+
this.seatScopeLastPositive = { at: Date.now(), problem, probed: limits };
|
|
639
702
|
return fail(problem);
|
|
640
703
|
};
|
|
641
704
|
const fixed = this.seatScopeStaticProblem(policy, seatEnv.OPENRIG_NODE_ID, seatEnv.OPENRIG_SESSION_NAME);
|
|
@@ -645,8 +708,9 @@ export class TmuxAdapter {
|
|
|
645
708
|
if ("problem" in tools)
|
|
646
709
|
return positive(tools.problem);
|
|
647
710
|
const runtimeDir = this.scopeRuntimeDir();
|
|
648
|
-
// A systemd-run that changed since (another PATH, an upgrade) is proven again
|
|
649
|
-
|
|
711
|
+
// A systemd-run that changed since (another PATH, an upgrade) is proven again, and so is each pair of limits: a
|
|
712
|
+
// memory limit is never taken as proven by a scope that had only the task limit.
|
|
713
|
+
const provenKey = `${tools.systemdRun}\0${limits.tasksMax ?? "-"}\0${limits.memoryMax ?? "-"}`;
|
|
650
714
|
const probeKey = `probe:${provenKey}`;
|
|
651
715
|
for (const key of ["bus", probeKey]) {
|
|
652
716
|
const failed = this.seatScopeFailedAt.get(key);
|
|
@@ -672,7 +736,7 @@ export class TmuxAdapter {
|
|
|
672
736
|
this.seatScopeFailedAt.delete("bus");
|
|
673
737
|
let opts = this.seatScopeProven.get(provenKey);
|
|
674
738
|
if (!opts) {
|
|
675
|
-
const proven = await this.proveSeatScope(runtimeDir, limits
|
|
739
|
+
const proven = await this.proveSeatScope(runtimeDir, limits, tools);
|
|
676
740
|
if (!proven.ok)
|
|
677
741
|
return remember(probeKey, proven.problem);
|
|
678
742
|
opts = proven.opts;
|
|
@@ -684,24 +748,36 @@ export class TmuxAdapter {
|
|
|
684
748
|
// Unit names take ASCII letters, digits and ":-_.\\"; an "@" would read as a template instance.
|
|
685
749
|
const unit = `openrig-seat-${name.replace(/[^A-Za-z0-9_.-]/g, "_").slice(0, 120)}-${randomUUID().slice(0, 8)}`;
|
|
686
750
|
return { ok: true, prefix: [...seatScopeBusEnv(runtimeDir),
|
|
687
|
-
...seatScopeArgv(opts, unit, `OpenRig seat ${name}`, limits
|
|
688
|
-
}
|
|
689
|
-
/** One throwaway scope with the seat's own options, whose command prints the pids.max of its own cgroup
|
|
690
|
-
*
|
|
691
|
-
* as for the server's scope. A pids.max
|
|
692
|
-
*
|
|
693
|
-
|
|
751
|
+
...seatScopeArgv(opts, unit, `OpenRig seat ${name}`, limits, tools.systemdRun), "--"] };
|
|
752
|
+
}
|
|
753
|
+
/** One throwaway scope with the seat's own options, whose command prints the pids.max of its own cgroup (and, with
|
|
754
|
+
* memory_max, its memory.max: one line per limit): the limits count as supported only when each one requested is the
|
|
755
|
+
* requested value. Options this systemd lacks are dropped from its stderr, as for the server's scope. A pids.max or
|
|
756
|
+
* memory.max that is another value (e.g. "max": TasksMax or MemoryMax= accepted but the controller not delegated) is a
|
|
757
|
+
* positive inability; an empty result or an error not recognized is unverified. */
|
|
758
|
+
async proveSeatScope(runtimeDir, limits, tools) {
|
|
694
759
|
const opts = { literal: true, oomPolicy: true };
|
|
760
|
+
const tasksMax = limits.tasksMax;
|
|
695
761
|
// Shell builtins only: no fork inside the scope, so even TasksMax=1 can be proven (the probe is the scope's one task).
|
|
696
762
|
const readOwnPidsMax = 'p=; while IFS= read -r l; do case $l in 0::*) p=${l#0::};; esac; done < /proc/self/cgroup; ' +
|
|
697
763
|
'if [ -z "$p" ]; then printf "nocgroup2\\n"; elif [ ! -e "/sys/fs/cgroup$p/pids.max" ]; then printf "nopids\\n"; ' +
|
|
698
764
|
'else IFS= read -r m < "/sys/fs/cgroup$p/pids.max" && printf "%s\\n" "$m"; fi';
|
|
765
|
+
// With memory_max, the same builtins print one line per requested limit: `memory <memory.max|nomemory>`, then
|
|
766
|
+
// `pids <pids.max|nopids>` when tasks_max is requested too (a seat without tasks_max has its user manager's own
|
|
767
|
+
// pids.max, which is not judged).
|
|
768
|
+
const readOwnLimits = 'p=; while IFS= read -r l; do case $l in 0::*) p=${l#0::};; esac; done < /proc/self/cgroup; ' +
|
|
769
|
+
'if [ -z "$p" ]; then printf "nocgroup2\\n"; else ' +
|
|
770
|
+
'if [ ! -e "/sys/fs/cgroup$p/memory.max" ]; then printf "memory nomemory\\n"; ' +
|
|
771
|
+
'else IFS= read -r m < "/sys/fs/cgroup$p/memory.max" && printf "memory %s\\n" "$m"; fi; ' +
|
|
772
|
+
(tasksMax !== undefined ? 'if [ ! -e "/sys/fs/cgroup$p/pids.max" ]; then printf "pids nopids\\n"; ' +
|
|
773
|
+
'else IFS= read -r t < "/sys/fs/cgroup$p/pids.max" && printf "pids %s\\n" "$t"; fi; ' : '') +
|
|
774
|
+
'fi';
|
|
699
775
|
for (;;) {
|
|
700
776
|
let out;
|
|
701
777
|
try {
|
|
702
778
|
out = await this.exec(posixJoinArgv([...seatScopeBusEnv(runtimeDir), tools.timeout, "10",
|
|
703
|
-
...seatScopeArgv(opts, `openrig-seat-probe-${randomUUID().slice(0, 8)}`, "OpenRig seat scope probe",
|
|
704
|
-
"--", "/bin/sh", "-c", readOwnPidsMax]));
|
|
779
|
+
...seatScopeArgv(opts, `openrig-seat-probe-${randomUUID().slice(0, 8)}`, "OpenRig seat scope probe", limits, tools.systemdRun),
|
|
780
|
+
"--", "/bin/sh", "-c", limits.memoryMax === undefined ? readOwnPidsMax : readOwnLimits]));
|
|
705
781
|
}
|
|
706
782
|
catch (error) {
|
|
707
783
|
const stderr = execStderrText(error);
|
|
@@ -713,13 +789,26 @@ export class TmuxAdapter {
|
|
|
713
789
|
opts.oomPolicy = false;
|
|
714
790
|
continue;
|
|
715
791
|
}
|
|
792
|
+
// The probe command ended with SIGKILL (the signal, or exit 137 from timeout or a shell) under a memory limit.
|
|
793
|
+
// That does not say which process died nor why (the OOM killer at that MemoryMax=, the host's OOM killer,
|
|
794
|
+
// systemd-oomd, a manual kill, or before the scope was entered), and the scope that could tell (its memory.events
|
|
795
|
+
// `oom`) is collected with it. So it says only what was seen, names the limit and stays retryable (unverified).
|
|
796
|
+
if (limits.memoryMax !== undefined && killedBySigkill(error)) {
|
|
797
|
+
return { ok: false, problem: { kind: "unverified", limit: "memory_max",
|
|
798
|
+
reason: `the probe command ended with SIGKILL (exit 137) under the requested MemoryMax=${limits.memoryMax}; ` +
|
|
799
|
+
"the process and the cause aren't confirmed; a larger memory_max may help" } };
|
|
800
|
+
}
|
|
716
801
|
return { ok: false, problem: classifyScopeFailure(error, "a throwaway seat scope") };
|
|
717
802
|
}
|
|
718
803
|
const got = out.trim();
|
|
804
|
+
if (limits.memoryMax !== undefined) {
|
|
805
|
+
const problem = scopeProbeProblem(got, limits);
|
|
806
|
+
return problem ? { ok: false, problem } : { ok: true, opts };
|
|
807
|
+
}
|
|
719
808
|
if (!got)
|
|
720
809
|
return { ok: false, problem: { kind: "unverified", reason: "a throwaway seat scope read no pids.max" } };
|
|
721
810
|
if (got === "nocgroup2")
|
|
722
|
-
return { ok: false, problem: { kind: "unsupported", reason:
|
|
811
|
+
return { ok: false, problem: { kind: "unsupported", reason: NO_CGROUP2 } };
|
|
723
812
|
if (got === "nopids") {
|
|
724
813
|
return { ok: false, problem: { kind: "unsupported", reason: "a throwaway seat scope has no pids.max: the pids controller is not delegated to the user manager" } };
|
|
725
814
|
}
|
|
@@ -799,8 +888,10 @@ export class TmuxAdapter {
|
|
|
799
888
|
}
|
|
800
889
|
}
|
|
801
890
|
/** The seat scope a pane's process runs in, read from the kernel: unknown when it can't be read, outside a seat scope,
|
|
802
|
-
* or in one, with its pids.max, pids.current and how many
|
|
803
|
-
|
|
891
|
+
* or in one, with the files of the limits requested only: for tasks_max, its pids.max, pids.current and how many
|
|
892
|
+
* times a fork hit the limit (pids.events `max`); for memory_max, its memory.max, memory.current, how many times its
|
|
893
|
+
* usage was about to go over the limit (memory.events `max`) and how many of its processes an OOM killer killed (memory.events `oom_kill`). */
|
|
894
|
+
async readPaneScope(paneTarget, requested) {
|
|
804
895
|
const pid = await this.getPanePid(paneTarget);
|
|
805
896
|
if (pid === null)
|
|
806
897
|
return { at: "unknown", reason: "the seat's pane process is not readable (not running?)" };
|
|
@@ -818,21 +909,35 @@ export class TmuxAdapter {
|
|
|
818
909
|
return { at: "outside", scope };
|
|
819
910
|
try {
|
|
820
911
|
const dir = `/sys/fs/cgroup${path}`;
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
912
|
+
let pids = {};
|
|
913
|
+
if (requested.tasksMax !== undefined) {
|
|
914
|
+
const pidsMax = (await this.procRead(`${dir}/pids.max`)).trim();
|
|
915
|
+
const pidsCurrent = Number((await this.procRead(`${dir}/pids.current`)).trim());
|
|
916
|
+
const hits = /^max (\d+)$/m.exec(await this.procRead(`${dir}/pids.events`));
|
|
917
|
+
pids = { pidsMax, pidsCurrent, limitHits: hits ? Number(hits[1]) : 0 };
|
|
918
|
+
}
|
|
919
|
+
let memory = {};
|
|
920
|
+
if (requested.memoryMax !== undefined) {
|
|
921
|
+
const memoryMax = (await this.procRead(`${dir}/memory.max`)).trim();
|
|
922
|
+
const memoryCurrent = Number((await this.procRead(`${dir}/memory.current`)).trim());
|
|
923
|
+
const events = await this.procRead(`${dir}/memory.events`);
|
|
924
|
+
const hits = /^max (\d+)$/m.exec(events);
|
|
925
|
+
const kills = /^oom_kill (\d+)$/m.exec(events);
|
|
926
|
+
memory = { memoryMax, memoryCurrent, memoryLimitHits: hits ? Number(hits[1]) : 0, oomKills: kills ? Number(kills[1]) : 0 };
|
|
927
|
+
}
|
|
928
|
+
return { at: "seat", scope, ...pids, ...memory };
|
|
825
929
|
}
|
|
826
930
|
catch (error) {
|
|
827
931
|
return { at: "unknown", scope, reason: `scope files unreadable: ${error.message}` };
|
|
828
932
|
}
|
|
829
933
|
}
|
|
830
|
-
/** Where a seat's
|
|
831
|
-
* pids.max
|
|
832
|
-
*
|
|
833
|
-
*
|
|
934
|
+
/** Where a seat's limits stand, read back from its pane's process (#3253): its cgroup must be a seat scope whose
|
|
935
|
+
* pids.max and memory.max are the requested values (each one requested). pids.events `max` counts the forks the
|
|
936
|
+
* limit refused; memory.events `max` the times usage was about to go over the memory limit, and `oom_kill` the processes in the scope any OOM killer killed.
|
|
937
|
+
* `paneTarget` is the seat's pane id (`%N`) when known, else its session (whose active pane is read). With `nodeId`, a
|
|
938
|
+
* seat in an environment guest reads `not_applied` (its pane holds only a local viewer). Read only. */
|
|
834
939
|
async readSeatProcessLimits(paneTarget, requested, nodeId) {
|
|
835
|
-
const base = { requested: {
|
|
940
|
+
const base = { requested: { ...requested } };
|
|
836
941
|
const policy = this.readLaunchPolicy();
|
|
837
942
|
// The running process is read first: a seat already under its limit reads `applied` whatever this daemon could
|
|
838
943
|
// create now. A seat not under it reads `unsupported` only on a positive inability (from the environment, or the
|
|
@@ -841,23 +946,34 @@ export class TmuxAdapter {
|
|
|
841
946
|
// A guest seat's pane holds only a local viewer: its readback says nothing of the agent's processes.
|
|
842
947
|
if (nodeId && this.seatInEnvironmentGuest?.(nodeId))
|
|
843
948
|
return { ...base, state: "not_applied", reason: fixed.reason };
|
|
844
|
-
|
|
949
|
+
// The last positive answer counts only for a request that asks a limit it was about: a failed memory probe says
|
|
950
|
+
// nothing of a tasks-only seat (nor a pids answer of a memory-only one); no cgroup v2 is about every limit.
|
|
951
|
+
const recent = this.seatScopeLastPositive && Date.now() - this.seatScopeLastPositive.at < SEAT_SCOPE_RETRY_MS
|
|
845
952
|
? this.seatScopeLastPositive : undefined;
|
|
953
|
+
const last = recent && inabilityLimits(recent.problem, recent.probed)
|
|
954
|
+
.some((k) => (k === "tasks_max" ? requested.tasksMax : requested.memoryMax) !== undefined) ? recent : undefined;
|
|
846
955
|
const unsupported = fixed?.kind === "unsupported" ? fixed.reason
|
|
847
956
|
: last ? `${last.problem.reason}, observed ${Math.floor((Date.now() - last.at) / 1000)}s ago` : null;
|
|
848
957
|
const notUnder = (reason) => unsupported ? { ...base, state: "unsupported", reason: `${reason}; and this host can't make the scope: ${unsupported}` }
|
|
849
958
|
: fixed ? { ...base, state: "not_applied", reason: `${reason}; and this setup can't make the scope: ${fixed.reason}` }
|
|
850
959
|
: { ...base, state: "not_applied", reason };
|
|
851
|
-
const read = await this.readPaneScope(paneTarget);
|
|
960
|
+
const read = await this.readPaneScope(paneTarget, requested);
|
|
852
961
|
if (read.at === "unknown")
|
|
853
962
|
return { ...base, state: "unknown", ...(read.scope ? { scope: read.scope } : {}), reason: read.reason };
|
|
854
963
|
if (read.at === "outside") {
|
|
855
964
|
return notUnder(`the seat's process is not in a seat scope (${read.scope}); the limit applies at its next fresh launch`);
|
|
856
965
|
}
|
|
857
966
|
const { at: _at, ...scopeRead } = read;
|
|
858
|
-
|
|
967
|
+
// Applied only when every requested limit reads back as its value; the reason names each one that doesn't.
|
|
968
|
+
const off = [
|
|
969
|
+
...(requested.tasksMax !== undefined && read.pidsMax !== String(requested.tasksMax)
|
|
970
|
+
? [`pids.max is ${read.pidsMax}, not ${requested.tasksMax}`] : []),
|
|
971
|
+
...(requested.memoryMax !== undefined && read.memoryMax !== String(requested.memoryMax)
|
|
972
|
+
? [`memory.max is ${read.memoryMax}, not ${requested.memoryMax}`] : []),
|
|
973
|
+
];
|
|
974
|
+
return off.length === 0
|
|
859
975
|
? { ...base, state: "applied", ...scopeRead }
|
|
860
|
-
: { ...base, state: "not_applied", ...scopeRead, reason:
|
|
976
|
+
: { ...base, state: "not_applied", ...scopeRead, reason: `${off.join("; ")}; the limit applies at its next fresh launch` };
|
|
861
977
|
}
|
|
862
978
|
/** Reset before the selected user shell runs, without changing the server or other sessions.
|
|
863
979
|
* Multiple tmux command arguments execute directly; only this fixed non-interactive sh runs
|
|
@@ -888,7 +1004,7 @@ export class TmuxAdapter {
|
|
|
888
1004
|
if ("invalid" in lookup)
|
|
889
1005
|
notApplied({ kind: "invalid", reason: lookup.invalid });
|
|
890
1006
|
else if (notices?.failedStart)
|
|
891
|
-
notApplied({ ...notices.failedStart, requested: {
|
|
1007
|
+
notApplied({ ...notices.failedStart, requested: { ...lookup.limits } });
|
|
892
1008
|
else {
|
|
893
1009
|
const outcome = await this.seatScope(lookup.limits, seatEnv, policy);
|
|
894
1010
|
if (outcome.ok) {
|
|
@@ -903,7 +1019,7 @@ export class TmuxAdapter {
|
|
|
903
1019
|
return null;
|
|
904
1020
|
if (!(policy instanceof Error) && policy.inheritTmuxEnvironment) {
|
|
905
1021
|
if (limited)
|
|
906
|
-
notApplied({ kind: "setup", reason: INHERIT_TMUX_ENVIRONMENT_REASON, requested: {
|
|
1022
|
+
notApplied({ kind: "setup", reason: INHERIT_TMUX_ENVIRONMENT_REASON, requested: { ...lookup.limits } });
|
|
907
1023
|
return null;
|
|
908
1024
|
}
|
|
909
1025
|
try {
|
|
@@ -960,16 +1076,15 @@ export class TmuxAdapter {
|
|
|
960
1076
|
notices.capped = seatScope.length > 0;
|
|
961
1077
|
if (marker) {
|
|
962
1078
|
notices.marker = marker;
|
|
963
|
-
notices.
|
|
1079
|
+
notices.requested = { ...lookup.limits };
|
|
964
1080
|
}
|
|
965
1081
|
}
|
|
966
1082
|
return ["/bin/sh", "-c", reset, "sh", file, ...seatScope, ...restore, shell, ...(command ? ["-c", command] : ["-l"])];
|
|
967
1083
|
}
|
|
968
1084
|
catch (error) {
|
|
969
1085
|
if (limited) {
|
|
970
|
-
const tasksMax = lookup.limits.tasksMax;
|
|
971
1086
|
notApplied({ kind: "unverified", reason: `the scoped launch environment failed: ${error.message}`,
|
|
972
|
-
requested: {
|
|
1087
|
+
requested: { ...lookup.limits } });
|
|
973
1088
|
}
|
|
974
1089
|
// Keep the working launch, with a diagnostic; this option is not a new admission gate.
|
|
975
1090
|
const warning = "Scoped tmux environment unavailable; retaining the previous environment for this launch.";
|
|
@@ -994,7 +1109,7 @@ export class TmuxAdapter {
|
|
|
994
1109
|
};
|
|
995
1110
|
if ("invalid" in lookup)
|
|
996
1111
|
return notApplied({ kind: "invalid", reason: lookup.invalid });
|
|
997
|
-
const requested = {
|
|
1112
|
+
const requested = { ...lookup.limits };
|
|
998
1113
|
if (notices.failedStart)
|
|
999
1114
|
return notApplied({ ...notices.failedStart, requested });
|
|
1000
1115
|
const outcome = await this.seatScope(lookup.limits, { OPENRIG_NODE_ID: nodeId }, this.readLaunchPolicy());
|
|
@@ -1013,7 +1128,7 @@ export class TmuxAdapter {
|
|
|
1013
1128
|
const marker = await this.scopeMarker();
|
|
1014
1129
|
notices.capped = true;
|
|
1015
1130
|
notices.marker = marker;
|
|
1016
|
-
notices.
|
|
1131
|
+
notices.requested = requested;
|
|
1017
1132
|
return [...outcome.prefix, ...scopeMarkArgv(marker), ...restore, shell, "-c", command];
|
|
1018
1133
|
}
|
|
1019
1134
|
catch (error) {
|
|
@@ -1051,7 +1166,7 @@ export class TmuxAdapter {
|
|
|
1051
1166
|
await this.fileOps.unlink(notices.marker).catch(() => { });
|
|
1052
1167
|
if (start === "started")
|
|
1053
1168
|
return null;
|
|
1054
|
-
const requested = notices.
|
|
1169
|
+
const requested = notices.requested ? { requested: { ...notices.requested } } : {};
|
|
1055
1170
|
const failedBefore = "the seat's scope did not start: its pane's command exited before entering it";
|
|
1056
1171
|
if (mode !== "recovery") {
|
|
1057
1172
|
if (start === "ran_and_ended")
|
|
@@ -1069,7 +1184,8 @@ export class TmuxAdapter {
|
|
|
1069
1184
|
}
|
|
1070
1185
|
if (start === "failed_before_command")
|
|
1071
1186
|
return { retryUncapped: { kind: "unverified", reason: failedBefore } };
|
|
1072
|
-
|
|
1187
|
+
// As in the fresh refusal: what was seen of the command, apart from the limit (nothing here is run again).
|
|
1188
|
+
const notice = unknownNotice({ kind: "unverified", ...requested, commandStarted: start === "unknown" ? "unknown" : true,
|
|
1073
1189
|
reason: start === "ran_and_ended"
|
|
1074
1190
|
? "the seat's command started in its scope and ended before it was seen running; it was not run again"
|
|
1075
1191
|
: start === "ran_unconfirmed"
|
|
@@ -1677,6 +1793,8 @@ export class TmuxAdapter {
|
|
|
1677
1793
|
printed = (await this.runEnvironmentCommand(argv, legacyParts.join(" "), true)).trim();
|
|
1678
1794
|
}
|
|
1679
1795
|
catch (err) {
|
|
1796
|
+
if (notices.marker)
|
|
1797
|
+
await this.fileOps.unlink(notices.marker).catch(() => { });
|
|
1680
1798
|
return classifyWriteError(err);
|
|
1681
1799
|
}
|
|
1682
1800
|
// A capped launch reads its pane and identity from the same, first, printed line (a hook may print more after it).
|
|
@@ -1695,11 +1813,15 @@ export class TmuxAdapter {
|
|
|
1695
1813
|
if (notices.marker)
|
|
1696
1814
|
await this.fileOps.unlink(notices.marker).catch(() => { });
|
|
1697
1815
|
return processLimitsNotAppliedResult(new SeatProcessLimitsNotApplied({ kind: "unverified", commandStarted: "unknown",
|
|
1698
|
-
...(notices.
|
|
1816
|
+
...(notices.requested ? { requested: { ...notices.requested } } : {}),
|
|
1699
1817
|
reason: `tmux printed no pane for the launch and its session couldn't be read back (${unconfirmed.message})` }), await this.removeRefusedSession(name, null));
|
|
1700
1818
|
}
|
|
1701
|
-
if (unconfirmed)
|
|
1819
|
+
if (unconfirmed) {
|
|
1820
|
+
// the scope start is never checked on this way out: its marker would be left pending in the temp dir
|
|
1821
|
+
if (notices.marker)
|
|
1822
|
+
await this.fileOps.unlink(notices.marker).catch(() => { });
|
|
1702
1823
|
return { ok: false, ...unconfirmed };
|
|
1824
|
+
}
|
|
1703
1825
|
}
|
|
1704
1826
|
// #3253: a capped launch counts only once its scope is seen to start. A fresh one that isn't is refused and the
|
|
1705
1827
|
// session it made is removed (never a retry without the limit). A recovery (a provider switch's staged successor)
|
|
@@ -2071,7 +2193,9 @@ export class TmuxAdapter {
|
|
|
2071
2193
|
}
|
|
2072
2194
|
/** With a delivery guard, terminate by immutable tmux session ID; checked callers validate before detach and kill.
|
|
2073
2195
|
* A seat's session is stopped only when it carries that seat's OpenRig marker, and each effect runs only while that
|
|
2074
|
-
* id still names a session on the server it was read from: a replaced server reuses ids for other terminals.
|
|
2196
|
+
* id still names a session on the server it was read from: a replaced server reuses ids for other terminals.
|
|
2197
|
+
* A checked caller's validation may be asynchronous (a fresh process observation); it's awaited right before each
|
|
2198
|
+
* effect, after this method's own reads, and the guard's synchronous check runs after it. */
|
|
2075
2199
|
async killSession(name, beforeEffect) {
|
|
2076
2200
|
let stopPhase = "none";
|
|
2077
2201
|
if (this.deliveryGuard) {
|
|
@@ -2088,7 +2212,7 @@ export class TmuxAdapter {
|
|
|
2088
2212
|
return unproven;
|
|
2089
2213
|
}
|
|
2090
2214
|
const kill = async () => {
|
|
2091
|
-
const result = await this.killSessionUnchecked(sessionId, beforeEffect && (() => {
|
|
2215
|
+
const result = await this.killSessionUnchecked(sessionId, beforeEffect && (async () => { await beforeEffect(); beforeWrite(); }), phase => { stopPhase = phase; }, { pid, start });
|
|
2092
2216
|
if (result.ok) {
|
|
2093
2217
|
this.freshProbes.delete(name);
|
|
2094
2218
|
this.freshProbes.delete(pane);
|
|
@@ -2144,7 +2268,7 @@ export class TmuxAdapter {
|
|
|
2144
2268
|
`${verb} ${flag} '${session}'`, `display-message -p ${changed}`]
|
|
2145
2269
|
: ["tmux", verb, flag, session];
|
|
2146
2270
|
// Detach first so `detach-on-destroy off` cannot switch views onto another session.
|
|
2147
|
-
beforeEffect?.();
|
|
2271
|
+
await beforeEffect?.();
|
|
2148
2272
|
phase?.("detach_attempted");
|
|
2149
2273
|
try {
|
|
2150
2274
|
const out = await this.run(effect("detach-client", "-s"), server ? undefined : `tmux detach-client -s ${shellQuote(session)}`);
|
|
@@ -2158,7 +2282,7 @@ export class TmuxAdapter {
|
|
|
2158
2282
|
return classifyWriteError(err);
|
|
2159
2283
|
}
|
|
2160
2284
|
phase?.("detached");
|
|
2161
|
-
beforeEffect?.();
|
|
2285
|
+
await beforeEffect?.();
|
|
2162
2286
|
phase?.("kill_attempted");
|
|
2163
2287
|
try {
|
|
2164
2288
|
const out = await this.run(effect("kill-session", "-t"), server ? undefined : `tmux kill-session -t ${shellQuote(session)}`);
|
|
@@ -2269,6 +2393,8 @@ export class TmuxAdapter {
|
|
|
2269
2393
|
return this.launched(warnings, notices);
|
|
2270
2394
|
}
|
|
2271
2395
|
catch (err) {
|
|
2396
|
+
if (notices.marker)
|
|
2397
|
+
await this.fileOps.unlink(notices.marker).catch(() => { });
|
|
2272
2398
|
return classifyWriteError(err);
|
|
2273
2399
|
}
|
|
2274
2400
|
}
|