oh-my-opencode 4.16.0 → 4.16.1

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.
Files changed (128) hide show
  1. package/.agents/skills/codex-qa/SKILL.md +9 -7
  2. package/.agents/skills/codex-qa/references/logging-debug.md +6 -4
  3. package/.agents/skills/opencode-qa/SKILL.md +9 -9
  4. package/.agents/skills/opencode-qa/references/tui-tmux.md +10 -8
  5. package/dist/cli/codex-ulw-loop.d.ts +8 -0
  6. package/dist/cli/get-local-version/types.d.ts +1 -1
  7. package/dist/cli/index.js +260 -207
  8. package/dist/cli-node/index.js +260 -207
  9. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  10. package/dist/features/monitor/process.d.ts +17 -1
  11. package/dist/index.js +1048 -1001
  12. package/dist/skills/frontend/SKILL.md +9 -9
  13. package/dist/skills/frontend/references/design/README.md +7 -3
  14. package/dist/skills/frontend/references/design/_INDEX.md +1 -1
  15. package/dist/skills/frontend/references/design/design-system-architecture.md +24 -2
  16. package/dist/skills/frontend/references/designpowers/README.md +2 -2
  17. package/dist/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
  18. package/dist/skills/start-work/SKILL.md +2 -2
  19. package/dist/skills/visual-qa/SKILL.md +13 -17
  20. package/docs/reference/web-terminal-visual-qa.md +39 -45
  21. package/package.json +31 -25
  22. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  23. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  24. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  25. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  26. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  27. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  28. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  29. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  30. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  31. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  32. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  33. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  34. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  35. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  36. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +2 -2
  37. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  38. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  39. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  40. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  41. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  42. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  43. package/packages/omo-codex/plugin/components/ultrawork/directive.md +18 -10
  44. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  45. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  46. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +18 -10
  47. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +11 -0
  48. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +22 -1
  49. package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +4 -0
  50. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +18 -10
  51. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +15 -2
  52. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +2 -1
  53. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +89 -27
  54. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +6 -0
  55. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +55 -9
  56. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.d.ts +15 -0
  57. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-snapshot.js +33 -0
  58. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +10 -3
  59. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +15 -11
  60. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  61. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  62. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
  63. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +7 -7
  64. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -2
  65. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +2 -1
  66. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +59 -11
  67. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-snapshot.ts +38 -0
  68. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-types.ts +11 -3
  69. package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +15 -7
  70. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +16 -0
  71. package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +260 -2
  72. package/packages/omo-codex/plugin/components/ulw-loop/test/steering-snapshot.test.ts +124 -0
  73. package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +101 -2
  74. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  78. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  92. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  93. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  94. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  95. package/packages/omo-codex/plugin/package-lock.json +13 -13
  96. package/packages/omo-codex/plugin/package.json +1 -1
  97. package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +10 -6
  98. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +9 -9
  99. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +7 -3
  100. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -1
  101. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +24 -2
  102. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +2 -2
  103. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
  104. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -2
  105. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +18 -10
  106. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
  107. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +7 -7
  108. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +11 -0
  109. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +13 -17
  110. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -4
  111. package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +1 -1
  112. package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +22 -9
  113. package/packages/omo-codex/plugin/test/sync-hook-status-messages.test.mjs +6 -6
  114. package/packages/omo-codex/plugin/test/ulw-plan-skill-contract.test.mjs +52 -0
  115. package/packages/omo-codex/scripts/install-dist/install-local.mjs +65 -39
  116. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +2 -2
  117. package/packages/shared-skills/skills/frontend/SKILL.md +9 -9
  118. package/packages/shared-skills/skills/frontend/references/design/README.md +7 -3
  119. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -1
  120. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +24 -2
  121. package/packages/shared-skills/skills/frontend/references/designpowers/README.md +2 -2
  122. package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +1 -1
  123. package/packages/shared-skills/skills/start-work/SKILL.md +2 -2
  124. package/packages/shared-skills/skills/visual-qa/SKILL.md +13 -17
  125. package/script/qa/strip-ansi.mjs +10 -0
  126. package/script/qa/web-terminal-visual-qa.mjs +112 -195
  127. package/script/qa/xterm-live-terminal.mjs +180 -0
  128. package/script/qa/web-terminal-renderer.mjs +0 -218
@@ -2146,7 +2146,7 @@ var package_default;
2146
2146
  var init_package = __esm(() => {
2147
2147
  package_default = {
2148
2148
  name: "oh-my-opencode",
2149
- version: "4.16.0",
2149
+ version: "4.16.1",
2150
2150
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2151
2151
  main: "./dist/index.js",
2152
2152
  types: "dist/index.d.ts",
@@ -2192,10 +2192,11 @@ var init_package = __esm(() => {
2192
2192
  "dist",
2193
2193
  "bin",
2194
2194
  "postinstall.mjs",
2195
+ "script/qa/strip-ansi.mjs",
2195
2196
  "script/qa/web-terminal-redaction.d.mts",
2196
2197
  "script/qa/web-terminal-redaction.mjs",
2197
- "script/qa/web-terminal-renderer.mjs",
2198
2198
  "script/qa/web-terminal-visual-qa.mjs",
2199
+ "script/qa/xterm-live-terminal.mjs",
2199
2200
  "docs/reference/github-attachment-upload.md",
2200
2201
  "docs/reference/web-terminal-visual-qa.md",
2201
2202
  ".opencode/command",
@@ -2261,6 +2262,7 @@ var init_package = __esm(() => {
2261
2262
  "build:all": "bun run build && bun run build:binaries",
2262
2263
  "build:binaries": "bun run script/build-binaries.ts",
2263
2264
  "build:schema": "bun run script/build-schema.ts",
2265
+ "build:omo-schema": "bun run script/build-omo-schema.ts",
2264
2266
  "build:model-capabilities": "bun run script/build-model-capabilities.ts",
2265
2267
  clean: "rm -rf dist",
2266
2268
  prepack: "bun run build:materialize-frontend",
@@ -2317,51 +2319,55 @@ var init_package = __esm(() => {
2317
2319
  zod: "^4.4.3"
2318
2320
  },
2319
2321
  devDependencies: {
2320
- "@oh-my-opencode/git-bash-mcp": "workspace:*",
2321
- "@oh-my-opencode/lsp-core": "workspace:*",
2322
- "@oh-my-opencode/mcp-stdio-core": "workspace:*",
2323
- "@oh-my-opencode/mcp-client-core": "workspace:*",
2324
2322
  "@oh-my-opencode/agents-md-core": "workspace:*",
2325
2323
  "@oh-my-opencode/boulder-state": "workspace:*",
2326
2324
  "@oh-my-opencode/claude-code-compat-core": "workspace:*",
2327
- "@oh-my-opencode/skills-loader-core": "workspace:*",
2328
2325
  "@oh-my-opencode/comment-checker-core": "workspace:*",
2329
2326
  "@oh-my-opencode/delegate-core": "workspace:*",
2327
+ "@oh-my-opencode/git-bash-mcp": "workspace:*",
2330
2328
  "@oh-my-opencode/hashline-core": "workspace:*",
2331
- "@oh-my-opencode/tmux-core": "workspace:*",
2332
- "@oh-my-opencode/team-core": "workspace:*",
2333
- "@oh-my-opencode/openclaw-core": "workspace:*",
2329
+ "@oh-my-opencode/lsp-core": "workspace:*",
2330
+ "@oh-my-opencode/mcp-client-core": "workspace:*",
2331
+ "@oh-my-opencode/mcp-stdio-core": "workspace:*",
2334
2332
  "@oh-my-opencode/model-core": "workspace:*",
2335
- "@oh-my-opencode/omo-config-core": "workspace:*",
2336
2333
  "@oh-my-opencode/omo-codex": "workspace:*",
2334
+ "@oh-my-opencode/omo-config-core": "workspace:*",
2337
2335
  "@oh-my-opencode/omo-senpi": "workspace:*",
2338
- "@oh-my-opencode/senpi-task": "workspace:*",
2336
+ "@oh-my-opencode/openclaw-core": "workspace:*",
2339
2337
  "@oh-my-opencode/pi-goal": "workspace:*",
2340
2338
  "@oh-my-opencode/pi-webfetch": "workspace:*",
2341
2339
  "@oh-my-opencode/prompts-core": "workspace:*",
2342
2340
  "@oh-my-opencode/rules-engine": "workspace:*",
2341
+ "@oh-my-opencode/senpi-task": "workspace:*",
2343
2342
  "@oh-my-opencode/shared-skills": "workspace:*",
2343
+ "@oh-my-opencode/skills-loader-core": "workspace:*",
2344
+ "@oh-my-opencode/team-core": "workspace:*",
2344
2345
  "@oh-my-opencode/telemetry-core": "workspace:*",
2346
+ "@oh-my-opencode/tmux-core": "workspace:*",
2345
2347
  "@oh-my-opencode/utils": "workspace:*",
2346
- "@typescript/native-preview": "7.0.0-dev.20260518.1",
2347
2348
  "@types/js-yaml": "^4.0.9",
2348
2349
  "@types/picomatch": "^4.0.3",
2350
+ "@typescript/native-preview": "7.0.0-dev.20260518.1",
2351
+ "@xterm/addon-unicode11": "^0.9.0",
2352
+ "@xterm/xterm": "^6.0.0",
2349
2353
  "bun-types": "1.3.14",
2354
+ "node-pty": "^1.1.0",
2355
+ "puppeteer-core": "^25.3.0",
2350
2356
  typescript: "^6.0.3"
2351
2357
  },
2352
2358
  optionalDependencies: {
2353
- "oh-my-opencode-darwin-arm64": "4.16.0",
2354
- "oh-my-opencode-darwin-x64": "4.16.0",
2355
- "oh-my-opencode-darwin-x64-baseline": "4.16.0",
2356
- "oh-my-opencode-linux-arm64": "4.16.0",
2357
- "oh-my-opencode-linux-arm64-musl": "4.16.0",
2358
- "oh-my-opencode-linux-x64": "4.16.0",
2359
- "oh-my-opencode-linux-x64-baseline": "4.16.0",
2360
- "oh-my-opencode-linux-x64-musl": "4.16.0",
2361
- "oh-my-opencode-linux-x64-musl-baseline": "4.16.0",
2362
- "oh-my-opencode-windows-arm64": "4.16.0",
2363
- "oh-my-opencode-windows-x64": "4.16.0",
2364
- "oh-my-opencode-windows-x64-baseline": "4.16.0"
2359
+ "oh-my-opencode-darwin-arm64": "4.16.1",
2360
+ "oh-my-opencode-darwin-x64": "4.16.1",
2361
+ "oh-my-opencode-darwin-x64-baseline": "4.16.1",
2362
+ "oh-my-opencode-linux-arm64": "4.16.1",
2363
+ "oh-my-opencode-linux-arm64-musl": "4.16.1",
2364
+ "oh-my-opencode-linux-x64": "4.16.1",
2365
+ "oh-my-opencode-linux-x64-baseline": "4.16.1",
2366
+ "oh-my-opencode-linux-x64-musl": "4.16.1",
2367
+ "oh-my-opencode-linux-x64-musl-baseline": "4.16.1",
2368
+ "oh-my-opencode-windows-arm64": "4.16.1",
2369
+ "oh-my-opencode-windows-x64": "4.16.1",
2370
+ "oh-my-opencode-windows-x64-baseline": "4.16.1"
2365
2371
  },
2366
2372
  overrides: {
2367
2373
  "@earendil-works/pi-agent-core": "0.80.3",
@@ -66684,20 +66690,20 @@ var init_config_manager = __esm(() => {
66684
66690
 
66685
66691
  // packages/telemetry-core/src/activity-state.ts
66686
66692
  import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "node:fs";
66687
- import { basename as basename10, join as join50 } from "node:path";
66693
+ import { basename as basename10, join as join51 } from "node:path";
66688
66694
  function resolveTelemetryStateDir(product, options = {}) {
66689
66695
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
66690
66696
  env: options.env,
66691
66697
  osProvider: options.osProvider
66692
66698
  });
66693
- const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join50(options.env.XDG_DATA_HOME, product.cacheDirName);
66699
+ const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
66694
66700
  if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
66695
66701
  return dataDir;
66696
66702
  }
66697
- return join50(dataDir, product.cacheDirName);
66703
+ return join51(dataDir, product.cacheDirName);
66698
66704
  }
66699
66705
  function getTelemetryActivityStateFilePath(stateDir) {
66700
- return join50(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
66706
+ return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
66701
66707
  }
66702
66708
  function getDailyActiveCaptureState(input) {
66703
66709
  const state = readPostHogActivityState(input.stateDir, input.diagnostics);
@@ -66768,9 +66774,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
66768
66774
 
66769
66775
  // packages/telemetry-core/src/diagnostics.ts
66770
66776
  import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "node:fs";
66771
- import { join as join51 } from "node:path";
66777
+ import { join as join52 } from "node:path";
66772
66778
  function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
66773
- return join51(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
66779
+ return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
66774
66780
  }
66775
66781
  function writeTelemetryDiagnostic(input, options) {
66776
66782
  const now = options.now ?? new Date;
@@ -72491,7 +72497,7 @@ var package_default2;
72491
72497
  var init_package2 = __esm(() => {
72492
72498
  package_default2 = {
72493
72499
  name: "@oh-my-opencode/omo-codex",
72494
- version: "4.16.0",
72500
+ version: "4.16.1",
72495
72501
  type: "module",
72496
72502
  private: true,
72497
72503
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -73461,7 +73467,7 @@ var init_update_toasts = __esm(() => {
73461
73467
 
73462
73468
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
73463
73469
  import { existsSync as existsSync49 } from "node:fs";
73464
- import { dirname as dirname27, join as join69 } from "node:path";
73470
+ import { dirname as dirname27, join as join70 } from "node:path";
73465
73471
  import { fileURLToPath as fileURLToPath5 } from "node:url";
73466
73472
  function defaultGetModuleHostingWorkspace() {
73467
73473
  try {
@@ -73615,7 +73621,7 @@ var init_background_update_check = __esm(() => {
73615
73621
  init_update_toasts();
73616
73622
  defaultDeps4 = {
73617
73623
  existsSync: existsSync49,
73618
- join: join69,
73624
+ join: join70,
73619
73625
  runBunInstallWithDetails,
73620
73626
  log: log2,
73621
73627
  getOpenCodeCacheDir,
@@ -74224,7 +74230,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
74224
74230
  }
74225
74231
 
74226
74232
  // packages/omo-codex/src/install/install-codex.ts
74227
- import { join as join52, resolve as resolve15 } from "node:path";
74233
+ import { join as join53, resolve as resolve15 } from "node:path";
74228
74234
  import { existsSync as existsSync30 } from "node:fs";
74229
74235
  import { homedir as homedir6 } from "node:os";
74230
74236
 
@@ -77182,7 +77188,11 @@ function stampHookGroups(hooks, version) {
77182
77188
  function stampHookStatusMessage(hook, version) {
77183
77189
  if (!isPlainRecord3(hook) || typeof hook.statusMessage !== "string")
77184
77190
  return;
77185
- hook.statusMessage = hook.statusMessage.replace(/^LazyCodex\([^)]+\):\s*/, "(OmO) ");
77191
+ hook.statusMessage = hook.statusMessage.replace(/^(?:LazyCodex\([^)]+\):|\(OmO(?:\s+[^)]+)?\))\s*/, `(OmO ${normalizeHookStatusVersion(version)}) `);
77192
+ }
77193
+ function normalizeHookStatusVersion(version) {
77194
+ const normalized = version.trim();
77195
+ return normalized.length === 0 ? "local" : normalized;
77186
77196
  }
77187
77197
 
77188
77198
  // packages/omo-codex/src/install/codex-process.ts
@@ -77527,11 +77537,32 @@ function resolveCodexInstallerBinDir(input) {
77527
77537
  return resolve14(homeDir, ".local", "bin");
77528
77538
  }
77529
77539
 
77530
- // packages/omo-codex/src/install/omo-sot-migration.ts
77540
+ // packages/omo-codex/src/install/codex-git-bash-hooks.ts
77541
+ import { readFile as readFile19, writeFile as writeFile10 } from "node:fs/promises";
77531
77542
  import { join as join48 } from "node:path";
77543
+ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
77544
+ "./hooks/pre-tool-use-recommending-git-bash-mcp.json",
77545
+ "./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
77546
+ ]);
77547
+ async function removeGitBashHooksOffWindows(input) {
77548
+ if (input.platform === "win32")
77549
+ return;
77550
+ const manifestPath = join48(input.pluginRoot, ".codex-plugin", "plugin.json");
77551
+ const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
77552
+ if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
77553
+ return;
77554
+ const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
77555
+ if (hooks.length === parsed.hooks.length)
77556
+ return;
77557
+ await writeFile10(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
77558
+ `);
77559
+ }
77560
+
77561
+ // packages/omo-codex/src/install/omo-sot-migration.ts
77562
+ import { join as join49 } from "node:path";
77532
77563
  async function seedAndMigrateOmoSot(input) {
77533
77564
  const commandEnv = { ...input.env };
77534
- const scriptPath = join48(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
77565
+ const scriptPath = join49(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
77535
77566
  try {
77536
77567
  await input.runCommand(process.execPath, [scriptPath, "--seed"], {
77537
77568
  cwd: input.repoRoot,
@@ -77546,7 +77577,7 @@ async function seedAndMigrateOmoSot(input) {
77546
77577
 
77547
77578
  // packages/omo-codex/src/install/install-ast-grep-sg.ts
77548
77579
  init_src();
77549
- import { join as join49 } from "node:path";
77580
+ import { join as join50 } from "node:path";
77550
77581
  function describeResult(result) {
77551
77582
  if (result.kind === "succeeded")
77552
77583
  return null;
@@ -77560,7 +77591,7 @@ async function installAstGrepForCodex(options) {
77560
77591
  return;
77561
77592
  const platform = options.platform ?? process.platform;
77562
77593
  const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
77563
- const skillDir = join49(plugin.path, "skills", "ast-grep");
77594
+ const skillDir = join50(plugin.path, "skills", "ast-grep");
77564
77595
  const installer = options.installer ?? runAstGrepSkillInstall;
77565
77596
  try {
77566
77597
  const result = await installer({ platform, skillDir, targetDir });
@@ -77594,7 +77625,7 @@ async function runCodexInstaller(options = {}) {
77594
77625
  const env3 = options.env ?? process.env;
77595
77626
  const platform = options.platform ?? process.platform;
77596
77627
  const repoRoot = resolve15(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
77597
- const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join52(homedir6(), ".codex"));
77628
+ const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join53(homedir6(), ".codex"));
77598
77629
  const projectDirectory = resolve15(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
77599
77630
  const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
77600
77631
  const runCommand = options.runCommand ?? defaultRunCommand;
@@ -77610,9 +77641,9 @@ async function runCodexInstaller(options = {}) {
77610
77641
  if (!gitBashResolution.found) {
77611
77642
  throw new Error(gitBashResolution.installHint);
77612
77643
  }
77613
- const codexPackageRoot = join52(repoRoot, "packages", "omo-codex");
77644
+ const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
77614
77645
  const marketplace = await readMarketplace(repoRoot, {
77615
- marketplacePath: join52(codexPackageRoot, "marketplace.json")
77646
+ marketplacePath: join53(codexPackageRoot, "marketplace.json")
77616
77647
  });
77617
77648
  const distributionManifest = await readDistributionManifest(repoRoot);
77618
77649
  const installed = [];
@@ -77644,6 +77675,7 @@ async function runCodexInstaller(options = {}) {
77644
77675
  if (marketplace.name === "sisyphuslabs" && plugin.name === "omo") {
77645
77676
  await stampLazyCodexPluginVersion({ pluginRoot: plugin.path, version: version2 });
77646
77677
  await writeLazyCodexInstallSnapshot({ pluginRoot: plugin.path, distributionManifest });
77678
+ await removeGitBashHooksOffWindows({ platform, pluginRoot: plugin.path });
77647
77679
  }
77648
77680
  const links = await linkCachedPluginBins({ binDir, pluginRoot: plugin.path, platform });
77649
77681
  for (const link of links) {
@@ -77654,7 +77686,7 @@ async function runCodexInstaller(options = {}) {
77654
77686
  if (runtimeLink !== null)
77655
77687
  log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
77656
77688
  else
77657
- log4(`Warning: skipped the omo runtime wrapper because ${join52(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
77689
+ log4(`Warning: skipped the omo runtime wrapper because ${join53(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
77658
77690
  }
77659
77691
  pluginSources.push({ name: entry.name, sourcePath });
77660
77692
  installed.push(plugin);
@@ -77708,13 +77740,13 @@ async function runCodexInstaller(options = {}) {
77708
77740
  });
77709
77741
  }
77710
77742
  await reapLspDaemons(codexHome).catch(() => []);
77711
- const marketplaceRoot = join52(codexHome, "plugins", "cache", marketplace.name);
77743
+ const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
77712
77744
  await writeCachedMarketplaceManifest({
77713
77745
  marketplaceName: marketplace.name,
77714
77746
  marketplaceRoot,
77715
77747
  plugins: installed
77716
77748
  });
77717
- const configPath = join52(codexHome, "config.toml");
77749
+ const configPath = join53(codexHome, "config.toml");
77718
77750
  await updateCodexConfig({
77719
77751
  configPath,
77720
77752
  repoRoot: codexPackageRoot,
@@ -77774,7 +77806,7 @@ function findRepoRootFromImporter(importerDir) {
77774
77806
  for (let depth = 0;depth <= 7; depth += 1) {
77775
77807
  if (isRepoRootWithCodexPlugin(current))
77776
77808
  return current;
77777
- for (const wrapperPackageRoot of [join52(current, "node_modules", "oh-my-openagent"), join52(current, "oh-my-openagent")]) {
77809
+ for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
77778
77810
  if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
77779
77811
  return wrapperPackageRoot;
77780
77812
  }
@@ -77792,7 +77824,7 @@ function findRepoRoot(input) {
77792
77824
  return findRepoRootFromImporter(input.importerDir);
77793
77825
  }
77794
77826
  function isRepoRootWithCodexPlugin(repoRoot) {
77795
- return existsSync30(join52(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
77827
+ return existsSync30(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
77796
77828
  }
77797
77829
  function codexMarketplaceSource(marketplaceRoot) {
77798
77830
  return { sourceType: "local", source: marketplaceRoot };
@@ -77927,12 +77959,12 @@ function defaultRunCommand2(command, args) {
77927
77959
  });
77928
77960
  }
77929
77961
  // packages/omo-codex/src/install/codex-cleanup.ts
77930
- import { lstat as lstat11, readFile as readFile20, readdir as readdir9, rm as rm11, rmdir } from "node:fs/promises";
77962
+ import { lstat as lstat11, readFile as readFile21, readdir as readdir9, rm as rm11, rmdir } from "node:fs/promises";
77931
77963
  import { homedir as homedir8 } from "node:os";
77932
- import { isAbsolute as isAbsolute10, join as join54, relative as relative7, resolve as resolve17 } from "node:path";
77964
+ import { isAbsolute as isAbsolute10, join as join55, relative as relative7, resolve as resolve17 } from "node:path";
77933
77965
 
77934
77966
  // packages/omo-codex/src/install/codex-cleanup-config.ts
77935
- import { lstat as lstat10, mkdir as mkdir8, readFile as readFile19, writeFile as writeFile10 } from "node:fs/promises";
77967
+ import { lstat as lstat10, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
77936
77968
  import { dirname as dirname18 } from "node:path";
77937
77969
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
77938
77970
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
@@ -77962,14 +77994,14 @@ function cleanupCodexLightConfigText(config) {
77962
77994
  async function cleanupCodexConfig(configPath, now) {
77963
77995
  if (!await configExists(configPath))
77964
77996
  return { changed: false };
77965
- const original = await readFile19(configPath, "utf8");
77997
+ const original = await readFile20(configPath, "utf8");
77966
77998
  const next = cleanupCodexLightConfigText(original);
77967
77999
  if (next === original)
77968
78000
  return { changed: false };
77969
78001
  const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
77970
78002
  await mkdir8(dirname18(configPath), { recursive: true });
77971
- await writeFile10(backupPath, original);
77972
- await writeFile10(configPath, `${next.trimEnd()}
78003
+ await writeFile11(backupPath, original);
78004
+ await writeFile11(configPath, `${next.trimEnd()}
77973
78005
  `);
77974
78006
  return { changed: true, backupPath };
77975
78007
  }
@@ -78046,7 +78078,7 @@ function nodeErrorCode4(error) {
78046
78078
  }
78047
78079
 
78048
78080
  // packages/omo-codex/src/install/codex-cleanup-safety.ts
78049
- import { dirname as dirname19, isAbsolute as isAbsolute9, join as join53, relative as relative6, resolve as resolve16 } from "node:path";
78081
+ import { dirname as dirname19, isAbsolute as isAbsolute9, join as join54, relative as relative6, resolve as resolve16 } from "node:path";
78050
78082
  function validateManagedCleanupTarget(input) {
78051
78083
  if (!isAbsolute9(input.path))
78052
78084
  return skipped(input.path, "outside managed Codex cleanup scope");
@@ -78059,11 +78091,11 @@ function validateManagedCleanupTarget(input) {
78059
78091
  if (target === codexHome)
78060
78092
  return skipped(input.path, "outside managed Codex cleanup scope");
78061
78093
  const exactManagedRoots = new Set([
78062
- resolve16(join53(codexHome, "plugins", "cache", "sisyphuslabs")),
78063
- resolve16(join53(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
78064
- resolve16(join53(codexHome, "runtime", "ast-grep")),
78065
- resolve16(join53(codexHome, "runtime", "node")),
78066
- resolve16(join53(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
78094
+ resolve16(join54(codexHome, "plugins", "cache", "sisyphuslabs")),
78095
+ resolve16(join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
78096
+ resolve16(join54(codexHome, "runtime", "ast-grep")),
78097
+ resolve16(join54(codexHome, "runtime", "node")),
78098
+ resolve16(join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
78067
78099
  ]);
78068
78100
  if (exactManagedRoots.has(target))
78069
78101
  return null;
@@ -78093,8 +78125,8 @@ function skipped(path7, reason) {
78093
78125
  var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
78094
78126
  async function cleanupCodexLight(input = {}) {
78095
78127
  const env3 = input.env ?? process.env;
78096
- const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join54(homedir8(), ".codex"));
78097
- const configPath = join54(codexHome, "config.toml");
78128
+ const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join55(homedir8(), ".codex"));
78129
+ const configPath = join55(codexHome, "config.toml");
78098
78130
  const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
78099
78131
  const configCleanup = await cleanupCodexConfig(configPath, input.now);
78100
78132
  const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
@@ -78133,17 +78165,17 @@ async function cleanupCodexLight(input = {}) {
78133
78165
  }
78134
78166
  function managedGlobalStatePaths(codexHome) {
78135
78167
  return [
78136
- join54(codexHome, "plugins", "cache", "sisyphuslabs"),
78137
- join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
78138
- join54(codexHome, "runtime", "ast-grep"),
78139
- join54(codexHome, "runtime", "node"),
78140
- join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
78168
+ join55(codexHome, "plugins", "cache", "sisyphuslabs"),
78169
+ join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
78170
+ join55(codexHome, "runtime", "ast-grep"),
78171
+ join55(codexHome, "runtime", "node"),
78172
+ join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
78141
78173
  ];
78142
78174
  }
78143
78175
  var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
78144
78176
  async function collectBootstrapDataDirsByGlob(codexHome) {
78145
78177
  const results = [];
78146
- await walkForManagedBootstrapDirs(join54(codexHome, "plugins"), 0, results);
78178
+ await walkForManagedBootstrapDirs(join55(codexHome, "plugins"), 0, results);
78147
78179
  return results;
78148
78180
  }
78149
78181
  async function walkForManagedBootstrapDirs(directory, depth, results) {
@@ -78155,9 +78187,9 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
78155
78187
  for (const entry of entries) {
78156
78188
  if (!entry.isDirectory())
78157
78189
  continue;
78158
- const childPath = join54(directory, entry.name);
78190
+ const childPath = join55(directory, entry.name);
78159
78191
  if (isManagedBootstrapOwnerName(entry.name)) {
78160
- const bootstrapDir = join54(childPath, "bootstrap");
78192
+ const bootstrapDir = join55(childPath, "bootstrap");
78161
78193
  if (await exists5(bootstrapDir))
78162
78194
  results.push(bootstrapDir);
78163
78195
  continue;
@@ -78191,7 +78223,7 @@ async function attemptRemove(path7) {
78191
78223
  }
78192
78224
  async function pruneEmptyRuntimeDirBestEffort(codexHome) {
78193
78225
  try {
78194
- await rmdir(join54(codexHome, "runtime"));
78226
+ await rmdir(join55(codexHome, "runtime"));
78195
78227
  } catch (error) {
78196
78228
  if (isExpectedRuntimePruneFailure(error))
78197
78229
  return;
@@ -78203,14 +78235,14 @@ function isExpectedRuntimePruneFailure(error) {
78203
78235
  }
78204
78236
  async function collectInstalledAgentPaths(codexHome, configPath) {
78205
78237
  const manifestPaths = [
78206
- join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
78238
+ join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
78207
78239
  ];
78208
- const versionRoot = join54(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78240
+ const versionRoot = join55(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78209
78241
  if (await exists5(versionRoot)) {
78210
78242
  const entries = await readdir9(versionRoot, { withFileTypes: true });
78211
78243
  for (const entry of entries) {
78212
78244
  if (entry.isDirectory())
78213
- manifestPaths.push(join54(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
78245
+ manifestPaths.push(join55(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
78214
78246
  }
78215
78247
  }
78216
78248
  const paths = new Set;
@@ -78227,19 +78259,19 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78227
78259
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
78228
78260
  if (!await exists5(configPath))
78229
78261
  return [];
78230
- const config = await readFile20(configPath, "utf8");
78231
- return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join54(codexHome, "agents", `${agentName}.toml`));
78262
+ const config = await readFile21(configPath, "utf8");
78263
+ return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join55(codexHome, "agents", `${agentName}.toml`));
78232
78264
  }
78233
78265
  async function readInstalledAgentManifest(manifestPath) {
78234
78266
  if (!await exists5(manifestPath))
78235
78267
  return [];
78236
- const parsed = JSON.parse(await readFile20(manifestPath, "utf8"));
78268
+ const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
78237
78269
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
78238
78270
  return [];
78239
78271
  return parsed.agents.filter((path7) => typeof path7 === "string");
78240
78272
  }
78241
78273
  async function removeManifestListedAgentLinks(codexHome, paths) {
78242
- const agentsDir = join54(codexHome, "agents");
78274
+ const agentsDir = join55(codexHome, "agents");
78243
78275
  const removed = [];
78244
78276
  const skipped2 = [];
78245
78277
  for (const path7 of paths) {
@@ -78292,16 +78324,16 @@ var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", ".
78292
78324
  // packages/omo-senpi/src/install/install-senpi.ts
78293
78325
  import { execFile as execFile3 } from "node:child_process";
78294
78326
  import { constants as constants7, existsSync as existsSync32 } from "node:fs";
78295
- import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile21, rename as rename5, writeFile as writeFile11 } from "node:fs/promises";
78327
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile12 } from "node:fs/promises";
78296
78328
  import { homedir as homedir9 } from "node:os";
78297
- import { dirname as dirname20, join as join55, resolve as resolve18 } from "node:path";
78329
+ import { dirname as dirname20, join as join56, resolve as resolve18 } from "node:path";
78298
78330
  import { fileURLToPath } from "node:url";
78299
78331
  import { promisify as promisify2 } from "node:util";
78300
78332
  var execFileAsync2 = promisify2(execFile3);
78301
78333
  var REQUIRED_PLUGIN_ARTIFACTS = [
78302
- join55("extensions", "omo.js"),
78303
- join55("skills", "ultrawork", "SKILL.md"),
78304
- join55("skills", "ulw-loop", "SKILL.md")
78334
+ join56("extensions", "omo.js"),
78335
+ join56("skills", "ultrawork", "SKILL.md"),
78336
+ join56("skills", "ulw-loop", "SKILL.md")
78305
78337
  ];
78306
78338
  async function runSenpiInstaller(options = {}) {
78307
78339
  const context = resolveInstallContext(options);
@@ -78326,13 +78358,13 @@ async function runSenpiInstaller(options = {}) {
78326
78358
  function resolveInstallContext(options) {
78327
78359
  const env3 = options.env ?? process.env;
78328
78360
  const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
78329
- const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join55(homedir9(), ".senpi", "agent"));
78330
- const pluginPath = resolve18(options.pluginPath ?? join55(repoRoot, "packages", "omo-senpi", "plugin"));
78361
+ const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join56(homedir9(), ".senpi", "agent"));
78362
+ const pluginPath = resolve18(options.pluginPath ?? join56(repoRoot, "packages", "omo-senpi", "plugin"));
78331
78363
  return {
78332
78364
  env: env3,
78333
78365
  repoRoot,
78334
78366
  agentDir,
78335
- settingsPath: join55(agentDir, "settings.json"),
78367
+ settingsPath: join56(agentDir, "settings.json"),
78336
78368
  pluginPath,
78337
78369
  runCommand: options.runCommand ?? defaultRunCommand3
78338
78370
  };
@@ -78341,12 +78373,12 @@ async function ensurePluginArtifacts(context) {
78341
78373
  const missing = await hasMissingPluginArtifact(context.pluginPath);
78342
78374
  if (!missing)
78343
78375
  return;
78344
- await context.runCommand("node", [join55(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78345
- await context.runCommand("node", [join55(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
78376
+ await context.runCommand("node", [join56(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78377
+ await context.runCommand("node", [join56(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
78346
78378
  }
78347
78379
  async function hasMissingPluginArtifact(pluginPath) {
78348
78380
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
78349
- if (!await fileExists(join55(pluginPath, artifact)))
78381
+ if (!await fileExists(join56(pluginPath, artifact)))
78350
78382
  return true;
78351
78383
  }
78352
78384
  return false;
@@ -78361,7 +78393,7 @@ async function defaultRunCommand3(command, args, options) {
78361
78393
  async function readSettings(settingsPath) {
78362
78394
  let raw;
78363
78395
  try {
78364
- raw = await readFile21(settingsPath, "utf8");
78396
+ raw = await readFile22(settingsPath, "utf8");
78365
78397
  } catch (error) {
78366
78398
  if (isErrno(error, "ENOENT"))
78367
78399
  return {};
@@ -78390,11 +78422,11 @@ async function writeSettingsAtomically(settingsPath, settings) {
78390
78422
  if (await fileExists(settingsPath)) {
78391
78423
  await copyFile3(settingsPath, backupPath);
78392
78424
  } else {
78393
- await writeFile11(backupPath, `{}
78425
+ await writeFile12(backupPath, `{}
78394
78426
  `, "utf8");
78395
78427
  }
78396
78428
  const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
78397
- await writeFile11(tempPath, `${JSON.stringify(settings, null, 2)}
78429
+ await writeFile12(tempPath, `${JSON.stringify(settings, null, 2)}
78398
78430
  `, "utf8");
78399
78431
  await rename5(tempPath, settingsPath);
78400
78432
  return backupPath;
@@ -78414,7 +78446,7 @@ function timestampForBackup() {
78414
78446
  function findRepoRoot2(importerDir) {
78415
78447
  let current = importerDir;
78416
78448
  for (let depth = 0;depth <= 7; depth += 1) {
78417
- if (fileExistsSync(join55(current, "packages", "omo-senpi", "plugin", "package.json")))
78449
+ if (fileExistsSync(join56(current, "packages", "omo-senpi", "plugin", "package.json")))
78418
78450
  return current;
78419
78451
  current = resolve18(current, "..");
78420
78452
  }
@@ -78474,19 +78506,19 @@ init_provider_availability();
78474
78506
 
78475
78507
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
78476
78508
  import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "node:fs";
78477
- import { join as join57 } from "node:path";
78509
+ import { join as join58 } from "node:path";
78478
78510
 
78479
78511
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
78480
78512
  init_shared();
78481
78513
  import { existsSync as existsSync33, readFileSync as readFileSync15 } from "node:fs";
78482
- import { join as join56 } from "node:path";
78514
+ import { join as join57 } from "node:path";
78483
78515
  var TUI_SUBPATH = "tui";
78484
78516
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
78485
78517
  function fileEntryPackageJsonPath(entry) {
78486
78518
  let path7 = entry.slice("file:".length);
78487
78519
  if (path7.startsWith("//"))
78488
78520
  path7 = path7.slice(2);
78489
- return join56(path7, "package.json");
78521
+ return join57(path7, "package.json");
78490
78522
  }
78491
78523
  function packageJsonExportsTui(pkgJsonPath) {
78492
78524
  if (!existsSync33(pkgJsonPath))
@@ -78524,7 +78556,7 @@ function packageExportsTuiForServerEntry(entry) {
78524
78556
  const packageName = packageNameFromServerEntry(entry);
78525
78557
  if (packageName === null)
78526
78558
  return null;
78527
- return packageJsonExportsTui(join56(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
78559
+ return packageJsonExportsTui(join57(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
78528
78560
  }
78529
78561
  function isOurFilePluginEntry(entry) {
78530
78562
  if (typeof entry !== "string" || !entry.startsWith("file:"))
@@ -78589,7 +78621,7 @@ function detectServerPluginRegistration() {
78589
78621
  }
78590
78622
  }
78591
78623
  function detectTuiPluginRegistration() {
78592
- const tuiJsonPath = join56(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
78624
+ const tuiJsonPath = join57(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
78593
78625
  if (!existsSync33(tuiJsonPath)) {
78594
78626
  return {
78595
78627
  registered: false,
@@ -78745,10 +78777,10 @@ function readConfig(path7) {
78745
78777
  return null;
78746
78778
  }
78747
78779
  function readServerConfig(configDir) {
78748
- const jsoncPath = join57(configDir, "opencode.jsonc");
78780
+ const jsoncPath = join58(configDir, "opencode.jsonc");
78749
78781
  if (existsSync34(jsoncPath))
78750
78782
  return readConfig(jsoncPath);
78751
- const jsonPath = join57(configDir, "opencode.json");
78783
+ const jsonPath = join58(configDir, "opencode.json");
78752
78784
  if (existsSync34(jsonPath))
78753
78785
  return readConfig(jsonPath);
78754
78786
  return null;
@@ -78790,7 +78822,7 @@ function ensureTuiPluginEntry(opts = {}) {
78790
78822
  if (!desiredEntry) {
78791
78823
  return { changed: false, reason: "no-server-entry" };
78792
78824
  }
78793
- const tuiJsonPath = join57(configDir, "tui.json");
78825
+ const tuiJsonPath = join58(configDir, "tui.json");
78794
78826
  const { config, malformed } = readTuiConfig(tuiJsonPath);
78795
78827
  if (malformed) {
78796
78828
  return { changed: false, reason: "malformed" };
@@ -78806,7 +78838,7 @@ function ensureTuiPluginEntry(opts = {}) {
78806
78838
 
78807
78839
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
78808
78840
  import { homedir as homedir10 } from "node:os";
78809
- import { join as join58 } from "node:path";
78841
+ import { join as join59 } from "node:path";
78810
78842
 
78811
78843
  // packages/shared-skills/index.mjs
78812
78844
  import { fileURLToPath as fileURLToPath2 } from "node:url";
@@ -78825,9 +78857,9 @@ function describeResult2(result) {
78825
78857
  }
78826
78858
  async function installAstGrepForOpenCode(options = {}) {
78827
78859
  const platform = options.platform ?? process.platform;
78828
- const baseDir = join58(options.homeDir ?? homedir10(), ".omo");
78860
+ const baseDir = join59(options.homeDir ?? homedir10(), ".omo");
78829
78861
  const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
78830
- const skillDir = join58(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
78862
+ const skillDir = join59(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
78831
78863
  const installer = options.installer ?? runAstGrepSkillInstall;
78832
78864
  try {
78833
78865
  const result = await installer({ platform, skillDir, targetDir });
@@ -97326,9 +97358,9 @@ function readCurrentTopLevelTask(planPath) {
97326
97358
  }
97327
97359
  // packages/boulder-state/src/storage/path.ts
97328
97360
  import { existsSync as existsSync38 } from "node:fs";
97329
- import { isAbsolute as isAbsolute11, join as join60, relative as relative8, resolve as resolve19 } from "node:path";
97361
+ import { isAbsolute as isAbsolute11, join as join61, relative as relative8, resolve as resolve19 } from "node:path";
97330
97362
  function getBoulderFilePath(directory) {
97331
- return join60(directory, BOULDER_DIR, BOULDER_FILE);
97363
+ return join61(directory, BOULDER_DIR, BOULDER_FILE);
97332
97364
  }
97333
97365
  function resolveTrackedPath(baseDirectory, trackedPath) {
97334
97366
  return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
@@ -97555,9 +97587,9 @@ init_state();
97555
97587
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
97556
97588
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
97557
97589
  import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
97558
- import { join as join61 } from "node:path";
97590
+ import { join as join62 } from "node:path";
97559
97591
  function getMarkerPath(directory, sessionID) {
97560
- return join61(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
97592
+ return join62(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
97561
97593
  }
97562
97594
  function readContinuationMarker(directory, sessionID) {
97563
97595
  const markerPath = getMarkerPath(directory, sessionID);
@@ -97630,7 +97662,7 @@ async function isSessionInBoulderLineage(input) {
97630
97662
  init_shared();
97631
97663
  init_compaction_marker();
97632
97664
  import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "node:fs";
97633
- import { join as join62 } from "node:path";
97665
+ import { join as join63 } from "node:path";
97634
97666
  var defaultSessionLastAgentDeps = {
97635
97667
  getMessageDir,
97636
97668
  isSqliteBackend,
@@ -97690,7 +97722,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
97690
97722
  try {
97691
97723
  const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
97692
97724
  try {
97693
- const content = readFileSync22(join62(messageDir, fileName), "utf-8");
97725
+ const content = readFileSync22(join63(messageDir, fileName), "utf-8");
97694
97726
  const parsed = JSON.parse(content);
97695
97727
  return {
97696
97728
  fileName,
@@ -97734,7 +97766,7 @@ init_agent_display_names();
97734
97766
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
97735
97767
  init_frontmatter2();
97736
97768
  import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "node:fs";
97737
- import { dirname as dirname23, join as join63 } from "node:path";
97769
+ import { dirname as dirname23, join as join64 } from "node:path";
97738
97770
 
97739
97771
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
97740
97772
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -97743,7 +97775,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
97743
97775
 
97744
97776
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
97745
97777
  function getStateFilePath(directory, customPath) {
97746
- return customPath ? join63(directory, customPath) : join63(directory, DEFAULT_STATE_FILE);
97778
+ return customPath ? join64(directory, customPath) : join64(directory, DEFAULT_STATE_FILE);
97747
97779
  }
97748
97780
  function readState(directory, customPath) {
97749
97781
  const filePath = getStateFilePath(directory, customPath);
@@ -98715,6 +98747,10 @@ function formatVersionOutput(info) {
98715
98747
  lines.push(` ${SYMBOLS3.pin} ${import_picocolors17.default.magenta(`Version pinned to ${info.pinnedVersion}`)}`);
98716
98748
  lines.push(` ${import_picocolors17.default.dim("Update check skipped for pinned versions")}`);
98717
98749
  break;
98750
+ case "pinned-mismatch":
98751
+ lines.push(` ${SYMBOLS3.warn} ${import_picocolors17.default.yellow(`Version pinned to ${info.pinnedVersion} but running ${info.currentVersion}`)}`);
98752
+ lines.push(` ${import_picocolors17.default.dim("The pin only skips the update check; it does not control which version OpenCode loads")}`);
98753
+ break;
98718
98754
  case "error":
98719
98755
  lines.push(` ${SYMBOLS3.cross} ${import_picocolors17.default.red("Unable to check for updates")}`);
98720
98756
  lines.push(` ${import_picocolors17.default.dim("Network error or npm registry unavailable")}`);
@@ -98751,14 +98787,16 @@ async function getLocalVersion(options = {}) {
98751
98787
  }
98752
98788
  const pluginInfo = findPluginEntry(directory);
98753
98789
  if (pluginInfo?.isPinned) {
98790
+ const actualVersion = getCachedVersion();
98791
+ const isMismatch = actualVersion !== null && actualVersion !== pluginInfo.pinnedVersion;
98754
98792
  const info2 = {
98755
- currentVersion: pluginInfo.pinnedVersion,
98793
+ currentVersion: isMismatch ? actualVersion : pluginInfo.pinnedVersion,
98756
98794
  latestVersion: null,
98757
98795
  isUpToDate: false,
98758
98796
  isLocalDev: false,
98759
98797
  isPinned: true,
98760
98798
  pinnedVersion: pluginInfo.pinnedVersion,
98761
- status: "pinned"
98799
+ status: isMismatch ? "pinned-mismatch" : "pinned"
98762
98800
  };
98763
98801
  console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
98764
98802
  return 0;
@@ -98827,7 +98865,7 @@ init_extract_semver();
98827
98865
  init_bun_which_shim();
98828
98866
  import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "node:fs";
98829
98867
  import { homedir as homedir14 } from "node:os";
98830
- import { join as join70 } from "node:path";
98868
+ import { join as join71 } from "node:path";
98831
98869
 
98832
98870
  // packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
98833
98871
  init_spawn_with_windows_hide();
@@ -98919,17 +98957,17 @@ function getDesktopAppPaths(platform) {
98919
98957
  case "darwin":
98920
98958
  return [
98921
98959
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
98922
- join70(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
98960
+ join71(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
98923
98961
  ];
98924
98962
  case "win32": {
98925
98963
  const programFiles = process.env.ProgramFiles;
98926
98964
  const localAppData = process.env.LOCALAPPDATA;
98927
98965
  const paths = [];
98928
98966
  if (programFiles) {
98929
- paths.push(join70(programFiles, "OpenCode", "OpenCode.exe"));
98967
+ paths.push(join71(programFiles, "OpenCode", "OpenCode.exe"));
98930
98968
  }
98931
98969
  if (localAppData) {
98932
- paths.push(join70(localAppData, "OpenCode", "OpenCode.exe"));
98970
+ paths.push(join71(localAppData, "OpenCode", "OpenCode.exe"));
98933
98971
  }
98934
98972
  return paths;
98935
98973
  }
@@ -98937,8 +98975,8 @@ function getDesktopAppPaths(platform) {
98937
98975
  return [
98938
98976
  "/usr/bin/opencode",
98939
98977
  "/usr/lib/opencode/opencode",
98940
- join70(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
98941
- join70(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
98978
+ join71(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
98979
+ join71(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
98942
98980
  ];
98943
98981
  default:
98944
98982
  return [];
@@ -98970,7 +99008,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
98970
99008
  const candidates = getCommandCandidates2(platform);
98971
99009
  for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
98972
99010
  for (const command of candidates) {
98973
- const fullPath = join70(entry, command);
99011
+ const fullPath = join71(entry, command);
98974
99012
  if (checkExists(fullPath) && isExecutable2(fullPath)) {
98975
99013
  return { binary: command, path: fullPath };
98976
99014
  }
@@ -99112,22 +99150,22 @@ init_package_json_locator();
99112
99150
  import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "node:fs";
99113
99151
  import { createRequire as createRequire3 } from "node:module";
99114
99152
  import { homedir as homedir15 } from "node:os";
99115
- import { join as join71 } from "node:path";
99153
+ import { join as join72 } from "node:path";
99116
99154
  import { fileURLToPath as fileURLToPath6 } from "node:url";
99117
99155
  init_shared();
99118
99156
  function getPlatformDefaultCacheDir(platform = process.platform) {
99119
99157
  if (platform === "darwin")
99120
- return join71(homedir15(), "Library", "Caches");
99158
+ return join72(homedir15(), "Library", "Caches");
99121
99159
  if (platform === "win32")
99122
- return process.env.LOCALAPPDATA ?? join71(homedir15(), "AppData", "Local");
99123
- return join71(homedir15(), ".cache");
99160
+ return process.env.LOCALAPPDATA ?? join72(homedir15(), "AppData", "Local");
99161
+ return join72(homedir15(), ".cache");
99124
99162
  }
99125
99163
  function resolveOpenCodeCacheDir() {
99126
99164
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
99127
99165
  if (xdgCacheHome)
99128
- return join71(xdgCacheHome, "opencode");
99166
+ return join72(xdgCacheHome, "opencode");
99129
99167
  const fromShared = getOpenCodeCacheDir();
99130
- const platformDefault = join71(getPlatformDefaultCacheDir(), "opencode");
99168
+ const platformDefault = join72(getPlatformDefaultCacheDir(), "opencode");
99131
99169
  if (existsSync52(fromShared) || !existsSync52(platformDefault))
99132
99170
  return fromShared;
99133
99171
  return platformDefault;
@@ -99159,11 +99197,11 @@ function normalizeVersion(value) {
99159
99197
  function createPackageCandidates(rootDir) {
99160
99198
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
99161
99199
  packageName,
99162
- installedPackagePath: join71(rootDir, "node_modules", packageName, "package.json")
99200
+ installedPackagePath: join72(rootDir, "node_modules", packageName, "package.json")
99163
99201
  }));
99164
99202
  }
99165
99203
  function createTaggedInstallCandidates(rootDir) {
99166
- const packagesDir = join71(rootDir, "packages");
99204
+ const packagesDir = join72(rootDir, "packages");
99167
99205
  if (!existsSync52(packagesDir))
99168
99206
  return [];
99169
99207
  const candidates = [];
@@ -99171,14 +99209,14 @@ function createTaggedInstallCandidates(rootDir) {
99171
99209
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
99172
99210
  if (packageName === undefined)
99173
99211
  continue;
99174
- const installDir = join71(packagesDir, entryName);
99212
+ const installDir = join72(packagesDir, entryName);
99175
99213
  candidates.push({
99176
99214
  cacheDir: installDir,
99177
- cachePackagePath: join71(installDir, "package.json"),
99215
+ cachePackagePath: join72(installDir, "package.json"),
99178
99216
  packageCandidates: [
99179
99217
  {
99180
99218
  packageName,
99181
- installedPackagePath: join71(installDir, "node_modules", packageName, "package.json")
99219
+ installedPackagePath: join72(installDir, "node_modules", packageName, "package.json")
99182
99220
  }
99183
99221
  ]
99184
99222
  });
@@ -99223,13 +99261,13 @@ function getLoadedPluginVersion() {
99223
99261
  const candidates = [
99224
99262
  {
99225
99263
  cacheDir: configDir,
99226
- cachePackagePath: join71(configDir, "package.json"),
99264
+ cachePackagePath: join72(configDir, "package.json"),
99227
99265
  packageCandidates: createPackageCandidates(configDir)
99228
99266
  },
99229
99267
  ...createTaggedInstallCandidates(configDir),
99230
99268
  {
99231
99269
  cacheDir,
99232
- cachePackagePath: join71(cacheDir, "package.json"),
99270
+ cachePackagePath: join72(cacheDir, "package.json"),
99233
99271
  packageCandidates: createPackageCandidates(cacheDir)
99234
99272
  },
99235
99273
  ...createTaggedInstallCandidates(cacheDir)
@@ -99536,18 +99574,18 @@ function validatePluginConfig(directory) {
99536
99574
  init_shared();
99537
99575
  import { existsSync as existsSync54, readFileSync as readFileSync35 } from "node:fs";
99538
99576
  import { homedir as homedir17 } from "node:os";
99539
- import { join as join72 } from "node:path";
99577
+ import { join as join73 } from "node:path";
99540
99578
  function getUserConfigDir2() {
99541
99579
  const xdgConfig = process.env.XDG_CONFIG_HOME;
99542
99580
  if (xdgConfig)
99543
- return join72(xdgConfig, "opencode");
99544
- return join72(homedir17(), ".config", "opencode");
99581
+ return join73(xdgConfig, "opencode");
99582
+ return join73(homedir17(), ".config", "opencode");
99545
99583
  }
99546
99584
  function loadCustomProviderNames() {
99547
99585
  const configDir = getUserConfigDir2();
99548
99586
  const candidatePaths = [
99549
- join72(configDir, "opencode.json"),
99550
- join72(configDir, "opencode.jsonc")
99587
+ join73(configDir, "opencode.json"),
99588
+ join73(configDir, "opencode.jsonc")
99551
99589
  ];
99552
99590
  for (const configPath of candidatePaths) {
99553
99591
  if (!existsSync54(configPath))
@@ -99568,7 +99606,7 @@ function loadCustomProviderNames() {
99568
99606
  return [];
99569
99607
  }
99570
99608
  function loadAvailableModelsFromCache() {
99571
- const cacheFile = join72(getOpenCodeCacheDir(), "models.json");
99609
+ const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
99572
99610
  const customProviders = loadCustomProviderNames();
99573
99611
  if (!existsSync54(cacheFile)) {
99574
99612
  if (customProviders.length > 0) {
@@ -99605,8 +99643,8 @@ init_model_capabilities2();
99605
99643
  init_shared();
99606
99644
  init_plugin_identity();
99607
99645
  import { readFileSync as readFileSync36 } from "node:fs";
99608
- import { join as join73 } from "node:path";
99609
- var PROJECT_CONFIG_DIR = join73(process.cwd(), ".opencode");
99646
+ import { join as join74 } from "node:path";
99647
+ var PROJECT_CONFIG_DIR = join74(process.cwd(), ".opencode");
99610
99648
  function loadOmoConfig() {
99611
99649
  const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
99612
99650
  basenames: [CONFIG_BASENAME],
@@ -99644,7 +99682,7 @@ function loadOmoConfig() {
99644
99682
 
99645
99683
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
99646
99684
  init_shared();
99647
- import { join as join74 } from "node:path";
99685
+ import { join as join75 } from "node:path";
99648
99686
 
99649
99687
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
99650
99688
  function formatModelWithVariant(model, variant) {
@@ -99686,7 +99724,7 @@ function formatCapabilityResolutionLabel(mode) {
99686
99724
  }
99687
99725
  function buildModelResolutionDetails(options) {
99688
99726
  const details = [];
99689
- const cacheFile = join74(getOpenCodeCacheDir(), "models.json");
99727
+ const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
99690
99728
  details.push("═══ Available Models (from cache) ═══");
99691
99729
  details.push("");
99692
99730
  if (options.available.cacheExists) {
@@ -99965,25 +100003,25 @@ init_src();
99965
100003
  import { existsSync as existsSync55 } from "node:fs";
99966
100004
  import { createRequire as createRequire4 } from "node:module";
99967
100005
  import { homedir as homedir19 } from "node:os";
99968
- import { dirname as dirname29, join as join76 } from "node:path";
100006
+ import { dirname as dirname29, join as join77 } from "node:path";
99969
100007
 
99970
100008
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
99971
- import { join as join75 } from "path";
100009
+ import { join as join76 } from "path";
99972
100010
  import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
99973
100011
  init_binary_downloader();
99974
100012
  init_logger2();
99975
100013
  init_plugin_identity();
99976
100014
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
99977
- var DEBUG_FILE = join75(tmpdir3(), "comment-checker-debug.log");
100015
+ var DEBUG_FILE = join76(tmpdir3(), "comment-checker-debug.log");
99978
100016
  function getCacheDir2() {
99979
100017
  if (process.platform === "win32") {
99980
100018
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
99981
- const base2 = localAppData || join75(homedir18(), "AppData", "Local");
99982
- return join75(base2, CACHE_DIR_NAME, "bin");
100019
+ const base2 = localAppData || join76(homedir18(), "AppData", "Local");
100020
+ return join76(base2, CACHE_DIR_NAME, "bin");
99983
100021
  }
99984
100022
  const xdgCache = process.env.XDG_CACHE_HOME;
99985
- const base = xdgCache || join75(homedir18(), ".cache");
99986
- return join75(base, CACHE_DIR_NAME, "bin");
100023
+ const base = xdgCache || join76(homedir18(), ".cache");
100024
+ return join76(base, CACHE_DIR_NAME, "bin");
99987
100025
  }
99988
100026
  function getBinaryName() {
99989
100027
  return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -100033,7 +100071,7 @@ async function getBinaryVersion(binary) {
100033
100071
  }
100034
100072
  }
100035
100073
  async function checkAstGrepCli() {
100036
- const runtimeDir = astGrepRuntimeDir(join76(homedir19(), ".omo"));
100074
+ const runtimeDir = astGrepRuntimeDir(join77(homedir19(), ".omo"));
100037
100075
  const sgPath = findSgBinarySync({ runtimeDir });
100038
100076
  if (sgPath === null) {
100039
100077
  return {
@@ -100063,10 +100101,10 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
100063
100101
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
100064
100102
  try {
100065
100103
  const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
100066
- const vendorPath = join76(packageDir, "vendor", platformKey, binaryName);
100104
+ const vendorPath = join77(packageDir, "vendor", platformKey, binaryName);
100067
100105
  if (existsSync55(vendorPath))
100068
100106
  return vendorPath;
100069
- const binPath = join76(packageDir, "bin", binaryName);
100107
+ const binPath = join77(packageDir, "bin", binaryName);
100070
100108
  if (existsSync55(binPath))
100071
100109
  return binPath;
100072
100110
  } catch (error51) {
@@ -100212,7 +100250,7 @@ async function getGhCliInfo(dependencies = {}) {
100212
100250
 
100213
100251
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
100214
100252
  import { readFileSync as readFileSync37 } from "node:fs";
100215
- import { join as join77 } from "node:path";
100253
+ import { join as join78 } from "node:path";
100216
100254
 
100217
100255
  // packages/omo-opencode/src/mcp/lsp.ts
100218
100256
  import { existsSync as existsSync56 } from "node:fs";
@@ -100419,7 +100457,7 @@ function readOmoConfig(configDirectory) {
100419
100457
  }
100420
100458
  function isLspMcpDisabled(options) {
100421
100459
  const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
100422
- const projectConfigDirectory = join77(options.cwd ?? process.cwd(), ".opencode");
100460
+ const projectConfigDirectory = join78(options.cwd ?? process.cwd(), ".opencode");
100423
100461
  const userConfig = readOmoConfig(userConfigDirectory);
100424
100462
  const projectConfig = readOmoConfig(projectConfigDirectory);
100425
100463
  const disabledMcps = new Set([
@@ -100440,13 +100478,13 @@ function getInstalledLspServers(options = {}) {
100440
100478
  init_shared();
100441
100479
  import { existsSync as existsSync57, readFileSync as readFileSync38 } from "node:fs";
100442
100480
  import { homedir as homedir20 } from "node:os";
100443
- import { join as join78 } from "node:path";
100481
+ import { join as join79 } from "node:path";
100444
100482
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
100445
100483
  function getMcpConfigPaths() {
100446
100484
  return [
100447
- join78(homedir20(), ".claude", ".mcp.json"),
100448
- join78(process.cwd(), ".mcp.json"),
100449
- join78(process.cwd(), ".claude", ".mcp.json")
100485
+ join79(homedir20(), ".claude", ".mcp.json"),
100486
+ join79(process.cwd(), ".mcp.json"),
100487
+ join79(process.cwd(), ".claude", ".mcp.json")
100450
100488
  ];
100451
100489
  }
100452
100490
  function loadUserMcpConfig() {
@@ -100746,9 +100784,9 @@ async function pathExists(dir) {
100746
100784
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
100747
100785
  init_src();
100748
100786
  import { existsSync as existsSync59 } from "node:fs";
100749
- import { lstat as lstat12, readdir as readdir10, readFile as readFile22 } from "node:fs/promises";
100787
+ import { lstat as lstat12, readdir as readdir10, readFile as readFile23 } from "node:fs/promises";
100750
100788
  import { homedir as homedir22 } from "node:os";
100751
- import { basename as basename13, join as join79, resolve as resolve22 } from "node:path";
100789
+ import { basename as basename13, join as join80, resolve as resolve22 } from "node:path";
100752
100790
  // packages/omo-opencode/package.json
100753
100791
  var package_default3 = {
100754
100792
  name: "@oh-my-opencode/omo-opencode",
@@ -100806,13 +100844,13 @@ var CODEX_BIN_NAMES = [
100806
100844
  "omo-git-bash-hook"
100807
100845
  ];
100808
100846
  async function gatherCodexSummary(deps = {}) {
100809
- const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join79(homedir22(), ".codex"));
100847
+ const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir22(), ".codex"));
100810
100848
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
100811
100849
  const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
100812
100850
  const pluginRoot = await resolveInstalledPluginRoot(codexHome);
100813
- const manifest = pluginRoot === null ? null : await readJson(join79(pluginRoot, ".codex-plugin", "plugin.json"));
100814
- const installSnapshot = pluginRoot === null ? null : await readJson(join79(pluginRoot, "lazycodex-install.json"));
100815
- const configPath = join79(codexHome, "config.toml");
100851
+ const manifest = pluginRoot === null ? null : await readJson(join80(pluginRoot, ".codex-plugin", "plugin.json"));
100852
+ const installSnapshot = pluginRoot === null ? null : await readJson(join80(pluginRoot, "lazycodex-install.json"));
100853
+ const configPath = join80(codexHome, "config.toml");
100816
100854
  const pluginVersion = stringField(manifest, "version");
100817
100855
  return {
100818
100856
  codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -100869,7 +100907,7 @@ function buildCodexIssues(summary) {
100869
100907
  if (summary.pluginRoot === null) {
100870
100908
  issues.push({
100871
100909
  title: "OMO Codex plugin is not installed",
100872
- description: `Expected cached plugin at ${join79("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
100910
+ description: `Expected cached plugin at ${join80("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
100873
100911
  fix: "Run: npx lazycodex-ai install",
100874
100912
  severity: "error",
100875
100913
  affects: ["plugin loading"]
@@ -100934,12 +100972,12 @@ function buildCodexIssues(summary) {
100934
100972
  return issues;
100935
100973
  }
100936
100974
  async function resolveInstalledPluginRoot(codexHome) {
100937
- const pluginRoot = join79(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
100975
+ const pluginRoot = join80(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
100938
100976
  if (!existsSync59(pluginRoot))
100939
100977
  return null;
100940
100978
  const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
100941
100979
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
100942
- return candidates.length === 0 ? null : join79(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
100980
+ return candidates.length === 0 ? null : join80(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
100943
100981
  }
100944
100982
  async function readCodexConfigSummary(configPath) {
100945
100983
  if (!existsSync59(configPath)) {
@@ -100953,7 +100991,7 @@ async function readCodexConfigSummary(configPath) {
100953
100991
  companionLifecycleHookStateEvents: []
100954
100992
  };
100955
100993
  }
100956
- const content = await readFile22(configPath, "utf8");
100994
+ const content = await readFile23(configPath, "utf8");
100957
100995
  return {
100958
100996
  exists: true,
100959
100997
  marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
@@ -100967,13 +101005,13 @@ async function readCodexConfigSummary(configPath) {
100967
101005
  async function readLinkedBins(binDir) {
100968
101006
  const linked = [];
100969
101007
  for (const name of CODEX_BIN_NAMES) {
100970
- if (await pathExists2(join79(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
101008
+ if (await pathExists2(join80(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
100971
101009
  linked.push(name);
100972
101010
  }
100973
101011
  return linked;
100974
101012
  }
100975
101013
  async function readLinkedAgents(codexHome) {
100976
- const agentsDir = join79(codexHome, "agents");
101014
+ const agentsDir = join80(codexHome, "agents");
100977
101015
  if (!existsSync59(agentsDir))
100978
101016
  return [];
100979
101017
  const entries = await readdir10(agentsDir, { withFileTypes: true });
@@ -100981,7 +101019,7 @@ async function readLinkedAgents(codexHome) {
100981
101019
  }
100982
101020
  async function readJson(path16) {
100983
101021
  try {
100984
- const parsed = JSON.parse(await readFile22(path16, "utf8"));
101022
+ const parsed = JSON.parse(await readFile23(path16, "utf8"));
100985
101023
  return isPlainRecord(parsed) ? parsed : null;
100986
101024
  } catch (error51) {
100987
101025
  if (error51 instanceof Error)
@@ -101087,9 +101125,9 @@ async function pathExists2(path16) {
101087
101125
 
101088
101126
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
101089
101127
  init_src();
101090
- import { readdir as readdir11, readFile as readFile23, stat as stat6 } from "node:fs/promises";
101128
+ import { readdir as readdir11, readFile as readFile24, stat as stat6 } from "node:fs/promises";
101091
101129
  import { homedir as homedir23 } from "node:os";
101092
- import { dirname as dirname31, isAbsolute as isAbsolute12, join as join80, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
101130
+ import { dirname as dirname31, isAbsolute as isAbsolute12, join as join81, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
101093
101131
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
101094
101132
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
101095
101133
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -101099,7 +101137,7 @@ async function checkCodexComponents(deps = {}) {
101099
101137
  const env3 = deps.env ?? process.env;
101100
101138
  const platform = deps.platform ?? process.platform;
101101
101139
  const arch = deps.arch ?? process.arch;
101102
- const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join80(homedir23(), ".codex"));
101140
+ const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join81(homedir23(), ".codex"));
101103
101141
  const summary = await gatherCodexSummary({ ...deps, codexHome });
101104
101142
  if (summary.pluginRoot === null) {
101105
101143
  return {
@@ -101124,7 +101162,7 @@ async function checkCodexComponents(deps = {}) {
101124
101162
  });
101125
101163
  }
101126
101164
  const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
101127
- const runtimeSgPath = join80(runtimeSgDir, sgBinaryName(platform));
101165
+ const runtimeSgPath = join81(runtimeSgDir, sgBinaryName(platform));
101128
101166
  const sg = findSgBinarySync({
101129
101167
  arch,
101130
101168
  env: env3,
@@ -101236,7 +101274,7 @@ async function findManifestPaths(root, manifestName) {
101236
101274
  for (const entry of entries) {
101237
101275
  if (entry.name === "node_modules" || entry.name === ".git")
101238
101276
  continue;
101239
- const entryPath = join80(root, entry.name);
101277
+ const entryPath = join81(root, entry.name);
101240
101278
  if (entry.isDirectory()) {
101241
101279
  paths2.push(...await findManifestPaths(entryPath, manifestName));
101242
101280
  continue;
@@ -101280,18 +101318,18 @@ function isPluginRuntimePathArg(arg) {
101280
101318
  return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
101281
101319
  }
101282
101320
  function runtimeSgDirectory(codexHome, platform, arch) {
101283
- return join80(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
101321
+ return join81(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
101284
101322
  }
101285
101323
  function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
101286
101324
  const override = env3[SG_PATH_ENV_KEY]?.trim();
101287
101325
  if (override !== undefined && override.length > 0 && sgPath === override)
101288
101326
  return `env override ${SG_PATH_ENV_KEY}`;
101289
- if (sgPath === join80(runtimeSgDir, sgBinaryName(platform)))
101327
+ if (sgPath === join81(runtimeSgDir, sgBinaryName(platform)))
101290
101328
  return "runtime dir";
101291
101329
  return "PATH";
101292
101330
  }
101293
101331
  async function readBootstrapStateSummary(codexHome) {
101294
- const statePath = join80(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
101332
+ const statePath = join81(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
101295
101333
  const raw = await readJson2(statePath);
101296
101334
  if (raw === null)
101297
101335
  return null;
@@ -101340,7 +101378,7 @@ function degradedDetailLines(entries) {
101340
101378
  }
101341
101379
  async function readJson2(path16) {
101342
101380
  try {
101343
- const parsed = JSON.parse(await readFile23(path16, "utf8"));
101381
+ const parsed = JSON.parse(await readFile24(path16, "utf8"));
101344
101382
  return isRecord5(parsed) ? parsed : null;
101345
101383
  } catch (error51) {
101346
101384
  if (error51 instanceof Error)
@@ -101368,17 +101406,17 @@ function isRecord5(value) {
101368
101406
 
101369
101407
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
101370
101408
  import { existsSync as existsSync60 } from "node:fs";
101371
- import { readFile as readFile24 } from "node:fs/promises";
101409
+ import { readFile as readFile25 } from "node:fs/promises";
101372
101410
  import { homedir as homedir24 } from "node:os";
101373
- import { join as join81, resolve as resolve24 } from "node:path";
101411
+ import { join as join82, resolve as resolve24 } from "node:path";
101374
101412
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
101375
101413
  var CHECK_NAME = "codex-runtime-wrapper";
101376
101414
  var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
101377
101415
  async function checkCodexRuntimeWrapper(deps = {}) {
101378
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join81(homedir24(), ".codex"));
101416
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir24(), ".codex"));
101379
101417
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
101380
101418
  const platform = deps.platform ?? process.platform;
101381
- const wrapperPath = join81(binDir, platform === "win32" ? "omo.cmd" : "omo");
101419
+ const wrapperPath = join82(binDir, platform === "win32" ? "omo.cmd" : "omo");
101382
101420
  const wrapper = await readRuntimeWrapper(wrapperPath);
101383
101421
  const issues = [];
101384
101422
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
@@ -101403,7 +101441,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
101403
101441
  }
101404
101442
  async function readRuntimeWrapper(path16) {
101405
101443
  try {
101406
- return await readFile24(path16, "utf8");
101444
+ return await readFile25(path16, "utf8");
101407
101445
  } catch (error51) {
101408
101446
  if (error51 instanceof Error)
101409
101447
  return null;
@@ -101890,12 +101928,12 @@ import {
101890
101928
  unlinkSync as unlinkSync8,
101891
101929
  writeFileSync as writeFileSync11
101892
101930
  } from "node:fs";
101893
- import { basename as basename14, dirname as dirname32, join as join84 } from "node:path";
101931
+ import { basename as basename14, dirname as dirname32, join as join85 } from "node:path";
101894
101932
 
101895
101933
  // packages/mcp-client-core/src/config-dir.ts
101896
101934
  import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
101897
101935
  import { homedir as homedir25 } from "node:os";
101898
- import { join as join82, resolve as resolve25 } from "node:path";
101936
+ import { join as join83, resolve as resolve25 } from "node:path";
101899
101937
  function resolveConfigPath2(pathValue) {
101900
101938
  const resolvedPath = resolve25(pathValue);
101901
101939
  if (!existsSync61(resolvedPath))
@@ -101913,13 +101951,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
101913
101951
  if (customConfigDir) {
101914
101952
  return resolveConfigPath2(customConfigDir);
101915
101953
  }
101916
- const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join82(homedir25(), ".config");
101917
- return resolveConfigPath2(join82(xdgConfigDir, "opencode"));
101954
+ const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join83(homedir25(), ".config");
101955
+ return resolveConfigPath2(join83(xdgConfigDir, "opencode"));
101918
101956
  }
101919
101957
 
101920
101958
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
101921
101959
  import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
101922
- import { join as join83 } from "node:path";
101960
+ import { join as join84 } from "node:path";
101923
101961
  var INDEX_FILE_NAME = "index.json";
101924
101962
  function isTokenIndex(value) {
101925
101963
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -101927,7 +101965,7 @@ function isTokenIndex(value) {
101927
101965
  return Object.values(value).every((entry) => typeof entry === "string");
101928
101966
  }
101929
101967
  function getIndexPath(storageDir) {
101930
- return join83(storageDir, INDEX_FILE_NAME);
101968
+ return join84(storageDir, INDEX_FILE_NAME);
101931
101969
  }
101932
101970
  function readTokenIndex(storageDir) {
101933
101971
  const indexPath = getIndexPath(storageDir);
@@ -101971,16 +102009,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
101971
102009
  var STORAGE_DIR_NAME = "mcp-oauth";
101972
102010
  var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
101973
102011
  function getMcpOauthStorageDir() {
101974
- return join84(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
102012
+ return join85(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
101975
102013
  }
101976
102014
  function getMcpOauthServerHash(serverHost, resource) {
101977
102015
  return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
101978
102016
  }
101979
102017
  function getMcpOauthStoragePath(serverHost, resource) {
101980
- return join84(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
102018
+ return join85(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
101981
102019
  }
101982
102020
  function getLegacyStoragePath() {
101983
- return join84(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
102021
+ return join85(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
101984
102022
  }
101985
102023
  function normalizeHost2(serverHost) {
101986
102024
  let host = serverHost.trim();
@@ -102159,7 +102197,7 @@ function listTokensByHost(serverHost) {
102159
102197
  for (const [hash2, indexedKey] of Object.entries(index)) {
102160
102198
  if (!indexedKey.startsWith(prefix))
102161
102199
  continue;
102162
- const indexedToken = readTokenFile(join84(getMcpOauthStorageDir(), `${hash2}.json`));
102200
+ const indexedToken = readTokenFile(join85(getMcpOauthStorageDir(), `${hash2}.json`));
102163
102201
  if (indexedToken)
102164
102202
  result[indexedKey] = indexedToken;
102165
102203
  }
@@ -102174,7 +102212,7 @@ function listAllTokens() {
102174
102212
  for (const entry of readdirSync9(dir, { withFileTypes: true })) {
102175
102213
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
102176
102214
  continue;
102177
- const token = readTokenFile(join84(dir, entry.name));
102215
+ const token = readTokenFile(join85(dir, entry.name));
102178
102216
  const hash2 = basename14(entry.name, ".json");
102179
102217
  if (token)
102180
102218
  result[index[hash2] ?? hash2] = token;
@@ -102898,8 +102936,9 @@ async function boulder(options) {
102898
102936
  }
102899
102937
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
102900
102938
  import { spawn as spawn5 } from "node:child_process";
102901
- import { existsSync as existsSync65, realpathSync as realpathSync9 } from "node:fs";
102939
+ import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync9 } from "node:fs";
102902
102940
  import { homedir as homedir26 } from "node:os";
102941
+ var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
102903
102942
  function resolveCodexUlwLoopCommand(input = {}) {
102904
102943
  const env3 = input.env ?? process.env;
102905
102944
  const homeDir = input.homeDir ?? homedir26();
@@ -102912,6 +102951,8 @@ function resolveCodexUlwLoopCommand(input = {}) {
102912
102951
  });
102913
102952
  if (componentCli !== null)
102914
102953
  return { executable: process.execPath, argsPrefix: [componentCli] };
102954
+ if (env3[ULW_LOOP_DELEGATION_SENTINEL] === "1")
102955
+ return null;
102915
102956
  const legacyLocalBin = resolveLegacyLocalOmoBin(env3, homeDir, input.currentExecutablePaths ?? [process.argv[1]].filter((value) => typeof value === "string"));
102916
102957
  if (legacyLocalBin !== null)
102917
102958
  return { executable: legacyLocalBin, argsPrefix: ["ulw-loop"] };
@@ -102923,14 +102964,17 @@ async function codexUlwLoop(args) {
102923
102964
  console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
102924
102965
  return 1;
102925
102966
  }
102926
- return new Promise((resolve26) => {
102927
- const child = spawn5(command.executable, [...command.argsPrefix, ...args], { stdio: "inherit" });
102928
- child.on("error", (error51) => {
102929
- console.error(error51.message);
102930
- resolve26(1);
102931
- });
102932
- child.on("close", (code) => resolve26(code ?? 1));
102967
+ const { promise: promise2, resolve: resolve26 } = Promise.withResolvers();
102968
+ const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
102969
+ stdio: "inherit",
102970
+ env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
102971
+ });
102972
+ child.on("error", (error51) => {
102973
+ console.error(error51.message);
102974
+ resolve26(1);
102933
102975
  });
102976
+ child.on("close", (code) => resolve26(code ?? 1));
102977
+ return promise2;
102934
102978
  }
102935
102979
  function resolveLocalUlwLoopBin(env3, homeDir) {
102936
102980
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
@@ -102938,7 +102982,16 @@ function resolveLocalUlwLoopBin(env3, homeDir) {
102938
102982
  }
102939
102983
  function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
102940
102984
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
102941
- return candidates.find((candidate) => existsSync65(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths)) ?? null;
102985
+ return candidates.find((candidate) => existsSync65(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate)) ?? null;
102986
+ }
102987
+ function isGeneratedRuntimeWrapper(candidate) {
102988
+ try {
102989
+ return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
102990
+ } catch (error51) {
102991
+ if (error51 instanceof Error)
102992
+ return false;
102993
+ return false;
102994
+ }
102942
102995
  }
102943
102996
  function isCurrentExecutable(candidate, currentExecutablePaths) {
102944
102997
  const candidateRealPath = realpathOrSelf(candidate);