oh-my-codex 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +5 -5
- package/Cargo.toml +1 -1
- package/README.md +3 -3
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +9 -0
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -1
- package/dist/cli/__tests__/cleanup.test.js +27 -0
- package/dist/cli/__tests__/cleanup.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +7 -5
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +137 -6
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +303 -4
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +58 -0
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +2 -0
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +48 -0
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +8 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +350 -27
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +85 -3
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-scope.test.js +1 -1
- package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +2 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +269 -0
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +69 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +90 -6
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +109 -19
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/cleanup.d.ts.map +1 -1
- package/dist/cli/cleanup.js +8 -4
- package/dist/cli/cleanup.js.map +1 -1
- package/dist/cli/codex-feature-probe.d.ts +9 -0
- package/dist/cli/codex-feature-probe.d.ts.map +1 -0
- package/dist/cli/codex-feature-probe.js +28 -0
- package/dist/cli/codex-feature-probe.js.map +1 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +168 -16
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +9 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +168 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-parity.js +8 -8
- package/dist/cli/mcp-parity.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +3 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +88 -0
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/ralph.d.ts.map +1 -1
- package/dist/cli/ralph.js +21 -0
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/setup-preferences.d.ts +4 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -1
- package/dist/cli/setup-preferences.js +7 -0
- package/dist/cli/setup-preferences.js.map +1 -1
- package/dist/cli/setup.d.ts +5 -3
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +177 -43
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +54 -15
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/ultragoal.d.ts +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +64 -5
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/uninstall.d.ts +2 -0
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +76 -5
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update.d.ts +10 -2
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +99 -5
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/codex-feature-flags.test.d.ts +2 -0
- package/dist/config/__tests__/codex-feature-flags.test.d.ts.map +1 -0
- package/dist/config/__tests__/codex-feature-flags.test.js +35 -0
- package/dist/config/__tests__/codex-feature-flags.test.js.map +1 -0
- package/dist/config/__tests__/codex-hooks.test.js +188 -4
- package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +129 -10
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +148 -7
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/__tests__/wiki-config-contract.test.js +6 -3
- package/dist/config/__tests__/wiki-config-contract.test.js.map +1 -1
- package/dist/config/codex-feature-flags.d.ts +21 -0
- package/dist/config/codex-feature-flags.d.ts.map +1 -0
- package/dist/config/codex-feature-flags.js +56 -0
- package/dist/config/codex-feature-flags.js.map +1 -0
- package/dist/config/codex-hooks.d.ts +40 -4
- package/dist/config/codex-hooks.d.ts.map +1 -1
- package/dist/config/codex-hooks.js +204 -18
- package/dist/config/codex-hooks.js.map +1 -1
- package/dist/config/generator.d.ts +19 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +319 -83
- package/dist/config/generator.js.map +1 -1
- package/dist/config/omx-first-party-mcp.d.ts +3 -1
- package/dist/config/omx-first-party-mcp.d.ts.map +1 -1
- package/dist/config/omx-first-party-mcp.js +2 -2
- package/dist/config/omx-first-party-mcp.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +92 -2
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +29 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +10 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +1 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js +176 -0
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +148 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js +3 -0
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.d.ts +2 -0
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.js +84 -0
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.js.map +1 -0
- package/dist/hooks/__tests__/wiki-docs-contract.test.js +1 -2
- package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +1 -1
- package/dist/hooks/agents-overlay.js +2 -2
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +1 -0
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +7 -5
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +164 -0
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +4 -5
- package/dist/hud/state.js.map +1 -1
- package/dist/mcp/__tests__/state-paths.test.js +61 -0
- package/dist/mcp/__tests__/state-paths.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +166 -0
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +23 -2
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/modes/__tests__/base-session-scope.test.js +22 -0
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/__tests__/base-tmux-pane.test.js +57 -26
- package/dist/modes/__tests__/base-tmux-pane.test.js.map +1 -1
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +5 -0
- package/dist/modes/base.js.map +1 -1
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.d.ts +2 -0
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.d.ts.map +1 -0
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js +316 -0
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js.map +1 -0
- package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.d.ts +2 -0
- package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.d.ts.map +1 -0
- package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.js +481 -0
- package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.js.map +1 -0
- package/dist/planning/__tests__/artifacts.test.js +597 -4
- package/dist/planning/__tests__/artifacts.test.js.map +1 -1
- package/dist/planning/__tests__/context-pack-status.test.js +524 -0
- package/dist/planning/__tests__/context-pack-status.test.js.map +1 -1
- package/dist/planning/__tests__/markdown-structure.test.d.ts +2 -0
- package/dist/planning/__tests__/markdown-structure.test.d.ts.map +1 -0
- package/dist/planning/__tests__/markdown-structure.test.js +459 -0
- package/dist/planning/__tests__/markdown-structure.test.js.map +1 -0
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.d.ts +2 -0
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.d.ts.map +1 -0
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.js +612 -0
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.js.map +1 -0
- package/dist/planning/artifacts.d.ts +7 -2
- package/dist/planning/artifacts.d.ts.map +1 -1
- package/dist/planning/artifacts.js +279 -26
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/planning/context-pack-status.d.ts +31 -0
- package/dist/planning/context-pack-status.d.ts.map +1 -1
- package/dist/planning/context-pack-status.js +291 -25
- package/dist/planning/context-pack-status.js.map +1 -1
- package/dist/planning/markdown-structure.d.ts +20 -0
- package/dist/planning/markdown-structure.d.ts.map +1 -0
- package/dist/planning/markdown-structure.js +137 -0
- package/dist/planning/markdown-structure.js.map +1 -0
- package/dist/ralph/__tests__/completion-audit.test.d.ts +2 -0
- package/dist/ralph/__tests__/completion-audit.test.d.ts.map +1 -0
- package/dist/ralph/__tests__/completion-audit.test.js +121 -0
- package/dist/ralph/__tests__/completion-audit.test.js.map +1 -0
- package/dist/ralph/completion-audit.d.ts +8 -0
- package/dist/ralph/completion-audit.d.ts.map +1 -0
- package/dist/ralph/completion-audit.js +99 -0
- package/dist/ralph/completion-audit.js.map +1 -0
- package/dist/ralph/persistence.d.ts +1 -1
- package/dist/ralph/persistence.d.ts.map +1 -1
- package/dist/ralph/persistence.js +8 -2
- package/dist/ralph/persistence.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +359 -24
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-dispatcher.test.d.ts +2 -0
- package/dist/scripts/__tests__/notify-dispatcher.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/notify-dispatcher.test.js +126 -0
- package/dist/scripts/__tests__/notify-dispatcher.test.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +142 -76
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +4 -2
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/notify-dispatcher.d.ts +7 -0
- package/dist/scripts/notify-dispatcher.d.ts.map +1 -0
- package/dist/scripts/notify-dispatcher.js +87 -0
- package/dist/scripts/notify-dispatcher.js.map +1 -0
- package/dist/scripts/notify-fallback-watcher.js +4 -0
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.js +96 -8
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -1
- package/dist/scripts/notify-hook/state-io.d.ts.map +1 -1
- package/dist/scripts/notify-hook/state-io.js +6 -2
- package/dist/scripts/notify-hook/state-io.js.map +1 -1
- package/dist/scripts/notify-hook/visual-verdict.js +3 -3
- package/dist/scripts/notify-hook/visual-verdict.js.map +1 -1
- package/dist/scripts/notify-hook.js +127 -1
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/state/__tests__/workflow-transition.test.js +102 -27
- package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +9 -3
- package/dist/state/operations.js.map +1 -1
- package/dist/state/skill-active.d.ts +7 -0
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +25 -8
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts +1 -0
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +22 -15
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/state/workflow-transition.js +3 -3
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/team/__tests__/approved-execution.test.js +84 -1
- package/dist/team/__tests__/approved-execution.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +178 -19
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +497 -2
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js +1 -1
- package/dist/team/__tests__/state-root.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +45 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/approved-execution.d.ts +1 -0
- package/dist/team/approved-execution.d.ts.map +1 -1
- package/dist/team/approved-execution.js +53 -0
- package/dist/team/approved-execution.js.map +1 -1
- package/dist/team/delivery-log.d.ts.map +1 -1
- package/dist/team/delivery-log.js +8 -1
- package/dist/team/delivery-log.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +104 -18
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +43 -0
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/mailbox.d.ts +1 -0
- package/dist/team/state/mailbox.d.ts.map +1 -1
- package/dist/team/state/mailbox.js +10 -1
- package/dist/team/state/mailbox.js.map +1 -1
- package/dist/team/state-root.d.ts.map +1 -1
- package/dist/team/state-root.js +5 -1
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +3 -7
- package/dist/team/state.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +7 -2
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +17 -4
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +124 -1
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +21 -0
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +44 -2
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +197 -13
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/wiki/lifecycle.js +1 -1
- package/dist/wiki/lifecycle.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/.mcp.json +5 -5
- package/plugins/oh-my-codex/skills/analyze/SKILL.md +0 -2
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/code-review/SKILL.md +1 -3
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +5 -7
- package/plugins/oh-my-codex/skills/doctor/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +3 -3
- package/plugins/oh-my-codex/skills/pipeline/SKILL.md +3 -3
- package/plugins/oh-my-codex/skills/plan/SKILL.md +3 -6
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +9 -10
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +36 -3
- package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +21 -24
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +8 -8
- package/plugins/oh-my-codex/skills/wiki/SKILL.md +13 -13
- package/skills/analyze/SKILL.md +0 -2
- package/skills/ask-claude/SKILL.md +5 -3
- package/skills/ask-gemini/SKILL.md +5 -3
- package/skills/autopilot/SKILL.md +2 -2
- package/skills/code-review/SKILL.md +1 -3
- package/skills/deep-interview/SKILL.md +5 -7
- package/skills/doctor/SKILL.md +2 -2
- package/skills/ecomode/SKILL.md +105 -1
- package/skills/frontend-ui-ux/SKILL.md +4 -26
- package/skills/git-master/SKILL.md +2 -4
- package/skills/omx-setup/SKILL.md +3 -3
- package/skills/pipeline/SKILL.md +3 -3
- package/skills/plan/SKILL.md +3 -6
- package/skills/ralph/SKILL.md +9 -10
- package/skills/swarm/SKILL.md +5 -3
- package/skills/tdd/SKILL.md +95 -1
- package/skills/ultragoal/SKILL.md +36 -3
- package/skills/ultraqa/SKILL.md +21 -24
- package/skills/ultrawork/SKILL.md +8 -8
- package/skills/web-clone/SKILL.md +348 -1
- package/skills/wiki/SKILL.md +13 -13
- package/src/scripts/__tests__/codex-native-hook.test.ts +389 -24
- package/src/scripts/__tests__/notify-dispatcher.test.ts +153 -0
- package/src/scripts/codex-native-hook.ts +168 -64
- package/src/scripts/codex-native-pre-post.ts +4 -1
- package/src/scripts/notify-dispatcher.ts +113 -0
- package/src/scripts/notify-fallback-watcher.ts +6 -2
- package/src/scripts/notify-hook/ralph-session-resume.ts +117 -8
- package/src/scripts/notify-hook/state-io.ts +4 -2
- package/src/scripts/notify-hook/visual-verdict.ts +3 -3
- package/src/scripts/notify-hook.ts +119 -1
package/dist/cli/index.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import { execFileSync, spawn } from "child_process";
|
|
6
6
|
import { basename, dirname, join, posix, win32 } from "path";
|
|
7
7
|
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "fs";
|
|
8
|
-
import { copyFile, cp, lstat, mkdir, readdir, rm, symlink } from "fs/promises";
|
|
8
|
+
import { copyFile, cp, lstat, mkdir, readFile, readdir, rm, symlink, writeFile } from "fs/promises";
|
|
9
9
|
import { constants as osConstants, homedir } from "os";
|
|
10
|
-
import { setup, SETUP_SCOPES } from "./setup.js";
|
|
10
|
+
import { setup, SETUP_MCP_MODES, SETUP_SCOPES, } from "./setup.js";
|
|
11
11
|
import { uninstall } from "./uninstall.js";
|
|
12
12
|
import { version } from "./version.js";
|
|
13
13
|
import { tmuxHookCommand } from "./tmux-hook.js";
|
|
@@ -35,9 +35,10 @@ import { adaptCommand } from "./adapt.js";
|
|
|
35
35
|
import { listCommand } from "./list.js";
|
|
36
36
|
import { MADMAX_FLAG, CODEX_BYPASS_FLAG, HIGH_REASONING_FLAG, XHIGH_REASONING_FLAG, SPARK_FLAG, MADMAX_SPARK_FLAG, CONFIG_FLAG, LONG_CONFIG_FLAG, } from "./constants.js";
|
|
37
37
|
import { getBaseStateDir, getStateDir, listModeStateFilesWithScopePreference, } from "../mcp/state-paths.js";
|
|
38
|
-
import {
|
|
38
|
+
import { evaluateRalphCompletionAuditEvidence, isRalphCompletePhase } from "../ralph/completion-audit.js";
|
|
39
|
+
import { readPersistedSetupPreferences, resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, resolveProjectLocalCodexHomeForLaunch, } from "./codex-home.js";
|
|
39
40
|
export { readPersistedSetupPreferences, readPersistedSetupScope, resolveCodexConfigPathForLaunch, resolveCodexHomeForLaunch, resolveProjectLocalCodexHomeForLaunch, } from "./codex-home.js";
|
|
40
|
-
import { SKILL_ACTIVE_STATE_MODE, extractSessionIdFromInitializedStatePath,
|
|
41
|
+
import { SKILL_ACTIVE_STATE_MODE, extractSessionIdFromInitializedStatePath, getSkillActiveStatePathsForStateDir, listActiveSkills, readSkillActiveState, syncCanonicalSkillStateForMode, } from "../state/skill-active.js";
|
|
41
42
|
import { isTrackedWorkflowMode } from "../state/workflow-transition.js";
|
|
42
43
|
import { maybeCheckAndPromptUpdate, runImmediateUpdate } from "./update.js";
|
|
43
44
|
import { maybePromptGithubStar } from "./star-prompt.js";
|
|
@@ -46,7 +47,8 @@ import { readSessionState, writeSessionStart, writeSessionEnd, resetSessionMetri
|
|
|
46
47
|
import { buildClientAttachedReconcileHookName, buildReconcileHudResizeArgs, buildRegisterClientAttachedReconcileArgs, buildRegisterResizeHookArgs, buildResizeHookName, buildResizeHookTarget, buildScheduleDelayedHudResizeArgs, buildUnregisterClientAttachedReconcileArgs, buildUnregisterResizeHookArgs, enableMouseScrolling, isMsysOrGitBash, isNativeWindows, isTmuxAvailable, mitigateCopyModeUnderlineArtifacts, } from "../team/tmux-session.js";
|
|
47
48
|
import { getPackageRoot } from "../utils/package.js";
|
|
48
49
|
import { codexConfigPath, omxRoot, rememberOmxLaunchContext, resolveOmxEntryPath } from "../utils/paths.js";
|
|
49
|
-
import { cleanCodexModelAvailabilityNuxIfNeeded, repairConfigIfNeeded } from "../config/generator.js";
|
|
50
|
+
import { cleanCodexModelAvailabilityNuxIfNeeded, extractSharedMcpRegistryServersFromConfig, repairConfigIfNeeded, upsertManagedCodexHookTrustState } from "../config/generator.js";
|
|
51
|
+
import { OMX_FIRST_PARTY_MCP_SERVER_NAMES } from "../config/omx-first-party-mcp.js";
|
|
50
52
|
import { HUD_TMUX_HEIGHT_LINES } from "../hud/constants.js";
|
|
51
53
|
import { OMX_TMUX_HUD_OWNER_ENV } from "../hud/reconcile.js";
|
|
52
54
|
import { createHudWatchPane as createSharedHudWatchPane, killTmuxPane as killSharedTmuxPane, listCurrentWindowHudPaneIds, parsePaneIdFromTmuxOutput, } from "../hud/tmux.js";
|
|
@@ -83,7 +85,7 @@ Usage:
|
|
|
83
85
|
Queue audited follow-up instructions for a running non-interactive exec job
|
|
84
86
|
omx imagegen continuation <session-id> --artifact <name>
|
|
85
87
|
Queue a Stop-hook continuation for built-in image generation turns
|
|
86
|
-
omx setup Install skills, prompts,
|
|
88
|
+
omx setup Install skills, prompts, CLI-first config, and scope-specific AGENTS.md
|
|
87
89
|
(user scope prompts for legacy vs plugin skill delivery when needed)
|
|
88
90
|
omx update Check npm now, update the global install immediately, then refresh setup
|
|
89
91
|
omx uninstall Remove OMX configuration and clean up installed artifacts
|
|
@@ -116,13 +118,13 @@ Usage:
|
|
|
116
118
|
omx hud Show HUD statusline (--watch, --json, --preset=NAME)
|
|
117
119
|
omx sidecar Show read-only team/multi-agent visualization (--watch, --json, --tmux)
|
|
118
120
|
omx state Read/write/list OMX mode state via CLI parity surface
|
|
119
|
-
omx notepad CLI
|
|
121
|
+
omx notepad JSON CLI surface for OMX notepad operations
|
|
120
122
|
omx project-memory
|
|
121
|
-
CLI
|
|
122
|
-
omx trace CLI
|
|
123
|
+
JSON CLI surface for OMX project-memory operations
|
|
124
|
+
omx trace JSON CLI surface for OMX trace operations
|
|
123
125
|
omx code-intel
|
|
124
|
-
CLI
|
|
125
|
-
omx wiki CLI
|
|
126
|
+
JSON CLI surface for OMX code-intel operations
|
|
127
|
+
omx wiki JSON CLI surface for OMX wiki operations
|
|
126
128
|
omx mcp-serve Launch an OMX stdio MCP server target (plugin/runtime use)
|
|
127
129
|
omx sparkshell <command> [args...]
|
|
128
130
|
omx sparkshell --tmux-pane <pane-id> [--tail-lines <100-1000>]
|
|
@@ -164,6 +166,10 @@ Options:
|
|
|
164
166
|
--legacy Use legacy setup delivery for omx setup, overriding persisted plugin mode
|
|
165
167
|
--install-mode <legacy|plugin>
|
|
166
168
|
Explicit setup install mode (canonical form; --legacy/--plugin are aliases)
|
|
169
|
+
--mcp <none|compat>
|
|
170
|
+
Explicit setup MCP mode (default: none; compat enables first-party MCP compatibility and shared registry sync)
|
|
171
|
+
--no-mcp Alias for --mcp=none
|
|
172
|
+
--with-mcp Alias for --mcp=compat
|
|
167
173
|
--keep-config Skip config.toml cleanup during uninstall
|
|
168
174
|
--purge Remove .omx/ cache directory during uninstall
|
|
169
175
|
--verbose Show detailed output
|
|
@@ -288,6 +294,45 @@ export function resolveSetupInstallModeArg(args) {
|
|
|
288
294
|
}
|
|
289
295
|
return value;
|
|
290
296
|
}
|
|
297
|
+
export function resolveSetupMcpModeArg(args) {
|
|
298
|
+
let value;
|
|
299
|
+
const setValue = (next, source) => {
|
|
300
|
+
if (value && value !== next) {
|
|
301
|
+
throw new Error(`Conflicting setup MCP mode flags: ${source} selects ${next}, but another flag already selected ${value}`);
|
|
302
|
+
}
|
|
303
|
+
value = next;
|
|
304
|
+
};
|
|
305
|
+
const parseValue = (next) => {
|
|
306
|
+
if (!SETUP_MCP_MODES.includes(next)) {
|
|
307
|
+
throw new Error(`Invalid setup MCP mode: ${next}. Expected one of: none, compat`);
|
|
308
|
+
}
|
|
309
|
+
return next;
|
|
310
|
+
};
|
|
311
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
312
|
+
const arg = args[index];
|
|
313
|
+
if (arg === "--no-mcp") {
|
|
314
|
+
setValue("none", arg);
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (arg === "--with-mcp") {
|
|
318
|
+
setValue("compat", arg);
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (arg === "--mcp") {
|
|
322
|
+
const next = args[index + 1];
|
|
323
|
+
if (!next || next.startsWith("-")) {
|
|
324
|
+
throw new Error(`Missing setup MCP mode value after --mcp. Expected one of: none, compat`);
|
|
325
|
+
}
|
|
326
|
+
setValue(parseValue(next), arg);
|
|
327
|
+
index += 1;
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
if (arg.startsWith("--mcp=")) {
|
|
331
|
+
setValue(parseValue(arg.slice("--mcp=".length)), "--mcp");
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return value;
|
|
335
|
+
}
|
|
291
336
|
export function resolveSetupScopeArg(args) {
|
|
292
337
|
let value;
|
|
293
338
|
for (let index = 0; index < args.length; index += 1) {
|
|
@@ -447,12 +492,20 @@ export async function prepareRuntimeCodexHomeForProjectLaunch(cwd, sessionId, pr
|
|
|
447
492
|
continue;
|
|
448
493
|
const source = join(projectCodexHome, entry.name);
|
|
449
494
|
const destination = join(runtimeCodexHome, entry.name);
|
|
450
|
-
if (entry.name === "config.toml") {
|
|
495
|
+
if (entry.name === "config.toml" || entry.name === "hooks.json") {
|
|
451
496
|
await copyFile(source, destination);
|
|
452
497
|
continue;
|
|
453
498
|
}
|
|
454
499
|
await linkOrCopyCodexHomeEntry(source, destination);
|
|
455
500
|
}
|
|
501
|
+
const runtimeConfigPath = join(runtimeCodexHome, "config.toml");
|
|
502
|
+
const runtimeHooksPath = join(runtimeCodexHome, "hooks.json");
|
|
503
|
+
if (existsSync(runtimeConfigPath) && existsSync(runtimeHooksPath)) {
|
|
504
|
+
const runtimeConfig = await readFile(runtimeConfigPath, "utf-8");
|
|
505
|
+
if (runtimeConfig.includes("# OMX-owned Codex hook trust state")) {
|
|
506
|
+
await writeFile(runtimeConfigPath, upsertManagedCodexHookTrustState(runtimeConfig, getPackageRoot(), runtimeHooksPath), "utf-8");
|
|
507
|
+
}
|
|
508
|
+
}
|
|
456
509
|
return runtimeCodexHome;
|
|
457
510
|
}
|
|
458
511
|
function resolveProjectSqliteHomeForLaunch(projectCodexHome, env) {
|
|
@@ -629,6 +682,39 @@ export function classifyCodexExecFailure(error) {
|
|
|
629
682
|
message,
|
|
630
683
|
};
|
|
631
684
|
}
|
|
685
|
+
export async function resolveLaunchConfigRepairOptions(cwd, configPath) {
|
|
686
|
+
let content;
|
|
687
|
+
const readConfig = async () => {
|
|
688
|
+
if (content !== undefined)
|
|
689
|
+
return content;
|
|
690
|
+
if (!existsSync(configPath))
|
|
691
|
+
return undefined;
|
|
692
|
+
content = await readFile(configPath, "utf-8");
|
|
693
|
+
return content;
|
|
694
|
+
};
|
|
695
|
+
const existingContent = await readConfig();
|
|
696
|
+
const sharedMcpRegistry = existingContent
|
|
697
|
+
? extractSharedMcpRegistryServersFromConfig(existingContent)
|
|
698
|
+
: { servers: [] };
|
|
699
|
+
const sharedMcpOptions = sharedMcpRegistry.servers.length > 0
|
|
700
|
+
? {
|
|
701
|
+
sharedMcpServers: sharedMcpRegistry.servers,
|
|
702
|
+
sharedMcpRegistrySource: sharedMcpRegistry.sourcePath,
|
|
703
|
+
}
|
|
704
|
+
: {};
|
|
705
|
+
if (readPersistedSetupPreferences(cwd)?.mcpMode === "compat") {
|
|
706
|
+
return { includeFirstPartyMcp: true, ...sharedMcpOptions };
|
|
707
|
+
}
|
|
708
|
+
if (existingContent) {
|
|
709
|
+
const hasExistingFirstPartyMcp = OMX_FIRST_PARTY_MCP_SERVER_NAMES.some((name) => new RegExp(`^\\s*\\[mcp_servers\\.${name}\\]\\s*$`, "m").test(existingContent));
|
|
710
|
+
if (hasExistingFirstPartyMcp || sharedMcpRegistry.servers.length > 0) {
|
|
711
|
+
return { includeFirstPartyMcp: hasExistingFirstPartyMcp, ...sharedMcpOptions };
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return {
|
|
715
|
+
includeFirstPartyMcp: false,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
632
718
|
function runCodexBlocking(cwd, launchArgs, codexEnv) {
|
|
633
719
|
const { result } = spawnPlatformCommandSync("codex", launchArgs, {
|
|
634
720
|
cwd,
|
|
@@ -658,6 +744,9 @@ function runCodexBlocking(cwd, launchArgs, codexEnv) {
|
|
|
658
744
|
if (result.signal) {
|
|
659
745
|
console.error(`[omx] codex exited due to signal ${result.signal}`);
|
|
660
746
|
}
|
|
747
|
+
else if (typeof result.status === "number") {
|
|
748
|
+
console.error(`[omx] codex exited with code ${result.status}`);
|
|
749
|
+
}
|
|
661
750
|
}
|
|
662
751
|
}
|
|
663
752
|
export function buildHudPaneCleanupTargets(existingPaneIds, createdPaneId, leaderPaneId) {
|
|
@@ -805,6 +894,7 @@ export async function main(args) {
|
|
|
805
894
|
verbose: options.verbose,
|
|
806
895
|
scope: resolveSetupScopeArg(args.slice(1)),
|
|
807
896
|
installMode: resolveSetupInstallModeArg(args.slice(1)),
|
|
897
|
+
mcpMode: resolveSetupMcpModeArg(args.slice(1)),
|
|
808
898
|
});
|
|
809
899
|
break;
|
|
810
900
|
case "update":
|
|
@@ -1096,7 +1186,8 @@ export async function launchWithHud(args) {
|
|
|
1096
1186
|
// have written a config.toml with duplicate [tui] sections. Codex CLI's
|
|
1097
1187
|
// TOML parser rejects duplicates, so we repair before spawning the CLI.
|
|
1098
1188
|
try {
|
|
1099
|
-
const
|
|
1189
|
+
const configPath = resolveCodexConfigPathForLaunch(launchCwd, process.env);
|
|
1190
|
+
const repaired = await repairConfigIfNeeded(configPath, getPackageRoot(), await resolveLaunchConfigRepairOptions(launchCwd, configPath));
|
|
1100
1191
|
if (repaired) {
|
|
1101
1192
|
console.log("[omx] Repaired managed config.toml compatibility issue.");
|
|
1102
1193
|
}
|
|
@@ -1180,7 +1271,8 @@ export async function execWithOverlay(args) {
|
|
|
1180
1271
|
logCliOperationFailure(err);
|
|
1181
1272
|
}
|
|
1182
1273
|
try {
|
|
1183
|
-
const
|
|
1274
|
+
const configPath = resolveCodexConfigPathForLaunch(launchCwd, process.env);
|
|
1275
|
+
const repaired = await repairConfigIfNeeded(configPath, getPackageRoot(), await resolveLaunchConfigRepairOptions(launchCwd, configPath));
|
|
1184
1276
|
if (repaired) {
|
|
1185
1277
|
console.log("[omx] Repaired managed config.toml compatibility issue.");
|
|
1186
1278
|
}
|
|
@@ -1759,15 +1851,30 @@ function buildDetachedSessionLeaderCommand(cwd, sessionName, codexCmd, sessionId
|
|
|
1759
1851
|
'exec 3<&- 2>/dev/null || true;',
|
|
1760
1852
|
buildTmuxExtendedKeysReleaseShellSnippet(cwd),
|
|
1761
1853
|
detachedPostLaunchHelper,
|
|
1762
|
-
'if [ "$status" -
|
|
1854
|
+
'if [ "$status" -eq 0 ]; then',
|
|
1763
1855
|
`tmux kill-session -t "${escapeShellDoubleQuotedValue(sessionName)}" >/dev/null 2>&1 || true;`,
|
|
1764
1856
|
"fi;",
|
|
1765
1857
|
"exit $status;",
|
|
1766
1858
|
"};",
|
|
1767
1859
|
"trap omx_detached_session_cleanup 0 INT TERM HUP;",
|
|
1860
|
+
"omx_codex_started_at=$(date +%s 2>/dev/null || printf 0);",
|
|
1768
1861
|
`${codexCmd} <&3 &`,
|
|
1769
1862
|
"omx_codex_pid=$!;",
|
|
1770
1863
|
'wait "$omx_codex_pid";',
|
|
1864
|
+
"omx_codex_status=$?;",
|
|
1865
|
+
"omx_codex_finished_at=$(date +%s 2>/dev/null || printf 0);",
|
|
1866
|
+
'omx_codex_elapsed=$((omx_codex_finished_at - omx_codex_started_at));',
|
|
1867
|
+
'if [ "$omx_codex_status" -eq 0 ] && [ "$omx_codex_elapsed" -le 2 ]; then',
|
|
1868
|
+
'printf "\\n[omx] codex exited immediately with code 0 during startup. The detached tmux session is being kept open so any output above remains visible. Press Enter to close this OMX session.\\n" >&2;',
|
|
1869
|
+
'IFS= read -r _omx_close || true;',
|
|
1870
|
+
'elif [ "$omx_codex_status" -gt 0 ] && [ "$omx_codex_status" -lt 128 ] && [ "$omx_codex_elapsed" -le 2 ]; then',
|
|
1871
|
+
'printf "\\n[omx] codex exited with code %s during startup. The detached tmux session is being kept open so the error above remains visible. Press Enter to close this OMX session.\\n" "$omx_codex_status" >&2;',
|
|
1872
|
+
'IFS= read -r _omx_close || true;',
|
|
1873
|
+
'elif [ "$omx_codex_status" -gt 0 ] && [ "$omx_codex_status" -lt 128 ]; then',
|
|
1874
|
+
'printf "\\n[omx] codex exited with code %s. The detached tmux session is being kept open so the error above remains visible. Press Enter to close this OMX session.\\n" "$omx_codex_status" >&2;',
|
|
1875
|
+
'IFS= read -r _omx_close || true;',
|
|
1876
|
+
"fi;",
|
|
1877
|
+
'exit "$omx_codex_status";',
|
|
1771
1878
|
].join(" ");
|
|
1772
1879
|
return `/bin/sh -c ${quoteShellArg(wrapped)}`;
|
|
1773
1880
|
}
|
|
@@ -2145,11 +2252,11 @@ function cleanPostLaunchString(value) {
|
|
|
2145
2252
|
function postLaunchUniqueStrings(values) {
|
|
2146
2253
|
return [...new Set(values.map((value) => value.trim()).filter(Boolean))];
|
|
2147
2254
|
}
|
|
2148
|
-
async function scrubPostLaunchRootSkillActiveForSession(
|
|
2255
|
+
async function scrubPostLaunchRootSkillActiveForSession(stateDir, sessionId, nowIso, writeFileFn, rootStateBeforeCleanup) {
|
|
2149
2256
|
const normalizedSessionId = cleanPostLaunchString(sessionId);
|
|
2150
2257
|
if (!normalizedSessionId)
|
|
2151
2258
|
return;
|
|
2152
|
-
const { rootPath } =
|
|
2259
|
+
const { rootPath } = getSkillActiveStatePathsForStateDir(stateDir);
|
|
2153
2260
|
const rootState = rootStateBeforeCleanup ?? await readSkillActiveState(rootPath);
|
|
2154
2261
|
if (!rootState)
|
|
2155
2262
|
return;
|
|
@@ -2200,6 +2307,23 @@ function buildRecoveredPostLaunchSkillActiveState(completedAt) {
|
|
|
2200
2307
|
active_skills: [],
|
|
2201
2308
|
};
|
|
2202
2309
|
}
|
|
2310
|
+
function markRalphCompletionAuditBlockedForPostLaunch(state, cwd, nowIso) {
|
|
2311
|
+
if (!isRalphCompletePhase(state.current_phase ?? state.currentPhase))
|
|
2312
|
+
return false;
|
|
2313
|
+
const audit = evaluateRalphCompletionAuditEvidence(state, cwd);
|
|
2314
|
+
if (audit.complete)
|
|
2315
|
+
return false;
|
|
2316
|
+
state.active = false;
|
|
2317
|
+
state.current_phase = "cancelled";
|
|
2318
|
+
state.completed_at = nowIso;
|
|
2319
|
+
state.last_turn_at = nowIso;
|
|
2320
|
+
state.interrupted_at = nowIso;
|
|
2321
|
+
state.stop_reason = `missing_completion_audit:${audit.reason}`;
|
|
2322
|
+
state.completion_audit_gate = "blocked";
|
|
2323
|
+
state.completion_audit_missing_reason = audit.reason;
|
|
2324
|
+
state.completion_audit_blocked_at = nowIso;
|
|
2325
|
+
return true;
|
|
2326
|
+
}
|
|
2203
2327
|
export async function cleanupPostLaunchModeStateFiles(cwd, sessionId, dependencies = {}) {
|
|
2204
2328
|
const readdir = dependencies.readdir ?? (await import("fs/promises")).readdir;
|
|
2205
2329
|
const writeFile = dependencies.writeFile ?? (await import("fs/promises")).writeFile;
|
|
@@ -2208,8 +2332,9 @@ export async function cleanupPostLaunchModeStateFiles(cwd, sessionId, dependenci
|
|
|
2208
2332
|
const scopedDirs = sessionId
|
|
2209
2333
|
? [getStateDir(cwd, sessionId)]
|
|
2210
2334
|
: [getBaseStateDir(cwd)];
|
|
2335
|
+
const rootStateDir = getBaseStateDir(cwd);
|
|
2211
2336
|
const rootSkillActiveStateBeforeCleanup = sessionId
|
|
2212
|
-
? await readSkillActiveState(
|
|
2337
|
+
? await readSkillActiveState(getSkillActiveStatePathsForStateDir(rootStateDir).rootPath)
|
|
2213
2338
|
: null;
|
|
2214
2339
|
for (const stateDir of scopedDirs) {
|
|
2215
2340
|
const files = await readdir(stateDir).catch(() => []);
|
|
@@ -2229,6 +2354,7 @@ export async function cleanupPostLaunchModeStateFiles(cwd, sessionId, dependenci
|
|
|
2229
2354
|
if (isTrackedWorkflowMode(mode)) {
|
|
2230
2355
|
await syncCanonicalSkillStateForMode({
|
|
2231
2356
|
cwd,
|
|
2357
|
+
baseStateDir: rootStateDir,
|
|
2232
2358
|
mode,
|
|
2233
2359
|
active: false,
|
|
2234
2360
|
currentPhase: "cancelled",
|
|
@@ -2250,8 +2376,25 @@ export async function cleanupPostLaunchModeStateFiles(cwd, sessionId, dependenci
|
|
|
2250
2376
|
const skillStateStillVisible = mode === SKILL_ACTIVE_STATE_MODE
|
|
2251
2377
|
&& Array.isArray(result.state.active_skills)
|
|
2252
2378
|
&& result.state.active_skills.length > 0;
|
|
2253
|
-
if (result.state.active !== true && !skillStateStillVisible)
|
|
2379
|
+
if (result.state.active !== true && !skillStateStillVisible) {
|
|
2380
|
+
if (mode === "ralph") {
|
|
2381
|
+
const completedAt = now().toISOString();
|
|
2382
|
+
if (markRalphCompletionAuditBlockedForPostLaunch(result.state, cwd, completedAt)) {
|
|
2383
|
+
await writeFile(path, JSON.stringify(result.state, null, 2));
|
|
2384
|
+
await syncCanonicalSkillStateForMode({
|
|
2385
|
+
cwd,
|
|
2386
|
+
baseStateDir: rootStateDir,
|
|
2387
|
+
mode,
|
|
2388
|
+
active: false,
|
|
2389
|
+
currentPhase: "cancelled",
|
|
2390
|
+
sessionId: stateDir === getStateDir(cwd, sessionId) ? sessionId : undefined,
|
|
2391
|
+
nowIso: completedAt,
|
|
2392
|
+
source: "postLaunchCleanup",
|
|
2393
|
+
});
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2254
2396
|
continue;
|
|
2397
|
+
}
|
|
2255
2398
|
try {
|
|
2256
2399
|
const completedAt = now().toISOString();
|
|
2257
2400
|
if (mode === SKILL_ACTIVE_STATE_MODE) {
|
|
@@ -2265,10 +2408,15 @@ export async function cleanupPostLaunchModeStateFiles(cwd, sessionId, dependenci
|
|
|
2265
2408
|
result.state.active = false;
|
|
2266
2409
|
result.state.current_phase = "cancelled";
|
|
2267
2410
|
result.state.completed_at = completedAt;
|
|
2411
|
+
if (mode === "ralph") {
|
|
2412
|
+
result.state.interrupted_at = completedAt;
|
|
2413
|
+
result.state.stop_reason = cleanPostLaunchString(result.state.stop_reason) || "session_exit";
|
|
2414
|
+
}
|
|
2268
2415
|
await writeFile(path, JSON.stringify(result.state, null, 2));
|
|
2269
2416
|
if (isTrackedWorkflowMode(mode)) {
|
|
2270
2417
|
await syncCanonicalSkillStateForMode({
|
|
2271
2418
|
cwd,
|
|
2419
|
+
baseStateDir: rootStateDir,
|
|
2272
2420
|
mode,
|
|
2273
2421
|
active: false,
|
|
2274
2422
|
currentPhase: "cancelled",
|
|
@@ -2285,7 +2433,7 @@ export async function cleanupPostLaunchModeStateFiles(cwd, sessionId, dependenci
|
|
|
2285
2433
|
}
|
|
2286
2434
|
if (sessionId) {
|
|
2287
2435
|
try {
|
|
2288
|
-
await scrubPostLaunchRootSkillActiveForSession(
|
|
2436
|
+
await scrubPostLaunchRootSkillActiveForSession(rootStateDir, sessionId, now().toISOString(), writeFile, rootSkillActiveStateBeforeCleanup);
|
|
2289
2437
|
}
|
|
2290
2438
|
catch (err) {
|
|
2291
2439
|
writeWarn(`[omx] postLaunch: failed to reconcile root skill-active state: ${err instanceof Error ? err.message : err}`);
|