oh-my-codex 0.20.2 → 0.20.5
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/Cargo.lock +36 -18
- package/Cargo.toml +1 -1
- package/README.md +28 -2
- package/crates/omx-runtime/Cargo.toml +4 -0
- package/crates/omx-runtime/src/main.rs +415 -2
- package/crates/omx-runtime/tests/execution.rs +483 -0
- package/crates/omx-runtime-core/src/dispatch.rs +96 -10
- package/crates/omx-runtime-core/src/engine.rs +839 -29
- package/crates/omx-runtime-core/src/lib.rs +8 -0
- package/dist/adapt/__tests__/herdr-target.test.d.ts +2 -0
- package/dist/adapt/__tests__/herdr-target.test.d.ts.map +1 -0
- package/dist/adapt/__tests__/herdr-target.test.js +72 -0
- package/dist/adapt/__tests__/herdr-target.test.js.map +1 -0
- package/dist/adapt/contracts.d.ts +1 -1
- package/dist/adapt/contracts.d.ts.map +1 -1
- package/dist/adapt/contracts.js +1 -1
- package/dist/adapt/contracts.js.map +1 -1
- package/dist/adapt/herdr/__tests__/authority.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/authority.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/authority.test.js +49 -0
- package/dist/adapt/herdr/__tests__/authority.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/bridge.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/bridge.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/bridge.test.js +176 -0
- package/dist/adapt/herdr/__tests__/bridge.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.js +45 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/semantic.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/semantic.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/semantic.test.js +130 -0
- package/dist/adapt/herdr/__tests__/semantic.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.js +54 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.js +104 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/team-map.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/team-map.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/team-map.test.js +46 -0
- package/dist/adapt/herdr/__tests__/team-map.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/transport.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/transport.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/transport.test.js +160 -0
- package/dist/adapt/herdr/__tests__/transport.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/wiring.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/wiring.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/wiring.test.js +118 -0
- package/dist/adapt/herdr/__tests__/wiring.test.js.map +1 -0
- package/dist/adapt/herdr/authority.d.ts +34 -0
- package/dist/adapt/herdr/authority.d.ts.map +1 -0
- package/dist/adapt/herdr/authority.js +71 -0
- package/dist/adapt/herdr/authority.js.map +1 -0
- package/dist/adapt/herdr/bridge.d.ts +84 -0
- package/dist/adapt/herdr/bridge.d.ts.map +1 -0
- package/dist/adapt/herdr/bridge.js +222 -0
- package/dist/adapt/herdr/bridge.js.map +1 -0
- package/dist/adapt/herdr/sanitize.d.ts +20 -0
- package/dist/adapt/herdr/sanitize.d.ts.map +1 -0
- package/dist/adapt/herdr/sanitize.js +70 -0
- package/dist/adapt/herdr/sanitize.js.map +1 -0
- package/dist/adapt/herdr/semantic.d.ts +67 -0
- package/dist/adapt/herdr/semantic.d.ts.map +1 -0
- package/dist/adapt/herdr/semantic.js +170 -0
- package/dist/adapt/herdr/semantic.js.map +1 -0
- package/dist/adapt/herdr/seq-store.d.ts +32 -0
- package/dist/adapt/herdr/seq-store.d.ts.map +1 -0
- package/dist/adapt/herdr/seq-store.js +126 -0
- package/dist/adapt/herdr/seq-store.js.map +1 -0
- package/dist/adapt/herdr/team-map.d.ts +30 -0
- package/dist/adapt/herdr/team-map.d.ts.map +1 -0
- package/dist/adapt/herdr/team-map.js +37 -0
- package/dist/adapt/herdr/team-map.js.map +1 -0
- package/dist/adapt/herdr/transport.d.ts +115 -0
- package/dist/adapt/herdr/transport.d.ts.map +1 -0
- package/dist/adapt/herdr/transport.js +260 -0
- package/dist/adapt/herdr/transport.js.map +1 -0
- package/dist/adapt/herdr/wiring.d.ts +24 -0
- package/dist/adapt/herdr/wiring.d.ts.map +1 -0
- package/dist/adapt/herdr/wiring.js +62 -0
- package/dist/adapt/herdr/wiring.js.map +1 -0
- package/dist/adapt/herdr.d.ts +19 -0
- package/dist/adapt/herdr.d.ts.map +1 -0
- package/dist/adapt/herdr.js +115 -0
- package/dist/adapt/herdr.js.map +1 -0
- package/dist/adapt/index.d.ts +4 -0
- package/dist/adapt/index.d.ts.map +1 -1
- package/dist/adapt/index.js +48 -0
- package/dist/adapt/index.js.map +1 -1
- package/dist/adapt/registry.d.ts.map +1 -1
- package/dist/adapt/registry.js +11 -0
- package/dist/adapt/registry.js.map +1 -1
- package/dist/agents/__tests__/definitions.test.js +81 -0
- package/dist/agents/__tests__/definitions.test.js.map +1 -1
- package/dist/agents/__tests__/native-config.test.js +25 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/native-config.d.ts +2 -1
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js.map +1 -1
- package/dist/auth/__tests__/hotswap.test.js +60 -1
- package/dist/auth/__tests__/hotswap.test.js.map +1 -1
- package/dist/auth/__tests__/storage.test.js +33 -1
- package/dist/auth/__tests__/storage.test.js.map +1 -1
- package/dist/auth/hotswap.d.ts +22 -2
- package/dist/auth/hotswap.d.ts.map +1 -1
- package/dist/auth/hotswap.js +107 -22
- package/dist/auth/hotswap.js.map +1 -1
- package/dist/auth/storage.js +1 -1
- package/dist/auth/storage.js.map +1 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.js +86 -1333
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -1
- package/dist/autopilot/ralplan-gate.d.ts.map +1 -1
- package/dist/autopilot/ralplan-gate.js +7 -6
- package/dist/autopilot/ralplan-gate.js.map +1 -1
- package/dist/cli/__tests__/agents-init.test.js +4 -23
- package/dist/cli/__tests__/agents-init.test.js.map +1 -1
- package/dist/cli/__tests__/api.test.js +61 -24
- package/dist/cli/__tests__/api.test.js.map +1 -1
- package/dist/cli/__tests__/auth.test.js +63 -7
- package/dist/cli/__tests__/auth.test.js.map +1 -1
- package/dist/cli/__tests__/codex-feature-probe.test.js +66 -1
- package/dist/cli/__tests__/codex-feature-probe.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +150 -2
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/detached-leader-teardown.test.d.ts +2 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.d.ts.map +1 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js +473 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js +103 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.js +139 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js +135 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +211 -0
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +878 -463
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +1290 -127
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-parity.test.js +8 -4
- package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
- package/dist/cli/__tests__/native-assets.test.js +398 -16
- package/dist/cli/__tests__/native-assets.test.js.map +1 -1
- package/dist/cli/__tests__/native-hook-claim-journal.test.js +132 -6
- package/dist/cli/__tests__/native-hook-claim-journal.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +3 -3
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +3 -3
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js +49 -164
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.d.ts +2 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.js +56 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.js.map +1 -0
- package/dist/cli/__tests__/ralplan.test.js +107 -109
- package/dist/cli/__tests__/ralplan.test.js.map +1 -1
- package/dist/cli/__tests__/resume.test.js +11 -10
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +1118 -43
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/session-search-help.test.js +25 -1
- package/dist/cli/__tests__/session-search-help.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +8 -55
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +224 -7
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +93 -41
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +150 -8
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +117 -2
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +95 -4
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +669 -177
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +33 -2
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
- package/dist/cli/api.d.ts.map +1 -1
- package/dist/cli/api.js +9 -10
- package/dist/cli/api.js.map +1 -1
- package/dist/cli/codex-feature-probe.d.ts +16 -0
- package/dist/cli/codex-feature-probe.d.ts.map +1 -1
- package/dist/cli/codex-feature-probe.js +44 -0
- package/dist/cli/codex-feature-probe.js.map +1 -1
- package/dist/cli/codex-home.d.ts.map +1 -1
- package/dist/cli/codex-home.js +7 -4
- package/dist/cli/codex-home.js.map +1 -1
- package/dist/cli/doctor.d.ts +20 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +290 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +234 -12
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2409 -746
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-parity.js +2 -2
- package/dist/cli/mcp-parity.js.map +1 -1
- package/dist/cli/native-assets.d.ts +25 -0
- package/dist/cli/native-assets.d.ts.map +1 -1
- package/dist/cli/native-assets.js +448 -51
- package/dist/cli/native-assets.js.map +1 -1
- package/dist/cli/native-hook-claim-journal.d.ts +20 -5
- package/dist/cli/native-hook-claim-journal.d.ts.map +1 -1
- package/dist/cli/native-hook-claim-journal.js +67 -32
- package/dist/cli/native-hook-claim-journal.js.map +1 -1
- package/dist/cli/package-manager-ownership.d.ts +63 -0
- package/dist/cli/package-manager-ownership.d.ts.map +1 -0
- package/dist/cli/package-manager-ownership.js +323 -0
- package/dist/cli/package-manager-ownership.js.map +1 -0
- package/dist/cli/ralph.js +2 -2
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/ralplan.d.ts +5 -7
- package/dist/cli/ralplan.d.ts.map +1 -1
- package/dist/cli/ralplan.js +83 -134
- package/dist/cli/ralplan.js.map +1 -1
- package/dist/cli/session-search.d.ts +5 -0
- package/dist/cli/session-search.d.ts.map +1 -1
- package/dist/cli/session-search.js +87 -0
- package/dist/cli/session-search.js.map +1 -1
- package/dist/cli/setup-preferences.d.ts +15 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -1
- package/dist/cli/setup-preferences.js +27 -1
- package/dist/cli/setup-preferences.js.map +1 -1
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +119 -47
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +52 -9
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +2 -2
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/uninstall.d.ts +9 -0
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +71 -30
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update-worker.d.ts +2 -0
- package/dist/cli/update-worker.d.ts.map +1 -0
- package/dist/cli/update-worker.js +142 -0
- package/dist/cli/update-worker.js.map +1 -0
- package/dist/cli/update.d.ts +14 -22
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +192 -241
- package/dist/cli/update.js.map +1 -1
- package/dist/compat/__tests__/rust-runtime-compat.test.js +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +503 -30
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +5 -3
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/__tests__/models.test.js +67 -3
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/generator.d.ts +27 -21
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +610 -152
- package/dist/config/generator.js.map +1 -1
- package/dist/config/models.d.ts +12 -2
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +15 -1
- package/dist/config/models.js.map +1 -1
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +25 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +2 -0
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/hooks/__tests__/agents-overlay.test.js +5 -3
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +27 -4
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.d.ts +2 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js +172 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js.map +1 -0
- package/dist/hooks/__tests__/keyword-detector.test.js +176 -37
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +402 -545
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +39 -4
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +161 -26
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +27 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +10 -118
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js +7 -0
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +533 -14
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +159 -24
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +482 -32
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +2 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +68 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +7 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +44 -4
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js +9 -0
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/session.test.js +3130 -365
- package/dist/hooks/__tests__/session.test.js.map +1 -1
- package/dist/hooks/agents-overlay.js +1 -1
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js +108 -2
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.js +151 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.js.map +1 -1
- package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
- package/dist/hooks/extensibility/dispatcher.js +20 -3
- package/dist/hooks/extensibility/dispatcher.js.map +1 -1
- package/dist/hooks/extensibility/plugin-runner.js +1 -0
- package/dist/hooks/extensibility/plugin-runner.js.map +1 -1
- package/dist/hooks/extensibility/runtime.d.ts.map +1 -1
- package/dist/hooks/extensibility/runtime.js.map +1 -1
- package/dist/hooks/extensibility/sdk/paths.d.ts +1 -1
- package/dist/hooks/extensibility/sdk/paths.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk/paths.js +2 -2
- package/dist/hooks/extensibility/sdk/paths.js.map +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.js +55 -15
- package/dist/hooks/extensibility/sdk/runtime-state.js.map +1 -1
- package/dist/hooks/extensibility/sdk.d.ts +1 -0
- package/dist/hooks/extensibility/sdk.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk.js +1 -1
- package/dist/hooks/extensibility/sdk.js.map +1 -1
- package/dist/hooks/extensibility/types.d.ts +7 -0
- package/dist/hooks/extensibility/types.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +10 -3
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +116 -20
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/session.d.ts +204 -14
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +1500 -223
- package/dist/hooks/session.js.map +1 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.js +6 -6
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +26 -16
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +83 -78
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +36 -31
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +155 -198
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/tmux.d.ts +42 -4
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +1017 -139
- package/dist/hud/tmux.js.map +1 -1
- package/dist/leader/__tests__/contract.test.js +124 -37
- package/dist/leader/__tests__/contract.test.js.map +1 -1
- package/dist/leader/contract.d.ts +17 -6
- package/dist/leader/contract.d.ts.map +1 -1
- package/dist/leader/contract.js +102 -26
- package/dist/leader/contract.js.map +1 -1
- package/dist/mcp/__tests__/code-intel-server.test.js +31 -3
- package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -1
- package/dist/mcp/__tests__/hermes-bridge.test.js +17 -0
- package/dist/mcp/__tests__/hermes-bridge.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +4 -4
- package/dist/mcp/__tests__/state-paths.test.js +735 -4
- package/dist/mcp/__tests__/state-paths.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +1 -1
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/__tests__/trace-server.test.js +2 -2
- package/dist/mcp/__tests__/trace-server.test.js.map +1 -1
- package/dist/mcp/__tests__/wiki-server.test.js +18 -0
- package/dist/mcp/__tests__/wiki-server.test.js.map +1 -1
- package/dist/mcp/code-intel-server.d.ts.map +1 -1
- package/dist/mcp/code-intel-server.js +13 -3
- package/dist/mcp/code-intel-server.js.map +1 -1
- package/dist/mcp/hermes-bridge.d.ts.map +1 -1
- package/dist/mcp/hermes-bridge.js +2 -2
- package/dist/mcp/hermes-bridge.js.map +1 -1
- package/dist/mcp/state-paths.d.ts +78 -4
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +543 -40
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/mcp/state-server.d.ts +4 -4
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/wiki-server.d.ts +11 -0
- package/dist/mcp/wiki-server.d.ts.map +1 -1
- package/dist/mcp/wiki-server.js +9 -2
- package/dist/mcp/wiki-server.js.map +1 -1
- package/dist/modes/__tests__/base-autopilot-gates.test.js +36 -7
- package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.js +1 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -1
- package/dist/modes/__tests__/base-session-scope.test.js +17 -8
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/__tests__/base-tmux-pane.test.js +4 -4
- package/dist/modes/__tests__/base-tmux-pane.test.js.map +1 -1
- package/dist/modes/base.d.ts +5 -5
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +76 -21
- package/dist/modes/base.js.map +1 -1
- package/dist/native-assets/archive.d.ts +17 -0
- package/dist/native-assets/archive.d.ts.map +1 -0
- package/dist/native-assets/archive.js +238 -0
- package/dist/native-assets/archive.js.map +1 -0
- package/dist/native-assets/policy.d.ts +42 -0
- package/dist/native-assets/policy.d.ts.map +1 -0
- package/dist/native-assets/policy.js +155 -0
- package/dist/native-assets/policy.js.map +1 -0
- package/dist/notifications/temp-contract.d.ts.map +1 -1
- package/dist/notifications/temp-contract.js +4 -0
- package/dist/notifications/temp-contract.js.map +1 -1
- package/dist/pipeline/__tests__/orchestrator.test.js +164 -42
- package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
- package/dist/pipeline/__tests__/stages.test.js +72 -155
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/orchestrator.d.ts.map +1 -1
- package/dist/pipeline/orchestrator.js +124 -18
- package/dist/pipeline/orchestrator.js.map +1 -1
- package/dist/pipeline/stages/ralplan.d.ts.map +1 -1
- package/dist/pipeline/stages/ralplan.js +36 -8
- package/dist/pipeline/stages/ralplan.js.map +1 -1
- package/dist/ralplan/__tests__/consensus-gate.test.js +73 -1316
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +1 -1
- package/dist/ralplan/__tests__/documented-leader-preflight.test.d.ts +2 -0
- package/dist/ralplan/__tests__/documented-leader-preflight.test.d.ts.map +1 -0
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js +335 -0
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js.map +1 -0
- package/dist/ralplan/__tests__/runtime.test.js +85 -101
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/consensus-gate.d.ts +9 -1
- package/dist/ralplan/consensus-gate.d.ts.map +1 -1
- package/dist/ralplan/consensus-gate.js +82 -338
- package/dist/ralplan/consensus-gate.js.map +1 -1
- package/dist/ralplan/documented-leader-preflight.d.ts +41 -0
- package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -0
- package/dist/ralplan/documented-leader-preflight.js +360 -0
- package/dist/ralplan/documented-leader-preflight.js.map +1 -0
- package/dist/ralplan/runtime.d.ts +2 -1
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +67 -168
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/runtime/__tests__/bridge.test.js +42 -1
- package/dist/runtime/__tests__/bridge.test.js.map +1 -1
- package/dist/runtime/bridge.d.ts +12 -0
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +52 -1
- package/dist/runtime/bridge.js.map +1 -1
- package/dist/runtime/run-state.d.ts +5 -1
- package/dist/runtime/run-state.d.ts.map +1 -1
- package/dist/runtime/run-state.js +15 -8
- package/dist/runtime/run-state.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +16323 -8978
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js +225 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.js +188 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js +259 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js +491 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js +708 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js +208 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js.map +1 -0
- package/dist/scripts/__tests__/notify-state-io.test.js +26 -0
- package/dist/scripts/__tests__/notify-state-io.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-tmux-injection.test.js +23 -1
- package/dist/scripts/__tests__/notify-tmux-injection.test.js.map +1 -1
- package/dist/scripts/__tests__/postinstall.test.js +19 -1
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.d.ts +2 -0
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js +108 -0
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js.map +1 -0
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js +63 -173
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js.map +1 -1
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js +74 -159
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js.map +1 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +404 -13
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-release-assets.test.d.ts +2 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.js +235 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts +53 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +14448 -1480
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts +9 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +35 -12
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/generate-native-release-manifest.js +80 -51
- package/dist/scripts/generate-native-release-manifest.js.map +1 -1
- package/dist/scripts/notify-fallback-watcher.js +78 -115
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.js +74 -3
- package/dist/scripts/notify-hook/auto-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/state-io.d.ts.map +1 -1
- package/dist/scripts/notify-hook/state-io.js +5 -0
- package/dist/scripts/notify-hook/state-io.js.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts +9 -0
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +234 -79
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.js +71 -16
- package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts +12 -4
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +365 -44
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.js +42 -21
- package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker.d.ts +3 -0
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +82 -33
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.d.ts +1 -0
- package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js +32 -3
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
- package/dist/scripts/notify-hook.js +79 -82
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/postinstall-advisory.d.ts +14 -0
- package/dist/scripts/postinstall-advisory.d.ts.map +1 -0
- package/dist/scripts/postinstall-advisory.js +49 -0
- package/dist/scripts/postinstall-advisory.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +1 -1
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +1 -1
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +80 -4
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +3162 -26
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +16 -1
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/scripts/verify-native-release-assets.js +37 -23
- package/dist/scripts/verify-native-release-assets.js.map +1 -1
- package/dist/state/__tests__/mode-state-context.test.js +61 -0
- package/dist/state/__tests__/mode-state-context.test.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +462 -850
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/skill-active.test.js +400 -2
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/mode-state-context.d.ts +8 -0
- package/dist/state/mode-state-context.d.ts.map +1 -1
- package/dist/state/mode-state-context.js +73 -0
- package/dist/state/mode-state-context.js.map +1 -1
- package/dist/state/operations.d.ts +3 -0
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +144 -40
- package/dist/state/operations.js.map +1 -1
- package/dist/state/skill-active.d.ts +18 -1
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +420 -23
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts +3 -0
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +10 -4
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/state/workflow-transition.d.ts.map +1 -1
- package/dist/state/workflow-transition.js +3 -1
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js +53 -247
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js.map +1 -1
- package/dist/subagents/__tests__/tracker.test.js +837 -1048
- package/dist/subagents/__tests__/tracker.test.js.map +1 -1
- package/dist/subagents/tracker.d.ts +58 -135
- package/dist/subagents/tracker.d.ts.map +1 -1
- package/dist/subagents/tracker.js +811 -632
- package/dist/subagents/tracker.js.map +1 -1
- package/dist/team/__tests__/api-interop.test.js +91 -1
- package/dist/team/__tests__/api-interop.test.js.map +1 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +58 -17
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -1
- package/dist/team/__tests__/idle-nudge.test.js +45 -15
- package/dist/team/__tests__/idle-nudge.test.js.map +1 -1
- package/dist/team/__tests__/mcp-comm.test.js +197 -30
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +110 -3
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/notice-ledger.test.d.ts +2 -0
- package/dist/team/__tests__/notice-ledger.test.d.ts.map +1 -0
- package/dist/team/__tests__/notice-ledger.test.js +131 -0
- package/dist/team/__tests__/notice-ledger.test.js.map +1 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.d.ts +2 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.d.ts.map +1 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.js +410 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.js.map +1 -0
- package/dist/team/__tests__/phase-controller.test.js +20 -0
- package/dist/team/__tests__/phase-controller.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.js +9 -0
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +3963 -428
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +2405 -203
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js +117 -2
- package/dist/team/__tests__/state-root.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +804 -36
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/team-ops-contract.test.js +6 -0
- package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +4099 -1039
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js +149 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js.map +1 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts +69 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.js +242 -15
- package/dist/team/__tests__/tmux-test-fixture.js.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.test.js +177 -1
- package/dist/team/__tests__/tmux-test-fixture.test.js.map +1 -1
- package/dist/team/__tests__/worker-runtime-identity.test.js +53 -44
- package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -1
- package/dist/team/__tests__/worktree.test.js +6 -0
- package/dist/team/__tests__/worktree.test.js.map +1 -1
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +15 -9
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/exact-pane.d.ts +23 -0
- package/dist/team/exact-pane.d.ts.map +1 -0
- package/dist/team/exact-pane.js +133 -0
- package/dist/team/exact-pane.js.map +1 -0
- package/dist/team/idle-nudge.d.ts +12 -1
- package/dist/team/idle-nudge.d.ts.map +1 -1
- package/dist/team/idle-nudge.js +41 -14
- package/dist/team/idle-nudge.js.map +1 -1
- package/dist/team/model-contract.d.ts +2 -5
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +59 -17
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/notice-ledger.d.ts +54 -0
- package/dist/team/notice-ledger.d.ts.map +1 -0
- package/dist/team/notice-ledger.js +259 -0
- package/dist/team/notice-ledger.js.map +1 -0
- package/dist/team/phase-controller.d.ts.map +1 -1
- package/dist/team/phase-controller.js +2 -0
- package/dist/team/phase-controller.js.map +1 -1
- package/dist/team/runtime.d.ts +4 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +1527 -291
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts +13 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +1503 -387
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/dispatch.d.ts.map +1 -1
- package/dist/team/state/dispatch.js +26 -8
- package/dist/team/state/dispatch.js.map +1 -1
- package/dist/team/state/locks.d.ts.map +1 -1
- package/dist/team/state/locks.js +61 -13
- package/dist/team/state/locks.js.map +1 -1
- package/dist/team/state/monitor.d.ts +10 -0
- package/dist/team/state/monitor.d.ts.map +1 -1
- package/dist/team/state/monitor.js +13 -0
- package/dist/team/state/monitor.js.map +1 -1
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +4 -3
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/state/types.d.ts +15 -0
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state-root.d.ts +12 -0
- package/dist/team/state-root.d.ts.map +1 -1
- package/dist/team/state-root.js +177 -0
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts +85 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +672 -129
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-ops.d.ts +5 -0
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +4 -0
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +163 -27
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +1682 -376
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worktree.d.ts.map +1 -1
- package/dist/team/worktree.js +4 -0
- package/dist/team/worktree.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +950 -2
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +1 -0
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +35 -1
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +232 -46
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/utils/__tests__/file-durability.test.d.ts +2 -0
- package/dist/utils/__tests__/file-durability.test.d.ts.map +1 -0
- package/dist/utils/__tests__/file-durability.test.js +114 -0
- package/dist/utils/__tests__/file-durability.test.js.map +1 -0
- package/dist/utils/__tests__/paths.test.js +21 -1
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/file-durability.d.ts +25 -0
- package/dist/utils/file-durability.d.ts.map +1 -0
- package/dist/utils/file-durability.js +67 -0
- package/dist/utils/file-durability.js.map +1 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +14 -6
- package/dist/utils/paths.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +49 -4
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +3 -0
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +1 -1
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js +60 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -1
- package/dist/verification/__tests__/native-release-manifest.test.js +157 -4
- package/dist/verification/__tests__/native-release-manifest.test.js.map +1 -1
- package/dist/wiki/lint.d.ts +4 -1
- package/dist/wiki/lint.d.ts.map +1 -1
- package/dist/wiki/lint.js +3 -2
- package/dist/wiki/lint.js.map +1 -1
- package/package.json +13 -5
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +105 -17
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +13 -5
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +30 -85
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +6 -4
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +16 -17
- package/plugins/oh-my-codex/skills/team/SKILL.md +13 -9
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +3 -2
- package/skills/autopilot/SKILL.md +13 -5
- package/skills/cancel/SKILL.md +30 -85
- package/skills/ralph/SKILL.md +6 -4
- package/skills/ralplan/SKILL.md +16 -17
- package/skills/team/SKILL.md +13 -9
- package/skills/ultragoal/SKILL.md +3 -2
- package/src/scripts/__tests__/codex-native-hook.test.ts +8831 -951
- package/src/scripts/__tests__/issue-3293-callsite-parity.test.ts +187 -0
- package/src/scripts/__tests__/issue-3293-cancel-transaction.test.ts +189 -0
- package/src/scripts/__tests__/issue-3293-hook-owned-cancel.test.ts +187 -0
- package/src/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.ts +591 -0
- package/src/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.ts +701 -0
- package/src/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.ts +211 -0
- package/src/scripts/__tests__/notify-state-io.test.ts +29 -0
- package/src/scripts/__tests__/notify-tmux-injection.test.ts +26 -1
- package/src/scripts/__tests__/postinstall.test.ts +23 -1
- package/src/scripts/__tests__/reasoning-artifact-contract.test.ts +129 -0
- package/src/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.ts +67 -185
- package/src/scripts/__tests__/role-intent-durable-recovery-3181.test.ts +79 -178
- package/src/scripts/__tests__/smoke-packed-install.test.ts +525 -16
- package/src/scripts/__tests__/verify-native-release-assets.test.ts +240 -0
- package/src/scripts/codex-native-hook.ts +14238 -1429
- package/src/scripts/codex-native-pre-post.ts +43 -12
- package/src/scripts/generate-native-release-manifest.ts +83 -79
- package/src/scripts/notify-fallback-watcher.ts +91 -122
- package/src/scripts/notify-hook/auto-nudge.ts +71 -3
- package/src/scripts/notify-hook/state-io.ts +11 -0
- package/src/scripts/notify-hook/team-dispatch.ts +242 -75
- package/src/scripts/notify-hook/team-leader-nudge.ts +72 -22
- package/src/scripts/notify-hook/team-tmux-guard.ts +366 -39
- package/src/scripts/notify-hook/team-worker-stop.ts +43 -20
- package/src/scripts/notify-hook/team-worker.ts +82 -31
- package/src/scripts/notify-hook/tmux-injection.ts +33 -3
- package/src/scripts/notify-hook.ts +84 -82
- package/src/scripts/postinstall-advisory.ts +67 -0
- package/src/scripts/postinstall.ts +1 -1
- package/src/scripts/smoke-packed-install.ts +3608 -39
- package/src/scripts/sync-plugin-mirror.ts +17 -1
- package/src/scripts/verify-native-release-assets.ts +39 -31
- package/templates/AGENTS.md +1 -0
- package/dist/subagents/__tests__/adapted-role-binding.test.d.ts +0 -2
- package/dist/subagents/__tests__/adapted-role-binding.test.d.ts.map +0 -1
- package/dist/subagents/__tests__/adapted-role-binding.test.js +0 -988
- package/dist/subagents/__tests__/adapted-role-binding.test.js.map +0 -1
- package/dist/subagents/adapted-role-binding.d.ts +0 -17
- package/dist/subagents/adapted-role-binding.d.ts.map +0 -1
- package/dist/subagents/adapted-role-binding.js +0 -75
- package/dist/subagents/adapted-role-binding.js.map +0 -1
package/dist/cli/update.js
CHANGED
|
@@ -5,15 +5,19 @@
|
|
|
5
5
|
* The explicit `omx update` command uses the same executor but bypasses the
|
|
6
6
|
* launch-time cadence so a user request always checks npm immediately.
|
|
7
7
|
*/
|
|
8
|
-
import { readFile, writeFile, mkdir } from 'fs/promises';
|
|
9
|
-
import { appendFileSync, existsSync, mkdirSync, mkdtempSync, rmSync } from 'fs';
|
|
10
|
-
import { dirname, join } from 'path';
|
|
8
|
+
import { readFile, writeFile, mkdir, realpath } from 'fs/promises';
|
|
9
|
+
import { appendFileSync, chmodSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'fs';
|
|
10
|
+
import { dirname, join, relative, isAbsolute } from 'path';
|
|
11
11
|
import { tmpdir } from 'os';
|
|
12
|
+
import { createHash } from 'node:crypto';
|
|
12
13
|
import { spawn, spawnSync } from 'child_process';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
13
15
|
import { createInterface } from 'readline/promises';
|
|
14
16
|
import { getPackageRoot } from '../utils/package.js';
|
|
15
|
-
import { omxUserInstallStampPath } from '../utils/paths.js';
|
|
16
17
|
import { readPersistedSetupPreferencesSync, resolvePersistedSetupMergeAgents, } from './setup-preferences.js';
|
|
18
|
+
import { isCompletePackageManagerOwnership, packageManagerOwnershipError, resolvePackageManagerOwnership, runNpmCommand, validatePackageManagerOwnership, } from './package-manager-ownership.js';
|
|
19
|
+
import { readUserInstallStamp, writeUserInstallStamp, } from '../scripts/postinstall-advisory.js';
|
|
20
|
+
export { isInstallVersionBump, readUserInstallStamp, writeUserInstallStamp, } from '../scripts/postinstall-advisory.js';
|
|
17
21
|
const PACKAGE_NAME = 'oh-my-codex';
|
|
18
22
|
const CHECK_INTERVAL_MS = 12 * 60 * 60 * 1000; // 12h
|
|
19
23
|
const STABLE_INSTALL_SOURCE = `${PACKAGE_NAME}@latest`;
|
|
@@ -112,34 +116,13 @@ async function getCurrentVersion() {
|
|
|
112
116
|
return null;
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
'
|
|
119
|
-
codes.includes(String(error.code)));
|
|
119
|
+
function stableInstallArgs(ownership, installSource) {
|
|
120
|
+
return ownership.manager === 'bun'
|
|
121
|
+
? ['add', '--global', '--ignore-scripts', installSource]
|
|
122
|
+
: ['install', '--global', '--ignore-scripts', '--no-audit', '--no-progress', '--prefix', ownership.npmPrefix, installSource];
|
|
120
123
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
if (platform === 'win32' && isSpawnErrorCode(result.error, ['ENOENT'])) {
|
|
124
|
-
return spawnProcess('npm.cmd', args, options);
|
|
125
|
-
}
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
128
|
-
function spawnGlobalNpmInstallSync(installSource, options, spawnProcess = spawnSync, platform = process.platform) {
|
|
129
|
-
const args = ['install', '-g', installSource];
|
|
130
|
-
const result = spawnProcess('npm', args, options);
|
|
131
|
-
if (platform !== 'win32' || !isSpawnErrorCode(result.error, ['ENOENT', 'EINVAL'])) {
|
|
132
|
-
return result;
|
|
133
|
-
}
|
|
134
|
-
if (isSpawnErrorCode(result.error, ['ENOENT'])) {
|
|
135
|
-
const cmdShimResult = spawnProcess('npm.cmd', args, options);
|
|
136
|
-
if (!isSpawnErrorCode(cmdShimResult.error, ['ENOENT', 'EINVAL'])) {
|
|
137
|
-
return cmdShimResult;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
// Some Windows/npm shim layouts reject direct npm/npm.cmd spawn with EINVAL;
|
|
141
|
-
// cmd.exe can still resolve and run npm from the user's configured PATH.
|
|
142
|
-
return spawnProcess('cmd.exe', ['/d', '/s', '/c', 'npm', ...args], options);
|
|
124
|
+
function runFrozenNpmInstall(ownership, installSource, options, spawnProcess) {
|
|
125
|
+
return runNpmCommand(ownership.npmCommand, stableInstallArgs(ownership, installSource), options, spawnProcess);
|
|
143
126
|
}
|
|
144
127
|
function commandFailure(stderr, status, label) {
|
|
145
128
|
const details = String(stderr || '').trim();
|
|
@@ -148,7 +131,7 @@ function commandFailure(stderr, status, label) {
|
|
|
148
131
|
stderr: details || `${label} exited ${typeof status === 'number' ? status : 'without a status'}`,
|
|
149
132
|
};
|
|
150
133
|
}
|
|
151
|
-
function runDevGlobalUpdate(spawnProcess = spawnSync
|
|
134
|
+
function runDevGlobalUpdate(ownership, spawnProcess = spawnSync) {
|
|
152
135
|
const tempRoot = mkdtempSync(join(tmpdir(), 'omx-dev-update-'));
|
|
153
136
|
const checkoutDir = join(tempRoot, 'checkout');
|
|
154
137
|
try {
|
|
@@ -176,7 +159,7 @@ function runDevGlobalUpdate(spawnProcess = spawnSync, platform = process.platfor
|
|
|
176
159
|
const installRevision = /^[0-9a-f]{7,40}$/i.test(clonedRevision ?? '')
|
|
177
160
|
? String(clonedRevision).slice(0, 12)
|
|
178
161
|
: null;
|
|
179
|
-
const installResult =
|
|
162
|
+
const installResult = runNpmCommand(ownership.npmCommand, [
|
|
180
163
|
'install',
|
|
181
164
|
'--global=false',
|
|
182
165
|
'--location=project',
|
|
@@ -190,32 +173,34 @@ function runDevGlobalUpdate(spawnProcess = spawnSync, platform = process.platfor
|
|
|
190
173
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
191
174
|
timeout: DEV_UPDATE_TIMEOUT_MS,
|
|
192
175
|
windowsHide: true,
|
|
193
|
-
env: { ...
|
|
194
|
-
}, spawnProcess
|
|
176
|
+
env: { ...ownership.environment, npm_config_global: 'false', npm_config_location: 'project' },
|
|
177
|
+
}, spawnProcess);
|
|
195
178
|
if (installResult.error)
|
|
196
179
|
return { ok: false, stderr: installResult.error.message };
|
|
197
180
|
if (installResult.status !== 0) {
|
|
198
181
|
return commandFailure(installResult.stderr, installResult.status, 'npm install --include=dev');
|
|
199
182
|
}
|
|
200
|
-
const prepackResult =
|
|
183
|
+
const prepackResult = runNpmCommand(ownership.npmCommand, ['run', 'prepack'], {
|
|
201
184
|
cwd: checkoutDir,
|
|
202
185
|
encoding: 'utf-8',
|
|
203
186
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
204
187
|
timeout: DEV_UPDATE_TIMEOUT_MS,
|
|
205
188
|
windowsHide: true,
|
|
206
|
-
|
|
189
|
+
env: ownership.environment,
|
|
190
|
+
}, spawnProcess);
|
|
207
191
|
if (prepackResult.error)
|
|
208
192
|
return { ok: false, stderr: prepackResult.error.message };
|
|
209
193
|
if (prepackResult.status !== 0) {
|
|
210
194
|
return commandFailure(prepackResult.stderr, prepackResult.status, 'npm run prepack');
|
|
211
195
|
}
|
|
212
|
-
const packResult =
|
|
196
|
+
const packResult = runNpmCommand(ownership.npmCommand, ['pack', '--ignore-scripts', '--json'], {
|
|
213
197
|
cwd: checkoutDir,
|
|
214
198
|
encoding: 'utf-8',
|
|
215
199
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
216
200
|
timeout: DEV_UPDATE_TIMEOUT_MS,
|
|
217
201
|
windowsHide: true,
|
|
218
|
-
|
|
202
|
+
env: ownership.environment,
|
|
203
|
+
}, spawnProcess);
|
|
219
204
|
if (packResult.error)
|
|
220
205
|
return { ok: false, stderr: packResult.error.message };
|
|
221
206
|
if (packResult.status !== 0) {
|
|
@@ -235,12 +220,13 @@ function runDevGlobalUpdate(spawnProcess = spawnSync, platform = process.platfor
|
|
|
235
220
|
if (!tarballPath || !existsSync(tarballPath)) {
|
|
236
221
|
return { ok: false, stderr: 'npm pack did not produce an installable tarball.' };
|
|
237
222
|
}
|
|
238
|
-
const globalInstallResult =
|
|
223
|
+
const globalInstallResult = runNpmCommand(ownership.npmCommand, ['install', '--global', '--ignore-scripts', '--no-audit', '--no-progress', '--prefix', ownership.npmPrefix, tarballPath], {
|
|
239
224
|
encoding: 'utf-8',
|
|
240
225
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
241
226
|
timeout: DEV_UPDATE_TIMEOUT_MS,
|
|
242
227
|
windowsHide: true,
|
|
243
|
-
|
|
228
|
+
env: ownership.environment,
|
|
229
|
+
}, spawnProcess);
|
|
244
230
|
if (globalInstallResult.error) {
|
|
245
231
|
return { ok: false, stderr: globalInstallResult.error.message };
|
|
246
232
|
}
|
|
@@ -259,35 +245,31 @@ function runDevGlobalUpdate(spawnProcess = spawnSync, platform = process.platfor
|
|
|
259
245
|
}
|
|
260
246
|
}
|
|
261
247
|
}
|
|
262
|
-
export function runGlobalUpdate(installSourceOrSpawnProcess = STABLE_INSTALL_SOURCE, spawnProcessOrPlatform = spawnSync,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const spawnProcess = legacySpawnFirst
|
|
266
|
-
? installSourceOrSpawnProcess
|
|
267
|
-
: typeof spawnProcessOrPlatform === 'function'
|
|
268
|
-
? spawnProcessOrPlatform
|
|
269
|
-
: spawnSync;
|
|
270
|
-
const resolvedPlatform = legacySpawnFirst
|
|
271
|
-
? typeof spawnProcessOrPlatform === 'string'
|
|
272
|
-
? spawnProcessOrPlatform
|
|
273
|
-
: platform
|
|
274
|
-
: typeof spawnProcessOrPlatform === 'string'
|
|
275
|
-
? spawnProcessOrPlatform
|
|
276
|
-
: platform;
|
|
277
|
-
if (installSource === DEV_INSTALL_SOURCE) {
|
|
278
|
-
return runDevGlobalUpdate(spawnProcess, resolvedPlatform);
|
|
248
|
+
export function runGlobalUpdate(installSourceOrSpawnProcess = STABLE_INSTALL_SOURCE, spawnProcessOrPlatform = spawnSync, _platform = process.platform, ownership) {
|
|
249
|
+
if (typeof installSourceOrSpawnProcess === 'function') {
|
|
250
|
+
return { ok: false, stderr: 'A validated package-manager ownership transaction is required before installing.' };
|
|
279
251
|
}
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
windowsHide: true,
|
|
285
|
-
}, spawnProcess, resolvedPlatform);
|
|
286
|
-
if (result.error) {
|
|
287
|
-
return { ok: false, stderr: result.error.message };
|
|
252
|
+
const installSource = installSourceOrSpawnProcess;
|
|
253
|
+
const spawnProcess = typeof spawnProcessOrPlatform === 'function' ? spawnProcessOrPlatform : spawnSync;
|
|
254
|
+
if (!ownership || !isCompletePackageManagerOwnership(ownership)) {
|
|
255
|
+
return { ok: false, stderr: ownership ? 'The package-manager ownership transaction is incomplete.' : 'A validated package-manager ownership transaction is required before installing.' };
|
|
288
256
|
}
|
|
257
|
+
if (installSource === DEV_INSTALL_SOURCE) {
|
|
258
|
+
return ownership.manager === 'bun'
|
|
259
|
+
? { ok: false, stderr: 'Bun dev updates are not yet supported' }
|
|
260
|
+
: runDevGlobalUpdate(ownership, spawnProcess);
|
|
261
|
+
}
|
|
262
|
+
const result = ownership.manager === 'bun'
|
|
263
|
+
? spawnProcess(ownership.bunCommand, stableInstallArgs(ownership, installSource), {
|
|
264
|
+
encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 120000, windowsHide: true, env: ownership.environment,
|
|
265
|
+
})
|
|
266
|
+
: runFrozenNpmInstall(ownership, installSource, {
|
|
267
|
+
encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 120000, windowsHide: true, env: ownership.environment,
|
|
268
|
+
}, spawnProcess);
|
|
269
|
+
if (result.error)
|
|
270
|
+
return { ok: false, stderr: result.error.message };
|
|
289
271
|
if (result.status !== 0) {
|
|
290
|
-
return { ok: false, stderr: String(result.stderr || '').trim() ||
|
|
272
|
+
return { ok: false, stderr: String(result.stderr || '').trim() || `${ownership.manager} exited ${result.status}` };
|
|
291
273
|
}
|
|
292
274
|
return { ok: true, stderr: '' };
|
|
293
275
|
}
|
|
@@ -322,97 +304,98 @@ export function resolveSetupRefreshArgs(cwd) {
|
|
|
322
304
|
return args;
|
|
323
305
|
}
|
|
324
306
|
function quotePosixShellArg(value) {
|
|
325
|
-
|
|
326
|
-
return "''";
|
|
327
|
-
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
307
|
+
return value === '' ? "''" : `'${value.replace(/'/g, "'\\''")}'`;
|
|
328
308
|
}
|
|
329
309
|
function quotePowerShellArg(value) {
|
|
330
|
-
return `'${value.replace(/'/g,
|
|
310
|
+
return `'${value.replace(/'/g, "''")}'`;
|
|
331
311
|
}
|
|
312
|
+
/** Compatibility formatter retained for existing callers; deferred updates use update-worker instead. */
|
|
332
313
|
export function formatDeferredSetupCommand(platform, command, args) {
|
|
333
314
|
const argv = [command, ...args];
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return argv.map(quotePosixShellArg).join(' ');
|
|
315
|
+
return platform === 'win32'
|
|
316
|
+
? `& ${argv.map(quotePowerShellArg).join(' ')}`
|
|
317
|
+
: argv.map(quotePosixShellArg).join(' ');
|
|
338
318
|
}
|
|
339
319
|
function formatUpdateLogPath(date = new Date()) {
|
|
340
320
|
return `update-${date.toISOString().replace(/[:.]/g, '-')}.log`;
|
|
341
321
|
}
|
|
342
|
-
export function runDeferredGlobalUpdate(cwd, spawnProcess = spawn, platform = process.platform, parentPid = process.pid) {
|
|
322
|
+
export function runDeferredGlobalUpdate(cwd, spawnProcess = spawn, platform = process.platform, parentPid = process.pid, ownership) {
|
|
343
323
|
const logPath = join(cwd, '.omx', 'logs', formatUpdateLogPath());
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
const setupCommand = formatDeferredSetupCommand(platform, 'omx', setupArgs);
|
|
324
|
+
if (!isCompletePackageManagerOwnership(ownership)) {
|
|
325
|
+
return { ok: false, stderr: 'The package-manager ownership transaction is incomplete.', logPath };
|
|
326
|
+
}
|
|
327
|
+
let stage;
|
|
349
328
|
try {
|
|
350
329
|
mkdirSync(dirname(logPath), { recursive: true });
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
];
|
|
381
|
-
const child = spawnProcess(command, args, {
|
|
382
|
-
cwd,
|
|
383
|
-
detached: true,
|
|
384
|
-
env,
|
|
385
|
-
stdio: 'ignore',
|
|
386
|
-
windowsHide: true,
|
|
330
|
+
stage = mkdtempSync(join(tmpdir(), 'omx-update-'));
|
|
331
|
+
if (platform !== 'win32')
|
|
332
|
+
chmodSync(stage, 0o700);
|
|
333
|
+
const payloadPath = join(stage, 'transaction.json');
|
|
334
|
+
const payload = { cwd, logPath, parentPid, ownership, setupArgs: resolveSetupRefreshArgs(cwd) };
|
|
335
|
+
const serialized = JSON.stringify(payload);
|
|
336
|
+
writeFileSync(payloadPath, serialized, { encoding: 'utf-8', mode: 0o600, flag: 'wx' });
|
|
337
|
+
const canonicalStage = realpathSync(stage);
|
|
338
|
+
const canonicalPayload = realpathSync(payloadPath);
|
|
339
|
+
const stageStat = lstatSync(stage);
|
|
340
|
+
const payloadStat = lstatSync(payloadPath);
|
|
341
|
+
if (!stageStat.isDirectory()
|
|
342
|
+
|| stageStat.isSymbolicLink()
|
|
343
|
+
|| (platform !== 'win32' && ((stageStat.mode & 0o077) !== 0 || (typeof process.getuid === 'function' && stageStat.uid !== process.getuid())))
|
|
344
|
+
|| canonicalPayload !== join(canonicalStage, 'transaction.json')
|
|
345
|
+
|| payloadStat.isSymbolicLink()
|
|
346
|
+
|| !payloadStat.isFile()
|
|
347
|
+
|| (platform !== 'win32' && (payloadStat.mode & 0o077) !== 0))
|
|
348
|
+
throw new Error('Deferred update payload is not a canonical owner-only staged file.');
|
|
349
|
+
const bundledWorker = join(dirname(fileURLToPath(import.meta.url)), 'update-worker.js');
|
|
350
|
+
const workerCandidate = existsSync(bundledWorker) ? bundledWorker : join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'dist', 'cli', 'update-worker.js');
|
|
351
|
+
const workerPath = realpathSync(workerCandidate);
|
|
352
|
+
if (lstatSync(workerCandidate).isSymbolicLink() || !lstatSync(workerPath).isFile())
|
|
353
|
+
throw new Error('Deferred update worker is not a regular canonical file.');
|
|
354
|
+
const payloadFingerprint = createHash('sha256').update(readFileSync(canonicalPayload)).digest('hex');
|
|
355
|
+
const workerFingerprint = createHash('sha256').update(readFileSync(workerPath)).digest('hex');
|
|
356
|
+
const stagedDirectory = stage;
|
|
357
|
+
const child = spawnProcess(process.execPath, [workerPath, payloadPath, payloadFingerprint, workerFingerprint], {
|
|
358
|
+
cwd, detached: true, env: { ...ownership.environment, [SKIP_NATIVE_AGENT_REFRESH_ENV]: '1' }, stdio: 'ignore', windowsHide: true,
|
|
387
359
|
});
|
|
388
360
|
child.once('error', (error) => {
|
|
389
361
|
try {
|
|
390
362
|
appendFileSync(logPath, `[omx] Deferred update launcher failed: ${error.message}\n`, 'utf-8');
|
|
391
363
|
}
|
|
392
364
|
catch {
|
|
393
|
-
// The
|
|
365
|
+
// The scheduler must not become fatal when diagnostics cannot be persisted.
|
|
366
|
+
}
|
|
367
|
+
try {
|
|
368
|
+
rmSync(stagedDirectory, { recursive: true, force: true });
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
// The asynchronous launcher failure must not throw into the caller.
|
|
394
372
|
}
|
|
395
373
|
});
|
|
396
374
|
child.unref();
|
|
375
|
+
stage = undefined;
|
|
397
376
|
return { ok: true, stderr: '', logPath };
|
|
398
377
|
}
|
|
399
378
|
catch (error) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
379
|
+
if (stage) {
|
|
380
|
+
try {
|
|
381
|
+
rmSync(stage, { recursive: true, force: true });
|
|
382
|
+
}
|
|
383
|
+
catch {
|
|
384
|
+
// Preserve the original scheduling failure when cleanup cannot complete.
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return { ok: false, stderr: error instanceof Error ? error.message : String(error), logPath };
|
|
405
388
|
}
|
|
406
389
|
}
|
|
407
|
-
function formatDeferredUpdateFailure(stderr, logPath) {
|
|
390
|
+
function formatDeferredUpdateFailure(stderr, logPath, manager = 'npm') {
|
|
408
391
|
return [
|
|
409
392
|
'[omx] Failed to schedule the deferred update.',
|
|
410
393
|
stderr.trim() ? `[omx] scheduler error: ${stderr.trim()}` : undefined,
|
|
411
394
|
logPath ? `[omx] Intended log: ${logPath}` : undefined,
|
|
412
|
-
|
|
395
|
+
`[omx] Retry with the selected ${manager} owner through: omx update`,
|
|
413
396
|
].filter((line) => typeof line === 'string').join('\n');
|
|
414
397
|
}
|
|
415
|
-
function summarizeUpdateFailure(stderr, installSource = STABLE_INSTALL_SOURCE, logPath) {
|
|
398
|
+
function summarizeUpdateFailure(stderr, installSource = STABLE_INSTALL_SOURCE, logPath, manager = 'npm') {
|
|
416
399
|
const details = stderr.trim().split(/\r?\n/).filter(Boolean).slice(0, 3).join(' | ');
|
|
417
400
|
if (installSource === DEV_INSTALL_SOURCE) {
|
|
418
401
|
return [
|
|
@@ -422,11 +405,12 @@ function summarizeUpdateFailure(stderr, installSource = STABLE_INSTALL_SOURCE, l
|
|
|
422
405
|
'[omx] You can retry manually with: omx update --dev',
|
|
423
406
|
].filter((line) => typeof line === 'string').join('\n');
|
|
424
407
|
}
|
|
408
|
+
const installCommand = `${manager === 'bun' ? 'bun add -g' : 'npm install -g'} ${installSource}`;
|
|
425
409
|
return [
|
|
426
|
-
`[omx] Update failed while running
|
|
427
|
-
details ? `[omx]
|
|
410
|
+
`[omx] Update failed while running the selected ${manager} transaction (${installCommand}).`,
|
|
411
|
+
details ? `[omx] ${manager} stderr: ${details}` : undefined,
|
|
428
412
|
logPath ? `[omx] Full log: ${logPath}` : undefined,
|
|
429
|
-
|
|
413
|
+
'[omx] Retry through the ownership-safe recovery command: omx update',
|
|
430
414
|
].filter((line) => typeof line === 'string').join('\n');
|
|
431
415
|
}
|
|
432
416
|
async function askYesNo(question) {
|
|
@@ -441,6 +425,12 @@ async function askYesNo(question) {
|
|
|
441
425
|
rl.close();
|
|
442
426
|
}
|
|
443
427
|
}
|
|
428
|
+
async function resolveCurrentPackageManagerOwnership() {
|
|
429
|
+
return resolvePackageManagerOwnership({
|
|
430
|
+
currentPackageRoot: getPackageRoot(),
|
|
431
|
+
readInstallStamp: readUserInstallStamp,
|
|
432
|
+
});
|
|
433
|
+
}
|
|
444
434
|
const defaultUpdateDependencies = {
|
|
445
435
|
askYesNo,
|
|
446
436
|
fetchLatestVersion,
|
|
@@ -448,8 +438,9 @@ const defaultUpdateDependencies = {
|
|
|
448
438
|
getInstalledVersionAfterUpdate,
|
|
449
439
|
getInstalledRevisionAfterUpdate,
|
|
450
440
|
readUserInstallStamp,
|
|
451
|
-
|
|
452
|
-
|
|
441
|
+
resolvePackageManagerOwnership: resolveCurrentPackageManagerOwnership,
|
|
442
|
+
runGlobalUpdate: (installSource, ownership) => runGlobalUpdate(installSource, spawnSync, process.platform, ownership),
|
|
443
|
+
runDeferredGlobalUpdate: (cwd, ownership) => runDeferredGlobalUpdate(cwd, spawn, process.platform, process.pid, ownership),
|
|
453
444
|
runSetupRefresh,
|
|
454
445
|
writeUpdateState,
|
|
455
446
|
};
|
|
@@ -464,53 +455,10 @@ async function writeSuccessfulInstallStamp(installedVersion, metadata = {}) {
|
|
|
464
455
|
...(metadata.source ? { install_source: metadata.source } : {}),
|
|
465
456
|
...(metadata.revision ? { install_revision: metadata.revision } : {}),
|
|
466
457
|
...(metadata.devBaseVersion ? { dev_base_version: stripLeadingV(metadata.devBaseVersion) } : {}),
|
|
458
|
+
...(metadata.packageManager ? { package_manager: metadata.packageManager } : {}),
|
|
467
459
|
updated_at: new Date().toISOString(),
|
|
468
460
|
});
|
|
469
461
|
}
|
|
470
|
-
export async function readUserInstallStamp(path = omxUserInstallStampPath()) {
|
|
471
|
-
if (!existsSync(path))
|
|
472
|
-
return null;
|
|
473
|
-
try {
|
|
474
|
-
const content = await readFile(path, 'utf-8');
|
|
475
|
-
const parsed = JSON.parse(content);
|
|
476
|
-
if (typeof parsed.installed_version !== 'string' || typeof parsed.updated_at !== 'string') {
|
|
477
|
-
return null;
|
|
478
|
-
}
|
|
479
|
-
return {
|
|
480
|
-
installed_version: parsed.installed_version,
|
|
481
|
-
...(typeof parsed.setup_completed_version === 'string'
|
|
482
|
-
? { setup_completed_version: parsed.setup_completed_version }
|
|
483
|
-
: {}),
|
|
484
|
-
...(parsed.install_channel === 'stable' || parsed.install_channel === 'dev'
|
|
485
|
-
? { install_channel: parsed.install_channel }
|
|
486
|
-
: {}),
|
|
487
|
-
...(typeof parsed.install_source === 'string'
|
|
488
|
-
? { install_source: parsed.install_source }
|
|
489
|
-
: {}),
|
|
490
|
-
...(typeof parsed.install_revision === 'string'
|
|
491
|
-
? { install_revision: parsed.install_revision }
|
|
492
|
-
: {}),
|
|
493
|
-
...(typeof parsed.dev_base_version === 'string'
|
|
494
|
-
? { dev_base_version: parsed.dev_base_version }
|
|
495
|
-
: {}),
|
|
496
|
-
updated_at: parsed.updated_at,
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
catch {
|
|
500
|
-
return null;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
export async function writeUserInstallStamp(stamp, path = omxUserInstallStampPath()) {
|
|
504
|
-
await mkdir(dirname(path), { recursive: true });
|
|
505
|
-
await writeFile(path, JSON.stringify(stamp, null, 2));
|
|
506
|
-
}
|
|
507
|
-
export function isInstallVersionBump(currentVersion, stamp) {
|
|
508
|
-
if (!currentVersion)
|
|
509
|
-
return false;
|
|
510
|
-
if (!stamp?.installed_version)
|
|
511
|
-
return true;
|
|
512
|
-
return stripLeadingV(currentVersion) !== stripLeadingV(stamp.installed_version);
|
|
513
|
-
}
|
|
514
462
|
function doesSetupStampMatchVersion(currentVersion, stamp) {
|
|
515
463
|
return stripLeadingV(stamp?.setup_completed_version ?? '') === stripLeadingV(currentVersion);
|
|
516
464
|
}
|
|
@@ -531,42 +479,25 @@ function resolveUpdateCheckBaseline(currentVersion, stamp) {
|
|
|
531
479
|
}
|
|
532
480
|
return currentVersion;
|
|
533
481
|
}
|
|
534
|
-
|
|
535
|
-
const
|
|
536
|
-
encoding: 'utf-8',
|
|
537
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
538
|
-
timeout: 15000,
|
|
539
|
-
windowsHide: true,
|
|
540
|
-
}, spawnProcess, platform);
|
|
541
|
-
if (result.error || result.status !== 0) {
|
|
542
|
-
return null;
|
|
543
|
-
}
|
|
544
|
-
const root = String(result.stdout || '').trim();
|
|
545
|
-
return root === '' ? null : root;
|
|
546
|
-
}
|
|
547
|
-
async function getInstalledVersionAfterUpdate() {
|
|
548
|
-
const globalInstallRoot = resolveGlobalInstallRoot();
|
|
482
|
+
async function getInstalledVersionAfterUpdate(ownership) {
|
|
483
|
+
const globalInstallRoot = ownership?.globalInstallRoot;
|
|
549
484
|
if (!globalInstallRoot)
|
|
550
485
|
return null;
|
|
551
486
|
try {
|
|
552
|
-
const
|
|
553
|
-
const content = await readFile(packageJsonPath, 'utf-8');
|
|
487
|
+
const content = await readFile(join(globalInstallRoot, PACKAGE_NAME, 'package.json'), 'utf-8');
|
|
554
488
|
const pkg = JSON.parse(content);
|
|
555
|
-
return typeof pkg.version === 'string' && pkg.version.trim() !== ''
|
|
556
|
-
? pkg.version
|
|
557
|
-
: null;
|
|
489
|
+
return typeof pkg.version === 'string' && pkg.version.trim() !== '' ? pkg.version : null;
|
|
558
490
|
}
|
|
559
491
|
catch {
|
|
560
492
|
return null;
|
|
561
493
|
}
|
|
562
494
|
}
|
|
563
|
-
async function getInstalledRevisionAfterUpdate() {
|
|
564
|
-
const globalInstallRoot =
|
|
495
|
+
async function getInstalledRevisionAfterUpdate(ownership) {
|
|
496
|
+
const globalInstallRoot = ownership?.globalInstallRoot;
|
|
565
497
|
if (!globalInstallRoot)
|
|
566
498
|
return null;
|
|
567
499
|
try {
|
|
568
|
-
const
|
|
569
|
-
const content = await readFile(packageJsonPath, 'utf-8');
|
|
500
|
+
const content = await readFile(join(globalInstallRoot, PACKAGE_NAME, 'package.json'), 'utf-8');
|
|
570
501
|
const pkg = JSON.parse(content);
|
|
571
502
|
const revision = typeof pkg.gitHead === 'string' ? pkg.gitHead.trim() : '';
|
|
572
503
|
return /^[0-9a-f]{7,40}$/i.test(revision) ? revision.slice(0, 12) : null;
|
|
@@ -575,33 +506,45 @@ async function getInstalledRevisionAfterUpdate() {
|
|
|
575
506
|
return null;
|
|
576
507
|
}
|
|
577
508
|
}
|
|
509
|
+
async function resolveCliEntryWithinPackage(packageRoot, relativePath) {
|
|
510
|
+
if (relativePath.trim() === '' || isAbsolute(relativePath))
|
|
511
|
+
return null;
|
|
512
|
+
try {
|
|
513
|
+
const cliEntry = await realpath(join(packageRoot, relativePath));
|
|
514
|
+
const relation = relative(packageRoot, cliEntry);
|
|
515
|
+
return relation !== '' && !relation.startsWith('..') && !isAbsolute(relation) ? cliEntry : null;
|
|
516
|
+
}
|
|
517
|
+
catch {
|
|
518
|
+
return null;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
578
521
|
export async function resolveInstalledCliEntry(globalInstallRoot) {
|
|
579
522
|
const packageRoot = join(globalInstallRoot, PACKAGE_NAME);
|
|
580
|
-
|
|
581
|
-
|
|
523
|
+
let packageRootRealpath;
|
|
524
|
+
try {
|
|
525
|
+
packageRootRealpath = await realpath(packageRoot);
|
|
526
|
+
}
|
|
527
|
+
catch {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
582
530
|
try {
|
|
583
|
-
const content = await readFile(
|
|
531
|
+
const content = await readFile(join(packageRootRealpath, 'package.json'), 'utf-8');
|
|
584
532
|
const pkg = JSON.parse(content);
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
pkg.bin.omx.trim() !== '') {
|
|
592
|
-
cliRelativePath = pkg.bin.omx;
|
|
593
|
-
}
|
|
533
|
+
const cliRelativePath = typeof pkg.bin === 'string'
|
|
534
|
+
? pkg.bin
|
|
535
|
+
: pkg.bin && typeof pkg.bin === 'object' ? pkg.bin.omx : undefined;
|
|
536
|
+
return typeof cliRelativePath === 'string'
|
|
537
|
+
? resolveCliEntryWithinPackage(packageRootRealpath, cliRelativePath)
|
|
538
|
+
: null;
|
|
594
539
|
}
|
|
595
540
|
catch {
|
|
596
|
-
|
|
541
|
+
return resolveCliEntryWithinPackage(packageRootRealpath, join('dist', 'cli', 'omx.js'));
|
|
597
542
|
}
|
|
598
|
-
const cliEntry = join(packageRoot, cliRelativePath);
|
|
599
|
-
return existsSync(cliEntry) ? cliEntry : null;
|
|
600
543
|
}
|
|
601
|
-
export function spawnInstalledSetupRefresh(cliEntry, cwd, spawnProcess = spawnSync) {
|
|
602
|
-
const result = spawnProcess(
|
|
544
|
+
export function spawnInstalledSetupRefresh(cliEntry, cwd, spawnProcess = spawnSync, command = process.execPath, environment = process.env) {
|
|
545
|
+
const result = spawnProcess(command, [cliEntry, ...resolveSetupRefreshArgs(cwd)], {
|
|
603
546
|
cwd,
|
|
604
|
-
env:
|
|
547
|
+
env: environment,
|
|
605
548
|
stdio: 'inherit',
|
|
606
549
|
windowsHide: true,
|
|
607
550
|
});
|
|
@@ -616,26 +559,33 @@ export function spawnInstalledSetupRefresh(cliEntry, cwd, spawnProcess = spawnSy
|
|
|
616
559
|
}
|
|
617
560
|
return { ok: true, stderr: '' };
|
|
618
561
|
}
|
|
619
|
-
async function runSetupRefresh(cwd) {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
ok: false,
|
|
624
|
-
stderr: 'Unable to resolve the npm global install root after updating.',
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
const cliEntry = await resolveInstalledCliEntry(globalInstallRoot);
|
|
562
|
+
async function runSetupRefresh(cwd, ownership) {
|
|
563
|
+
if (!ownership || !ownership.packageRoot)
|
|
564
|
+
return { ok: false, stderr: 'A frozen package-manager ownership transaction is required for setup refresh.' };
|
|
565
|
+
const cliEntry = await validatePackageManagerOwnership(ownership);
|
|
628
566
|
if (!cliEntry) {
|
|
629
|
-
return {
|
|
630
|
-
ok: false,
|
|
631
|
-
stderr: `Unable to find the updated OMX CLI entry under ${join(globalInstallRoot, PACKAGE_NAME)}.`,
|
|
632
|
-
};
|
|
567
|
+
return { ok: false, stderr: `Frozen manager, package root, or bin ownership validation failed before setup refresh under ${join(ownership.globalInstallRoot, PACKAGE_NAME)}.` };
|
|
633
568
|
}
|
|
634
|
-
return spawnInstalledSetupRefresh(cliEntry, cwd);
|
|
569
|
+
return spawnInstalledSetupRefresh(cliEntry, cwd, spawnSync, process.execPath, { ...ownership.environment, [SKIP_NATIVE_AGENT_REFRESH_ENV]: '1' });
|
|
635
570
|
}
|
|
636
571
|
async function executeUpdate(options) {
|
|
637
572
|
const { cwd, dependencies, prompt, immediate, channel = 'stable', forceInstall = false, nowMs = Date.now(), } = options;
|
|
638
573
|
const channelConfig = resolveUpdateChannelConfig(channel);
|
|
574
|
+
const usesNativeTransaction = immediate
|
|
575
|
+
? dependencies.runGlobalUpdate === defaultUpdateDependencies.runGlobalUpdate
|
|
576
|
+
|| dependencies.runSetupRefresh === defaultUpdateDependencies.runSetupRefresh
|
|
577
|
+
: dependencies.runDeferredGlobalUpdate === defaultUpdateDependencies.runDeferredGlobalUpdate;
|
|
578
|
+
const ownership = usesNativeTransaction
|
|
579
|
+
? await dependencies.resolvePackageManagerOwnership()
|
|
580
|
+
: null;
|
|
581
|
+
if (usesNativeTransaction && !ownership) {
|
|
582
|
+
console.log(packageManagerOwnershipError());
|
|
583
|
+
return { status: 'failed', currentVersion: null, latestVersion: null };
|
|
584
|
+
}
|
|
585
|
+
if (ownership?.manager === 'bun' && channel === 'dev') {
|
|
586
|
+
console.log('[omx] Bun dev updates are not yet supported');
|
|
587
|
+
return { status: 'failed', currentVersion: null, latestVersion: null };
|
|
588
|
+
}
|
|
639
589
|
const [current, latest] = await Promise.all([
|
|
640
590
|
dependencies.getCurrentVersion(),
|
|
641
591
|
channel === 'stable' || !forceInstall || channel === 'dev' ? dependencies.fetchLatestVersion() : Promise.resolve(null),
|
|
@@ -664,12 +614,12 @@ async function executeUpdate(options) {
|
|
|
664
614
|
if (immediate) {
|
|
665
615
|
if (current && !doesSetupStampMatchVersion(current, installStamp)) {
|
|
666
616
|
console.log(`[omx] oh-my-codex is already up to date (v${updateCheckBaseline}). Running setup refresh...`);
|
|
667
|
-
const setupRefreshResult = await dependencies.runSetupRefresh(cwd);
|
|
617
|
+
const setupRefreshResult = await dependencies.runSetupRefresh(cwd, ownership ?? undefined);
|
|
668
618
|
if (!setupRefreshResult.ok) {
|
|
669
619
|
console.log(`[omx] Update installed, but the setup refresh failed. Run \`omx setup\` with the new install. (${setupRefreshResult.stderr})`);
|
|
670
620
|
return { status: 'failed', currentVersion: current, latestVersion: latest };
|
|
671
621
|
}
|
|
672
|
-
await writeSuccessfulInstallStamp(current);
|
|
622
|
+
await writeSuccessfulInstallStamp(current, { packageManager: ownership?.manager });
|
|
673
623
|
console.log(`[omx] Setup refresh completed for v${updateCheckBaseline}. Restart to use current code.`);
|
|
674
624
|
return { status: 'up-to-date', currentVersion: current, latestVersion: latest };
|
|
675
625
|
}
|
|
@@ -688,9 +638,9 @@ async function executeUpdate(options) {
|
|
|
688
638
|
}
|
|
689
639
|
}
|
|
690
640
|
if (!immediate) {
|
|
691
|
-
const deferredResult = dependencies.runDeferredGlobalUpdate(cwd);
|
|
641
|
+
const deferredResult = dependencies.runDeferredGlobalUpdate(cwd, ownership ?? undefined);
|
|
692
642
|
if (!deferredResult.ok) {
|
|
693
|
-
console.log(formatDeferredUpdateFailure(deferredResult.stderr, deferredResult.logPath));
|
|
643
|
+
console.log(formatDeferredUpdateFailure(deferredResult.stderr, deferredResult.logPath, ownership?.manager));
|
|
694
644
|
return { status: 'failed', currentVersion: current, latestVersion: latest };
|
|
695
645
|
}
|
|
696
646
|
console.log('[omx] Update scheduled after this session exits.');
|
|
@@ -705,21 +655,21 @@ async function executeUpdate(options) {
|
|
|
705
655
|
console.log('[omx] Running: clone dev branch, run prepack, then npm install -g the packed tarball');
|
|
706
656
|
}
|
|
707
657
|
else {
|
|
708
|
-
console.log(`[omx] Running: npm install -g ${channelConfig.installSource}`);
|
|
658
|
+
console.log(`[omx] Running: ${ownership?.manager === 'bun' ? 'bun add -g' : 'npm install -g'} ${channelConfig.installSource}`);
|
|
709
659
|
}
|
|
710
|
-
const result = dependencies.runGlobalUpdate(channelConfig.installSource);
|
|
660
|
+
const result = dependencies.runGlobalUpdate(channelConfig.installSource, ownership ?? undefined);
|
|
711
661
|
if (!result.ok) {
|
|
712
|
-
console.log(summarizeUpdateFailure(result.stderr, channelConfig.installSource));
|
|
662
|
+
console.log(summarizeUpdateFailure(result.stderr, channelConfig.installSource, undefined, ownership?.manager));
|
|
713
663
|
return { status: 'failed', currentVersion: current, latestVersion: latest };
|
|
714
664
|
}
|
|
715
|
-
const setupRefreshResult = await dependencies.runSetupRefresh(cwd);
|
|
665
|
+
const setupRefreshResult = await dependencies.runSetupRefresh(cwd, ownership ?? undefined);
|
|
716
666
|
if (!setupRefreshResult.ok) {
|
|
717
667
|
console.log(`[omx] Update installed, but the setup refresh failed. Run \`omx setup\` with the new install. (${setupRefreshResult.stderr})`);
|
|
718
668
|
return { status: 'failed', currentVersion: current, latestVersion: latest };
|
|
719
669
|
}
|
|
720
|
-
const installedVersion = await dependencies.getInstalledVersionAfterUpdate();
|
|
670
|
+
const installedVersion = await dependencies.getInstalledVersionAfterUpdate(ownership ?? undefined);
|
|
721
671
|
const installedRevision = channelConfig.channel === 'dev'
|
|
722
|
-
? ((await dependencies.getInstalledRevisionAfterUpdate()) ?? result.revision ?? null)
|
|
672
|
+
? ((await dependencies.getInstalledRevisionAfterUpdate(ownership ?? undefined)) ?? result.revision ?? null)
|
|
723
673
|
: null;
|
|
724
674
|
const devBaseVersion = channelConfig.channel === 'dev'
|
|
725
675
|
? (latest && installedVersion
|
|
@@ -735,6 +685,7 @@ async function executeUpdate(options) {
|
|
|
735
685
|
source: channelConfig.installSource,
|
|
736
686
|
revision: channelConfig.channel === 'dev' ? installedRevision : null,
|
|
737
687
|
devBaseVersion,
|
|
688
|
+
packageManager: ownership?.manager,
|
|
738
689
|
});
|
|
739
690
|
}
|
|
740
691
|
else if (channelConfig.channel === 'dev') {
|