oh-my-copilot 5.5.0 → 5.6.2
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -0
- package/bridge/__pycache__/gyoshu_bridge.cpython-312.pyc +0 -0
- package/bridge/claude-md-coordinator.cjs +2 -2
- package/bridge/cli.cjs +6290 -3436
- package/bridge/mcp-server.cjs +637 -503
- package/bridge/runtime-cli.cjs +516 -213
- package/bridge/team-bridge.cjs +141 -135
- package/bridge/team-mcp.cjs +201 -129
- package/bridge/team.js +473 -237
- package/copilot/hooks.json +43 -0
- package/dist/__tests__/chain-enqueuer-registration.test.d.ts +11 -0
- package/dist/__tests__/chain-enqueuer-registration.test.d.ts.map +1 -0
- package/dist/__tests__/chain-enqueuer-registration.test.js +122 -0
- package/dist/__tests__/chain-enqueuer-registration.test.js.map +1 -0
- package/dist/__tests__/copilot-hooks-manifest.test.js +3 -1
- package/dist/__tests__/copilot-hooks-manifest.test.js.map +1 -1
- package/dist/__tests__/directory-context-injector.test.js +41 -1
- package/dist/__tests__/directory-context-injector.test.js.map +1 -1
- package/dist/__tests__/hook-bridge-main-module.test.d.ts +2 -0
- package/dist/__tests__/hook-bridge-main-module.test.d.ts.map +1 -0
- package/dist/__tests__/hook-bridge-main-module.test.js +48 -0
- package/dist/__tests__/hook-bridge-main-module.test.js.map +1 -0
- package/dist/__tests__/ralph-prd-stale.test.js +12 -1
- package/dist/__tests__/ralph-prd-stale.test.js.map +1 -1
- package/dist/__tests__/ralph-prd.test.js +56 -0
- package/dist/__tests__/ralph-prd.test.js.map +1 -1
- package/dist/__tests__/run-cjs-graceful-fallback.test.js +2 -0
- package/dist/__tests__/run-cjs-graceful-fallback.test.js.map +1 -1
- package/dist/__tests__/session-end-forwarder-fallback.test.d.ts +2 -0
- package/dist/__tests__/session-end-forwarder-fallback.test.d.ts.map +1 -0
- package/dist/__tests__/session-end-forwarder-fallback.test.js +138 -0
- package/dist/__tests__/session-end-forwarder-fallback.test.js.map +1 -0
- package/dist/cli/__tests__/autoresearch-setup-session.test.js +67 -3
- package/dist/cli/__tests__/autoresearch-setup-session.test.js.map +1 -1
- package/dist/cli/__tests__/launch.test.js +73 -11
- package/dist/cli/__tests__/launch.test.js.map +1 -1
- package/dist/cli/__tests__/plugin-dir-capture.test.js +45 -0
- package/dist/cli/__tests__/plugin-dir-capture.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-afk.test.d.ts +2 -0
- package/dist/cli/__tests__/ralph-afk.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralph-afk.test.js +312 -0
- package/dist/cli/__tests__/ralph-afk.test.js.map +1 -0
- package/dist/cli/__tests__/team.test.js +170 -0
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/tmux-utils.test.js +132 -16
- package/dist/cli/__tests__/tmux-utils.test.js.map +1 -1
- package/dist/cli/autoresearch-setup-session.d.ts.map +1 -1
- package/dist/cli/autoresearch-setup-session.js +29 -9
- package/dist/cli/autoresearch-setup-session.js.map +1 -1
- package/dist/cli/commands/__tests__/factory-init.test.d.ts +2 -0
- package/dist/cli/commands/__tests__/factory-init.test.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/factory-init.test.js +90 -0
- package/dist/cli/commands/__tests__/factory-init.test.js.map +1 -0
- package/dist/cli/commands/__tests__/intake-headless-flag.test.d.ts +2 -0
- package/dist/cli/commands/__tests__/intake-headless-flag.test.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/intake-headless-flag.test.js +30 -0
- package/dist/cli/commands/__tests__/intake-headless-flag.test.js.map +1 -0
- package/dist/cli/commands/__tests__/intake.test.d.ts +2 -0
- package/dist/cli/commands/__tests__/intake.test.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/intake.test.js +257 -0
- package/dist/cli/commands/__tests__/intake.test.js.map +1 -0
- package/dist/cli/commands/factory.d.ts +61 -0
- package/dist/cli/commands/factory.d.ts.map +1 -0
- package/dist/cli/commands/factory.js +190 -0
- package/dist/cli/commands/factory.js.map +1 -0
- package/dist/cli/commands/intake.d.ts +94 -0
- package/dist/cli/commands/intake.d.ts.map +1 -0
- package/dist/cli/commands/intake.js +311 -0
- package/dist/cli/commands/intake.js.map +1 -0
- package/dist/cli/commands/ralph.d.ts +88 -0
- package/dist/cli/commands/ralph.d.ts.map +1 -0
- package/dist/cli/commands/ralph.js +456 -0
- package/dist/cli/commands/ralph.js.map +1 -0
- package/dist/cli/commands/team.d.ts.map +1 -1
- package/dist/cli/commands/team.js +25 -5
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/launch.d.ts.map +1 -1
- package/dist/cli/launch.js +32 -7
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +61 -7
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/tmux-utils.d.ts +26 -0
- package/dist/cli/tmux-utils.d.ts.map +1 -1
- package/dist/cli/tmux-utils.js +61 -9
- package/dist/cli/tmux-utils.js.map +1 -1
- package/dist/config/__tests__/loader.test.js +138 -0
- package/dist/config/__tests__/loader.test.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +17 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/factory/__tests__/check-run.test.d.ts +2 -0
- package/dist/factory/__tests__/check-run.test.d.ts.map +1 -0
- package/dist/factory/__tests__/check-run.test.js +213 -0
- package/dist/factory/__tests__/check-run.test.js.map +1 -0
- package/dist/factory/__tests__/listener.test.d.ts +2 -0
- package/dist/factory/__tests__/listener.test.d.ts.map +1 -0
- package/dist/factory/__tests__/listener.test.js +312 -0
- package/dist/factory/__tests__/listener.test.js.map +1 -0
- package/dist/factory/__tests__/map-frontier.test.d.ts +2 -0
- package/dist/factory/__tests__/map-frontier.test.d.ts.map +1 -0
- package/dist/factory/__tests__/map-frontier.test.js +128 -0
- package/dist/factory/__tests__/map-frontier.test.js.map +1 -0
- package/dist/factory/__tests__/map-ingest.test.d.ts +2 -0
- package/dist/factory/__tests__/map-ingest.test.d.ts.map +1 -0
- package/dist/factory/__tests__/map-ingest.test.js +166 -0
- package/dist/factory/__tests__/map-ingest.test.js.map +1 -0
- package/dist/factory/__tests__/map-run.test.d.ts +2 -0
- package/dist/factory/__tests__/map-run.test.d.ts.map +1 -0
- package/dist/factory/__tests__/map-run.test.js +148 -0
- package/dist/factory/__tests__/map-run.test.js.map +1 -0
- package/dist/factory/__tests__/status.test.d.ts +2 -0
- package/dist/factory/__tests__/status.test.d.ts.map +1 -0
- package/dist/factory/__tests__/status.test.js +77 -0
- package/dist/factory/__tests__/status.test.js.map +1 -0
- package/dist/factory/listener.d.ts +98 -0
- package/dist/factory/listener.d.ts.map +1 -0
- package/dist/factory/listener.js +315 -0
- package/dist/factory/listener.js.map +1 -0
- package/dist/factory/map-frontier.d.ts +73 -0
- package/dist/factory/map-frontier.d.ts.map +1 -0
- package/dist/factory/map-frontier.js +147 -0
- package/dist/factory/map-frontier.js.map +1 -0
- package/dist/factory/map-ingest.d.ts +79 -0
- package/dist/factory/map-ingest.d.ts.map +1 -0
- package/dist/factory/map-ingest.js +232 -0
- package/dist/factory/map-ingest.js.map +1 -0
- package/dist/factory/map-run.d.ts +74 -0
- package/dist/factory/map-run.d.ts.map +1 -0
- package/dist/factory/map-run.js +229 -0
- package/dist/factory/map-run.js.map +1 -0
- package/dist/factory/status.d.ts +33 -0
- package/dist/factory/status.d.ts.map +1 -0
- package/dist/factory/status.js +93 -0
- package/dist/factory/status.js.map +1 -0
- package/dist/factory/watchdog.d.ts +46 -0
- package/dist/factory/watchdog.d.ts.map +1 -0
- package/dist/factory/watchdog.js +130 -0
- package/dist/factory/watchdog.js.map +1 -0
- package/dist/factory/watchdog.test.d.ts +2 -0
- package/dist/factory/watchdog.test.d.ts.map +1 -0
- package/dist/factory/watchdog.test.js +111 -0
- package/dist/factory/watchdog.test.js.map +1 -0
- package/dist/graph/runtime/native-contained-fs.js +1 -1
- package/dist/graph/runtime/native-contained-fs.js.map +1 -1
- package/dist/hooks/__tests__/compaction-concurrency.test.js +20 -20
- package/dist/hooks/__tests__/compaction-concurrency.test.js.map +1 -1
- package/dist/hooks/__tests__/workflow-drift-guard-script.test.js +27 -0
- package/dist/hooks/__tests__/workflow-drift-guard-script.test.js.map +1 -1
- package/dist/hooks/bridge.d.ts +8 -0
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +38 -9
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/code-simplifier/__tests__/global-config-path.test.d.ts +2 -0
- package/dist/hooks/code-simplifier/__tests__/global-config-path.test.d.ts.map +1 -0
- package/dist/hooks/code-simplifier/__tests__/global-config-path.test.js +89 -0
- package/dist/hooks/code-simplifier/__tests__/global-config-path.test.js.map +1 -0
- package/dist/hooks/code-simplifier/index.d.ts +1 -1
- package/dist/hooks/code-simplifier/index.js +1 -1
- package/dist/hooks/code-simplifier/jev-shadow.d.ts +5 -4
- package/dist/hooks/code-simplifier/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/code-simplifier/jev-shadow.js +9 -4
- package/dist/hooks/code-simplifier/jev-shadow.js.map +1 -1
- package/dist/hooks/directory-readme-injector/index.d.ts.map +1 -1
- package/dist/hooks/directory-readme-injector/index.js +11 -2
- package/dist/hooks/directory-readme-injector/index.js.map +1 -1
- package/dist/hooks/jev/__tests__/active-mode.test.d.ts +9 -0
- package/dist/hooks/jev/__tests__/active-mode.test.d.ts.map +1 -0
- package/dist/hooks/jev/__tests__/active-mode.test.js +252 -0
- package/dist/hooks/jev/__tests__/active-mode.test.js.map +1 -0
- package/dist/hooks/jev/points.d.ts +3 -1
- package/dist/hooks/jev/points.d.ts.map +1 -1
- package/dist/hooks/jev/points.js +1 -0
- package/dist/hooks/jev/points.js.map +1 -1
- package/dist/hooks/jev/resolver.d.ts.map +1 -1
- package/dist/hooks/jev/resolver.js +17 -1
- package/dist/hooks/jev/resolver.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts +2 -0
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/index.js +3 -3
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/keyword-detector/jev-shadow.d.ts +6 -4
- package/dist/hooks/keyword-detector/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/jev-shadow.js +18 -4
- package/dist/hooks/keyword-detector/jev-shadow.js.map +1 -1
- package/dist/hooks/learner/jev-shadow.d.ts +4 -3
- package/dist/hooks/learner/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/learner/jev-shadow.js +14 -3
- package/dist/hooks/learner/jev-shadow.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +22 -6
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/jev-shadow.d.ts +7 -5
- package/dist/hooks/persistent-mode/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/jev-shadow.js +28 -6
- package/dist/hooks/persistent-mode/jev-shadow.js.map +1 -1
- package/dist/hooks/preemptive-compaction/__tests__/jev-shadow.test.js +3 -3
- package/dist/hooks/preemptive-compaction/__tests__/jev-shadow.test.js.map +1 -1
- package/dist/hooks/preemptive-compaction/index.d.ts +5 -1
- package/dist/hooks/preemptive-compaction/index.d.ts.map +1 -1
- package/dist/hooks/preemptive-compaction/index.js +13 -8
- package/dist/hooks/preemptive-compaction/index.js.map +1 -1
- package/dist/hooks/preemptive-compaction/jev-shadow.d.ts +6 -5
- package/dist/hooks/preemptive-compaction/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/preemptive-compaction/jev-shadow.js +18 -5
- package/dist/hooks/preemptive-compaction/jev-shadow.js.map +1 -1
- package/dist/hooks/ralph/__tests__/feedback-baseline.test.d.ts +2 -0
- package/dist/hooks/ralph/__tests__/feedback-baseline.test.d.ts.map +1 -0
- package/dist/hooks/ralph/__tests__/feedback-baseline.test.js +250 -0
- package/dist/hooks/ralph/__tests__/feedback-baseline.test.js.map +1 -0
- package/dist/hooks/ralph/feedback-baseline.d.ts +58 -0
- package/dist/hooks/ralph/feedback-baseline.d.ts.map +1 -0
- package/dist/hooks/ralph/feedback-baseline.js +141 -0
- package/dist/hooks/ralph/feedback-baseline.js.map +1 -0
- package/dist/hooks/ralph/index.d.ts +1 -1
- package/dist/hooks/ralph/index.d.ts.map +1 -1
- package/dist/hooks/ralph/index.js +1 -1
- package/dist/hooks/ralph/index.js.map +1 -1
- package/dist/hooks/ralph/jev-shadow.d.ts +4 -3
- package/dist/hooks/ralph/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/ralph/jev-shadow.js +14 -4
- package/dist/hooks/ralph/jev-shadow.js.map +1 -1
- package/dist/hooks/ralph/loop.d.ts +7 -0
- package/dist/hooks/ralph/loop.d.ts.map +1 -1
- package/dist/hooks/ralph/loop.js +21 -0
- package/dist/hooks/ralph/loop.js.map +1 -1
- package/dist/hooks/ralph/prd.d.ts +17 -0
- package/dist/hooks/ralph/prd.d.ts.map +1 -1
- package/dist/hooks/ralph/prd.js +26 -1
- package/dist/hooks/ralph/prd.js.map +1 -1
- package/dist/hooks/registry/__tests__/registry.test.js +12 -4
- package/dist/hooks/registry/__tests__/registry.test.js.map +1 -1
- package/dist/hooks/rules-injector/matcher.d.ts.map +1 -1
- package/dist/hooks/rules-injector/matcher.js +35 -7
- package/dist/hooks/rules-injector/matcher.js.map +1 -1
- package/dist/hooks/rules-injector/matcher.test.d.ts +2 -0
- package/dist/hooks/rules-injector/matcher.test.d.ts.map +1 -0
- package/dist/hooks/rules-injector/matcher.test.js +58 -0
- package/dist/hooks/rules-injector/matcher.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/action-runner.test.js +51 -0
- package/dist/hooks/session-end/__tests__/action-runner.test.js.map +1 -1
- package/dist/hooks/session-end/__tests__/chain-enqueuer.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/chain-enqueuer.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/chain-enqueuer.test.js +274 -0
- package/dist/hooks/session-end/__tests__/chain-enqueuer.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/check-evidence.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/check-evidence.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/check-evidence.test.js +171 -0
- package/dist/hooks/session-end/__tests__/check-evidence.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/cleanup-manifest.test.js +21 -0
- package/dist/hooks/session-end/__tests__/cleanup-manifest.test.js.map +1 -1
- package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.d.ts +10 -0
- package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.js +123 -0
- package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/guardrails.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/guardrails.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/guardrails.test.js +184 -0
- package/dist/hooks/session-end/__tests__/guardrails.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.d.ts +9 -0
- package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.js +96 -0
- package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/routing.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/routing.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/routing.test.js +135 -0
- package/dist/hooks/session-end/__tests__/routing.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/spawn-next.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/spawn-next.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/spawn-next.test.js +501 -0
- package/dist/hooks/session-end/__tests__/spawn-next.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/worker.test.js +102 -0
- package/dist/hooks/session-end/__tests__/worker.test.js.map +1 -1
- package/dist/hooks/session-end/action-runner.d.ts.map +1 -1
- package/dist/hooks/session-end/action-runner.js +24 -2
- package/dist/hooks/session-end/action-runner.js.map +1 -1
- package/dist/hooks/session-end/chain-enqueuer.d.ts +45 -0
- package/dist/hooks/session-end/chain-enqueuer.d.ts.map +1 -0
- package/dist/hooks/session-end/chain-enqueuer.js +191 -0
- package/dist/hooks/session-end/chain-enqueuer.js.map +1 -0
- package/dist/hooks/session-end/check-evidence.d.ts +29 -0
- package/dist/hooks/session-end/check-evidence.d.ts.map +1 -0
- package/dist/hooks/session-end/check-evidence.js +52 -0
- package/dist/hooks/session-end/check-evidence.js.map +1 -0
- package/dist/hooks/session-end/cleanup-manifest.d.ts +1 -1
- package/dist/hooks/session-end/cleanup-manifest.d.ts.map +1 -1
- package/dist/hooks/session-end/cleanup-manifest.js +22 -2
- package/dist/hooks/session-end/cleanup-manifest.js.map +1 -1
- package/dist/hooks/session-end/foreground-bootstrap.d.ts.map +1 -1
- package/dist/hooks/session-end/foreground-bootstrap.js +30 -4
- package/dist/hooks/session-end/foreground-bootstrap.js.map +1 -1
- package/dist/hooks/session-end/guardrails.d.ts +67 -0
- package/dist/hooks/session-end/guardrails.d.ts.map +1 -0
- package/dist/hooks/session-end/guardrails.js +149 -0
- package/dist/hooks/session-end/guardrails.js.map +1 -0
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +14 -6
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/session-end/routing.d.ts +53 -0
- package/dist/hooks/session-end/routing.d.ts.map +1 -0
- package/dist/hooks/session-end/routing.js +75 -0
- package/dist/hooks/session-end/routing.js.map +1 -0
- package/dist/hooks/session-end/spawn-next.d.ts +117 -0
- package/dist/hooks/session-end/spawn-next.d.ts.map +1 -0
- package/dist/hooks/session-end/spawn-next.js +292 -0
- package/dist/hooks/session-end/spawn-next.js.map +1 -0
- package/dist/hooks/session-end/worker.d.ts.map +1 -1
- package/dist/hooks/session-end/worker.js +45 -5
- package/dist/hooks/session-end/worker.js.map +1 -1
- package/dist/hooks/task-size-detector/jev-shadow.d.ts +2 -1
- package/dist/hooks/task-size-detector/jev-shadow.d.ts.map +1 -1
- package/dist/hooks/task-size-detector/jev-shadow.js +19 -1
- package/dist/hooks/task-size-detector/jev-shadow.js.map +1 -1
- package/dist/installer/__tests__/hook-command-portability.test.js +57 -1
- package/dist/installer/__tests__/hook-command-portability.test.js.map +1 -1
- package/dist/installer/__tests__/mcp-registry.test.js +98 -0
- package/dist/installer/__tests__/mcp-registry.test.js.map +1 -1
- package/dist/installer/hooks.d.ts +7 -0
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +15 -0
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +12 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +3 -1
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/mcp-registry.d.ts.map +1 -1
- package/dist/installer/mcp-registry.js +56 -6
- package/dist/installer/mcp-registry.js.map +1 -1
- package/dist/lib/__tests__/host-load-gate.test.d.ts +2 -0
- package/dist/lib/__tests__/host-load-gate.test.d.ts.map +1 -0
- package/dist/lib/__tests__/host-load-gate.test.js +377 -0
- package/dist/lib/__tests__/host-load-gate.test.js.map +1 -0
- package/dist/lib/__tests__/runs-ledger.test.d.ts +2 -0
- package/dist/lib/__tests__/runs-ledger.test.d.ts.map +1 -0
- package/dist/lib/__tests__/runs-ledger.test.js +99 -0
- package/dist/lib/__tests__/runs-ledger.test.js.map +1 -0
- package/dist/lib/atomic-write.d.ts +16 -0
- package/dist/lib/atomic-write.d.ts.map +1 -1
- package/dist/lib/atomic-write.js +27 -4
- package/dist/lib/atomic-write.js.map +1 -1
- package/dist/lib/host-load-gate.d.ts +110 -0
- package/dist/lib/host-load-gate.d.ts.map +1 -0
- package/dist/lib/host-load-gate.js +228 -0
- package/dist/lib/host-load-gate.js.map +1 -0
- package/dist/lib/mode-state-io.d.ts.map +1 -1
- package/dist/lib/mode-state-io.js +55 -18
- package/dist/lib/mode-state-io.js.map +1 -1
- package/dist/lib/runs-ledger.d.ts +45 -0
- package/dist/lib/runs-ledger.d.ts.map +1 -0
- package/dist/lib/runs-ledger.js +141 -0
- package/dist/lib/runs-ledger.js.map +1 -0
- package/dist/platform/executable-resolution.d.ts +13 -0
- package/dist/platform/executable-resolution.d.ts.map +1 -1
- package/dist/platform/executable-resolution.js +16 -0
- package/dist/platform/executable-resolution.js.map +1 -1
- package/dist/shared/types.d.ts +3 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +63 -1
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/stage-router.test.js +22 -0
- package/dist/team/__tests__/stage-router.test.js.map +1 -1
- package/dist/team/__tests__/team-owner-epoch.test.js +33 -0
- package/dist/team/__tests__/team-owner-epoch.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.create-team.test.js +60 -2
- package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.psmux.test.js +12 -0
- package/dist/team/__tests__/tmux-session.psmux.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +230 -7
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-launch-ack.test.js +62 -0
- package/dist/team/__tests__/worker-launch-ack.test.js.map +1 -1
- package/dist/team/model-contract.d.ts +3 -2
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +35 -10
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/runtime-v2.d.ts +13 -0
- package/dist/team/runtime-v2.d.ts.map +1 -1
- package/dist/team/runtime-v2.js +112 -7
- package/dist/team/runtime-v2.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +4 -1
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/stage-router.d.ts.map +1 -1
- package/dist/team/stage-router.js +3 -1
- package/dist/team/stage-router.js.map +1 -1
- package/dist/team/team-owner-epoch.d.ts.map +1 -1
- package/dist/team/team-owner-epoch.js +4 -7
- package/dist/team/team-owner-epoch.js.map +1 -1
- package/dist/team/tmux-session.d.ts +8 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +71 -19
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-launch-ack.d.ts +1 -1
- package/dist/team/worker-launch-ack.d.ts.map +1 -1
- package/dist/team/worker-launch-ack.js +28 -1
- package/dist/team/worker-launch-ack.js.map +1 -1
- package/dist/tools/lsp/__tests__/client-handle-data.test.js +83 -0
- package/dist/tools/lsp/__tests__/client-handle-data.test.js.map +1 -1
- package/dist/tools/lsp/client.d.ts.map +1 -1
- package/dist/tools/lsp/client.js +41 -11
- package/dist/tools/lsp/client.js.map +1 -1
- package/docs/CLAUDE.md +1 -1
- package/docs/HOOKS.md +235 -0
- package/docs/MIGRATION.md +132 -0
- package/docs/REFERENCE.md +26 -1
- package/docs/adr/03672-env-activated-active-mode.md +18 -1
- package/docs/design/FACTORY-FINAL-DESIGN.md +114 -0
- package/docs/design/P2-RUN-LEDGER-AND-INTAKE-PLAN.md +83 -0
- package/docs/factory/t6-acceptance/acceptance-comment.md +36 -0
- package/hooks/hooks.json +22 -1
- package/package.json +6 -2
- package/plugin.json +1 -1
- package/scripts/build-contained-fs.mjs +24 -2
- package/scripts/ci/check-multirepo-paths.mjs +3 -0
- package/scripts/code-simplifier.mjs +24 -2
- package/scripts/dev/repro-state-lock.mjs +67 -0
- package/scripts/git-guardrails.mjs +581 -0
- package/scripts/keyword-detector.mjs +21 -4
- package/scripts/lib/atomic-write.mjs +31 -8
- package/scripts/lib/jev-shadow.mjs +68 -29
- package/scripts/lib/run-reaper.mjs +114 -0
- package/scripts/lib/state-lock.mjs +22 -13
- package/scripts/post-tool-verifier.mjs +8 -2
- package/scripts/postinstall-contained-fs.mjs +56 -0
- package/scripts/pre-tool-enforcer.mjs +25 -8
- package/scripts/run.cjs +18 -0
- package/scripts/runs-reconciler.mjs +103 -0
- package/scripts/stale-run-reporter.mjs +73 -0
- package/scripts/workflow-drift-guard.mjs +6 -1
- package/skills/autopilot/SKILL.md +10 -2
- package/skills/harbor/SKILL.md +8 -0
- package/skills/omc-setup/phases/04-welcome.md +1 -1
- package/skills/ralph/SKILL.md +32 -15
- package/skills/refit/SKILL.md +8 -0
- package/skills/team/SKILL.md +2 -0
- package/templates/hooks/code-simplifier.mjs +24 -2
- package/templates/hooks/lib/atomic-write.mjs +31 -8
- package/templates/hooks/session-end.mjs +99 -0
- package/templates/hooks/workflow-drift-guard.mjs +6 -1
package/bridge/team-mcp.cjs
CHANGED
|
@@ -8252,7 +8252,7 @@ function getNativeContainedFs() {
|
|
|
8252
8252
|
loaded = (0, import_node_module.createRequire)(importMetaUrl)(binary);
|
|
8253
8253
|
return loaded;
|
|
8254
8254
|
} catch (cause) {
|
|
8255
|
-
throw new Error(`The contained filesystem backend is unavailable at ${binary}. Build it with node scripts/build-contained-fs.mjs before running graph commands.`, { cause });
|
|
8255
|
+
throw new Error(`The contained filesystem backend is unavailable at ${binary}. Build it with node scripts/build-contained-fs.mjs (from the installed package directory) before running graph or team commands.`, { cause });
|
|
8256
8256
|
}
|
|
8257
8257
|
}
|
|
8258
8258
|
}
|
|
@@ -8318,7 +8318,7 @@ function probeProcessStartIdentityForPlatform(pid, platform, exec2, read, strict
|
|
|
8318
8318
|
["-NoProfile", "-NonInteractive", "-Command", command],
|
|
8319
8319
|
{ encoding: "utf8", windowsHide: true }
|
|
8320
8320
|
).trim();
|
|
8321
|
-
return
|
|
8321
|
+
return /^[1-9]\d*$/.test(ticks) ? { identity: `win32:${ticks}`, precise: true } : { identity: null, precise: false };
|
|
8322
8322
|
}
|
|
8323
8323
|
if (platform === "darwin") {
|
|
8324
8324
|
if (strict) {
|
|
@@ -11625,11 +11625,11 @@ function tmuxEnv() {
|
|
|
11625
11625
|
function resolveEnv(opts) {
|
|
11626
11626
|
return opts?.stripTmux ? tmuxEnv() : process.env;
|
|
11627
11627
|
}
|
|
11628
|
-
function
|
|
11629
|
-
assertSafeCmdValue(
|
|
11630
|
-
if (
|
|
11631
|
-
if (!/[\s"%^&|<>()]/.test(
|
|
11632
|
-
return `"${
|
|
11628
|
+
function quoteForTmuxCmdLayer(command) {
|
|
11629
|
+
assertSafeCmdValue(command);
|
|
11630
|
+
if (command.length === 0) return '""';
|
|
11631
|
+
if (!/[\s"%^&|<>()]/.test(command)) return command;
|
|
11632
|
+
return `"${command.replace(/(["%])/g, "$1$1")}"`;
|
|
11633
11633
|
}
|
|
11634
11634
|
function assertSafeCmdValue(value) {
|
|
11635
11635
|
if (/[\0\r\n]/.test(value)) {
|
|
@@ -11640,7 +11640,7 @@ function resolveTmuxInvocation(args) {
|
|
|
11640
11640
|
const resolvedBinary = resolveTmuxBinaryPath();
|
|
11641
11641
|
if (process.platform === "win32" && /\.(cmd|bat)$/i.test(resolvedBinary)) {
|
|
11642
11642
|
const comspec = process.env.COMSPEC || "cmd.exe";
|
|
11643
|
-
const commandLine = [
|
|
11643
|
+
const commandLine = [quoteForTmuxCmdLayer(resolvedBinary), ...args.map(quoteForTmuxCmdLayer)].join(" ");
|
|
11644
11644
|
return {
|
|
11645
11645
|
command: comspec,
|
|
11646
11646
|
args: ["/d", "/s", "/c", commandLine]
|
|
@@ -12080,7 +12080,7 @@ function verifyPrivateTempFile(fd, tempPath, label, operations) {
|
|
|
12080
12080
|
`${label} temporary file must be a private regular single-link file`
|
|
12081
12081
|
);
|
|
12082
12082
|
}
|
|
12083
|
-
if (fdStats
|
|
12083
|
+
if (!sameFileIdentity(fdStats, pathStats)) {
|
|
12084
12084
|
throw new Error(`${label} temporary file was replaced before rename`);
|
|
12085
12085
|
}
|
|
12086
12086
|
}
|
|
@@ -12092,7 +12092,7 @@ function verifyPublishedFile(fd, filePath, label, operations) {
|
|
|
12092
12092
|
} catch {
|
|
12093
12093
|
throw new Error(`${label} target was replaced at publication`);
|
|
12094
12094
|
}
|
|
12095
|
-
if (!pathStats.isFile() || fdStats
|
|
12095
|
+
if (!pathStats.isFile() || !sameFileIdentity(fdStats, pathStats)) {
|
|
12096
12096
|
throw new Error(`${label} target was replaced at publication`);
|
|
12097
12097
|
}
|
|
12098
12098
|
}
|
|
@@ -12116,6 +12116,14 @@ function preservePriorTarget(filePath, operations) {
|
|
|
12116
12116
|
return null;
|
|
12117
12117
|
}
|
|
12118
12118
|
}
|
|
12119
|
+
function sameFileIdentity(a, b) {
|
|
12120
|
+
if (a.ino !== b.ino) return false;
|
|
12121
|
+
const isWindows = process.platform === "win32";
|
|
12122
|
+
if (isWindows && (a.dev === 0 || b.dev === 0)) {
|
|
12123
|
+
return true;
|
|
12124
|
+
}
|
|
12125
|
+
return a.dev === b.dev;
|
|
12126
|
+
}
|
|
12119
12127
|
function currentFileIdentity(filePath, operations) {
|
|
12120
12128
|
try {
|
|
12121
12129
|
const stats = (operations?.lstat ?? fsSync.lstatSync)(filePath);
|
|
@@ -12136,7 +12144,7 @@ function rollbackPriorTarget(filePath, backupPath, expectedIdentity, operations)
|
|
|
12136
12144
|
if (expectedIdentity === null) return;
|
|
12137
12145
|
const current = currentFileIdentity(filePath, operations);
|
|
12138
12146
|
if (current === null) return;
|
|
12139
|
-
if (expectedIdentity !== null && (current
|
|
12147
|
+
if (expectedIdentity !== null && !sameFileIdentity(current, expectedIdentity)) {
|
|
12140
12148
|
return;
|
|
12141
12149
|
}
|
|
12142
12150
|
try {
|
|
@@ -12433,6 +12441,18 @@ var init_file_lock = __esm({
|
|
|
12433
12441
|
}
|
|
12434
12442
|
});
|
|
12435
12443
|
|
|
12444
|
+
// src/lib/host-load-gate.ts
|
|
12445
|
+
var import_os6, import_fs20, import_path22;
|
|
12446
|
+
var init_host_load_gate = __esm({
|
|
12447
|
+
"src/lib/host-load-gate.ts"() {
|
|
12448
|
+
"use strict";
|
|
12449
|
+
import_os6 = require("os");
|
|
12450
|
+
import_fs20 = require("fs");
|
|
12451
|
+
import_path22 = require("path");
|
|
12452
|
+
init_paths();
|
|
12453
|
+
}
|
|
12454
|
+
});
|
|
12455
|
+
|
|
12436
12456
|
// src/team/worker-launch-ack.ts
|
|
12437
12457
|
function buildWindowsSupervisorSource() {
|
|
12438
12458
|
return [
|
|
@@ -12498,7 +12518,11 @@ function normalizeProviderEnvironment(value, platform = process.platform) {
|
|
|
12498
12518
|
}
|
|
12499
12519
|
return normalized;
|
|
12500
12520
|
}
|
|
12501
|
-
function
|
|
12521
|
+
function parseEnvPassthrough(value) {
|
|
12522
|
+
if (!value || value.trim().length === 0) return [];
|
|
12523
|
+
return value.split(",").map((k) => k.trim()).filter((k) => k.length > 0);
|
|
12524
|
+
}
|
|
12525
|
+
function buildProviderEnvironment(providerEnv, sourceEnv = process.env, platform = process.platform, envPassthrough) {
|
|
12502
12526
|
const normalized = normalizeProviderEnvironment(providerEnv, platform);
|
|
12503
12527
|
const baseline = {};
|
|
12504
12528
|
for (const key of SAFE_BASELINE_ENV_KEYS) {
|
|
@@ -12519,6 +12543,14 @@ function buildProviderEnvironment(providerEnv, sourceEnv = process.env, platform
|
|
|
12519
12543
|
const homeKey = platform === "win32" ? "USERPROFILE" : "HOME";
|
|
12520
12544
|
const home = platform === "win32" ? Object.entries(sourceEnv).find(([key]) => key.toUpperCase() === homeKey)?.[1] : sourceEnv[homeKey];
|
|
12521
12545
|
if (typeof home === "string" && home.length > 0) baseline[homeKey] = home;
|
|
12546
|
+
const passthroughList = envPassthrough ?? parseEnvPassthrough(sourceEnv.OMC_TEAM_WORKER_ENV_PASSTHROUGH);
|
|
12547
|
+
for (const key of passthroughList) {
|
|
12548
|
+
if (!isValidEnvironmentKey(key)) throw new Error("worker_launch_env_passthrough_key_invalid");
|
|
12549
|
+
if (WORKER_LAUNCH_INTERNAL_ENV_KEYS.has(key)) throw new Error("worker_launch_env_passthrough_key_reserved");
|
|
12550
|
+
if (platform === "win32" && WINDOWS_RESERVED_ENV_KEYS.has(key.toUpperCase())) throw new Error("worker_launch_env_passthrough_key_reserved");
|
|
12551
|
+
const value = sourceEnv[key];
|
|
12552
|
+
if (typeof value === "string") baseline[key] = value;
|
|
12553
|
+
}
|
|
12522
12554
|
if (platform === "win32") {
|
|
12523
12555
|
for (const key of Object.keys(normalized)) {
|
|
12524
12556
|
const baselineKey = Object.keys(baseline).find((candidate) => candidate.toUpperCase() === key.toUpperCase());
|
|
@@ -13256,6 +13288,7 @@ var init_worker_launch_ack = __esm({
|
|
|
13256
13288
|
init_state_paths();
|
|
13257
13289
|
init_atomic_write();
|
|
13258
13290
|
init_file_lock();
|
|
13291
|
+
init_host_load_gate();
|
|
13259
13292
|
WORKER_LAUNCH_SCHEMA_VERSION = 1;
|
|
13260
13293
|
DEFAULT_ACK_TIMEOUT_MS = 8e3;
|
|
13261
13294
|
DEFAULT_POLL_INTERVAL_MS = 25;
|
|
@@ -13303,13 +13336,13 @@ var init_worker_launch_ack = __esm({
|
|
|
13303
13336
|
});
|
|
13304
13337
|
|
|
13305
13338
|
// src/team/recovery-request-store.ts
|
|
13306
|
-
var import_crypto6,
|
|
13339
|
+
var import_crypto6, import_fs21, import_path23, RETENTION_MS;
|
|
13307
13340
|
var init_recovery_request_store = __esm({
|
|
13308
13341
|
"src/team/recovery-request-store.ts"() {
|
|
13309
13342
|
"use strict";
|
|
13310
13343
|
import_crypto6 = require("crypto");
|
|
13311
|
-
|
|
13312
|
-
|
|
13344
|
+
import_fs21 = require("fs");
|
|
13345
|
+
import_path23 = require("path");
|
|
13313
13346
|
init_types2();
|
|
13314
13347
|
init_state_paths();
|
|
13315
13348
|
init_process_identity_lock();
|
|
@@ -13394,6 +13427,7 @@ __export(tmux_session_exports, {
|
|
|
13394
13427
|
spawnWorkerInPane: () => spawnWorkerInPane,
|
|
13395
13428
|
splitTeamWorkerPane: () => splitTeamWorkerPane,
|
|
13396
13429
|
splitTeamWorkerPaneWithEvidence: () => splitTeamWorkerPaneWithEvidence,
|
|
13430
|
+
strictIdentityUnavailableError: () => strictIdentityUnavailableError,
|
|
13397
13431
|
validateTmux: () => validateTmux,
|
|
13398
13432
|
verifyTeamTargetOwnership: () => verifyTeamTargetOwnership,
|
|
13399
13433
|
waitForPaneReady: () => waitForPaneReady,
|
|
@@ -13405,7 +13439,7 @@ function tmuxArgsForIdentity(identity, args) {
|
|
|
13405
13439
|
return ["-S", identity.socket_path, ...args];
|
|
13406
13440
|
}
|
|
13407
13441
|
function buildDetachedTmuxServerKeepaliveArgs(socketPath) {
|
|
13408
|
-
if (!(0,
|
|
13442
|
+
if (!(0, import_path24.isAbsolute)(socketPath) && !import_path24.win32.isAbsolute(socketPath)) {
|
|
13409
13443
|
throw new Error("tmux_private_socket_path_not_absolute");
|
|
13410
13444
|
}
|
|
13411
13445
|
return [
|
|
@@ -13421,8 +13455,8 @@ function buildDetachedTmuxServerKeepaliveArgs(socketPath) {
|
|
|
13421
13455
|
}
|
|
13422
13456
|
function buildPrivateTmuxSocketPath() {
|
|
13423
13457
|
if (isPsmux()) return buildPsmuxNamespacePath();
|
|
13424
|
-
const socketDirectory = process.platform === "darwin" || process.platform === "linux" ? "/tmp" : (0,
|
|
13425
|
-
const socketPath = (0,
|
|
13458
|
+
const socketDirectory = process.platform === "darwin" || process.platform === "linux" ? "/tmp" : (0, import_os7.tmpdir)();
|
|
13459
|
+
const socketPath = (0, import_path24.join)(
|
|
13426
13460
|
socketDirectory,
|
|
13427
13461
|
`o-${process.pid.toString(36)}-${Date.now().toString(36)}-${(0, import_crypto7.randomUUID)().slice(0, 8)}.sock`
|
|
13428
13462
|
);
|
|
@@ -13444,19 +13478,19 @@ function resolveTmuxServerGuardRuntime() {
|
|
|
13444
13478
|
} catch {
|
|
13445
13479
|
throw new Error("tmux_server_guard_runtime_path_unavailable");
|
|
13446
13480
|
}
|
|
13447
|
-
if (!(0,
|
|
13481
|
+
if (!(0, import_path24.isAbsolute)(runtimePath) && !import_path24.win32.isAbsolute(runtimePath) || !isRegularFile(runtimePath)) {
|
|
13448
13482
|
throw new Error("tmux_server_guard_runtime_path_unavailable");
|
|
13449
13483
|
}
|
|
13450
13484
|
const nodePath = process.execPath;
|
|
13451
|
-
if (!(0,
|
|
13485
|
+
if (!(0, import_path24.isAbsolute)(nodePath) && !import_path24.win32.isAbsolute(nodePath) || !isRegularFile(nodePath)) {
|
|
13452
13486
|
throw new Error("tmux_server_guard_node_path_unavailable");
|
|
13453
13487
|
}
|
|
13454
13488
|
return { nodePath, runtimePath };
|
|
13455
13489
|
}
|
|
13456
13490
|
function isRegularFile(path5) {
|
|
13457
|
-
if (!(0,
|
|
13491
|
+
if (!(0, import_fs22.existsSync)(path5)) return false;
|
|
13458
13492
|
try {
|
|
13459
|
-
return (0,
|
|
13493
|
+
return (0, import_fs22.statSync)(path5).isFile();
|
|
13460
13494
|
} catch {
|
|
13461
13495
|
return false;
|
|
13462
13496
|
}
|
|
@@ -13488,6 +13522,13 @@ function parseTmuxServerFields(output) {
|
|
|
13488
13522
|
function buildTmuxServerIdentity(socketPath, pid, processIdentity) {
|
|
13489
13523
|
const processStartedAt = processIdentity(pid);
|
|
13490
13524
|
if (!processStartedAt || !isValidStrictProcessStartIdentity(processStartedAt)) return null;
|
|
13525
|
+
if (process.platform === "win32") {
|
|
13526
|
+
try {
|
|
13527
|
+
process.kill(pid, 0);
|
|
13528
|
+
} catch {
|
|
13529
|
+
return null;
|
|
13530
|
+
}
|
|
13531
|
+
}
|
|
13491
13532
|
const identity = {
|
|
13492
13533
|
socket_path: socketPath,
|
|
13493
13534
|
server_pid: pid,
|
|
@@ -13540,17 +13581,26 @@ async function captureTmuxServerIdentity(selectedEndpoint, dependencies = {}) {
|
|
|
13540
13581
|
async function observeTmuxServerIdentity(expected, dependencies = {}) {
|
|
13541
13582
|
const deps = { ...defaultTmuxServerIdentityDependencies, ...dependencies };
|
|
13542
13583
|
if (!isValidTmuxServerIdentity(expected) || !isValidStrictProcessStartIdentity(expected.process_started_at)) return "unknown";
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
13548
|
-
|
|
13549
|
-
|
|
13550
|
-
|
|
13584
|
+
const singleWindowsProbe = process.platform === "win32" && dependencies.processObservation === void 0;
|
|
13585
|
+
if (singleWindowsProbe) {
|
|
13586
|
+
try {
|
|
13587
|
+
process.kill(expected.server_pid, 0);
|
|
13588
|
+
} catch (error2) {
|
|
13589
|
+
return error2.code === "ESRCH" ? "dead" : "unknown";
|
|
13590
|
+
}
|
|
13591
|
+
} else {
|
|
13592
|
+
let processState;
|
|
13593
|
+
try {
|
|
13594
|
+
processState = deps.processObservation({
|
|
13595
|
+
server_pid: expected.server_pid,
|
|
13596
|
+
process_started_at: expected.process_started_at
|
|
13597
|
+
});
|
|
13598
|
+
} catch {
|
|
13599
|
+
return "unknown";
|
|
13600
|
+
}
|
|
13601
|
+
if (processState === "dead") return "dead";
|
|
13602
|
+
if (processState !== "matching") return "unknown";
|
|
13551
13603
|
}
|
|
13552
|
-
if (processState === "dead") return "dead";
|
|
13553
|
-
if (processState !== "matching") return "unknown";
|
|
13554
13604
|
try {
|
|
13555
13605
|
const result = await deps.tmuxQuery(
|
|
13556
13606
|
tmuxArgsForIdentity(expected, ["display-message", "-p", "#{pid}"]),
|
|
@@ -13562,7 +13612,15 @@ async function observeTmuxServerIdentity(expected, dependencies = {}) {
|
|
|
13562
13612
|
const actualPid = parseExactPositivePid(lines[0]);
|
|
13563
13613
|
if (actualPid !== expected.server_pid) return "unknown";
|
|
13564
13614
|
const actualStart = deps.processIdentity(actualPid);
|
|
13615
|
+
if (singleWindowsProbe && actualStart && isValidStrictProcessStartIdentity(actualStart) && actualStart !== expected.process_started_at) return "dead";
|
|
13565
13616
|
if (!actualStart || actualStart !== expected.process_started_at) return "unknown";
|
|
13617
|
+
if (singleWindowsProbe) {
|
|
13618
|
+
try {
|
|
13619
|
+
process.kill(actualPid, 0);
|
|
13620
|
+
} catch (error2) {
|
|
13621
|
+
return error2.code === "ESRCH" ? "dead" : "unknown";
|
|
13622
|
+
}
|
|
13623
|
+
}
|
|
13566
13624
|
return "matching";
|
|
13567
13625
|
} catch {
|
|
13568
13626
|
return "unknown";
|
|
@@ -14070,7 +14128,7 @@ function getDefaultShell() {
|
|
|
14070
14128
|
return process.env.COMSPEC || "cmd.exe";
|
|
14071
14129
|
}
|
|
14072
14130
|
const shell = process.env.SHELL || "/bin/bash";
|
|
14073
|
-
const name = (0,
|
|
14131
|
+
const name = (0, import_path24.basename)(shell.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "");
|
|
14074
14132
|
if (!SUPPORTED_POSIX_SHELLS.has(name)) {
|
|
14075
14133
|
return "/bin/sh";
|
|
14076
14134
|
}
|
|
@@ -14080,7 +14138,7 @@ function pathEntries(envPath) {
|
|
|
14080
14138
|
return (envPath ?? "").split(process.platform === "win32" ? ";" : ":").map((entry) => entry.trim()).filter(Boolean);
|
|
14081
14139
|
}
|
|
14082
14140
|
function pathCandidateNames(candidatePath) {
|
|
14083
|
-
const base = (0,
|
|
14141
|
+
const base = (0, import_path24.basename)(candidatePath.replace(/\\/g, "/"));
|
|
14084
14142
|
const bare = base.replace(/\.(exe|cmd|bat)$/i, "");
|
|
14085
14143
|
if (process.platform === "win32") {
|
|
14086
14144
|
return Array.from(/* @__PURE__ */ new Set([`${bare}.exe`, `${bare}.cmd`, `${bare}.bat`, bare]));
|
|
@@ -14090,15 +14148,15 @@ function pathCandidateNames(candidatePath) {
|
|
|
14090
14148
|
function resolveShellFromPath(candidatePath) {
|
|
14091
14149
|
for (const dir of pathEntries(process.env.PATH)) {
|
|
14092
14150
|
for (const name of pathCandidateNames(candidatePath)) {
|
|
14093
|
-
const full = (0,
|
|
14094
|
-
if ((0,
|
|
14151
|
+
const full = (0, import_path24.join)(dir, name);
|
|
14152
|
+
if ((0, import_fs22.existsSync)(full)) return full;
|
|
14095
14153
|
}
|
|
14096
14154
|
}
|
|
14097
14155
|
return null;
|
|
14098
14156
|
}
|
|
14099
14157
|
function resolveShellFromCandidates(paths, rcFile) {
|
|
14100
14158
|
for (const p of paths) {
|
|
14101
|
-
if ((0,
|
|
14159
|
+
if ((0, import_fs22.existsSync)(p)) return { shell: p, rcFile };
|
|
14102
14160
|
const resolvedFromPath = resolveShellFromPath(p);
|
|
14103
14161
|
if (resolvedFromPath) return { shell: resolvedFromPath, rcFile };
|
|
14104
14162
|
}
|
|
@@ -14106,9 +14164,9 @@ function resolveShellFromCandidates(paths, rcFile) {
|
|
|
14106
14164
|
}
|
|
14107
14165
|
function resolveSupportedShellAffinity(shellPath) {
|
|
14108
14166
|
if (!shellPath) return null;
|
|
14109
|
-
const name = (0,
|
|
14167
|
+
const name = (0, import_path24.basename)(shellPath.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "");
|
|
14110
14168
|
if (name !== "zsh" && name !== "bash") return null;
|
|
14111
|
-
if (!(0,
|
|
14169
|
+
if (!(0, import_fs22.existsSync)(shellPath)) return null;
|
|
14112
14170
|
const home = process.env.HOME ?? "";
|
|
14113
14171
|
const rcFile = home ? `${home}/.${name}rc` : null;
|
|
14114
14172
|
return { shell: shellPath, rcFile };
|
|
@@ -14141,7 +14199,7 @@ function logWorkerSpawnDiagnostic(message) {
|
|
|
14141
14199
|
`);
|
|
14142
14200
|
}
|
|
14143
14201
|
function paneCurrentCommandLooksReady(command) {
|
|
14144
|
-
const normalized = (0,
|
|
14202
|
+
const normalized = (0, import_path24.basename)(command.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "").toLowerCase();
|
|
14145
14203
|
return SUPPORTED_POSIX_SHELLS.has(normalized) || ["cmd", "powershell", "pwsh", "nu", "elvish"].includes(normalized);
|
|
14146
14204
|
}
|
|
14147
14205
|
async function getPaneCurrentCommandStatus(paneId, tmuxServerIdentity) {
|
|
@@ -14275,7 +14333,7 @@ function assertSafeCmdValue2(value) {
|
|
|
14275
14333
|
if (/[\r\n\0]/.test(value)) throw new Error("Invalid Windows command value: contains CR, LF, or NUL");
|
|
14276
14334
|
}
|
|
14277
14335
|
function shellNameFromPath(shellPath) {
|
|
14278
|
-
const shellName = (0,
|
|
14336
|
+
const shellName = (0, import_path24.basename)(shellPath.replace(/\\/g, "/"));
|
|
14279
14337
|
return shellName.replace(/\.(exe|cmd|bat)$/i, "");
|
|
14280
14338
|
}
|
|
14281
14339
|
function shellEscape(value) {
|
|
@@ -14287,7 +14345,7 @@ function assertSafeEnvKey(key) {
|
|
|
14287
14345
|
}
|
|
14288
14346
|
}
|
|
14289
14347
|
function isAbsoluteLaunchBinaryPath(value) {
|
|
14290
|
-
return (0,
|
|
14348
|
+
return (0, import_path24.isAbsolute)(value) || import_path24.win32.isAbsolute(value);
|
|
14291
14349
|
}
|
|
14292
14350
|
function assertSafeLaunchBinary(launchBinary) {
|
|
14293
14351
|
if (launchBinary.trim().length === 0) {
|
|
@@ -14321,11 +14379,13 @@ function buildWorkerStartCommand(config2) {
|
|
|
14321
14379
|
const providerLaunchWords = getLaunchWords(config2);
|
|
14322
14380
|
const launchWords = config2.launchAttempt ? [process.execPath, config2.launchAttempt.runtimeCliPath, "--worker-launch"] : providerLaunchWords;
|
|
14323
14381
|
const envVars = config2.launchAttempt ? {
|
|
14324
|
-
...config2.envVars,
|
|
14325
14382
|
// Supervised launches carry the attempt-owned bootstrap descriptor by
|
|
14326
14383
|
// path (never inline): secrets stay out of the process list and tmux
|
|
14327
14384
|
// scrollback, and the delivered command stays small. The runtime CLI
|
|
14328
14385
|
// validates and consumes the descriptor before running the provider.
|
|
14386
|
+
// Team identity (team_name, worker_name, provider, instance_id) is read
|
|
14387
|
+
// from the descriptor, not from environment vars, keeping the typed
|
|
14388
|
+
// command under 1024 bytes even with long cwd paths.
|
|
14329
14389
|
OMC_WORKER_LAUNCH_SPEC_FILE: config2.launchAttempt.bootstrapDescriptorPath
|
|
14330
14390
|
} : config2.envVars;
|
|
14331
14391
|
const shouldSourceRc = process.env.OMC_TEAM_NO_RC !== "1";
|
|
@@ -14615,6 +14675,17 @@ async function splitTeamWorkerPaneWithEvidence(splitTarget, direction, cwd, prov
|
|
|
14615
14675
|
async function splitTeamWorkerPane(splitTarget, direction, cwd) {
|
|
14616
14676
|
return (await splitTeamWorkerPaneWithEvidence(splitTarget, direction, cwd)).paneId;
|
|
14617
14677
|
}
|
|
14678
|
+
function strictIdentityUnavailableError(platform, loadNative = getNativeContainedFs) {
|
|
14679
|
+
if (platform === "darwin") {
|
|
14680
|
+
try {
|
|
14681
|
+
loadNative();
|
|
14682
|
+
} catch (cause) {
|
|
14683
|
+
const detail = cause instanceof Error ? cause.message : String(cause);
|
|
14684
|
+
return new Error(`tmux_server_identity_probe_unavailable: ${detail}`, { cause });
|
|
14685
|
+
}
|
|
14686
|
+
}
|
|
14687
|
+
return new Error("tmux_server_identity_probe_unavailable");
|
|
14688
|
+
}
|
|
14618
14689
|
async function createTeamSession(teamName, workerCount, cwd, options = {}) {
|
|
14619
14690
|
const multiplexerContext = isPsmux() ? "none" : detectTeamMultiplexerContext();
|
|
14620
14691
|
const inTmux = multiplexerContext === "tmux";
|
|
@@ -14624,7 +14695,7 @@ async function createTeamSession(teamName, workerCount, cwd, options = {}) {
|
|
|
14624
14695
|
validateTmux();
|
|
14625
14696
|
}
|
|
14626
14697
|
if (!inCmux && !currentStrictProcessStartIdentity()) {
|
|
14627
|
-
throw
|
|
14698
|
+
throw strictIdentityUnavailableError(process.platform);
|
|
14628
14699
|
}
|
|
14629
14700
|
let tmuxServerIdentity;
|
|
14630
14701
|
let freshDetachedServerIdentity;
|
|
@@ -14674,7 +14745,7 @@ async function createTeamSession(teamName, workerCount, cwd, options = {}) {
|
|
|
14674
14745
|
"-d",
|
|
14675
14746
|
"-P",
|
|
14676
14747
|
"-F",
|
|
14677
|
-
"#S
|
|
14748
|
+
"#S:#{window_index} #{pane_id} #{socket_path} #{pid}",
|
|
14678
14749
|
"-s",
|
|
14679
14750
|
detachedSessionName,
|
|
14680
14751
|
"-c",
|
|
@@ -15368,7 +15439,7 @@ async function spawnWorkerInPane(sessionName2, paneId, config2) {
|
|
|
15368
15439
|
if (config2.launchAttempt) {
|
|
15369
15440
|
await revokeWorkerLaunchAttempt(config2.launchAttempt, "launch_failed").catch(() => void 0);
|
|
15370
15441
|
}
|
|
15371
|
-
if (config2.launchAttempt && (!materializedTransport || (0,
|
|
15442
|
+
if (config2.launchAttempt && (!materializedTransport || (0, import_fs22.existsSync)(materializedTransport.bootstrapDescriptorPath))) {
|
|
15372
15443
|
const cleaned = await cleanupWorkerLaunchTransport(config2.launchAttempt, "launch_failed").catch(() => false);
|
|
15373
15444
|
if (!cleaned) {
|
|
15374
15445
|
logWorkerSpawnDiagnostic(
|
|
@@ -16189,7 +16260,7 @@ function parseDedicatedWindowTarget(sessionName2) {
|
|
|
16189
16260
|
}
|
|
16190
16261
|
function normalizeDetachedSessionTarget(sessionName2) {
|
|
16191
16262
|
const detachedTarget = sessionName2.includes(":") ? parseDedicatedWindowTarget(sessionName2) : null;
|
|
16192
|
-
const sessionTarget = detachedTarget ? detachedTarget.
|
|
16263
|
+
const sessionTarget = detachedTarget ? detachedTarget.sessionName : sessionName2;
|
|
16193
16264
|
return sessionTarget && /^[^\s:]+$/.test(sessionTarget) ? sessionTarget : null;
|
|
16194
16265
|
}
|
|
16195
16266
|
async function resolveSplitPaneWorkerPaneIds(_sessionName, recordedPaneIds, leaderPaneId) {
|
|
@@ -16347,20 +16418,21 @@ async function killTeamSession(sessionName2, workerPaneIds, leaderPaneId, option
|
|
|
16347
16418
|
if (result.outcome === "executed") return true;
|
|
16348
16419
|
return await observeTmuxServerIdentity(identity) === "dead";
|
|
16349
16420
|
}
|
|
16350
|
-
var
|
|
16421
|
+
var import_fs22, import_crypto7, import_child_process7, import_util7, import_path24, import_os7, sleep3, execFileAsync2, TMUX_SESSION_PREFIX, defaultTmuxServerIdentityDependencies, guardMarkerCounter, TMUX_MAILBOX_PANE_ID, TMUX_MAILBOX_TARGET, defaultMailboxTargetOwnershipDependencies, defaultDirectMailboxEffectDependencies, TeamSessionCreationError, SUPPORTED_POSIX_SHELLS, ZSH_CANDIDATES, BASH_CANDIDATES, DANGEROUS_LAUNCH_BINARY_CHARS;
|
|
16351
16422
|
var init_tmux_session = __esm({
|
|
16352
16423
|
"src/team/tmux-session.ts"() {
|
|
16353
16424
|
"use strict";
|
|
16354
|
-
|
|
16425
|
+
import_fs22 = require("fs");
|
|
16355
16426
|
import_crypto7 = require("crypto");
|
|
16356
16427
|
import_child_process7 = require("child_process");
|
|
16357
16428
|
import_util7 = require("util");
|
|
16358
|
-
|
|
16359
|
-
|
|
16429
|
+
import_path24 = require("path");
|
|
16430
|
+
import_os7 = require("os");
|
|
16360
16431
|
init_team_name();
|
|
16361
16432
|
init_tmux_utils();
|
|
16362
16433
|
init_types2();
|
|
16363
16434
|
init_team_owner_epoch();
|
|
16435
|
+
init_native_contained_fs();
|
|
16364
16436
|
init_pane_readiness();
|
|
16365
16437
|
init_worker_launch_ack();
|
|
16366
16438
|
init_runtime_owner_client();
|
|
@@ -16418,23 +16490,23 @@ var init_tmux_session = __esm({
|
|
|
16418
16490
|
// src/agents/prompt-helpers.ts
|
|
16419
16491
|
function getPackageDir3() {
|
|
16420
16492
|
if (typeof __dirname !== "undefined" && __dirname) {
|
|
16421
|
-
const currentDirName = (0,
|
|
16422
|
-
const parentDirName = (0,
|
|
16493
|
+
const currentDirName = (0, import_path25.basename)(__dirname);
|
|
16494
|
+
const parentDirName = (0, import_path25.basename)((0, import_path25.dirname)(__dirname));
|
|
16423
16495
|
if (currentDirName === "bridge") {
|
|
16424
|
-
return (0,
|
|
16496
|
+
return (0, import_path25.join)(__dirname, "..");
|
|
16425
16497
|
}
|
|
16426
16498
|
if (currentDirName === "agents" && (parentDirName === "src" || parentDirName === "dist")) {
|
|
16427
|
-
return (0,
|
|
16499
|
+
return (0, import_path25.join)(__dirname, "..", "..");
|
|
16428
16500
|
}
|
|
16429
16501
|
}
|
|
16430
16502
|
try {
|
|
16431
16503
|
const __filename = (0, import_url4.fileURLToPath)(importMetaUrl);
|
|
16432
|
-
const __dirname2 = (0,
|
|
16433
|
-
const currentDirName = (0,
|
|
16504
|
+
const __dirname2 = (0, import_path25.dirname)(__filename);
|
|
16505
|
+
const currentDirName = (0, import_path25.basename)(__dirname2);
|
|
16434
16506
|
if (currentDirName === "bridge") {
|
|
16435
|
-
return (0,
|
|
16507
|
+
return (0, import_path25.join)(__dirname2, "..");
|
|
16436
16508
|
}
|
|
16437
|
-
return (0,
|
|
16509
|
+
return (0, import_path25.join)(__dirname2, "..", "..");
|
|
16438
16510
|
} catch {
|
|
16439
16511
|
}
|
|
16440
16512
|
return process.cwd();
|
|
@@ -16449,21 +16521,21 @@ function getValidAgentRoles() {
|
|
|
16449
16521
|
} catch {
|
|
16450
16522
|
}
|
|
16451
16523
|
try {
|
|
16452
|
-
const agentsDir = (0,
|
|
16453
|
-
const files = (0,
|
|
16454
|
-
_cachedRoles = files.filter((f) => f.endsWith(".md")).map((f) => (0,
|
|
16524
|
+
const agentsDir = (0, import_path25.join)(getPackageDir3(), "agents");
|
|
16525
|
+
const files = (0, import_fs23.readdirSync)(agentsDir);
|
|
16526
|
+
_cachedRoles = files.filter((f) => f.endsWith(".md")).map((f) => (0, import_path25.basename)(f, ".md")).sort();
|
|
16455
16527
|
} catch (err) {
|
|
16456
16528
|
console.error("[prompt-injection] CRITICAL: Could not scan agents/ directory for role discovery:", err);
|
|
16457
16529
|
_cachedRoles = [];
|
|
16458
16530
|
}
|
|
16459
16531
|
return _cachedRoles;
|
|
16460
16532
|
}
|
|
16461
|
-
var
|
|
16533
|
+
var import_fs23, import_path25, import_url4, _cachedRoles, VALID_AGENT_ROLES;
|
|
16462
16534
|
var init_prompt_helpers = __esm({
|
|
16463
16535
|
"src/agents/prompt-helpers.ts"() {
|
|
16464
16536
|
"use strict";
|
|
16465
|
-
|
|
16466
|
-
|
|
16537
|
+
import_fs23 = require("fs");
|
|
16538
|
+
import_path25 = require("path");
|
|
16467
16539
|
import_url4 = require("url");
|
|
16468
16540
|
init_utils();
|
|
16469
16541
|
init_strict_mode_guidance();
|
|
@@ -16474,58 +16546,58 @@ var init_prompt_helpers = __esm({
|
|
|
16474
16546
|
|
|
16475
16547
|
// src/team/fs-utils.ts
|
|
16476
16548
|
function atomicWriteJson2(filePath, data, mode = 384) {
|
|
16477
|
-
const dir = (0,
|
|
16478
|
-
if (!(0,
|
|
16549
|
+
const dir = (0, import_path26.dirname)(filePath);
|
|
16550
|
+
if (!(0, import_fs24.existsSync)(dir)) (0, import_fs24.mkdirSync)(dir, { recursive: true, mode: 448 });
|
|
16479
16551
|
const tmpPath = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
16480
|
-
(0,
|
|
16481
|
-
(0,
|
|
16552
|
+
(0, import_fs24.writeFileSync)(tmpPath, JSON.stringify(data, null, 2) + "\n", { encoding: "utf-8", mode });
|
|
16553
|
+
(0, import_fs24.renameSync)(tmpPath, filePath);
|
|
16482
16554
|
}
|
|
16483
16555
|
function ensureDirWithMode(dirPath, mode = 448) {
|
|
16484
|
-
if (!(0,
|
|
16556
|
+
if (!(0, import_fs24.existsSync)(dirPath)) (0, import_fs24.mkdirSync)(dirPath, { recursive: true, mode });
|
|
16485
16557
|
}
|
|
16486
16558
|
function safeRealpath(p) {
|
|
16487
16559
|
try {
|
|
16488
|
-
return (0,
|
|
16560
|
+
return (0, import_fs24.realpathSync)(p);
|
|
16489
16561
|
} catch {
|
|
16490
16562
|
const segments = [];
|
|
16491
|
-
let current = (0,
|
|
16492
|
-
while (!(0,
|
|
16493
|
-
segments.unshift((0,
|
|
16494
|
-
const parent = (0,
|
|
16563
|
+
let current = (0, import_path26.resolve)(p);
|
|
16564
|
+
while (!(0, import_fs24.existsSync)(current)) {
|
|
16565
|
+
segments.unshift((0, import_path26.basename)(current));
|
|
16566
|
+
const parent = (0, import_path26.dirname)(current);
|
|
16495
16567
|
if (parent === current) break;
|
|
16496
16568
|
current = parent;
|
|
16497
16569
|
}
|
|
16498
16570
|
try {
|
|
16499
|
-
return (0,
|
|
16571
|
+
return (0, import_path26.join)((0, import_fs24.realpathSync)(current), ...segments);
|
|
16500
16572
|
} catch {
|
|
16501
|
-
return (0,
|
|
16573
|
+
return (0, import_path26.resolve)(p);
|
|
16502
16574
|
}
|
|
16503
16575
|
}
|
|
16504
16576
|
}
|
|
16505
16577
|
function validateResolvedPath(resolvedPath, expectedBase) {
|
|
16506
16578
|
const absResolved = safeRealpath(resolvedPath);
|
|
16507
16579
|
const absBase = safeRealpath(expectedBase);
|
|
16508
|
-
const rel = (0,
|
|
16509
|
-
if (rel.startsWith("..") || (0,
|
|
16580
|
+
const rel = (0, import_path26.relative)(absBase, absResolved);
|
|
16581
|
+
if (rel.startsWith("..") || (0, import_path26.resolve)(absBase, rel) !== absResolved) {
|
|
16510
16582
|
throw new Error(`Path traversal detected: "${resolvedPath}" escapes base "${expectedBase}"`);
|
|
16511
16583
|
}
|
|
16512
16584
|
}
|
|
16513
|
-
var
|
|
16585
|
+
var import_fs24, import_path26;
|
|
16514
16586
|
var init_fs_utils = __esm({
|
|
16515
16587
|
"src/team/fs-utils.ts"() {
|
|
16516
16588
|
"use strict";
|
|
16517
|
-
|
|
16518
|
-
|
|
16589
|
+
import_fs24 = require("fs");
|
|
16590
|
+
import_path26 = require("path");
|
|
16519
16591
|
}
|
|
16520
16592
|
});
|
|
16521
16593
|
|
|
16522
16594
|
// src/team/worker-bootstrap.ts
|
|
16523
|
-
var import_promises9,
|
|
16595
|
+
var import_promises9, import_path27;
|
|
16524
16596
|
var init_worker_bootstrap = __esm({
|
|
16525
16597
|
"src/team/worker-bootstrap.ts"() {
|
|
16526
16598
|
"use strict";
|
|
16527
16599
|
import_promises9 = require("fs/promises");
|
|
16528
|
-
|
|
16600
|
+
import_path27 = require("path");
|
|
16529
16601
|
init_prompt_helpers();
|
|
16530
16602
|
init_omc_cli_rendering();
|
|
16531
16603
|
init_tmux_session();
|
|
@@ -16536,14 +16608,14 @@ var init_worker_bootstrap = __esm({
|
|
|
16536
16608
|
});
|
|
16537
16609
|
|
|
16538
16610
|
// src/team/dispatch-queue.ts
|
|
16539
|
-
var import_crypto8,
|
|
16611
|
+
var import_crypto8, import_fs25, import_promises10, import_path28, LOCK_STALE_MS;
|
|
16540
16612
|
var init_dispatch_queue = __esm({
|
|
16541
16613
|
"src/team/dispatch-queue.ts"() {
|
|
16542
16614
|
"use strict";
|
|
16543
16615
|
import_crypto8 = require("crypto");
|
|
16544
|
-
|
|
16616
|
+
import_fs25 = require("fs");
|
|
16545
16617
|
import_promises10 = require("fs/promises");
|
|
16546
|
-
|
|
16618
|
+
import_path28 = require("path");
|
|
16547
16619
|
init_state_paths();
|
|
16548
16620
|
init_fs_utils();
|
|
16549
16621
|
init_contracts();
|
|
@@ -16583,7 +16655,7 @@ function taskDependencyIds(task) {
|
|
|
16583
16655
|
return validateTaskDependencies(task, "invalid_persisted_state");
|
|
16584
16656
|
}
|
|
16585
16657
|
async function listTasks(teamName, cwd, deps) {
|
|
16586
|
-
const tasksRoot = (0,
|
|
16658
|
+
const tasksRoot = (0, import_path29.join)(deps.teamDir(teamName, cwd), "tasks");
|
|
16587
16659
|
const invalidState = (path5, cause) => deps.stateError?.(path5, cause) ?? new Error("invalid_persisted_state");
|
|
16588
16660
|
let entries;
|
|
16589
16661
|
try {
|
|
@@ -16608,7 +16680,7 @@ async function listTasks(teamName, cwd, deps) {
|
|
|
16608
16680
|
for (const [id, paths] of candidates) {
|
|
16609
16681
|
let fileName = paths.canonical ?? paths.legacy;
|
|
16610
16682
|
if (!fileName) continue;
|
|
16611
|
-
let path5 = (0,
|
|
16683
|
+
let path5 = (0, import_path29.join)(tasksRoot, fileName);
|
|
16612
16684
|
let fileStat;
|
|
16613
16685
|
try {
|
|
16614
16686
|
fileStat = await (0, import_promises11.lstat)(path5);
|
|
@@ -16616,7 +16688,7 @@ async function listTasks(teamName, cwd, deps) {
|
|
|
16616
16688
|
if (error2.code === "ENOENT") {
|
|
16617
16689
|
if (fileName === paths.canonical && paths.legacy) {
|
|
16618
16690
|
fileName = paths.legacy;
|
|
16619
|
-
path5 = (0,
|
|
16691
|
+
path5 = (0, import_path29.join)(tasksRoot, fileName);
|
|
16620
16692
|
try {
|
|
16621
16693
|
fileStat = await (0, import_promises11.lstat)(path5);
|
|
16622
16694
|
} catch (legacyError) {
|
|
@@ -16640,7 +16712,7 @@ async function listTasks(teamName, cwd, deps) {
|
|
|
16640
16712
|
if (error2.code === "ENOENT") {
|
|
16641
16713
|
if (fileName === paths.canonical && paths.legacy) {
|
|
16642
16714
|
fileName = paths.legacy;
|
|
16643
|
-
path5 = (0,
|
|
16715
|
+
path5 = (0, import_path29.join)(tasksRoot, fileName);
|
|
16644
16716
|
try {
|
|
16645
16717
|
const legacyStat = await (0, import_promises11.lstat)(path5);
|
|
16646
16718
|
if (legacyStat.isSymbolicLink() || !legacyStat.isFile()) {
|
|
@@ -16665,7 +16737,7 @@ async function listTasks(teamName, cwd, deps) {
|
|
|
16665
16737
|
try {
|
|
16666
16738
|
parsed = JSON.parse(raw);
|
|
16667
16739
|
} catch {
|
|
16668
|
-
throw invalidState((0,
|
|
16740
|
+
throw invalidState((0, import_path29.join)(tasksRoot, fileName), "json");
|
|
16669
16741
|
}
|
|
16670
16742
|
if (!deps.isTeamTask(parsed)) throw invalidState(path5, "schema");
|
|
16671
16743
|
const task = deps.normalizeTask(parsed);
|
|
@@ -16680,12 +16752,12 @@ async function listTasks(teamName, cwd, deps) {
|
|
|
16680
16752
|
tasks.sort((a, b) => Number(a.id) - Number(b.id));
|
|
16681
16753
|
return tasks;
|
|
16682
16754
|
}
|
|
16683
|
-
var import_crypto9,
|
|
16755
|
+
var import_crypto9, import_path29, import_promises11, logEventAppendFailure, logCompletionMarkerFailure;
|
|
16684
16756
|
var init_tasks = __esm({
|
|
16685
16757
|
"src/team/state/tasks.ts"() {
|
|
16686
16758
|
"use strict";
|
|
16687
16759
|
import_crypto9 = require("crypto");
|
|
16688
|
-
|
|
16760
|
+
import_path29 = require("path");
|
|
16689
16761
|
import_promises11 = require("fs/promises");
|
|
16690
16762
|
init_contracts();
|
|
16691
16763
|
init_swallowed_error();
|
|
@@ -17255,13 +17327,13 @@ var init_merge_coordinator = __esm({
|
|
|
17255
17327
|
});
|
|
17256
17328
|
|
|
17257
17329
|
// src/team/leader-inbox.ts
|
|
17258
|
-
var import_promises12,
|
|
17330
|
+
var import_promises12, import_fs26, import_path30;
|
|
17259
17331
|
var init_leader_inbox = __esm({
|
|
17260
17332
|
"src/team/leader-inbox.ts"() {
|
|
17261
17333
|
"use strict";
|
|
17262
17334
|
import_promises12 = require("fs/promises");
|
|
17263
|
-
|
|
17264
|
-
|
|
17335
|
+
import_fs26 = require("fs");
|
|
17336
|
+
import_path30 = require("path");
|
|
17265
17337
|
init_tmux_session();
|
|
17266
17338
|
init_fs_utils();
|
|
17267
17339
|
init_state_paths();
|
|
@@ -17290,7 +17362,7 @@ async function uninstallCommitCadence(ctx, io = { readFile: import_promises13.re
|
|
|
17290
17362
|
if (ownsRegisteredGeneration) cadenceOwners.delete(ctx.worktreePath);
|
|
17291
17363
|
return;
|
|
17292
17364
|
}
|
|
17293
|
-
const settingsPath = (0,
|
|
17365
|
+
const settingsPath = (0, import_path31.join)(ctx.worktreePath, ".copilot", "settings.json");
|
|
17294
17366
|
let raw;
|
|
17295
17367
|
try {
|
|
17296
17368
|
raw = await io.readFile(settingsPath, "utf-8");
|
|
@@ -17315,13 +17387,13 @@ async function uninstallCommitCadence(ctx, io = { readFile: import_promises13.re
|
|
|
17315
17387
|
await io.writeFile(settingsPath, JSON.stringify(updated, null, 2) + "\n", "utf-8");
|
|
17316
17388
|
if (ownsRegisteredGeneration) cadenceOwners.delete(ctx.worktreePath);
|
|
17317
17389
|
}
|
|
17318
|
-
var
|
|
17390
|
+
var import_fs27, import_promises13, import_path31, import_child_process8, cadenceOwners, HOOK_MATCHER;
|
|
17319
17391
|
var init_worker_commit_cadence = __esm({
|
|
17320
17392
|
"src/team/worker-commit-cadence.ts"() {
|
|
17321
17393
|
"use strict";
|
|
17322
|
-
|
|
17394
|
+
import_fs27 = require("fs");
|
|
17323
17395
|
import_promises13 = require("fs/promises");
|
|
17324
|
-
|
|
17396
|
+
import_path31 = require("path");
|
|
17325
17397
|
import_child_process8 = require("child_process");
|
|
17326
17398
|
cadenceOwners = /* @__PURE__ */ new Map();
|
|
17327
17399
|
HOOK_MATCHER = "Write|Edit|MultiEdit";
|
|
@@ -17346,11 +17418,11 @@ var init_merge_orchestrator = __esm({
|
|
|
17346
17418
|
});
|
|
17347
17419
|
|
|
17348
17420
|
// src/team/scaling.ts
|
|
17349
|
-
var
|
|
17421
|
+
var import_path32, import_promises14;
|
|
17350
17422
|
var init_scaling = __esm({
|
|
17351
17423
|
"src/team/scaling.ts"() {
|
|
17352
17424
|
"use strict";
|
|
17353
|
-
|
|
17425
|
+
import_path32 = require("path");
|
|
17354
17426
|
import_promises14 = require("fs/promises");
|
|
17355
17427
|
init_model_contract();
|
|
17356
17428
|
init_loader();
|
|
@@ -17680,7 +17752,7 @@ async function shutdownTeamV2(teamName, cwd, options = {}) {
|
|
|
17680
17752
|
};
|
|
17681
17753
|
if (!config2) {
|
|
17682
17754
|
const cleanupSafety = inspectTeamWorktreeCleanupSafety(sanitized, cwd);
|
|
17683
|
-
if (cleanupSafety.hasEvidence || (0,
|
|
17755
|
+
if (cleanupSafety.hasEvidence || (0, import_fs28.existsSync)(absPath(cwd, TeamPaths.root(sanitized)))) {
|
|
17684
17756
|
process.stderr.write("[team/runtime-v2] preserving team state because config is missing and worktree cleanup evidence remains\n");
|
|
17685
17757
|
return { outcome: "preserved", reason: "config_missing_cleanup_evidence", workers: [] };
|
|
17686
17758
|
}
|
|
@@ -17957,12 +18029,12 @@ Then exit your session.
|
|
|
17957
18029
|
return { outcome: "cleaned" };
|
|
17958
18030
|
});
|
|
17959
18031
|
}
|
|
17960
|
-
var
|
|
18032
|
+
var import_path33, import_fs28, import_promises15, import_node_crypto6, orchestratorByTeam, cadenceByTeam, TEAM_INSTANCE_FINAL_DISPOSAL_AUTHORIZATION;
|
|
17961
18033
|
var init_runtime_v2 = __esm({
|
|
17962
18034
|
"src/team/runtime-v2.ts"() {
|
|
17963
18035
|
"use strict";
|
|
17964
|
-
|
|
17965
|
-
|
|
18036
|
+
import_path33 = require("path");
|
|
18037
|
+
import_fs28 = require("fs");
|
|
17966
18038
|
import_promises15 = require("fs/promises");
|
|
17967
18039
|
init_state_paths();
|
|
17968
18040
|
init_worktree_paths();
|
|
@@ -28995,10 +29067,10 @@ var StdioServerTransport = class {
|
|
|
28995
29067
|
// src/mcp/team-server.ts
|
|
28996
29068
|
var import_node_crypto7 = require("node:crypto");
|
|
28997
29069
|
var import_child_process9 = require("child_process");
|
|
28998
|
-
var
|
|
29070
|
+
var import_path35 = require("path");
|
|
28999
29071
|
var import_url5 = require("url");
|
|
29000
29072
|
init_omc_cli_rendering();
|
|
29001
|
-
var
|
|
29073
|
+
var import_fs30 = require("fs");
|
|
29002
29074
|
var import_promises16 = require("fs/promises");
|
|
29003
29075
|
init_team_name();
|
|
29004
29076
|
init_runtime_v2();
|
|
@@ -29114,16 +29186,16 @@ var NudgeTracker = class {
|
|
|
29114
29186
|
};
|
|
29115
29187
|
|
|
29116
29188
|
// src/mcp/team-job-convergence.ts
|
|
29117
|
-
var
|
|
29118
|
-
var
|
|
29189
|
+
var import_fs29 = require("fs");
|
|
29190
|
+
var import_path34 = require("path");
|
|
29119
29191
|
init_types2();
|
|
29120
29192
|
init_team_name();
|
|
29121
29193
|
function readResultArtifact(omcJobsDir, jobId) {
|
|
29122
|
-
const artifactPath = (0,
|
|
29123
|
-
if (!(0,
|
|
29194
|
+
const artifactPath = (0, import_path34.join)(omcJobsDir, `${jobId}-result.json`);
|
|
29195
|
+
if (!(0, import_fs29.existsSync)(artifactPath)) return { kind: "none" };
|
|
29124
29196
|
let raw;
|
|
29125
29197
|
try {
|
|
29126
|
-
raw = (0,
|
|
29198
|
+
raw = (0, import_fs29.readFileSync)(artifactPath, "utf-8");
|
|
29127
29199
|
} catch (error2) {
|
|
29128
29200
|
if (error2.code === "ENOENT") return { kind: "none" };
|
|
29129
29201
|
const message = `Failed to read result artifact at ${artifactPath}: ${error2 instanceof Error ? error2.message : String(error2)}`;
|
|
@@ -29225,10 +29297,10 @@ function convergeJobWithResultArtifact(job, jobId, omcJobsDir) {
|
|
|
29225
29297
|
};
|
|
29226
29298
|
}
|
|
29227
29299
|
function resultArtifactIdentityError(job, jobId, omcJobsDir) {
|
|
29228
|
-
const artifactPath = (0,
|
|
29300
|
+
const artifactPath = (0, import_path34.join)(omcJobsDir, `${jobId}-result.json`);
|
|
29229
29301
|
let raw;
|
|
29230
29302
|
try {
|
|
29231
|
-
raw = (0,
|
|
29303
|
+
raw = (0, import_fs29.readFileSync)(artifactPath, "utf-8");
|
|
29232
29304
|
} catch (error2) {
|
|
29233
29305
|
if (error2.code === "ENOENT") return null;
|
|
29234
29306
|
return `cleanup_result_evidence_unreadable:${error2 instanceof Error ? error2.message : String(error2)}`;
|
|
@@ -29243,7 +29315,7 @@ function resultArtifactIdentityError(job, jobId, omcJobsDir) {
|
|
|
29243
29315
|
}
|
|
29244
29316
|
function readMatchingTerminalArtifact(job, jobId, omcJobsDir) {
|
|
29245
29317
|
try {
|
|
29246
|
-
const raw = (0,
|
|
29318
|
+
const raw = (0, import_fs29.readFileSync)((0, import_path34.join)(omcJobsDir, `${jobId}-result.json`), "utf-8");
|
|
29247
29319
|
const parsed = JSON.parse(raw);
|
|
29248
29320
|
if (parsed.status !== "completed" && parsed.status !== "failed" || parsed.instanceId !== job.instanceId || !isValidTeamInstanceId(parsed.instanceId)) return null;
|
|
29249
29321
|
return { status: parsed.status, raw };
|
|
@@ -29389,10 +29461,10 @@ function persistJob(jobId, job) {
|
|
|
29389
29461
|
}
|
|
29390
29462
|
}
|
|
29391
29463
|
function loadJobFromDisk(jobId) {
|
|
29392
|
-
const path5 = (0,
|
|
29464
|
+
const path5 = (0, import_path35.join)(OMC_JOBS_DIR, `${jobId}.json`);
|
|
29393
29465
|
let content;
|
|
29394
29466
|
try {
|
|
29395
|
-
content = (0,
|
|
29467
|
+
content = (0, import_fs30.readFileSync)(path5, "utf-8");
|
|
29396
29468
|
} catch (error2) {
|
|
29397
29469
|
if (error2.code === "ENOENT") return void 0;
|
|
29398
29470
|
throw new Error(`Unreadable job file: ${jobId} (${error2 instanceof Error ? error2.message : String(error2)})`);
|
|
@@ -29412,7 +29484,7 @@ function getJob(jobId) {
|
|
|
29412
29484
|
return loadJobFromDisk(jobId);
|
|
29413
29485
|
}
|
|
29414
29486
|
async function loadPaneIds(jobId, instanceId) {
|
|
29415
|
-
const p = (0,
|
|
29487
|
+
const p = (0, import_path35.join)(OMC_JOBS_DIR, `${jobId}-panes.json`);
|
|
29416
29488
|
try {
|
|
29417
29489
|
const parsed = JSON.parse(await (0, import_promises16.readFile)(p, "utf-8"));
|
|
29418
29490
|
if (!isValidTeamPaneArtifact(parsed, instanceId)) return null;
|
|
@@ -29576,18 +29648,18 @@ function validateJobId(job_id) {
|
|
|
29576
29648
|
}
|
|
29577
29649
|
}
|
|
29578
29650
|
function jobLockPath(jobId) {
|
|
29579
|
-
return (0,
|
|
29651
|
+
return (0, import_path35.join)(OMC_JOBS_DIR, `.${jobId}.lock`);
|
|
29580
29652
|
}
|
|
29581
29653
|
function persistJobUnlocked(jobId, job) {
|
|
29582
|
-
if (!(0,
|
|
29583
|
-
const targetPath = (0,
|
|
29654
|
+
if (!(0, import_fs30.existsSync)(OMC_JOBS_DIR)) (0, import_fs30.mkdirSync)(OMC_JOBS_DIR, { recursive: true });
|
|
29655
|
+
const targetPath = (0, import_path35.join)(OMC_JOBS_DIR, `${jobId}.json`);
|
|
29584
29656
|
const tempPath = `${targetPath}.tmp.${process.pid}.${(0, import_node_crypto7.randomUUID)()}`;
|
|
29585
29657
|
try {
|
|
29586
|
-
(0,
|
|
29587
|
-
(0,
|
|
29658
|
+
(0, import_fs30.writeFileSync)(tempPath, JSON.stringify(job), { encoding: "utf-8", mode: 384 });
|
|
29659
|
+
(0, import_fs30.renameSync)(tempPath, targetPath);
|
|
29588
29660
|
} finally {
|
|
29589
29661
|
try {
|
|
29590
|
-
(0,
|
|
29662
|
+
(0, import_fs30.unlinkSync)(tempPath);
|
|
29591
29663
|
} catch {
|
|
29592
29664
|
}
|
|
29593
29665
|
}
|
|
@@ -29717,10 +29789,10 @@ async function handleStart(args) {
|
|
|
29717
29789
|
"team_start_unsafe_runtime_v1: instance-bound provider cleanup requires runtime v2; set OMC_RUNTIME_V2=1"
|
|
29718
29790
|
);
|
|
29719
29791
|
}
|
|
29720
|
-
const cwd = (0,
|
|
29792
|
+
const cwd = (0, import_path35.resolve)(input.cwd);
|
|
29721
29793
|
const jobId = `omc-${Date.now().toString(36)}${(0, import_node_crypto7.randomUUID)().slice(0, 8)}`;
|
|
29722
29794
|
const instanceId = (0, import_node_crypto7.randomUUID)();
|
|
29723
|
-
const runtimeCliPath = (0,
|
|
29795
|
+
const runtimeCliPath = (0, import_path35.join)(__ownDir, "runtime-cli.cjs");
|
|
29724
29796
|
const job = {
|
|
29725
29797
|
status: "running",
|
|
29726
29798
|
startedAt: Date.now(),
|
|
@@ -29997,7 +30069,7 @@ async function handleCleanup(args) {
|
|
|
29997
30069
|
if (resultEvidenceError) return blockCleanup(resultEvidenceError);
|
|
29998
30070
|
const panes = await loadPaneIds(job_id, job.instanceId);
|
|
29999
30071
|
if (!panes) {
|
|
30000
|
-
const reason = (0,
|
|
30072
|
+
const reason = (0, import_fs30.existsSync)((0, import_path35.join)(OMC_JOBS_DIR, `${job_id}-panes.json`)) ? "cleanup_panes_evidence_corrupt" : "cleanup_panes_evidence_missing";
|
|
30001
30073
|
return blockCleanup(reason);
|
|
30002
30074
|
}
|
|
30003
30075
|
try {
|