oh-my-opencode 5.0.0-beta.1 → 5.0.0-beta.11

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 (202) hide show
  1. package/.agents/command/publish.md +44 -16
  2. package/.agents/skills/publish/SKILL.md +44 -16
  3. package/.agents/skills/work-with-pr/SKILL.md +37 -23
  4. package/.opencode/command/publish.md +44 -16
  5. package/.opencode/skills/work-with-pr/SKILL.md +37 -23
  6. package/README.md +12 -1
  7. package/dist/agents/atlas/agent.d.ts +0 -1
  8. package/dist/agents/sisyphus/grok-4.d.ts +20 -0
  9. package/dist/agents/sisyphus/index.d.ts +2 -0
  10. package/dist/agents/sisyphus-agent-config.d.ts +6 -0
  11. package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
  12. package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
  13. package/dist/agents/types.d.ts +2 -2
  14. package/dist/cli/index.js +805 -534
  15. package/dist/cli/run/on-complete-hook.d.ts +2 -0
  16. package/dist/cli-node/index.js +805 -534
  17. package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
  18. package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
  19. package/dist/index.js +1566 -1217
  20. package/dist/shared/normalize-sdk-response.d.ts +1 -0
  21. package/dist/shared/shell-env.d.ts +1 -1
  22. package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
  23. package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  24. package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
  25. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  26. package/dist/skills/frontend/SKILL.md +10 -7
  27. package/dist/skills/frontend/references/design/_INDEX.md +1 -0
  28. package/dist/skills/frontend/references/design/stylegallery.md +80 -0
  29. package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  30. package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  31. package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
  32. package/dist/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
  33. package/dist/skills/ulw-plan/SKILL.md +2 -2
  34. package/dist/skills/ulw-plan/references/full-workflow.md +27 -3
  35. package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
  36. package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
  37. package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
  38. package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
  39. package/dist/tools/delegate-task/tool-description.d.ts +3 -1
  40. package/dist/tui.js +184 -83
  41. package/package.json +21 -19
  42. package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
  43. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
  44. package/packages/lsp-core/src/lsp/client-wrapper-outside-cwd.test.ts +78 -0
  45. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +66 -13
  46. package/packages/lsp-core/src/lsp/client-wrapper.ts +70 -18
  47. package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
  48. package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
  49. package/packages/lsp-core/src/lsp/workspace-markers.ts +1 -0
  50. package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
  51. package/packages/lsp-core/src/tools/navigation.ts +4 -2
  52. package/packages/lsp-core/src/tools/rename.ts +4 -2
  53. package/packages/lsp-core/src/tools/symbols.ts +1 -1
  54. package/packages/lsp-daemon/dist/cli.js +160 -71
  55. package/packages/lsp-daemon/dist/client.js +135 -46
  56. package/packages/lsp-daemon/dist/index.js +143 -54
  57. package/packages/lsp-tools-mcp/dist/cli.js +131 -42
  58. package/packages/lsp-tools-mcp/dist/mcp.js +131 -42
  59. package/packages/lsp-tools-mcp/dist/tools.js +131 -42
  60. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  61. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  62. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  63. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +118 -8
  64. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +118 -8
  65. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  66. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  67. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  68. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  69. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  70. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  71. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  72. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
  73. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  74. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +147 -64
  75. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  76. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  77. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  78. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  79. package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
  80. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
  81. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
  82. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
  83. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
  84. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
  85. package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
  86. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
  87. package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
  88. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
  89. package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +3 -2
  90. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  91. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  92. package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +0 -3
  93. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +2 -16
  94. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  95. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  96. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
  97. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +24 -12
  98. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
  99. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  100. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  101. package/packages/omo-codex/plugin/components/ultrawork/directive.md +6 -0
  102. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  103. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  104. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +6 -0
  105. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +2 -2
  106. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +27 -3
  107. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
  108. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
  109. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
  110. package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
  111. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +6 -0
  112. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  113. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  114. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +3 -2
  115. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
  116. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
  117. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
  118. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
  119. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
  120. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +2 -35
  121. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
  122. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  123. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  124. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  125. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  126. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  127. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  128. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  129. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  130. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  131. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  132. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  133. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  134. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  135. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  136. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  137. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  138. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  139. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  140. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  141. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  142. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  143. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  144. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  145. package/packages/omo-codex/plugin/package-lock.json +20 -20
  146. package/packages/omo-codex/plugin/package.json +1 -1
  147. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
  148. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  149. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
  150. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  151. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +10 -7
  152. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
  153. package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
  154. package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  155. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  156. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
  157. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
  158. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +6 -0
  159. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
  160. package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
  161. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
  162. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +2 -2
  163. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +27 -3
  164. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
  165. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
  166. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
  167. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
  168. package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
  169. package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
  170. package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
  171. package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
  172. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
  173. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
  174. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
  175. package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
  176. package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
  177. package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
  178. package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
  179. package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
  180. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
  181. package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
  182. package/packages/omo-codex/scripts/install-dist/install-local.mjs +57 -19
  183. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
  184. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
  185. package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  186. package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
  187. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  188. package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
  189. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
  190. package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
  191. package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  192. package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  193. package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
  194. package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
  195. package/packages/shared-skills/skills/ulw-plan/SKILL.md +2 -2
  196. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +27 -3
  197. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
  198. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
  199. package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
  200. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
  201. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
  202. package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
@@ -1020,7 +1020,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1020
1020
  this._exitCallback = (err) => {
1021
1021
  if (err.code !== "commander.executeSubCommandAsync") {
1022
1022
  throw err;
1023
- } else {}
1023
+ }
1024
1024
  };
1025
1025
  }
1026
1026
  return this;
@@ -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: "5.0.0-beta.1",
2149
+ version: "5.0.0-beta.11",
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",
@@ -2282,6 +2282,7 @@ var init_package = __esm(() => {
2282
2282
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
2283
2283
  test: "bun test",
2284
2284
  "test:codex": "bun run build:codex-install && bun run build:git-bash-mcp && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && npm --prefix packages/lsp-tools-mcp test && npm --prefix packages/omo-codex/plugin ci && npm --prefix packages/omo-codex/plugin/components/ulw-loop test && bun run --cwd packages/omo-codex/plugin build && npm --prefix packages/omo-codex/plugin/components/codegraph run typecheck && npm --prefix packages/omo-codex/plugin/components/codegraph test && node scripts/check-third-party-notices.mjs --ship && bun test packages/omo-opencode/src/cli/cli-installer.platform.test.ts packages/omo-codex/src/install/codex-cache.test.ts packages/omo-codex/src/install/codex-cleanup.test.ts packages/omo-codex/src/install/codex-config-agent-cleanup.test.ts packages/omo-codex/src/install/codex-config-autonomous-features.test.ts packages/omo-codex/src/install/codex-config-reasoning.test.ts packages/omo-codex/src/install/codex-config-toml.test.ts packages/omo-codex/src/install/codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex.test.ts packages/omo-codex/src/install/install-codex-packaged.test.ts packages/omo-codex/src/install/link-cached-plugin-agents.test.ts packages/omo-codex/src/**/*.test.ts packages/utils/src/jsonc-parser.test.ts packages/utils/src/frontmatter.test.ts packages/hashline-core/src/hash-computation.test.ts packages/hashline-core/src/smoke-untested-modules.test.ts packages/rules-engine/src/index.test.ts packages/rules-engine/src/security-boundary.test.ts packages/agents-md-core/src/injector.test.ts packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts && node --test packages/omo-codex/plugin/test/*.test.mjs packages/omo-codex/scripts/install-cache-copy.test.mjs packages/omo-codex/scripts/install-cli-args.test.mjs packages/omo-codex/scripts/install-delegated-command.test.mjs packages/omo-codex/scripts/install-config-autonomous-features.test.mjs packages/omo-codex/scripts/install-config-autonomous.test.mjs packages/omo-codex/scripts/install-config-reasoning.test.mjs packages/omo-codex/scripts/install-config.test.mjs packages/omo-codex/scripts/install-hook-targets.test.mjs packages/omo-codex/scripts/install-project-local-cleanup.test.mjs packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs packages/omo-codex/scripts/install-local-entrypoint.test.mjs packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs packages/omo-codex/scripts/install-local.test.mjs packages/omo-codex/scripts/install-marketplace-cache.test.mjs packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs packages/omo-codex/scripts/install-mcp-runtime.test.mjs packages/omo-codex/scripts/install-packaged-local.test.mjs packages/omo-codex/scripts/install-generated-bundle.test.mjs packages/omo-codex/scripts/install-agent-links.test.mjs packages/omo-codex/scripts/install-bin-links.test.mjs",
2285
+ "test:fast": "bun run script/test-fast.ts",
2285
2286
  "test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
2286
2287
  "test:windows-codex": "bun run test:codex",
2287
2288
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
@@ -2326,7 +2327,7 @@ var init_package = __esm(() => {
2326
2327
  zod: "^4.4.3"
2327
2328
  },
2328
2329
  devDependencies: {
2329
- "@code-yeongyu/senpi": "2026.8.9-2",
2330
+ "@code-yeongyu/senpi": "2026.8.18-3",
2330
2331
  "@oh-my-opencode/agents-md-core": "workspace:*",
2331
2332
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
2332
2333
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -2342,6 +2343,7 @@ var init_package = __esm(() => {
2342
2343
  "@oh-my-opencode/model-core": "workspace:*",
2343
2344
  "@oh-my-opencode/omo-codex": "workspace:*",
2344
2345
  "@oh-my-opencode/omo-config-core": "workspace:*",
2346
+ "@oh-my-opencode/omo-opencode": "workspace:*",
2345
2347
  "@oh-my-opencode/omo-senpi": "workspace:*",
2346
2348
  "@oh-my-opencode/openclaw-core": "workspace:*",
2347
2349
  "@oh-my-opencode/pi-goal": "workspace:*",
@@ -2357,7 +2359,7 @@ var init_package = __esm(() => {
2357
2359
  "@oh-my-opencode/utils": "workspace:*",
2358
2360
  "@types/js-yaml": "^4.0.9",
2359
2361
  "@types/picomatch": "^4.0.3",
2360
- "@typescript/native-preview": "7.0.0-dev.20260518.1",
2362
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
2361
2363
  "@xterm/addon-unicode11": "^0.9.0",
2362
2364
  "@xterm/xterm": "^6.0.0",
2363
2365
  "bun-types": "1.3.14",
@@ -2366,24 +2368,24 @@ var init_package = __esm(() => {
2366
2368
  typescript: "^7.0.2"
2367
2369
  },
2368
2370
  optionalDependencies: {
2369
- "oh-my-opencode-darwin-arm64": "5.0.0-beta.1",
2370
- "oh-my-opencode-darwin-x64": "5.0.0-beta.1",
2371
- "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.1",
2372
- "oh-my-opencode-linux-arm64": "5.0.0-beta.1",
2373
- "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.1",
2374
- "oh-my-opencode-linux-x64": "5.0.0-beta.1",
2375
- "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.1",
2376
- "oh-my-opencode-linux-x64-musl": "5.0.0-beta.1",
2377
- "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.1",
2378
- "oh-my-opencode-windows-arm64": "5.0.0-beta.1",
2379
- "oh-my-opencode-windows-x64": "5.0.0-beta.1",
2380
- "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.1"
2371
+ "oh-my-opencode-darwin-arm64": "5.0.0-beta.11",
2372
+ "oh-my-opencode-darwin-x64": "5.0.0-beta.11",
2373
+ "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.11",
2374
+ "oh-my-opencode-linux-arm64": "5.0.0-beta.11",
2375
+ "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.11",
2376
+ "oh-my-opencode-linux-x64": "5.0.0-beta.11",
2377
+ "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.11",
2378
+ "oh-my-opencode-linux-x64-musl": "5.0.0-beta.11",
2379
+ "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.11",
2380
+ "oh-my-opencode-windows-arm64": "5.0.0-beta.11",
2381
+ "oh-my-opencode-windows-x64": "5.0.0-beta.11",
2382
+ "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.11"
2381
2383
  },
2382
2384
  overrides: {
2383
- "@earendil-works/pi-agent-core": "0.80.3",
2384
- "@earendil-works/pi-ai": "0.80.3",
2385
- "@earendil-works/pi-coding-agent": "0.80.3",
2386
- "@earendil-works/pi-tui": "0.80.3",
2385
+ "@earendil-works/pi-agent-core": "0.84.2",
2386
+ "@earendil-works/pi-ai": "0.84.2",
2387
+ "@earendil-works/pi-coding-agent": "0.84.2",
2388
+ "@earendil-works/pi-tui": "0.84.2",
2387
2389
  hono: "^4.12.18",
2388
2390
  "@hono/node-server": "^1.19.13",
2389
2391
  "express-rate-limit": "^8.5.1",
@@ -18762,7 +18764,7 @@ function finalize(ctx, schema) {
18762
18764
  result.$schema = "http://json-schema.org/draft-07/schema#";
18763
18765
  } else if (ctx.target === "draft-04") {
18764
18766
  result.$schema = "http://json-schema.org/draft-04/schema#";
18765
- } else if (ctx.target === "openapi-3.0") {} else {}
18767
+ } else if (ctx.target === "openapi-3.0") {}
18766
18768
  if (ctx.external?.uri) {
18767
18769
  const id = ctx.external.registry.get(schema)?.id;
18768
18770
  if (!id)
@@ -19023,7 +19025,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
19023
19025
  if (val === undefined) {
19024
19026
  if (ctx.unrepresentable === "throw") {
19025
19027
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
19026
- } else {}
19028
+ }
19027
19029
  } else if (typeof val === "bigint") {
19028
19030
  if (ctx.unrepresentable === "throw") {
19029
19031
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -22405,15 +22407,16 @@ var init_codegraph = __esm(() => {
22405
22407
  });
22406
22408
 
22407
22409
  // packages/omo-config-core/src/schema/memory.ts
22408
- var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
22410
+ var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryNudgeSchema, OmoMemoryFactsSchema, OmoMemoryDreamSchema, OmoMemoryPeopleSchema, OmoMemorySoulSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryNudgeLayerSchema, OmoMemoryFactsLayerSchema, OmoMemoryDreamLayerSchema, OmoMemoryPeopleLayerSchema, OmoMemorySoulLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
22409
22411
  var init_memory = __esm(() => {
22410
22412
  init_zod();
22411
22413
  OmoMemoryReflectionTriggerSchema = object({
22412
- step_count: number2().int().nonnegative().default(0),
22414
+ step_count: number2().int().nonnegative().default(25),
22413
22415
  on_compaction: boolean2().default(true)
22414
22416
  }).strict();
22415
22417
  OmoMemoryReflectionSchema = object({
22416
- trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 0, on_compaction: true }),
22418
+ enabled: boolean2().default(true),
22419
+ trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 25, on_compaction: true }),
22417
22420
  merge: _enum2(["auto", "integration"]).default("auto"),
22418
22421
  category: string2().min(1).default("quick"),
22419
22422
  timeout_minutes: number2().int().positive().default(15),
@@ -22426,11 +22429,36 @@ var init_memory = __esm(() => {
22426
22429
  OmoMemorySearchSchema = object({
22427
22430
  enabled: boolean2().default(true)
22428
22431
  }).strict();
22432
+ OmoMemoryNudgeSchema = object({
22433
+ enabled: boolean2().default(true),
22434
+ every_user_turns: number2().int().min(1).default(10)
22435
+ }).strict();
22436
+ OmoMemoryFactsSchema = object({
22437
+ enabled: boolean2().default(true),
22438
+ debounce_settles: number2().int().min(1).default(4)
22439
+ }).strict();
22440
+ OmoMemoryDreamSchema = object({
22441
+ enabled: boolean2().default(true),
22442
+ idle_minutes: number2().int().min(0).default(30),
22443
+ min_hours_between: number2().int().min(1).default(24),
22444
+ shutdown_launch: boolean2().default(true),
22445
+ auto_select_max: number2().int().min(1).max(10).default(5),
22446
+ auto_select_max_chars: number2().int().min(1e4).default(150000)
22447
+ }).strict();
22448
+ OmoMemoryPeopleSchema = object({
22449
+ enabled: boolean2().default(true),
22450
+ max_entries: number2().int().min(1).max(100).default(40),
22451
+ max_entry_chars: number2().int().min(50).max(500).default(200)
22452
+ }).strict();
22453
+ OmoMemorySoulSchema = object({
22454
+ edit_notice: boolean2().default(true)
22455
+ }).strict();
22429
22456
  OmoMemoryReflectionTriggerLayerSchema = object({
22430
22457
  step_count: number2().int().nonnegative().optional(),
22431
22458
  on_compaction: boolean2().optional()
22432
22459
  }).strict();
22433
22460
  OmoMemoryReflectionLayerSchema = object({
22461
+ enabled: boolean2().optional(),
22434
22462
  trigger: OmoMemoryReflectionTriggerLayerSchema.optional(),
22435
22463
  merge: _enum2(["auto", "integration"]).optional(),
22436
22464
  category: string2().min(1).optional(),
@@ -22444,10 +22472,39 @@ var init_memory = __esm(() => {
22444
22472
  OmoMemorySearchLayerSchema = object({
22445
22473
  enabled: boolean2().optional()
22446
22474
  }).strict();
22475
+ OmoMemoryNudgeLayerSchema = object({
22476
+ enabled: boolean2().optional(),
22477
+ every_user_turns: number2().int().min(1).optional()
22478
+ }).strict();
22479
+ OmoMemoryFactsLayerSchema = object({
22480
+ enabled: boolean2().optional(),
22481
+ debounce_settles: number2().int().min(1).optional()
22482
+ }).strict();
22483
+ OmoMemoryDreamLayerSchema = object({
22484
+ enabled: boolean2().optional(),
22485
+ idle_minutes: number2().int().min(0).optional(),
22486
+ min_hours_between: number2().int().min(1).optional(),
22487
+ shutdown_launch: boolean2().optional(),
22488
+ auto_select_max: number2().int().min(1).max(10).optional(),
22489
+ auto_select_max_chars: number2().int().min(1e4).optional()
22490
+ }).strict();
22491
+ OmoMemoryPeopleLayerSchema = object({
22492
+ enabled: boolean2().optional(),
22493
+ max_entries: number2().int().min(1).max(100).optional(),
22494
+ max_entry_chars: number2().int().min(50).max(500).optional()
22495
+ }).strict();
22496
+ OmoMemorySoulLayerSchema = object({
22497
+ edit_notice: boolean2().optional()
22498
+ }).strict();
22447
22499
  OmoMemoryAgentOverridesSchema = object({
22448
22500
  enabled: boolean2().optional(),
22449
22501
  agent: string2().min(1).optional(),
22450
22502
  reflection: OmoMemoryReflectionLayerSchema.optional(),
22503
+ nudge: OmoMemoryNudgeLayerSchema.optional(),
22504
+ facts: OmoMemoryFactsLayerSchema.optional(),
22505
+ dream: OmoMemoryDreamLayerSchema.optional(),
22506
+ people: OmoMemoryPeopleLayerSchema.optional(),
22507
+ soul: OmoMemorySoulLayerSchema.optional(),
22451
22508
  sync: OmoMemorySyncLayerSchema.optional(),
22452
22509
  search: OmoMemorySearchLayerSchema.optional(),
22453
22510
  compile_warn_tokens: number2().int().positive().optional()
@@ -22455,13 +22512,27 @@ var init_memory = __esm(() => {
22455
22512
  OmoMemorySettingsSchema = object({
22456
22513
  enabled: boolean2().default(true),
22457
22514
  agent: string2().min(1).default("auto"),
22515
+ tool_exposure: _enum2(["direct", "search"]).default("direct"),
22458
22516
  reflection: OmoMemoryReflectionSchema.default({
22459
- trigger: { step_count: 0, on_compaction: true },
22517
+ enabled: true,
22518
+ trigger: { step_count: 25, on_compaction: true },
22460
22519
  merge: "auto",
22461
22520
  category: "quick",
22462
22521
  timeout_minutes: 15,
22463
22522
  sandbox: "auto"
22464
22523
  }),
22524
+ nudge: OmoMemoryNudgeSchema.default({ enabled: true, every_user_turns: 10 }),
22525
+ facts: OmoMemoryFactsSchema.default({ enabled: true, debounce_settles: 4 }),
22526
+ dream: OmoMemoryDreamSchema.default({
22527
+ enabled: true,
22528
+ idle_minutes: 30,
22529
+ min_hours_between: 24,
22530
+ shutdown_launch: true,
22531
+ auto_select_max: 5,
22532
+ auto_select_max_chars: 150000
22533
+ }),
22534
+ people: OmoMemoryPeopleSchema.default({ enabled: true, max_entries: 40, max_entry_chars: 200 }),
22535
+ soul: OmoMemorySoulSchema.default({ edit_notice: true }),
22465
22536
  sync: OmoMemorySyncSchema.default({ enabled: true }),
22466
22537
  search: OmoMemorySearchSchema.default({ enabled: true }),
22467
22538
  compile_warn_tokens: number2().int().positive().default(30000),
@@ -22470,7 +22541,13 @@ var init_memory = __esm(() => {
22470
22541
  OmoMemorySettingsLayerSchema = object({
22471
22542
  enabled: boolean2().optional(),
22472
22543
  agent: string2().min(1).optional(),
22544
+ tool_exposure: _enum2(["direct", "search"]).optional(),
22473
22545
  reflection: OmoMemoryReflectionLayerSchema.optional(),
22546
+ nudge: OmoMemoryNudgeLayerSchema.optional(),
22547
+ facts: OmoMemoryFactsLayerSchema.optional(),
22548
+ dream: OmoMemoryDreamLayerSchema.optional(),
22549
+ people: OmoMemoryPeopleLayerSchema.optional(),
22550
+ soul: OmoMemorySoulLayerSchema.optional(),
22474
22551
  sync: OmoMemorySyncLayerSchema.optional(),
22475
22552
  search: OmoMemorySearchLayerSchema.optional(),
22476
22553
  compile_warn_tokens: number2().int().positive().optional(),
@@ -22509,7 +22586,7 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
22509
22586
  residency_max_children: record2["residency_max_children"] ?? Math.max(8, resolveParallelism() * 3)
22510
22587
  });
22511
22588
  }
22512
- var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskSettingsSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
22589
+ var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
22513
22590
  var init_task = __esm(() => {
22514
22591
  init_zod();
22515
22592
  ResidencyMaxChildrenInputSchema = union([number2().int().positive(), literal("unlimited")]);
@@ -22526,6 +22603,16 @@ var init_task = __esm(() => {
22526
22603
  OmoTaskWarningsSchema = object({
22527
22604
  unavailable_categories: boolean2().default(true)
22528
22605
  }).strict();
22606
+ OmoTaskDagSettingsSchema = object({
22607
+ max_nodes_per_run: number2().int().positive().default(64),
22608
+ max_runs_per_session: number2().int().positive().default(16),
22609
+ subscriber_ring: number2().int().positive().default(1000),
22610
+ heartbeat_ms: number2().int().positive().default(15000),
22611
+ history_default_limit: number2().int().positive().default(256),
22612
+ history_max_limit: number2().int().positive().default(1000),
22613
+ retention_days: number2().int().positive().default(7),
22614
+ max_prompt_bytes: number2().int().positive().default(262144)
22615
+ }).strict();
22529
22616
  OmoTaskSettingsSchema = object({
22530
22617
  default_execution_mode: _enum2(["in-process", "process"]).default("in-process"),
22531
22618
  default_concurrency: number2().int().positive().default(5),
@@ -22543,7 +22630,18 @@ var init_task = __esm(() => {
22543
22630
  max_members: 8,
22544
22631
  max_parallel_members: 4,
22545
22632
  max_wall_clock_minutes: 120
22546
- })
22633
+ }),
22634
+ dag: OmoTaskDagSettingsSchema.optional()
22635
+ }).strict();
22636
+ OmoTaskDagSettingsLayerSchema = object({
22637
+ max_nodes_per_run: number2().int().positive().optional(),
22638
+ max_runs_per_session: number2().int().positive().optional(),
22639
+ subscriber_ring: number2().int().positive().optional(),
22640
+ heartbeat_ms: number2().int().positive().optional(),
22641
+ history_default_limit: number2().int().positive().optional(),
22642
+ history_max_limit: number2().int().positive().optional(),
22643
+ retention_days: number2().int().positive().optional(),
22644
+ max_prompt_bytes: number2().int().positive().optional()
22547
22645
  }).strict();
22548
22646
  OmoTaskWaitLayerSchema = object({
22549
22647
  min_ms: number2().int().positive().optional(),
@@ -22571,7 +22669,8 @@ var init_task = __esm(() => {
22571
22669
  resume_children: boolean2().optional(),
22572
22670
  warnings: OmoTaskWarningsLayerSchema.optional(),
22573
22671
  wait: OmoTaskWaitLayerSchema.optional(),
22574
- team: OmoTaskTeamSettingsLayerSchema.optional()
22672
+ team: OmoTaskTeamSettingsLayerSchema.optional(),
22673
+ dag: OmoTaskDagSettingsLayerSchema.optional()
22575
22674
  }).strict();
22576
22675
  });
22577
22676
 
@@ -22626,6 +22725,19 @@ var init_team = __esm(() => {
22626
22725
  OmoTeamsConfigLayerSchema = record(string2(), OmoTeamSpecLayerSchema);
22627
22726
  });
22628
22727
 
22728
+ // packages/omo-config-core/src/schema/telemetry.ts
22729
+ var OmoTelemetrySettingsShape, OmoTelemetrySettingsLayerSchema, OmoTelemetrySettingsSchema;
22730
+ var init_telemetry = __esm(() => {
22731
+ init_zod();
22732
+ OmoTelemetrySettingsShape = {
22733
+ enabled: boolean2()
22734
+ };
22735
+ OmoTelemetrySettingsLayerSchema = object(OmoTelemetrySettingsShape).partial().strict();
22736
+ OmoTelemetrySettingsSchema = OmoTelemetrySettingsLayerSchema.extend({
22737
+ enabled: boolean2().default(true)
22738
+ }).strict();
22739
+ });
22740
+
22629
22741
  // packages/omo-config-core/src/schema/config.ts
22630
22742
  var OmoOpenCodeHarnessConfigSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
22631
22743
  var init_config = __esm(() => {
@@ -22637,6 +22749,7 @@ var init_config = __esm(() => {
22637
22749
  init_model_catalog();
22638
22750
  init_task();
22639
22751
  init_team();
22752
+ init_telemetry();
22640
22753
  OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
22641
22754
  OmoTypedHarnessConfigSchema = object({
22642
22755
  categories: OmoCategoriesConfigSchema.optional(),
@@ -22645,7 +22758,8 @@ var init_config = __esm(() => {
22645
22758
  task: OmoTaskSettingsLayerSchema.optional(),
22646
22759
  teams: OmoTeamsConfigLayerSchema.optional(),
22647
22760
  models: OmoModelCatalogLayerSchema.optional(),
22648
- memory: OmoMemorySettingsLayerSchema.optional()
22761
+ memory: OmoMemorySettingsLayerSchema.optional(),
22762
+ telemetry: OmoTelemetrySettingsLayerSchema.optional()
22649
22763
  }).strict();
22650
22764
  OmoConfigProfileSchema = object({
22651
22765
  categories: OmoCategoriesConfigSchema.optional(),
@@ -22655,6 +22769,7 @@ var init_config = __esm(() => {
22655
22769
  teams: OmoTeamsConfigLayerSchema.optional(),
22656
22770
  models: OmoModelCatalogLayerSchema.optional(),
22657
22771
  memory: OmoMemorySettingsLayerSchema.optional(),
22772
+ telemetry: OmoTelemetrySettingsLayerSchema.optional(),
22658
22773
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
22659
22774
  "[senpi]": OmoTypedHarnessConfigSchema.optional(),
22660
22775
  "[codex]": OmoTypedHarnessConfigSchema.optional()
@@ -22668,6 +22783,7 @@ var init_config = __esm(() => {
22668
22783
  teams: OmoTeamsConfigSchema.optional(),
22669
22784
  models: OmoModelCatalogSchema.optional(),
22670
22785
  memory: OmoMemorySettingsSchema.optional(),
22786
+ telemetry: OmoTelemetrySettingsSchema.optional(),
22671
22787
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
22672
22788
  "[senpi]": OmoTypedHarnessConfigSchema.optional(),
22673
22789
  "[codex]": OmoTypedHarnessConfigSchema.optional(),
@@ -22684,6 +22800,7 @@ var init_config = __esm(() => {
22684
22800
  teams: OmoTeamsConfigLayerSchema.optional(),
22685
22801
  models: OmoModelCatalogLayerSchema.optional(),
22686
22802
  memory: OmoMemorySettingsLayerSchema.optional(),
22803
+ telemetry: OmoTelemetrySettingsLayerSchema.optional(),
22687
22804
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
22688
22805
  "[senpi]": OmoTypedHarnessConfigSchema.optional(),
22689
22806
  "[codex]": OmoTypedHarnessConfigSchema.optional(),
@@ -22706,6 +22823,7 @@ var init_schema = __esm(() => {
22706
22823
  init_model_ref();
22707
22824
  init_task();
22708
22825
  init_team();
22826
+ init_telemetry();
22709
22827
  });
22710
22828
 
22711
22829
  // packages/omo-config-core/src/loader/merge.ts
@@ -24268,16 +24386,30 @@ function invocationsForPlatform(scriptPath, platform) {
24268
24386
  async function runInvocation(input) {
24269
24387
  const child = input.spawnProcess(input.invocation.command, input.invocation.args, { cwd: input.skillDir, env: input.env });
24270
24388
  let timedOut = false;
24389
+ let terminateDeadline;
24390
+ let terminateDeadlineGrace;
24391
+ const killIgnored = new Promise((_, reject) => {
24392
+ terminateDeadline = () => reject(new Error("ast-grep install child ignored termination"));
24393
+ });
24271
24394
  const timeout = setTimeout(() => {
24272
24395
  timedOut = true;
24273
24396
  child.kill();
24397
+ terminateDeadlineGrace = setTimeout(() => terminateDeadline?.(), KILL_GRACE_MS);
24274
24398
  }, input.timeoutMs);
24275
- timeout.unref?.();
24276
24399
  try {
24277
- const outcome = await child.outcome;
24278
- return timedOut ? { kind: "timed-out" } : outcome;
24400
+ const outcome = await Promise.race([child.outcome, killIgnored]);
24401
+ if (timedOut)
24402
+ return { kind: "timed-out" };
24403
+ return outcome;
24404
+ } catch (error51) {
24405
+ if (error51 instanceof Error && error51.message.includes("ignored termination")) {
24406
+ return { kind: "spawn-error", error: error51, missingExecutable: false };
24407
+ }
24408
+ throw error51;
24279
24409
  } finally {
24280
24410
  clearTimeout(timeout);
24411
+ if (terminateDeadlineGrace !== undefined)
24412
+ clearTimeout(terminateDeadlineGrace);
24281
24413
  }
24282
24414
  }
24283
24415
  function failedReason(outcome) {
@@ -24314,7 +24446,7 @@ async function runAstGrepSkillInstall(options) {
24314
24446
  return { kind: "failed", reason: String(error51) };
24315
24447
  }
24316
24448
  }
24317
- var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", AST_GREP_INSTALL_TIMEOUT_MS = 30000;
24449
+ var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", KILL_GRACE_MS = 1000, AST_GREP_INSTALL_TIMEOUT_MS = 30000;
24318
24450
  var init_install_script = __esm(() => {
24319
24451
  init_sg_manifest();
24320
24452
  });
@@ -26377,10 +26509,10 @@ var init_category_model_requirements = __esm(() => {
26377
26509
  quick: {
26378
26510
  fallbackChain: [
26379
26511
  { providers: ["kimi-for-coding"], model: "kimi-for-coding-highspeed" },
26380
- { providers: ["quotio-openai"], model: "gpt-5.6-luna-fast", variant: "low" },
26512
+ { providers: ["openai-codex"], model: "gpt-5.6-luna-fast", variant: "low" },
26381
26513
  { providers: ["deepseek"], model: "deepseek-v4-flash", variant: "off" },
26382
26514
  {
26383
- providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "opencode-go", "vercel"],
26515
+ providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "vercel"],
26384
26516
  model: "qwen3.6-flash",
26385
26517
  variant: "low"
26386
26518
  },
@@ -26396,6 +26528,11 @@ var init_category_model_requirements = __esm(() => {
26396
26528
  },
26397
26529
  "unspecified-low": {
26398
26530
  fallbackChain: [
26531
+ {
26532
+ providers: ["xai", "github-copilot", "opencode", "vercel"],
26533
+ model: "grok-4.6",
26534
+ variant: "xhigh"
26535
+ },
26399
26536
  {
26400
26537
  providers: ["openai", "quotio-openai", "github-copilot", "opencode", "vercel"],
26401
26538
  model: "gpt-5.6-terra",
@@ -27630,6 +27767,7 @@ var init_context_limit_resolver2 = () => {};
27630
27767
 
27631
27768
  // packages/omo-opencode/src/shared/normalize-sdk-response.ts
27632
27769
  function normalizeSDKResponse(response, fallback, options) {
27770
+ const fallbackIsArray = Array.isArray(fallback);
27633
27771
  if (response == null) {
27634
27772
  return fallback;
27635
27773
  }
@@ -27639,14 +27777,17 @@ function normalizeSDKResponse(response, fallback, options) {
27639
27777
  if (typeof response === "object" && "data" in response) {
27640
27778
  const data = response.data;
27641
27779
  if (data != null) {
27780
+ if (fallbackIsArray && !Array.isArray(data)) {
27781
+ return fallback;
27782
+ }
27642
27783
  return data;
27643
27784
  }
27644
- if (options?.preferResponseOnMissingData === true) {
27785
+ if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
27645
27786
  return response;
27646
27787
  }
27647
27788
  return fallback;
27648
27789
  }
27649
- if (options?.preferResponseOnMissingData === true) {
27790
+ if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
27650
27791
  return response;
27651
27792
  }
27652
27793
  return fallback;
@@ -27801,24 +27942,14 @@ var init_agent_display_names = __esm(() => {
27801
27942
  // packages/omo-opencode/src/tools/delegate-task/anthropic-categories.ts
27802
27943
  var UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND = `<Category_Context>
27803
27944
  You are working on tasks that don't fit specific categories but require substantial effort.
27804
-
27805
- <Selection_Gate>
27806
- BEFORE selecting this category, VERIFY ALL conditions:
27807
- 1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)
27808
- 2. Task requires substantial effort across multiple systems/modules
27809
- 3. Changes have broad impact or require careful coordination
27810
- 4. NOT just "complex" - must be genuinely unclassifiable AND high-effort
27811
-
27812
- If task fits ANY other category, DO NOT select unspecified-high.
27813
- If task is unclassifiable but moderate-effort, use unspecified-low instead.
27814
- </Selection_Gate>
27815
- </Category_Context>`, ANTHROPIC_CATEGORIES;
27945
+ </Category_Context>`, UNSPECIFIED_HIGH_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits and substantial effort spans systems/modules with broad impact. Use unspecified-low for contained moderate work.</Selection_Gate>`, ANTHROPIC_CATEGORIES;
27816
27946
  var init_anthropic_categories = __esm(() => {
27817
27947
  ANTHROPIC_CATEGORIES = [
27818
27948
  {
27819
27949
  name: "unspecified-high",
27820
27950
  config: { model: "kimi-for-coding/k3", variant: "max" },
27821
27951
  description: "Tasks that don't fit other categories, high effort required",
27952
+ callerGuidance: UNSPECIFIED_HIGH_CATEGORY_CALLER_GUIDANCE,
27822
27953
  promptAppend: UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND
27823
27954
  }
27824
27955
  ];
@@ -28075,64 +28206,10 @@ Approach:
28075
28206
  - Minimal viable implementation
28076
28207
  - Skip unnecessary abstractions
28077
28208
  - Direct and concise
28078
- </Category_Context>
28079
-
28080
- <Caller_Warning>
28081
- THIS CATEGORY USES A SMALLER/FASTER MODEL (gpt-5.6-luna-fast).
28082
-
28083
- The model executing this task is optimized for speed over depth. Your prompt MUST be:
28084
-
28085
- **EXHAUSTIVELY EXPLICIT** - Leave NOTHING to interpretation:
28086
- 1. MUST DO: List every required action as atomic, numbered steps
28087
- 2. MUST NOT DO: Explicitly forbid likely mistakes and deviations
28088
- 3. EXPECTED OUTPUT: Describe exact success criteria with concrete examples
28089
-
28090
- **WHY THIS MATTERS:**
28091
- - Smaller models benefit from explicit guardrails
28092
- - Vague instructions may lead to unpredictable results
28093
- - Implicit expectations may be missed
28094
- **PROMPT STRUCTURE (MANDATORY):**
28095
- \`\`\`
28096
- TASK: [One-sentence goal]
28097
-
28098
- MUST DO:
28099
- 1. [Specific action with exact details]
28100
- 2. [Another specific action]
28101
- ...
28102
-
28103
- MUST NOT DO:
28104
- - [Forbidden action + why]
28105
- - [Another forbidden action]
28106
- ...
28107
-
28108
- EXPECTED OUTPUT:
28109
- - [Exact deliverable description]
28110
- - [Success criteria / verification method]
28111
- \`\`\`
28112
-
28113
- If your prompt lacks this structure, REWRITE IT before delegating.
28114
- </Caller_Warning>`, UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = `<Category_Context>
28209
+ </Category_Context>`, QUICK_CATEGORY_CALLER_GUIDANCE = `<Caller_Warning>Small/fast model: before delegating, write an explicit prompt with numbered must-do steps, forbidden deviations, and concrete success criteria.</Caller_Warning>`, UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = `<Category_Context>
28115
28210
  You are working on tasks that don't fit specific categories but require moderate effort.
28116
-
28117
- <Selection_Gate>
28118
- BEFORE selecting this category, VERIFY ALL conditions:
28119
- 1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)
28120
- 2. Task requires more than trivial effort but is NOT system-wide
28121
- 3. Scope is contained within a few files/modules
28122
-
28123
- If task fits ANY other category, DO NOT select unspecified-low.
28124
- This is NOT a default choice - it's for genuinely unclassifiable moderate-effort work.
28125
- </Selection_Gate>
28126
- </Category_Context>
28127
-
28128
- <Caller_Warning>
28129
- THIS CATEGORY USES A LIGHTWEIGHT MODEL (gpt-5.6-luna).
28130
-
28131
- **PROVIDE CLEAR STRUCTURE:**
28132
- 1. MUST DO: Enumerate required actions explicitly
28133
- 2. MUST NOT DO: State forbidden actions to prevent scope creep
28134
- 3. EXPECTED OUTPUT: Define concrete success criteria
28135
- </Caller_Warning>`, OPENAI_CATEGORIES;
28211
+ </Category_Context>`, UNSPECIFIED_LOW_CATEGORY_CALLER_GUIDANCE = `<Selection_Gate>Use only when no specialist category fits, effort is moderate, and scope stays within a few files/modules. Prefer any matching specialist category.</Selection_Gate>
28212
+ <Caller_Warning>Provide explicit must-do steps, forbidden scope, and concrete success criteria.</Caller_Warning>`, OPENAI_CATEGORIES;
28136
28213
  var init_openai_categories = __esm(() => {
28137
28214
  init_types4();
28138
28215
  OPENAI_CATEGORIES = [
@@ -28154,12 +28231,14 @@ var init_openai_categories = __esm(() => {
28154
28231
  name: "quick",
28155
28232
  config: { model: "kimi-for-coding/kimi-for-coding-highspeed" },
28156
28233
  description: "Trivial tasks - single file changes, typo fixes, simple modifications",
28234
+ callerGuidance: QUICK_CATEGORY_CALLER_GUIDANCE,
28157
28235
  promptAppend: QUICK_CATEGORY_PROMPT_APPEND
28158
28236
  },
28159
28237
  {
28160
28238
  name: "unspecified-low",
28161
- config: { model: "openai/gpt-5.6-luna", variant: "xhigh" },
28239
+ config: { model: "xai/grok-4.6", variant: "xhigh" },
28162
28240
  description: "Tasks that don't fit other categories, low effort required",
28241
+ callerGuidance: UNSPECIFIED_LOW_CATEGORY_CALLER_GUIDANCE,
28163
28242
  promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
28164
28243
  }
28165
28244
  ];
@@ -28169,7 +28248,7 @@ var init_openai_categories = __esm(() => {
28169
28248
  function buildCategoryRecord(selector) {
28170
28249
  return Object.fromEntries(BUILTIN_CATEGORIES.map((definition) => [definition.name, selector(definition)]));
28171
28250
  }
28172
- var BUILTIN_CATEGORIES, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS, CATEGORY_PROMPT_APPEND_RESOLVERS, BUILTIN_CATEGORY_REQUIRES_MODEL;
28251
+ var BUILTIN_CATEGORIES, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS, CATEGORY_DESCRIPTIONS, CATEGORY_CALLER_GUIDANCE, CATEGORY_PROMPT_APPEND_RESOLVERS, BUILTIN_CATEGORY_REQUIRES_MODEL;
28173
28252
  var init_builtin_categories = __esm(() => {
28174
28253
  init_anthropic_categories();
28175
28254
  init_google_categories();
@@ -28184,6 +28263,7 @@ var init_builtin_categories = __esm(() => {
28184
28263
  DEFAULT_CATEGORIES = buildCategoryRecord((definition) => definition.config);
28185
28264
  CATEGORY_PROMPT_APPENDS = buildCategoryRecord((definition) => definition.promptAppend);
28186
28265
  CATEGORY_DESCRIPTIONS = buildCategoryRecord((definition) => definition.description);
28266
+ CATEGORY_CALLER_GUIDANCE = buildCategoryRecord((definition) => definition.callerGuidance);
28187
28267
  CATEGORY_PROMPT_APPEND_RESOLVERS = Object.fromEntries(BUILTIN_CATEGORIES.filter((definition) => definition.resolvePromptAppend !== undefined).map((definition) => [definition.name, definition.resolvePromptAppend]));
28188
28268
  BUILTIN_CATEGORY_REQUIRES_MODEL = Object.fromEntries(BUILTIN_CATEGORIES.filter((definition) => definition.requiresModel !== undefined).map((definition) => [definition.name, definition.requiresModel]));
28189
28269
  });
@@ -83055,6 +83135,47 @@ var init_model_capabilities_generated = __esm(() => {
83055
83135
  input: 272000,
83056
83136
  output: 128000
83057
83137
  }
83138
+ },
83139
+ "grok-4.6": {
83140
+ id: "grok-4.6",
83141
+ family: "grok",
83142
+ reasoning: true,
83143
+ temperature: true,
83144
+ toolCall: true,
83145
+ modalities: {
83146
+ input: [
83147
+ "text",
83148
+ "image"
83149
+ ],
83150
+ output: [
83151
+ "text"
83152
+ ]
83153
+ },
83154
+ limit: {
83155
+ context: 500000,
83156
+ output: 500000
83157
+ }
83158
+ },
83159
+ "xai/grok-4.6": {
83160
+ id: "xai/grok-4.6",
83161
+ family: "grok",
83162
+ reasoning: true,
83163
+ temperature: true,
83164
+ toolCall: true,
83165
+ modalities: {
83166
+ input: [
83167
+ "text",
83168
+ "image",
83169
+ "pdf"
83170
+ ],
83171
+ output: [
83172
+ "text"
83173
+ ]
83174
+ },
83175
+ limit: {
83176
+ context: 500000,
83177
+ output: 500000
83178
+ }
83058
83179
  }
83059
83180
  }
83060
83181
  };
@@ -83096,21 +83217,21 @@ var init_session_cursor = __esm(() => {
83096
83217
  });
83097
83218
 
83098
83219
  // packages/omo-opencode/src/shared/shell-env.ts
83099
- function detectShellType() {
83100
- if (process.env.SHELL) {
83101
- const shell = process.env.SHELL;
83220
+ function detectShellType(platform = process.platform, env2 = process.env) {
83221
+ if (env2.SHELL) {
83222
+ const shell = env2.SHELL;
83102
83223
  if (shell.includes("csh") || shell.includes("tcsh")) {
83103
83224
  return "csh";
83104
83225
  }
83105
83226
  return "unix";
83106
83227
  }
83107
- if (process.platform === "win32" && (process.env.BASH_VERSION || process.env.MSYSTEM || process.env.WSL_DISTRO_NAME)) {
83228
+ if (platform === "win32" && (env2.BASH_VERSION || env2.MSYSTEM || env2.WSL_DISTRO_NAME)) {
83108
83229
  return "unix";
83109
83230
  }
83110
- if (process.env.PSModulePath) {
83231
+ if (env2.PSModulePath) {
83111
83232
  return "powershell";
83112
83233
  }
83113
- return process.platform === "win32" ? "cmd" : "unix";
83234
+ return platform === "win32" ? "cmd" : "unix";
83114
83235
  }
83115
83236
  var init_shell_env = () => {};
83116
83237
 
@@ -88768,7 +88889,7 @@ var init_activity_state = __esm(() => {
88768
88889
  });
88769
88890
 
88770
88891
  // packages/telemetry-core/src/constants.ts
88771
- var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
88892
+ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74", UNCONFIGURED_POSTHOG_API_KEY = "phc_REPLACE_ME_OMO_NATIVE";
88772
88893
 
88773
88894
  // packages/telemetry-core/src/diagnostics.ts
88774
88895
  import { appendFileSync as appendFileSync2, existsSync as existsSync27, mkdirSync as mkdirSync9, readFileSync as readFileSync13 } from "node:fs";
@@ -88906,6 +89027,9 @@ function shouldDisableTelemetry(input) {
88906
89027
  const env2 = input.env ?? process.env;
88907
89028
  const globalPrefix = input.globalEnvPrefix ?? "OMO";
88908
89029
  const prefixes = Array.from(new Set([globalPrefix, input.productEnvPrefix]));
89030
+ if (isDisableFlag(env2["DO_NOT_TRACK"])) {
89031
+ return true;
89032
+ }
88909
89033
  for (const prefix of prefixes) {
88910
89034
  if (isDisableFlag(env2[`${prefix}_DISABLE_POSTHOG`])) {
88911
89035
  return true;
@@ -88919,6 +89043,13 @@ function shouldDisableTelemetry(input) {
88919
89043
  function getTelemetryApiKey(env2 = process.env, defaultApiKey = DEFAULT_POSTHOG_API_KEY) {
88920
89044
  return env2["POSTHOG_API_KEY"]?.trim() ?? defaultApiKey;
88921
89045
  }
89046
+ function isConfiguredTelemetryApiKey(apiKey) {
89047
+ const normalized = apiKey.trim();
89048
+ return normalized.length > 0 && normalized !== UNCONFIGURED_POSTHOG_API_KEY;
89049
+ }
89050
+ function hasTelemetryApiKey(env2, defaultApiKey) {
89051
+ return isConfiguredTelemetryApiKey(getTelemetryApiKey(env2, defaultApiKey));
89052
+ }
88922
89053
  function getTelemetryHost(env2 = process.env, defaultHost = DEFAULT_POSTHOG_HOST) {
88923
89054
  return env2["POSTHOG_HOST"]?.trim() || defaultHost;
88924
89055
  }
@@ -88928,17 +89059,6 @@ var init_env2 = __esm(() => {
88928
89059
  SEND_OPT_OUT_VALUES = ["0", "false", "no", "yes"];
88929
89060
  });
88930
89061
 
88931
- // packages/telemetry-core/src/machine-id.ts
88932
- import { createHash as createHash4 } from "node:crypto";
88933
- import os4 from "node:os";
88934
- function getDefaultTelemetryOsProvider() {
88935
- return os4;
88936
- }
88937
- function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
88938
- return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
88939
- }
88940
- var init_machine_id = () => {};
88941
-
88942
89062
  // node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
88943
89063
  import { dirname as dirname17, posix as posix7, sep as sep7 } from "path";
88944
89064
  function createModulerModifier() {
@@ -94313,6 +94433,17 @@ var init_index_node = __esm(() => {
94313
94433
  };
94314
94434
  });
94315
94435
 
94436
+ // packages/telemetry-core/src/machine-id.ts
94437
+ import { createHash as createHash4 } from "node:crypto";
94438
+ import os4 from "node:os";
94439
+ function getDefaultTelemetryOsProvider() {
94440
+ return os4;
94441
+ }
94442
+ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
94443
+ return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
94444
+ }
94445
+ var init_machine_id = () => {};
94446
+
94316
94447
  // packages/telemetry-core/src/posthog-client.ts
94317
94448
  class PostHogTelemetryTransport {
94318
94449
  #client;
@@ -94334,7 +94465,7 @@ function createDefaultPostHogTransport(apiKey, options) {
94334
94465
  }
94335
94466
  function isTelemetryClientEnabled(input) {
94336
94467
  const env2 = input.env ?? process.env;
94337
- return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) && getTelemetryApiKey(env2, input.product.defaultApiKey).length > 0;
94468
+ return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) && hasTelemetryApiKey(env2, input.product.defaultApiKey);
94338
94469
  }
94339
94470
  function createTelemetryClient(input) {
94340
94471
  if (!isTelemetryClientEnabled(input)) {
@@ -94400,7 +94531,8 @@ function createTransport(input) {
94400
94531
  flushAt: 1,
94401
94532
  flushInterval: 0,
94402
94533
  host: getTelemetryHost(env2, input.product.defaultHost),
94403
- disableGeoip: false
94534
+ disableGeoip: input.product.disableGeoip ?? false,
94535
+ ...input.product.transportOptions
94404
94536
  });
94405
94537
  } catch (error51) {
94406
94538
  input.diagnostics?.({
@@ -94477,6 +94609,17 @@ var init_posthog_client = __esm(() => {
94477
94609
  };
94478
94610
  });
94479
94611
 
94612
+ // packages/telemetry-core/src/events.ts
94613
+ var ALLOWED_DOLLAR_KEYS;
94614
+ var init_events = __esm(() => {
94615
+ ALLOWED_DOLLAR_KEYS = new Set([
94616
+ "$os",
94617
+ "$os_version",
94618
+ "$process_person_profile",
94619
+ "$session_id"
94620
+ ]);
94621
+ });
94622
+
94480
94623
  // packages/telemetry-core/src/record-daily-active.ts
94481
94624
  var init_record_daily_active = () => {};
94482
94625
 
@@ -94485,6 +94628,7 @@ var init_src5 = __esm(() => {
94485
94628
  init_activity_state();
94486
94629
  init_diagnostics();
94487
94630
  init_env2();
94631
+ init_events();
94488
94632
  init_machine_id();
94489
94633
  init_posthog_client();
94490
94634
  init_record_daily_active();
@@ -94495,7 +94639,7 @@ var package_default2;
94495
94639
  var init_package2 = __esm(() => {
94496
94640
  package_default2 = {
94497
94641
  name: "@oh-my-opencode/omo-codex",
94498
- version: "5.0.0-beta.1",
94642
+ version: "5.0.0-beta.11",
94499
94643
  type: "module",
94500
94644
  private: true,
94501
94645
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -94709,7 +94853,7 @@ __export(exports_telemetry, {
94709
94853
  __resetOsProviderForTesting: () => __resetOsProviderForTesting,
94710
94854
  __resetActivityStateProviderForTesting: () => __resetActivityStateProviderForTesting
94711
94855
  });
94712
- var init_telemetry = __esm(() => {
94856
+ var init_telemetry2 = __esm(() => {
94713
94857
  init_posthog();
94714
94858
  });
94715
94859
 
@@ -95464,20 +95608,20 @@ var init_update_toasts = __esm(() => {
95464
95608
  });
95465
95609
 
95466
95610
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
95467
- import { existsSync as existsSync46 } from "node:fs";
95468
- import { dirname as dirname28, join as join73 } from "node:path";
95611
+ import { existsSync as existsSync48 } from "node:fs";
95612
+ import { dirname as dirname30, join as join76 } from "node:path";
95469
95613
  import { fileURLToPath as fileURLToPath5 } from "node:url";
95470
95614
  function defaultGetModuleHostingWorkspace() {
95471
95615
  try {
95472
- const currentDir = dirname28(fileURLToPath5(import.meta.url));
95616
+ const currentDir = dirname30(fileURLToPath5(import.meta.url));
95473
95617
  const pkgJsonPath = findPackageJsonUp(currentDir);
95474
95618
  if (!pkgJsonPath)
95475
95619
  return null;
95476
- const pkgDir = dirname28(pkgJsonPath);
95477
- const nodeModulesDir = dirname28(pkgDir);
95620
+ const pkgDir = dirname30(pkgJsonPath);
95621
+ const nodeModulesDir = dirname30(pkgDir);
95478
95622
  if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
95479
95623
  return null;
95480
- return dirname28(nodeModulesDir);
95624
+ return dirname30(nodeModulesDir);
95481
95625
  } catch (error51) {
95482
95626
  if (error51 instanceof Error) {
95483
95627
  return null;
@@ -95618,8 +95762,8 @@ var init_background_update_check = __esm(() => {
95618
95762
  init_package_json_locator();
95619
95763
  init_update_toasts();
95620
95764
  defaultDeps4 = {
95621
- existsSync: existsSync46,
95622
- join: join73,
95765
+ existsSync: existsSync48,
95766
+ join: join76,
95623
95767
  runBunInstallWithDetails,
95624
95768
  log: log2,
95625
95769
  getOpenCodeCacheDir,
@@ -95782,7 +95926,7 @@ async function showSpinnerToast(ctx, version3, message) {
95782
95926
  duration: frameInterval + 50
95783
95927
  }
95784
95928
  }).catch(ignoreToastError);
95785
- await new Promise((resolve20) => setTimeout(resolve20, frameInterval));
95929
+ await new Promise((resolve22) => setTimeout(resolve22, frameInterval));
95786
95930
  }
95787
95931
  }
95788
95932
  var SISYPHUS_SPINNER;
@@ -100574,7 +100718,7 @@ async function installAstGrepForCodex(options) {
100574
100718
  // packages/omo-codex/src/install/codex-install-telemetry.ts
100575
100719
  async function trackCodexInstallTelemetry() {
100576
100720
  try {
100577
- const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry(), exports_telemetry));
100721
+ const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry2(), exports_telemetry));
100578
100722
  const posthog = createInstallPostHog2();
100579
100723
  posthog.trackActive(getPostHogDistinctId2(), "install_completed");
100580
100724
  await posthog.shutdown();
@@ -101394,22 +101538,136 @@ function nodeErrorCode6(error51) {
101394
101538
  var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
101395
101539
  // packages/omo-senpi/src/install/install-senpi.ts
101396
101540
  import { execFile as execFile4 } from "node:child_process";
101397
- import { createHash as createHash5 } from "node:crypto";
101398
- import { constants as constants8, existsSync as existsSync30 } from "node:fs";
101399
- import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
101400
- import { homedir as homedir9 } from "node:os";
101401
- import { dirname as dirname22, join as join60, resolve as resolve18 } from "node:path";
101541
+ import { existsSync as existsSync32 } from "node:fs";
101542
+ import { homedir as homedir11 } from "node:os";
101543
+ import { dirname as dirname24, join as join63, resolve as resolve20 } from "node:path";
101402
101544
  import { fileURLToPath } from "node:url";
101403
101545
  import { promisify as promisify2 } from "node:util";
101404
101546
 
101547
+ // packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
101548
+ import { existsSync as existsSync30 } from "node:fs";
101549
+ import { homedir as homedir9 } from "node:os";
101550
+ import { join as join59, resolve as resolve17 } from "node:path";
101551
+ var AGENT_DIR_ENV_NAMES = [
101552
+ "OMO_CODING_AGENT_DIR",
101553
+ "SENPI_CODING_AGENT_DIR",
101554
+ "PI_CODING_AGENT_DIR"
101555
+ ];
101556
+ var AGENT_HOME_SENTINEL = "settings.json";
101557
+ function resolveAgentHome(options) {
101558
+ const { env: env3, homeDir = homedir9(), exists: exists7 = existsSync30 } = options;
101559
+ for (const name of AGENT_DIR_ENV_NAMES) {
101560
+ const configured = env3[name]?.trim();
101561
+ if (configured)
101562
+ return resolve17(configured);
101563
+ }
101564
+ const brandedHome = join59(homeDir, ".omo");
101565
+ const canonical = join59(brandedHome, "agent");
101566
+ if (exists7(join59(canonical, AGENT_HOME_SENTINEL)))
101567
+ return canonical;
101568
+ if (exists7(join59(brandedHome, AGENT_HOME_SENTINEL)))
101569
+ return brandedHome;
101570
+ return join59(homeDir, ".senpi", "agent");
101571
+ }
101572
+
101573
+ // packages/omo-senpi/src/install/local-launcher.ts
101574
+ import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "node:fs";
101575
+ import { homedir as homedir10 } from "node:os";
101576
+ import { dirname as dirname21, join as join60, resolve as resolve18 } from "node:path";
101577
+ var MARKER = "omo-local-launcher";
101578
+ function localLauncherPath(homeDir = homedir10()) {
101579
+ return join60(homeDir, ".local", "bin", "omo");
101580
+ }
101581
+ function localLauncherCmdPath(homeDir = homedir10()) {
101582
+ return join60(homeDir, ".local", "bin", "omo.cmd");
101583
+ }
101584
+ function renderLocalLauncher(options) {
101585
+ const brand = {
101586
+ name: "omo",
101587
+ displayVersion: options.version ?? "local",
101588
+ configDir: ".omo",
101589
+ flatLayout: false,
101590
+ envPrefix: "OMO",
101591
+ userAgent: "omo",
101592
+ originator: "omo",
101593
+ update: {
101594
+ packageName: "omo-ai",
101595
+ distTag: "beta",
101596
+ command: "npm i -g omo-ai@beta",
101597
+ changelogUrl: "https://github.com/code-yeongyu/oh-my-openagent/releases"
101598
+ }
101599
+ };
101600
+ return `#!/usr/bin/env node
101601
+ // ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
101602
+ import { spawn } from "node:child_process"
101603
+ import { homedir } from "node:os"
101604
+ import { join } from "node:path"
101605
+
101606
+ const brand = ${JSON.stringify(brand)}
101607
+ const cli = process.env.OMO_SENPI_CLI_PATH ?? ${JSON.stringify(options.senpiCliPath)}
101608
+ const plugin = process.env.OMO_PLUGIN_ROOT ?? ${JSON.stringify(options.pluginPath)}
101609
+ // The same directory the published launcher pins, so a local install shares one state location
101610
+ // with the published one and with anything either of them spawns.
101611
+ const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AGENT_DIR
101612
+ ?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
101613
+ const env = {
101614
+ ...process.env,
101615
+ SENPI_BRAND: JSON.stringify(brand),
101616
+ OMO_NATIVE: "1",
101617
+ OMO_CODING_AGENT_DIR: agentDir,
101618
+ SENPI_CODING_AGENT_DIR: agentDir,
101619
+ }
101620
+ // Anything resolving the product by name must re-enter through this launcher, never the engine.
101621
+ env.OMO_BIN = process.argv[1]
101622
+ const selfUpdate = process.argv[2] === "update"
101623
+ && process.argv.slice(3).every((arg) => arg.startsWith("-") || ["self", "senpi", "omo"].includes(arg))
101624
+ && !process.argv.slice(3).some((arg) => arg === "--extensions" || arg === "--models")
101625
+ if (selfUpdate) {
101626
+ console.log("omo is updated via npm: npm i -g omo-ai@beta")
101627
+ process.exit(0)
101628
+ }
101629
+ const child = spawn(process.execPath, [cli, "--extension", plugin, ...process.argv.slice(2)], {
101630
+ env,
101631
+ stdio: "inherit",
101632
+ })
101633
+ child.on("close", (code, signal) => {
101634
+ if (signal) {
101635
+ process.kill(process.pid, signal)
101636
+ return
101637
+ }
101638
+ process.exitCode = code ?? 1
101639
+ })
101640
+ `;
101641
+ }
101642
+ function installLocalLauncher(options) {
101643
+ const path6 = localLauncherPath(options.homeDir);
101644
+ if (existsSync31(path6) && !readFileSync14(path6, "utf8").includes(MARKER))
101645
+ return;
101646
+ mkdirSync10(dirname21(path6), { recursive: true });
101647
+ writeFileSync6(path6, renderLocalLauncher(options));
101648
+ chmodSync3(path6, 493);
101649
+ if ((options.platform ?? process.platform) === "win32") {
101650
+ writeFileSync6(localLauncherCmdPath(options.homeDir), `@echo off\r
101651
+ node "%~dp0omo" %*\r
101652
+ `);
101653
+ }
101654
+ return path6;
101655
+ }
101656
+
101657
+ // packages/omo-senpi/src/install/plugin-artifacts.ts
101658
+ import { createHash as createHash5 } from "node:crypto";
101659
+ import { constants as constants8 } from "node:fs";
101660
+ import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
101661
+ import { dirname as dirname23, join as join62 } from "node:path";
101662
+
101405
101663
  // packages/omo-senpi/src/install/senpi-settings.ts
101406
101664
  import { constants as constants7 } from "node:fs";
101407
101665
  import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
101408
- import { dirname as dirname21, join as join59, resolve as resolve17 } from "node:path";
101666
+ import { dirname as dirname22, join as join61, resolve as resolve19 } from "node:path";
101409
101667
  var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
101410
101668
  var LEGACY_BUILTIN_SHADOW_PACKAGES = [
101411
- join59("packages", "pi-goal"),
101412
- join59("packages", "pi-webfetch")
101669
+ join61("packages", "pi-goal"),
101670
+ join61("packages", "pi-webfetch")
101413
101671
  ];
101414
101672
  async function readSettings(settingsPath) {
101415
101673
  let raw;
@@ -101438,13 +101696,13 @@ function dedupePackages(packages) {
101438
101696
  return [...new Set(packages)];
101439
101697
  }
101440
101698
  function removeLegacyBuiltinShadows(packages, repoRoot, agentDir) {
101441
- const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve17(repoRoot, path6)));
101442
- return packages.filter((entry) => !shadowPaths.has(resolve17(agentDir, entry)));
101699
+ const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve19(repoRoot, path6)));
101700
+ return packages.filter((entry) => !shadowPaths.has(resolve19(agentDir, entry)));
101443
101701
  }
101444
101702
  async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir) {
101445
- const currentPath = resolve17(currentPluginPath);
101703
+ const currentPath = resolve19(currentPluginPath);
101446
101704
  const entries = await Promise.all(packages.map(async (entry) => {
101447
- const packagePath = resolve17(agentDir, entry);
101705
+ const packagePath = resolve19(agentDir, entry);
101448
101706
  if (packagePath === currentPath)
101449
101707
  return currentPath;
101450
101708
  return await readPackageName(packagePath) === OMO_SENPI_PACKAGE_NAME ? undefined : entry;
@@ -101452,7 +101710,7 @@ async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir
101452
101710
  return entries.filter((entry) => entry !== undefined);
101453
101711
  }
101454
101712
  async function writeSettingsAtomically(settingsPath, settings) {
101455
- await mkdir9(dirname21(settingsPath), { recursive: true });
101713
+ await mkdir9(dirname22(settingsPath), { recursive: true });
101456
101714
  const backupPath = await nextBackupPath(settingsPath);
101457
101715
  if (await fileExists(settingsPath)) {
101458
101716
  await copyFile3(settingsPath, backupPath);
@@ -101484,7 +101742,7 @@ function isRecord10(value) {
101484
101742
  async function readPackageName(packagePath) {
101485
101743
  let raw;
101486
101744
  try {
101487
- raw = await readFile25(join59(packagePath, "package.json"), "utf8");
101745
+ raw = await readFile25(join61(packagePath, "package.json"), "utf8");
101488
101746
  } catch (error51) {
101489
101747
  if (isErrno(error51, "ENOENT") || isErrno(error51, "ENOTDIR"))
101490
101748
  return;
@@ -101507,89 +101765,56 @@ function isErrno(error51, code) {
101507
101765
  return error51 instanceof Error && "code" in error51 && error51.code === code;
101508
101766
  }
101509
101767
 
101510
- // packages/omo-senpi/src/install/install-senpi.ts
101511
- var execFileAsync2 = promisify2(execFile4);
101768
+ // packages/omo-senpi/src/install/plugin-artifacts.ts
101512
101769
  var REQUIRED_PLUGIN_ARTIFACTS = [
101513
- join60("extensions", "omo.js"),
101514
- join60("extensions", "reflection-persona.md"),
101515
- join60("skills", "ast-grep", "SKILL.md"),
101516
- join60("skills", "coding-agent-sessions", "SKILL.md"),
101517
- join60("skills", "debugging", "SKILL.md"),
101518
- join60("skills", "frontend", "SKILL.md"),
101519
- join60("skills", "git-master", "SKILL.md"),
101520
- join60("skills", "init-deep", "SKILL.md"),
101521
- join60("skills", "lsp-setup", "SKILL.md"),
101522
- join60("skills", "programming", "SKILL.md"),
101523
- join60("skills", "refactor", "SKILL.md"),
101524
- join60("skills", "remove-ai-slops", "SKILL.md"),
101525
- join60("skills", "review-work", "SKILL.md"),
101526
- join60("skills", "start-work", "SKILL.md"),
101527
- join60("skills", "ultimate-browsing", "SKILL.md"),
101528
- join60("skills", "ultrawork", "SKILL.md"),
101529
- join60("skills", "ulw-loop", "SKILL.md"),
101530
- join60("skills", "ulw-plan", "SKILL.md"),
101531
- join60("skills", "ulw-research", "SKILL.md"),
101532
- join60("skills", "visual-qa", "SKILL.md"),
101533
- join60("runtime", "ast-grep-mcp", "cli.js"),
101534
- join60("runtime", "agent-toolkit", "cli.js"),
101535
- join60("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
101536
- join60("runtime", "agent-toolkit", "omo-agent-toolkit"),
101537
- join60("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
101538
- join60("runtime", "lsp-daemon", "dist", "cli.js"),
101539
- join60("runtime", "lsp-daemon", "dist", "index.js"),
101540
- join60("runtime", "lsp-daemon", "dist", "index.d.ts"),
101541
- join60("runtime", "lsp-daemon", "dist", "daemon-client.js"),
101542
- join60("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
101543
- join60("runtime", "lsp-daemon", "dist", "package.json"),
101544
- join60("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
101545
- join60("scripts", "install.mjs")
101770
+ join62("extensions", "omo.js"),
101771
+ join62("extensions", "omo-task.js"),
101772
+ join62("extensions", "omo-member.js"),
101773
+ join62("extensions", "memory-run-supervisor.mjs"),
101774
+ join62("extensions", "reflection-persona.md"),
101775
+ join62("extensions", "dream-persona.md"),
101776
+ join62("extensions", "facts-persona.md"),
101777
+ join62("skills", "ast-grep", "SKILL.md"),
101778
+ join62("skills", "coding-agent-sessions", "SKILL.md"),
101779
+ join62("skills", "debugging", "SKILL.md"),
101780
+ join62("skills", "frontend", "SKILL.md"),
101781
+ join62("skills", "git-master", "SKILL.md"),
101782
+ join62("skills", "init-deep", "SKILL.md"),
101783
+ join62("skills", "lsp-setup", "SKILL.md"),
101784
+ join62("skills", "programming", "SKILL.md"),
101785
+ join62("skills", "refactor", "SKILL.md"),
101786
+ join62("skills", "remove-ai-slops", "SKILL.md"),
101787
+ join62("skills", "review-work", "SKILL.md"),
101788
+ join62("skills", "start-work", "SKILL.md"),
101789
+ join62("skills", "ultimate-browsing", "SKILL.md"),
101790
+ join62("skills", "ultrawork", "SKILL.md"),
101791
+ join62("skills", "ulw-loop", "SKILL.md"),
101792
+ join62("skills", "ulw-plan", "SKILL.md"),
101793
+ join62("skills", "ulw-research", "SKILL.md"),
101794
+ join62("skills", "visual-qa", "SKILL.md"),
101795
+ join62("runtime", "ast-grep-mcp", "cli.js"),
101796
+ join62("runtime", "agent-toolkit", "cli.js"),
101797
+ join62("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
101798
+ join62("runtime", "agent-toolkit", "omo-agent-toolkit"),
101799
+ join62("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
101800
+ join62("runtime", "lsp-daemon", "dist", "cli.js"),
101801
+ join62("runtime", "lsp-daemon", "dist", "index.js"),
101802
+ join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
101803
+ join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
101804
+ join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
101805
+ join62("runtime", "lsp-daemon", "dist", "package.json"),
101806
+ join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
101807
+ join62("scripts", "install.mjs")
101546
101808
  ];
101547
- async function runSenpiInstaller(options = {}) {
101548
- const context = resolveInstallContext(options);
101549
- await ensurePluginArtifacts(context);
101550
- const settings = await readSettings(context.settingsPath);
101551
- const before = JSON.stringify(settings);
101552
- const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
101553
- if (!packages.includes(context.pluginPath))
101554
- packages.push(context.pluginPath);
101555
- settings.packages = packages;
101556
- const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
101557
- return {
101558
- ok: true,
101559
- action: "install",
101560
- agentDir: context.agentDir,
101561
- settingsPath: context.settingsPath,
101562
- pluginPath: context.pluginPath,
101563
- changed: JSON.stringify(settings) !== before,
101564
- backupPath
101565
- };
101566
- }
101567
- function resolveInstallContext(options) {
101568
- const env3 = options.env ?? process.env;
101569
- const allowBuild = options.pluginPath === undefined;
101570
- const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname22(fileURLToPath(import.meta.url))) : dirname22(resolve18(options.pluginPath))));
101571
- const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join60(homedir9(), ".senpi", "agent"));
101572
- const pluginPath = resolve18(options.pluginPath ?? join60(repoRoot, "packages", "omo-senpi", "plugin"));
101573
- return {
101574
- env: env3,
101575
- repoRoot,
101576
- agentDir,
101577
- settingsPath: join60(agentDir, "settings.json"),
101578
- pluginPath,
101579
- platform: options.platform ?? process.platform,
101580
- allowBuild,
101581
- runCommand: options.runCommand ?? defaultRunCommand3
101582
- };
101583
- }
101584
101809
  async function ensurePluginArtifacts(context) {
101585
101810
  if (context.allowBuild) {
101586
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
101587
- await context.runCommand("node", [join60("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
101588
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
101589
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
101590
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
101591
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
101592
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
101811
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
101812
+ await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
101813
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
101814
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
101815
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
101816
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
101817
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
101593
101818
  }
101594
101819
  if (await hasMissingPluginArtifact(context.pluginPath)) {
101595
101820
  throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
@@ -101598,14 +101823,14 @@ async function ensurePluginArtifacts(context) {
101598
101823
  }
101599
101824
  async function hasMissingPluginArtifact(pluginPath) {
101600
101825
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
101601
- if (!await fileExists2(join60(pluginPath, artifact)))
101826
+ if (!await fileExists2(join62(pluginPath, artifact)))
101602
101827
  return true;
101603
101828
  }
101604
101829
  return false;
101605
101830
  }
101606
101831
  async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
101607
- const runtimeEntry = join60(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
101608
- const manifestPath = join60(dirname22(runtimeEntry), "manifest.json");
101832
+ const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
101833
+ const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
101609
101834
  let runtimeStat;
101610
101835
  try {
101611
101836
  runtimeStat = await stat6(runtimeEntry);
@@ -101652,6 +101877,63 @@ function astGrepIntegrityError(runtimeEntry, reason) {
101652
101877
  function messageOf(error51) {
101653
101878
  return error51 instanceof Error ? error51.message : String(error51);
101654
101879
  }
101880
+ async function fileExists2(path6) {
101881
+ try {
101882
+ await access2(path6, constants8.F_OK);
101883
+ return true;
101884
+ } catch (error51) {
101885
+ if (isErrno2(error51, "ENOENT"))
101886
+ return false;
101887
+ throw error51;
101888
+ }
101889
+ }
101890
+ function isErrno2(error51, code) {
101891
+ return error51 instanceof Error && "code" in error51 && error51.code === code;
101892
+ }
101893
+
101894
+ // packages/omo-senpi/src/install/install-senpi.ts
101895
+ var execFileAsync2 = promisify2(execFile4);
101896
+ async function runSenpiInstaller(options = {}) {
101897
+ const context = resolveInstallContext(options);
101898
+ await ensurePluginArtifacts(context);
101899
+ const settings = await readSettings(context.settingsPath);
101900
+ const before = JSON.stringify(settings);
101901
+ const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
101902
+ if (!packages.includes(context.pluginPath))
101903
+ packages.push(context.pluginPath);
101904
+ settings.packages = packages;
101905
+ const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
101906
+ installLocalLauncher({
101907
+ pluginPath: context.pluginPath,
101908
+ senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
101909
+ });
101910
+ return {
101911
+ ok: true,
101912
+ action: "install",
101913
+ agentDir: context.agentDir,
101914
+ settingsPath: context.settingsPath,
101915
+ pluginPath: context.pluginPath,
101916
+ changed: JSON.stringify(settings) !== before,
101917
+ backupPath
101918
+ };
101919
+ }
101920
+ function resolveInstallContext(options) {
101921
+ const env3 = options.env ?? process.env;
101922
+ const allowBuild = options.pluginPath === undefined;
101923
+ const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
101924
+ const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
101925
+ const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
101926
+ return {
101927
+ env: env3,
101928
+ repoRoot,
101929
+ agentDir,
101930
+ settingsPath: join63(agentDir, "settings.json"),
101931
+ pluginPath,
101932
+ platform: options.platform ?? process.platform,
101933
+ allowBuild,
101934
+ runCommand: options.runCommand ?? defaultRunCommand3
101935
+ };
101936
+ }
101655
101937
  async function defaultRunCommand3(command, args, options) {
101656
101938
  const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
101657
101939
  if (result.stderr.trim().length > 0)
@@ -101662,27 +101944,14 @@ async function defaultRunCommand3(command, args, options) {
101662
101944
  function findRepoRoot2(importerDir) {
101663
101945
  let current = importerDir;
101664
101946
  for (let depth = 0;depth <= 7; depth += 1) {
101665
- if (fileExistsSync(join60(current, "packages", "omo-senpi", "plugin", "package.json")))
101947
+ if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
101666
101948
  return current;
101667
- current = resolve18(current, "..");
101949
+ current = resolve20(current, "..");
101668
101950
  }
101669
101951
  throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
101670
101952
  }
101671
- async function fileExists2(path6) {
101672
- try {
101673
- await access2(path6, constants8.F_OK);
101674
- return true;
101675
- } catch (error51) {
101676
- if (isErrno2(error51, "ENOENT"))
101677
- return false;
101678
- throw error51;
101679
- }
101680
- }
101681
101953
  function fileExistsSync(path6) {
101682
- return existsSync30(path6);
101683
- }
101684
- function isErrno2(error51, code) {
101685
- return error51 instanceof Error && "code" in error51 && error51.code === code;
101954
+ return existsSync32(path6);
101686
101955
  }
101687
101956
  // packages/omo-opencode/src/cli/star-request.ts
101688
101957
  import { execFile as execFile5 } from "node:child_process";
@@ -101718,26 +101987,26 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
101718
101987
  init_provider_availability();
101719
101988
 
101720
101989
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
101721
- import { existsSync as existsSync32, mkdirSync as mkdirSync10, readFileSync as readFileSync15 } from "node:fs";
101722
- import { join as join62 } from "node:path";
101990
+ import { existsSync as existsSync34, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "node:fs";
101991
+ import { join as join65 } from "node:path";
101723
101992
 
101724
101993
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
101725
101994
  init_shared();
101726
- import { existsSync as existsSync31, readFileSync as readFileSync14 } from "node:fs";
101727
- import { join as join61 } from "node:path";
101995
+ import { existsSync as existsSync33, readFileSync as readFileSync15 } from "node:fs";
101996
+ import { join as join64 } from "node:path";
101728
101997
  var TUI_SUBPATH = "tui";
101729
101998
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
101730
101999
  function fileEntryPackageJsonPath(entry) {
101731
102000
  let path6 = entry.slice("file:".length);
101732
102001
  if (path6.startsWith("//"))
101733
102002
  path6 = path6.slice(2);
101734
- return join61(path6, "package.json");
102003
+ return join64(path6, "package.json");
101735
102004
  }
101736
102005
  function packageJsonExportsTui(pkgJsonPath) {
101737
- if (!existsSync31(pkgJsonPath))
102006
+ if (!existsSync33(pkgJsonPath))
101738
102007
  return null;
101739
102008
  try {
101740
- const parsed = JSON.parse(readFileSync14(pkgJsonPath, "utf-8"));
102009
+ const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
101741
102010
  if (parsed.exports === undefined)
101742
102011
  return null;
101743
102012
  if (typeof parsed.exports === "string")
@@ -101769,16 +102038,16 @@ function packageExportsTuiForServerEntry(entry) {
101769
102038
  const packageName = packageNameFromServerEntry(entry);
101770
102039
  if (packageName === null)
101771
102040
  return null;
101772
- return packageJsonExportsTui(join61(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
102041
+ return packageJsonExportsTui(join64(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
101773
102042
  }
101774
102043
  function isOurFilePluginEntry(entry) {
101775
102044
  if (typeof entry !== "string" || !entry.startsWith("file:"))
101776
102045
  return false;
101777
102046
  try {
101778
102047
  const pkgJsonPath = fileEntryPackageJsonPath(entry);
101779
- if (!existsSync31(pkgJsonPath))
102048
+ if (!existsSync33(pkgJsonPath))
101780
102049
  return false;
101781
- const parsed = JSON.parse(readFileSync14(pkgJsonPath, "utf-8"));
102050
+ const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
101782
102051
  return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
101783
102052
  } catch (error51) {
101784
102053
  log2("[tui-plugin-config] Failed to inspect file plugin package", {
@@ -101811,12 +102080,12 @@ function isCanonicalNamedTuiPluginEntry(entry) {
101811
102080
  }
101812
102081
  function detectServerPluginRegistration() {
101813
102082
  const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
101814
- const configPath = existsSync31(paths2.configJsonc) ? paths2.configJsonc : existsSync31(paths2.configJson) ? paths2.configJson : null;
102083
+ const configPath = existsSync33(paths2.configJsonc) ? paths2.configJsonc : existsSync33(paths2.configJson) ? paths2.configJson : null;
101815
102084
  if (!configPath) {
101816
102085
  return { registered: false, configPath: null, entry: null, packageExportsTui: null };
101817
102086
  }
101818
102087
  try {
101819
- const parsed = parseJsonc(readFileSync14(configPath, "utf-8"));
102088
+ const parsed = parseJsonc(readFileSync15(configPath, "utf-8"));
101820
102089
  const plugins = parsed.plugin ?? [];
101821
102090
  const serverEntry = plugins.find(isServerPluginEntry);
101822
102091
  return {
@@ -101834,8 +102103,8 @@ function detectServerPluginRegistration() {
101834
102103
  }
101835
102104
  }
101836
102105
  function detectTuiPluginRegistration() {
101837
- const tuiJsonPath = join61(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
101838
- if (!existsSync31(tuiJsonPath)) {
102106
+ const tuiJsonPath = join64(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
102107
+ if (!existsSync33(tuiJsonPath)) {
101839
102108
  return {
101840
102109
  registered: false,
101841
102110
  configPath: tuiJsonPath,
@@ -101846,7 +102115,7 @@ function detectTuiPluginRegistration() {
101846
102115
  };
101847
102116
  }
101848
102117
  try {
101849
- const parsed = parseJsonc(readFileSync14(tuiJsonPath, "utf-8"));
102118
+ const parsed = parseJsonc(readFileSync15(tuiJsonPath, "utf-8"));
101850
102119
  const plugins = parsed.plugin ?? [];
101851
102120
  return {
101852
102121
  registered: plugins.some(isTuiPluginEntry),
@@ -101979,7 +102248,7 @@ init_shared();
101979
102248
  init_write_file_atomically();
101980
102249
  function readConfig(path6) {
101981
102250
  try {
101982
- const parsed = parseJsonc(readFileSync15(path6, "utf-8"));
102251
+ const parsed = parseJsonc(readFileSync16(path6, "utf-8"));
101983
102252
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
101984
102253
  return parsed;
101985
102254
  }
@@ -101990,11 +102259,11 @@ function readConfig(path6) {
101990
102259
  return null;
101991
102260
  }
101992
102261
  function readServerConfig(configDir) {
101993
- const jsoncPath = join62(configDir, "opencode.jsonc");
101994
- if (existsSync32(jsoncPath))
102262
+ const jsoncPath = join65(configDir, "opencode.jsonc");
102263
+ if (existsSync34(jsoncPath))
101995
102264
  return readConfig(jsoncPath);
101996
- const jsonPath = join62(configDir, "opencode.json");
101997
- if (existsSync32(jsonPath))
102265
+ const jsonPath = join65(configDir, "opencode.json");
102266
+ if (existsSync34(jsonPath))
101998
102267
  return readConfig(jsonPath);
101999
102268
  return null;
102000
102269
  }
@@ -102014,7 +102283,7 @@ function desiredTuiEntry(serverEntry) {
102014
102283
  return null;
102015
102284
  }
102016
102285
  function readTuiConfig(tuiJsonPath) {
102017
- if (!existsSync32(tuiJsonPath)) {
102286
+ if (!existsSync34(tuiJsonPath)) {
102018
102287
  return { config: {}, malformed: false };
102019
102288
  }
102020
102289
  const config3 = readConfig(tuiJsonPath);
@@ -102035,7 +102304,7 @@ function ensureTuiPluginEntry(opts = {}) {
102035
102304
  if (!desiredEntry) {
102036
102305
  return { changed: false, reason: "no-server-entry" };
102037
102306
  }
102038
- const tuiJsonPath = join62(configDir, "tui.json");
102307
+ const tuiJsonPath = join65(configDir, "tui.json");
102039
102308
  const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
102040
102309
  if (malformed) {
102041
102310
  return { changed: false, reason: "malformed" };
@@ -102044,22 +102313,22 @@ function ensureTuiPluginEntry(opts = {}) {
102044
102313
  if (plugins.includes(desiredEntry)) {
102045
102314
  return { changed: false, reason: "already-present" };
102046
102315
  }
102047
- mkdirSync10(configDir, { recursive: true });
102316
+ mkdirSync11(configDir, { recursive: true });
102048
102317
  writeFileAtomically2(tuiJsonPath, formatConfig({ ...config3, plugin: [...plugins, desiredEntry] }));
102049
102318
  return { changed: true, reason: "added" };
102050
102319
  }
102051
102320
 
102052
102321
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
102053
- import { homedir as homedir10 } from "node:os";
102054
- import { join as join63 } from "node:path";
102322
+ import { homedir as homedir12 } from "node:os";
102323
+ import { join as join66 } from "node:path";
102055
102324
 
102056
102325
  // packages/shared-skills/index.mjs
102057
- import { existsSync as existsSync33 } from "node:fs";
102326
+ import { existsSync as existsSync35 } from "node:fs";
102058
102327
  import { fileURLToPath as fileURLToPath2 } from "node:url";
102059
102328
  var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
102060
102329
  function sharedSkillsRootPath() {
102061
102330
  const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
102062
- return candidates.find((candidate2) => existsSync33(candidate2)) ?? candidates[0];
102331
+ return candidates.find((candidate2) => existsSync35(candidate2)) ?? candidates[0];
102063
102332
  }
102064
102333
 
102065
102334
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
@@ -102073,9 +102342,9 @@ function describeResult2(result) {
102073
102342
  }
102074
102343
  async function installAstGrepForOpenCode(options = {}) {
102075
102344
  const platform = options.platform ?? process.platform;
102076
- const baseDir = join63(options.homeDir ?? homedir10(), ".omo");
102345
+ const baseDir = join66(options.homeDir ?? homedir12(), ".omo");
102077
102346
  const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
102078
- const skillDir = join63(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
102347
+ const skillDir = join66(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
102079
102348
  const installer = options.installer ?? runAstGrepSkillInstall;
102080
102349
  try {
102081
102350
  const result = await installer({ platform, skillDir, targetDir });
@@ -105878,7 +106147,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
105878
106147
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
105879
106148
  init_bun_which_shim();
105880
106149
  init_spawn_with_windows_hide();
105881
- import { delimiter as delimiter2, dirname as dirname23, posix as posix9, win32 as win325 } from "node:path";
106150
+ import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "node:path";
105882
106151
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
105883
106152
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
105884
106153
  function getCommandCandidates(platform) {
@@ -105936,7 +106205,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
105936
106205
  return null;
105937
106206
  }
105938
106207
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
105939
- const preferredDir = dirname23(binaryPath);
106208
+ const preferredDir = dirname25(binaryPath);
105940
106209
  const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
105941
106210
  return [preferredDir, ...existing].join(delimiter2);
105942
106211
  }
@@ -106105,7 +106374,7 @@ async function resolveSession(options) {
106105
106374
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
106106
106375
  const delay2 = retryDelayMs * attempt;
106107
106376
  console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
106108
- await new Promise((resolve19) => setTimeout(resolve19, delay2));
106377
+ await new Promise((resolve21) => setTimeout(resolve21, delay2));
106109
106378
  }
106110
106379
  continue;
106111
106380
  }
@@ -106116,7 +106385,7 @@ async function resolveSession(options) {
106116
106385
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
106117
106386
  const delay2 = retryDelayMs * attempt;
106118
106387
  console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
106119
- await new Promise((resolve19) => setTimeout(resolve19, delay2));
106388
+ await new Promise((resolve21) => setTimeout(resolve21, delay2));
106120
106389
  }
106121
106390
  }
106122
106391
  throw new Error("Failed to create session after all retries");
@@ -106155,7 +106424,7 @@ function createJsonOutputManager(options = {}) {
106155
106424
 
106156
106425
  // packages/omo-opencode/src/cli/run/on-complete-hook.ts
106157
106426
  init_spawn_with_windows_hide();
106158
- init_shared();
106427
+ init_shell_env();
106159
106428
  init_logger2();
106160
106429
  var defaultDeps3 = {
106161
106430
  spawnWithWindowsHide,
@@ -106175,15 +106444,15 @@ async function readOutput(stream, streamName, deps = defaultDeps3) {
106175
106444
  return "";
106176
106445
  }
106177
106446
  }
106178
- function resolveHookShellCommand(command) {
106179
- const shellType = detectShellType();
106447
+ function resolveHookShellCommand(command, platform, env3) {
106448
+ const shellType = detectShellType(platform, env3);
106180
106449
  switch (shellType) {
106181
106450
  case "powershell": {
106182
- const powershellExecutable = process.platform === "win32" ? "powershell.exe" : "pwsh";
106451
+ const powershellExecutable = platform === "win32" ? "powershell.exe" : "pwsh";
106183
106452
  return [powershellExecutable, "-NoProfile", "-Command", command];
106184
106453
  }
106185
106454
  case "cmd":
106186
- return [process.env.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
106455
+ return [env3.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
106187
106456
  case "csh":
106188
106457
  return ["csh", "-c", command];
106189
106458
  case "unix":
@@ -106199,10 +106468,12 @@ async function executeOnCompleteHook(options, deps = defaultDeps3) {
106199
106468
  }
106200
106469
  deps.log("Running on-complete hook", { command: trimmedCommand });
106201
106470
  try {
106202
- const shellCommand = resolveHookShellCommand(trimmedCommand);
106471
+ const platform = deps.platform ?? process.platform;
106472
+ const env3 = deps.env ?? process.env;
106473
+ const shellCommand = resolveHookShellCommand(trimmedCommand, platform, env3);
106203
106474
  const proc = deps.spawnWithWindowsHide(shellCommand, {
106204
106475
  env: {
106205
- ...process.env,
106476
+ ...env3,
106206
106477
  SESSION_ID: sessionId,
106207
106478
  EXIT_CODE: String(exitCode),
106208
106479
  DURATION_MS: String(durationMs),
@@ -106514,26 +106785,26 @@ function isClosingFence(line, fence) {
106514
106785
  return run?.charAt(0) === fence.marker && run.length >= fence.length;
106515
106786
  }
106516
106787
  // packages/boulder-state/src/top-level-task.ts
106517
- import { existsSync as existsSync34, readFileSync as readFileSync16 } from "node:fs";
106788
+ import { existsSync as existsSync36, readFileSync as readFileSync17 } from "node:fs";
106518
106789
  function readCurrentTopLevelTask(planPath) {
106519
- if (!existsSync34(planPath)) {
106790
+ if (!existsSync36(planPath)) {
106520
106791
  return null;
106521
106792
  }
106522
106793
  try {
106523
- const content = readFileSync16(planPath, "utf-8");
106794
+ const content = readFileSync17(planPath, "utf-8");
106524
106795
  return parseCurrentTopLevelTask(content);
106525
106796
  } catch {
106526
106797
  return null;
106527
106798
  }
106528
106799
  }
106529
106800
  // packages/boulder-state/src/storage/path.ts
106530
- import { existsSync as existsSync35 } from "node:fs";
106531
- import { isAbsolute as isAbsolute11, join as join64, relative as relative8, resolve as resolve19 } from "node:path";
106801
+ import { existsSync as existsSync37 } from "node:fs";
106802
+ import { isAbsolute as isAbsolute11, join as join67, relative as relative8, resolve as resolve21 } from "node:path";
106532
106803
  function getBoulderFilePath(directory) {
106533
- return join64(directory, BOULDER_DIR, BOULDER_FILE);
106804
+ return join67(directory, BOULDER_DIR, BOULDER_FILE);
106534
106805
  }
106535
106806
  function resolveTrackedPath(baseDirectory, trackedPath) {
106536
- return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
106807
+ return isAbsolute11(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
106537
106808
  }
106538
106809
  function resolveBoulderPlanPath(directory, state) {
106539
106810
  const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
@@ -106541,26 +106812,26 @@ function resolveBoulderPlanPath(directory, state) {
106541
106812
  if (!worktreePath) {
106542
106813
  return absolutePlanPath;
106543
106814
  }
106544
- const absoluteDirectory = resolve19(directory);
106815
+ const absoluteDirectory = resolve21(directory);
106545
106816
  const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
106546
106817
  if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
106547
106818
  return absolutePlanPath;
106548
106819
  }
106549
106820
  const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
106550
- const worktreePlanPath = resolve19(absoluteWorktreePath, relativePlanPath);
106551
- return existsSync35(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
106821
+ const worktreePlanPath = resolve21(absoluteWorktreePath, relativePlanPath);
106822
+ return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
106552
106823
  }
106553
106824
  function resolveBoulderPlanPathForWork(directory, work) {
106554
106825
  return resolveBoulderPlanPath(directory, work);
106555
106826
  }
106556
106827
  // packages/boulder-state/src/storage/plan-progress.ts
106557
- import { existsSync as existsSync36, readFileSync as readFileSync17, readdirSync as readdirSync7, statSync as statSync4 } from "node:fs";
106828
+ import { existsSync as existsSync38, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync4 } from "node:fs";
106558
106829
  function getPlanProgress(planPath) {
106559
- if (!existsSync36(planPath)) {
106830
+ if (!existsSync38(planPath)) {
106560
106831
  return { total: 0, completed: 0, isComplete: false };
106561
106832
  }
106562
106833
  try {
106563
- const content = readFileSync17(planPath, "utf-8");
106834
+ const content = readFileSync18(planPath, "utf-8");
106564
106835
  const checklist = parsePlanChecklist(content);
106565
106836
  return {
106566
106837
  total: checklist.total,
@@ -106639,14 +106910,14 @@ function selectMirrorWork(state) {
106639
106910
  return sorted[0] ?? null;
106640
106911
  }
106641
106912
  // packages/boulder-state/src/storage/read-state.ts
106642
- import { existsSync as existsSync37, readFileSync as readFileSync18 } from "node:fs";
106913
+ import { existsSync as existsSync39, readFileSync as readFileSync19 } from "node:fs";
106643
106914
  function readBoulderState(directory) {
106644
106915
  const filePath = getBoulderFilePath(directory);
106645
- if (!existsSync37(filePath)) {
106916
+ if (!existsSync39(filePath)) {
106646
106917
  return null;
106647
106918
  }
106648
106919
  try {
106649
- const content = readFileSync18(filePath, "utf-8");
106920
+ const content = readFileSync19(filePath, "utf-8");
106650
106921
  const parsed = JSON.parse(content);
106651
106922
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || Object.keys(parsed).length === 0) {
106652
106923
  return null;
@@ -106712,17 +106983,17 @@ init_state();
106712
106983
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
106713
106984
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
106714
106985
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
106715
- import { existsSync as existsSync38, mkdirSync as mkdirSync11, readFileSync as readFileSync19, rmSync, writeFileSync as writeFileSync6 } from "node:fs";
106716
- import { join as join65 } from "node:path";
106986
+ import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "node:fs";
106987
+ import { join as join68 } from "node:path";
106717
106988
  function getMarkerPath(directory, sessionID) {
106718
- return join65(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
106989
+ return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
106719
106990
  }
106720
106991
  function readContinuationMarker(directory, sessionID) {
106721
106992
  const markerPath = getMarkerPath(directory, sessionID);
106722
- if (!existsSync38(markerPath))
106993
+ if (!existsSync40(markerPath))
106723
106994
  return null;
106724
106995
  try {
106725
- const raw = readFileSync19(markerPath, "utf-8");
106996
+ const raw = readFileSync20(markerPath, "utf-8");
106726
106997
  const parsed = JSON.parse(raw);
106727
106998
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
106728
106999
  return null;
@@ -106787,8 +107058,8 @@ async function isSessionInBoulderLineage(input) {
106787
107058
  // packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
106788
107059
  init_shared();
106789
107060
  init_compaction_marker();
106790
- import { readFileSync as readFileSync20, readdirSync as readdirSync8 } from "node:fs";
106791
- import { join as join66 } from "node:path";
107061
+ import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "node:fs";
107062
+ import { join as join69 } from "node:path";
106792
107063
  var defaultSessionLastAgentDeps = {
106793
107064
  getMessageDir,
106794
107065
  isSqliteBackend,
@@ -106848,7 +107119,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
106848
107119
  try {
106849
107120
  const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
106850
107121
  try {
106851
- const content = readFileSync20(join66(messageDir, fileName), "utf-8");
107122
+ const content = readFileSync21(join69(messageDir, fileName), "utf-8");
106852
107123
  const parsed = JSON.parse(content);
106853
107124
  return {
106854
107125
  fileName,
@@ -106891,8 +107162,8 @@ init_agent_display_names();
106891
107162
 
106892
107163
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
106893
107164
  init_frontmatter2();
106894
- import { existsSync as existsSync39, readFileSync as readFileSync21, writeFileSync as writeFileSync7, unlinkSync as unlinkSync6, mkdirSync as mkdirSync12 } from "node:fs";
106895
- import { dirname as dirname24, join as join67 } from "node:path";
107165
+ import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "node:fs";
107166
+ import { dirname as dirname26, join as join70 } from "node:path";
106896
107167
 
106897
107168
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
106898
107169
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -106901,15 +107172,15 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
106901
107172
 
106902
107173
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
106903
107174
  function getStateFilePath(directory, customPath) {
106904
- return customPath ? join67(directory, customPath) : join67(directory, DEFAULT_STATE_FILE);
107175
+ return customPath ? join70(directory, customPath) : join70(directory, DEFAULT_STATE_FILE);
106905
107176
  }
106906
107177
  function readState(directory, customPath) {
106907
107178
  const filePath = getStateFilePath(directory, customPath);
106908
- if (!existsSync39(filePath)) {
107179
+ if (!existsSync41(filePath)) {
106909
107180
  return null;
106910
107181
  }
106911
107182
  try {
106912
- const content = readFileSync21(filePath, "utf-8");
107183
+ const content = readFileSync22(filePath, "utf-8");
106913
107184
  const { data, body } = parseFrontmatter(content);
106914
107185
  const active = data.active;
106915
107186
  const iteration = data.iteration;
@@ -107135,7 +107406,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
107135
107406
  const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
107136
107407
  const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
107137
107408
  const now = options.now ?? Date.now;
107138
- const sleep = options.sleep ?? ((ms) => new Promise((resolve20) => setTimeout(resolve20, ms)));
107409
+ const sleep = options.sleep ?? ((ms) => new Promise((resolve22) => setTimeout(resolve22, ms)));
107139
107410
  let consecutiveCompleteChecks = 0;
107140
107411
  let errorCycleCount = 0;
107141
107412
  let firstWorkTimestamp = null;
@@ -107300,7 +107571,7 @@ function createAbortError() {
107300
107571
  return error51;
107301
107572
  }
107302
107573
  function sleep(delayMs) {
107303
- return new Promise((resolve20) => setTimeout(resolve20, delayMs));
107574
+ return new Promise((resolve22) => setTimeout(resolve22, delayMs));
107304
107575
  }
107305
107576
  function hasPromptStartEvidence(eventState) {
107306
107577
  return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
@@ -107675,7 +107946,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
107675
107946
  async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
107676
107947
  const completed = await Promise.race([
107677
107948
  eventProcessor.then(() => true),
107678
- new Promise((resolve20) => setTimeout(() => resolve20(false), timeoutMs))
107949
+ new Promise((resolve22) => setTimeout(() => resolve22(false), timeoutMs))
107679
107950
  ]);
107680
107951
  }
107681
107952
  async function run(options) {
@@ -107738,10 +108009,10 @@ Interrupted. Shutting down...`));
107738
108009
  abortController,
107739
108010
  verbose: options.verbose ?? false
107740
108011
  };
107741
- const events = await client3.event.subscribe({ query: { directory } });
108012
+ const events2 = await client3.event.subscribe({ query: { directory } });
107742
108013
  const eventState = createEventState();
107743
108014
  eventState.agentColorsByName = await loadAgentProfileColors(client3);
107744
- const eventProcessor = processEvents(ctx, events.stream, eventState).catch(() => {});
108015
+ const eventProcessor = processEvents(ctx, events2.stream, eventState).catch(() => {});
107745
108016
  const promptResult = await dispatchInternalPrompt({
107746
108017
  mode: "async",
107747
108018
  client: client3,
@@ -108001,14 +108272,14 @@ async function getLocalVersion(options = {}) {
108001
108272
  }
108002
108273
  }
108003
108274
  // packages/omo-opencode/src/cli/doctor/checks/system.ts
108004
- import { existsSync as existsSync50, readFileSync as readFileSync31 } from "node:fs";
108275
+ import { existsSync as existsSync52, readFileSync as readFileSync32 } from "node:fs";
108005
108276
 
108006
108277
  // packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
108007
108278
  init_extract_semver();
108008
108279
  init_bun_which_shim();
108009
- import { existsSync as existsSync47, accessSync as accessSync4, constants as constants11 } from "node:fs";
108010
- import { homedir as homedir13 } from "node:os";
108011
- import { join as join74 } from "node:path";
108280
+ import { existsSync as existsSync49, accessSync as accessSync4, constants as constants11 } from "node:fs";
108281
+ import { homedir as homedir15 } from "node:os";
108282
+ import { join as join77 } from "node:path";
108012
108283
 
108013
108284
  // packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
108014
108285
  init_spawn_with_windows_hide();
@@ -108047,8 +108318,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
108047
108318
  const stdoutPromise = readSpawnStream(proc.stdout);
108048
108319
  const stderrPromise = readSpawnStream(proc.stderr);
108049
108320
  let timer;
108050
- const timeoutPromise = new Promise((resolve20) => {
108051
- timer = setTimeout(() => resolve20("timeout"), timeoutMs);
108321
+ const timeoutPromise = new Promise((resolve22) => {
108322
+ timer = setTimeout(() => resolve22("timeout"), timeoutMs);
108052
108323
  });
108053
108324
  const processPromise = (async () => {
108054
108325
  await proc.exited;
@@ -108095,22 +108366,22 @@ function isExecutable2(path12) {
108095
108366
  }
108096
108367
  }
108097
108368
  function getDesktopAppPaths(platform) {
108098
- const home = homedir13();
108369
+ const home = homedir15();
108099
108370
  switch (platform) {
108100
108371
  case "darwin":
108101
108372
  return [
108102
108373
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
108103
- join74(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
108374
+ join77(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
108104
108375
  ];
108105
108376
  case "win32": {
108106
108377
  const programFiles = process.env.ProgramFiles;
108107
108378
  const localAppData = process.env.LOCALAPPDATA;
108108
108379
  const paths2 = [];
108109
108380
  if (programFiles) {
108110
- paths2.push(join74(programFiles, "OpenCode", "OpenCode.exe"));
108381
+ paths2.push(join77(programFiles, "OpenCode", "OpenCode.exe"));
108111
108382
  }
108112
108383
  if (localAppData) {
108113
- paths2.push(join74(localAppData, "OpenCode", "OpenCode.exe"));
108384
+ paths2.push(join77(localAppData, "OpenCode", "OpenCode.exe"));
108114
108385
  }
108115
108386
  return paths2;
108116
108387
  }
@@ -108118,8 +108389,8 @@ function getDesktopAppPaths(platform) {
108118
108389
  return [
108119
108390
  "/usr/bin/opencode",
108120
108391
  "/usr/lib/opencode/opencode",
108121
- join74(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
108122
- join74(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
108392
+ join77(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
108393
+ join77(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
108123
108394
  ];
108124
108395
  default:
108125
108396
  return [];
@@ -108131,7 +108402,7 @@ function buildVersionCommand(binaryPath, platform) {
108131
108402
  }
108132
108403
  return [binaryPath, "--version"];
108133
108404
  }
108134
- function findDesktopBinary(platform = process.platform, checkExists = existsSync47) {
108405
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
108135
108406
  for (const desktopPath of getDesktopAppPaths(platform)) {
108136
108407
  if (checkExists(desktopPath)) {
108137
108408
  return { binary: "opencode", path: desktopPath };
@@ -108139,7 +108410,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
108139
108410
  }
108140
108411
  return null;
108141
108412
  }
108142
- async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync47) {
108413
+ async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
108143
108414
  for (const binary of OPENCODE_BINARIES2) {
108144
108415
  const path12 = bunWhich(binary);
108145
108416
  if (path12 && checkExists(path12)) {
@@ -108151,7 +108422,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
108151
108422
  const candidates = getCommandCandidates2(platform);
108152
108423
  for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
108153
108424
  for (const command of candidates) {
108154
- const fullPath = join74(entry, command);
108425
+ const fullPath = join77(entry, command);
108155
108426
  if (checkExists(fullPath) && isExecutable2(fullPath)) {
108156
108427
  return { binary: command, path: fullPath };
108157
108428
  }
@@ -108197,12 +108468,12 @@ function compareVersions3(current, minimum) {
108197
108468
 
108198
108469
  // packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
108199
108470
  init_shared();
108200
- import { existsSync as existsSync48, readFileSync as readFileSync29 } from "node:fs";
108471
+ import { existsSync as existsSync50, readFileSync as readFileSync30 } from "node:fs";
108201
108472
  function detectConfigPath() {
108202
108473
  const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
108203
- if (existsSync48(paths2.configJsonc))
108474
+ if (existsSync50(paths2.configJsonc))
108204
108475
  return paths2.configJsonc;
108205
- if (existsSync48(paths2.configJson))
108476
+ if (existsSync50(paths2.configJson))
108206
108477
  return paths2.configJson;
108207
108478
  return null;
108208
108479
  }
@@ -108248,7 +108519,7 @@ function getPluginInfo() {
108248
108519
  };
108249
108520
  }
108250
108521
  try {
108251
- const content = readFileSync29(configPath, "utf-8");
108522
+ const content = readFileSync30(configPath, "utf-8");
108252
108523
  const parsedConfig = parseJsonc(content);
108253
108524
  const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
108254
108525
  if (!pluginEntry) {
@@ -108290,39 +108561,39 @@ init_file_utils2();
108290
108561
  init_checker();
108291
108562
  init_auto_update_checker();
108292
108563
  init_package_json_locator();
108293
- import { existsSync as existsSync49, readFileSync as readFileSync30, readdirSync as readdirSync10 } from "node:fs";
108564
+ import { existsSync as existsSync51, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "node:fs";
108294
108565
  import { createRequire as createRequire3 } from "node:module";
108295
- import { homedir as homedir14 } from "node:os";
108296
- import { join as join75 } from "node:path";
108566
+ import { homedir as homedir16 } from "node:os";
108567
+ import { join as join78 } from "node:path";
108297
108568
  import { fileURLToPath as fileURLToPath6 } from "node:url";
108298
108569
  init_shared();
108299
108570
  function getPlatformDefaultCacheDir(platform = process.platform) {
108300
108571
  if (platform === "darwin")
108301
- return join75(homedir14(), "Library", "Caches");
108572
+ return join78(homedir16(), "Library", "Caches");
108302
108573
  if (platform === "win32")
108303
- return process.env.LOCALAPPDATA ?? join75(homedir14(), "AppData", "Local");
108304
- return join75(homedir14(), ".cache");
108574
+ return process.env.LOCALAPPDATA ?? join78(homedir16(), "AppData", "Local");
108575
+ return join78(homedir16(), ".cache");
108305
108576
  }
108306
108577
  function resolveOpenCodeCacheDir() {
108307
108578
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
108308
108579
  if (xdgCacheHome)
108309
- return join75(xdgCacheHome, "opencode");
108580
+ return join78(xdgCacheHome, "opencode");
108310
108581
  const fromShared = getOpenCodeCacheDir();
108311
- const platformDefault = join75(getPlatformDefaultCacheDir(), "opencode");
108312
- if (existsSync49(fromShared) || !existsSync49(platformDefault))
108582
+ const platformDefault = join78(getPlatformDefaultCacheDir(), "opencode");
108583
+ if (existsSync51(fromShared) || !existsSync51(platformDefault))
108313
108584
  return fromShared;
108314
108585
  return platformDefault;
108315
108586
  }
108316
108587
  function resolveExistingDir(dirPath) {
108317
- if (!existsSync49(dirPath))
108588
+ if (!existsSync51(dirPath))
108318
108589
  return dirPath;
108319
108590
  return resolveSymlink(dirPath);
108320
108591
  }
108321
108592
  function readPackageJson(filePath) {
108322
- if (!existsSync49(filePath))
108593
+ if (!existsSync51(filePath))
108323
108594
  return null;
108324
108595
  try {
108325
- const content = readFileSync30(filePath, "utf-8");
108596
+ const content = readFileSync31(filePath, "utf-8");
108326
108597
  return parseJsonc(content);
108327
108598
  } catch (error51) {
108328
108599
  if (!(error51 instanceof Error)) {
@@ -108340,26 +108611,26 @@ function normalizeVersion(value) {
108340
108611
  function createPackageCandidates(rootDir) {
108341
108612
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
108342
108613
  packageName,
108343
- installedPackagePath: join75(rootDir, "node_modules", packageName, "package.json")
108614
+ installedPackagePath: join78(rootDir, "node_modules", packageName, "package.json")
108344
108615
  }));
108345
108616
  }
108346
108617
  function createTaggedInstallCandidates(rootDir) {
108347
- const packagesDir = join75(rootDir, "packages");
108348
- if (!existsSync49(packagesDir))
108618
+ const packagesDir = join78(rootDir, "packages");
108619
+ if (!existsSync51(packagesDir))
108349
108620
  return [];
108350
108621
  const candidates = [];
108351
108622
  for (const entryName of readdirSync10(packagesDir).sort()) {
108352
108623
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
108353
108624
  if (packageName === undefined)
108354
108625
  continue;
108355
- const installDir = join75(packagesDir, entryName);
108626
+ const installDir = join78(packagesDir, entryName);
108356
108627
  candidates.push({
108357
108628
  cacheDir: installDir,
108358
- cachePackagePath: join75(installDir, "package.json"),
108629
+ cachePackagePath: join78(installDir, "package.json"),
108359
108630
  packageCandidates: [
108360
108631
  {
108361
108632
  packageName,
108362
- installedPackagePath: join75(installDir, "node_modules", packageName, "package.json")
108633
+ installedPackagePath: join78(installDir, "node_modules", packageName, "package.json")
108363
108634
  }
108364
108635
  ]
108365
108636
  });
@@ -108367,7 +108638,7 @@ function createTaggedInstallCandidates(rootDir) {
108367
108638
  return candidates;
108368
108639
  }
108369
108640
  function selectInstalledPackage(candidate2) {
108370
- return candidate2.packageCandidates.find((packageCandidate) => existsSync49(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
108641
+ return candidate2.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
108371
108642
  }
108372
108643
  function getExpectedVersion(cachePackage, packageName) {
108373
108644
  return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
@@ -108378,7 +108649,7 @@ function resolveInstalledPackageJsonPath() {
108378
108649
  for (const packageName of ACCEPTED_PACKAGE_NAMES) {
108379
108650
  try {
108380
108651
  const packageJsonPath = require2.resolve(`${packageName}/package.json`);
108381
- if (existsSync49(packageJsonPath)) {
108652
+ if (existsSync51(packageJsonPath)) {
108382
108653
  return { packageName, packageJsonPath };
108383
108654
  }
108384
108655
  } catch {
@@ -108404,22 +108675,22 @@ function getLoadedPluginVersion() {
108404
108675
  const candidates = [
108405
108676
  {
108406
108677
  cacheDir: configDir,
108407
- cachePackagePath: join75(configDir, "package.json"),
108678
+ cachePackagePath: join78(configDir, "package.json"),
108408
108679
  packageCandidates: createPackageCandidates(configDir)
108409
108680
  },
108410
108681
  ...createTaggedInstallCandidates(configDir),
108411
108682
  {
108412
108683
  cacheDir,
108413
- cachePackagePath: join75(cacheDir, "package.json"),
108684
+ cachePackagePath: join78(cacheDir, "package.json"),
108414
108685
  packageCandidates: createPackageCandidates(cacheDir)
108415
108686
  },
108416
108687
  ...createTaggedInstallCandidates(cacheDir)
108417
108688
  ];
108418
- const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync49(packageCandidate.installedPackagePath))) ?? candidates[0];
108689
+ const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
108419
108690
  const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
108420
108691
  const selectedPackage = selectInstalledPackage(selectedCandidate);
108421
108692
  const candidateInstalledPath = selectedPackage.installedPackagePath;
108422
- const candidateExists = existsSync49(candidateInstalledPath);
108693
+ const candidateExists = existsSync51(candidateInstalledPath);
108423
108694
  const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
108424
108695
  const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
108425
108696
  const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
@@ -108455,8 +108726,8 @@ var defaultDeps6 = {
108455
108726
  getLoadedPluginVersion,
108456
108727
  getLatestPluginVersion,
108457
108728
  getSuggestedInstallTag,
108458
- configExists: existsSync50,
108459
- readConfigFile: (path12) => readFileSync31(path12, "utf-8"),
108729
+ configExists: existsSync52,
108730
+ readConfigFile: (path12) => readFileSync32(path12, "utf-8"),
108460
108731
  parseConfigContent: (content) => parseJsonc(content)
108461
108732
  };
108462
108733
  var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
@@ -108601,26 +108872,26 @@ async function checkSystem(deps = defaultDeps6) {
108601
108872
 
108602
108873
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
108603
108874
  init_shared();
108604
- import { existsSync as existsSync51, readFileSync as readFileSync32 } from "node:fs";
108605
- import { homedir as homedir15 } from "node:os";
108606
- import { join as join76 } from "node:path";
108875
+ import { existsSync as existsSync53, readFileSync as readFileSync33 } from "node:fs";
108876
+ import { homedir as homedir17 } from "node:os";
108877
+ import { join as join79 } from "node:path";
108607
108878
  function getUserConfigDir2() {
108608
108879
  const xdgConfig = process.env.XDG_CONFIG_HOME;
108609
108880
  if (xdgConfig)
108610
- return join76(xdgConfig, "opencode");
108611
- return join76(homedir15(), ".config", "opencode");
108881
+ return join79(xdgConfig, "opencode");
108882
+ return join79(homedir17(), ".config", "opencode");
108612
108883
  }
108613
108884
  function loadCustomProviderNames() {
108614
108885
  const configDir = getUserConfigDir2();
108615
108886
  const candidatePaths = [
108616
- join76(configDir, "opencode.json"),
108617
- join76(configDir, "opencode.jsonc")
108887
+ join79(configDir, "opencode.json"),
108888
+ join79(configDir, "opencode.jsonc")
108618
108889
  ];
108619
108890
  for (const configPath of candidatePaths) {
108620
- if (!existsSync51(configPath))
108891
+ if (!existsSync53(configPath))
108621
108892
  continue;
108622
108893
  try {
108623
- const content = readFileSync32(configPath, "utf-8");
108894
+ const content = readFileSync33(configPath, "utf-8");
108624
108895
  const data = parseJsonc(content);
108625
108896
  if (data?.provider && typeof data.provider === "object") {
108626
108897
  return Object.keys(data.provider);
@@ -108635,16 +108906,16 @@ function loadCustomProviderNames() {
108635
108906
  return [];
108636
108907
  }
108637
108908
  function loadAvailableModelsFromCache() {
108638
- const cacheFile = join76(getOpenCodeCacheDir(), "models.json");
108909
+ const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
108639
108910
  const customProviders = loadCustomProviderNames();
108640
- if (!existsSync51(cacheFile)) {
108911
+ if (!existsSync53(cacheFile)) {
108641
108912
  if (customProviders.length > 0) {
108642
108913
  return { providers: customProviders, modelCount: 0, cacheExists: true };
108643
108914
  }
108644
108915
  return { providers: [], modelCount: 0, cacheExists: false };
108645
108916
  }
108646
108917
  try {
108647
- const content = readFileSync32(cacheFile, "utf-8");
108918
+ const content = readFileSync33(cacheFile, "utf-8");
108648
108919
  const data = parseJsonc(content);
108649
108920
  const cacheProviders = Object.keys(data);
108650
108921
  let modelCount = 0;
@@ -108697,7 +108968,7 @@ function loadOmoConfig2() {
108697
108968
 
108698
108969
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
108699
108970
  init_shared();
108700
- import { join as join77 } from "node:path";
108971
+ import { join as join80 } from "node:path";
108701
108972
 
108702
108973
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
108703
108974
  function formatModelWithVariant(model, variant) {
@@ -108739,7 +109010,7 @@ function formatCapabilityResolutionLabel(mode) {
108739
109010
  }
108740
109011
  function buildModelResolutionDetails(options) {
108741
109012
  const details = [];
108742
- const cacheFile = join77(getOpenCodeCacheDir(), "models.json");
109013
+ const cacheFile = join80(getOpenCodeCacheDir(), "models.json");
108743
109014
  details.push("═══ Available Models (from cache) ═══");
108744
109015
  details.push("");
108745
109016
  if (options.available.cacheExists) {
@@ -109048,8 +109319,8 @@ async function checkConfig() {
109048
109319
 
109049
109320
  // packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
109050
109321
  init_main();
109051
- import { existsSync as existsSync52, readFileSync as readFileSync33 } from "node:fs";
109052
- import { join as join78 } from "node:path";
109322
+ import { existsSync as existsSync54, readFileSync as readFileSync34 } from "node:fs";
109323
+ import { join as join81 } from "node:path";
109053
109324
  var CANONICAL_REPLACEMENT = new Map([
109054
109325
  ["variant", "reasoning"],
109055
109326
  ["reasoningEffort", "reasoning"],
@@ -109104,16 +109375,16 @@ function userConfigPaths() {
109104
109375
  const home = process.env.HOME ?? process.env.USERPROFILE;
109105
109376
  if (home === undefined || home.length === 0)
109106
109377
  return [];
109107
- return [join78(home, ".omo", "omo.jsonc"), join78(home, ".omo", "omo.json")];
109378
+ return [join81(home, ".omo", "omo.jsonc"), join81(home, ".omo", "omo.json")];
109108
109379
  }
109109
109380
  async function checkDeprecatedReasoningKeys() {
109110
109381
  const issues = [];
109111
109382
  const scanned = [];
109112
109383
  for (const configPath of userConfigPaths()) {
109113
- if (!existsSync52(configPath))
109384
+ if (!existsSync54(configPath))
109114
109385
  continue;
109115
109386
  scanned.push(configPath);
109116
- const parsed = parse2(readFileSync33(configPath, "utf-8"));
109387
+ const parsed = parse2(readFileSync34(configPath, "utf-8"));
109117
109388
  issues.push(...collectIssues(configPath, parsed, ""));
109118
109389
  }
109119
109390
  return {
@@ -109127,28 +109398,28 @@ async function checkDeprecatedReasoningKeys() {
109127
109398
 
109128
109399
  // packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
109129
109400
  init_src2();
109130
- import { existsSync as existsSync53 } from "node:fs";
109401
+ import { existsSync as existsSync55 } from "node:fs";
109131
109402
  import { createRequire as createRequire4 } from "node:module";
109132
- import { homedir as homedir17 } from "node:os";
109133
- import { dirname as dirname29, join as join80 } from "node:path";
109403
+ import { homedir as homedir19 } from "node:os";
109404
+ import { dirname as dirname31, join as join83 } from "node:path";
109134
109405
 
109135
109406
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
109136
- import { join as join79 } from "path";
109137
- import { homedir as homedir16, tmpdir as tmpdir4 } from "os";
109407
+ import { join as join82 } from "path";
109408
+ import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
109138
109409
  init_binary_downloader();
109139
109410
  init_logger2();
109140
109411
  init_plugin_identity();
109141
109412
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
109142
- var DEBUG_FILE = join79(tmpdir4(), "comment-checker-debug.log");
109413
+ var DEBUG_FILE = join82(tmpdir4(), "comment-checker-debug.log");
109143
109414
  function getCacheDir2() {
109144
109415
  if (process.platform === "win32") {
109145
109416
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
109146
- const base2 = localAppData || join79(homedir16(), "AppData", "Local");
109147
- return join79(base2, CACHE_DIR_NAME, "bin");
109417
+ const base2 = localAppData || join82(homedir18(), "AppData", "Local");
109418
+ return join82(base2, CACHE_DIR_NAME, "bin");
109148
109419
  }
109149
109420
  const xdgCache = process.env.XDG_CACHE_HOME;
109150
- const base = xdgCache || join79(homedir16(), ".cache");
109151
- return join79(base, CACHE_DIR_NAME, "bin");
109421
+ const base = xdgCache || join82(homedir18(), ".cache");
109422
+ return join82(base, CACHE_DIR_NAME, "bin");
109152
109423
  }
109153
109424
  function getBinaryName() {
109154
109425
  return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -109198,7 +109469,7 @@ async function getBinaryVersion(binary) {
109198
109469
  }
109199
109470
  }
109200
109471
  async function checkAstGrepCli() {
109201
- const runtimeDir = astGrepRuntimeDir(join80(homedir17(), ".omo"));
109472
+ const runtimeDir = astGrepRuntimeDir(join83(homedir19(), ".omo"));
109202
109473
  const sgPath = findSgBinarySync({ runtimeDir });
109203
109474
  if (sgPath === null) {
109204
109475
  return {
@@ -109227,12 +109498,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
109227
109498
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
109228
109499
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
109229
109500
  try {
109230
- const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
109231
- const vendorPath = join80(packageDir, "vendor", platformKey, binaryName);
109232
- if (existsSync53(vendorPath))
109501
+ const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
109502
+ const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
109503
+ if (existsSync55(vendorPath))
109233
109504
  return vendorPath;
109234
- const binPath = join80(packageDir, "bin", binaryName);
109235
- if (existsSync53(binPath))
109505
+ const binPath = join83(packageDir, "bin", binaryName);
109506
+ if (existsSync55(binPath))
109236
109507
  return binPath;
109237
109508
  } catch (error51) {
109238
109509
  if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
@@ -109378,8 +109649,8 @@ async function getGhCliInfo(dependencies = {}) {
109378
109649
  // packages/omo-opencode/src/mcp/lsp.ts
109379
109650
  init_zod();
109380
109651
  init_opencode_config_dir();
109381
- import { existsSync as existsSync54, readFileSync as readFileSync34 } from "node:fs";
109382
- import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "node:path";
109652
+ import { existsSync as existsSync56, readFileSync as readFileSync35 } from "node:fs";
109653
+ import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "node:path";
109383
109654
  import { fileURLToPath as fileURLToPath7 } from "node:url";
109384
109655
 
109385
109656
  // packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -109426,7 +109697,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
109426
109697
  }
109427
109698
 
109428
109699
  // packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
109429
- import { resolve as resolve20 } from "node:path";
109700
+ import { resolve as resolve22 } from "node:path";
109430
109701
  function resolveJavaScriptRuntime(resolveExecutable) {
109431
109702
  const node = resolveExecutable("node");
109432
109703
  return node.available ? node : resolveExecutable("bun");
@@ -109434,9 +109705,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
109434
109705
  function createAncestorCliCandidates(options) {
109435
109706
  const candidates = [];
109436
109707
  const seenPaths = new Set;
109437
- let currentDirectory = resolve20(options.startDirectory);
109708
+ let currentDirectory = resolve22(options.startDirectory);
109438
109709
  while (true) {
109439
- const distCliPath = resolve20(currentDirectory, options.packageRel, options.distCliRel);
109710
+ const distCliPath = resolve22(currentDirectory, options.packageRel, options.distCliRel);
109440
109711
  if (!seenPaths.has(distCliPath)) {
109441
109712
  const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
109442
109713
  seenPaths.add(distCliPath);
@@ -109448,7 +109719,7 @@ function createAncestorCliCandidates(options) {
109448
109719
  runtimeAvailable: runtime5.available
109449
109720
  });
109450
109721
  }
109451
- const sourceCliPath = resolve20(currentDirectory, options.packageRel, options.sourceCliRel);
109722
+ const sourceCliPath = resolve22(currentDirectory, options.packageRel, options.sourceCliRel);
109452
109723
  if (!seenPaths.has(sourceCliPath)) {
109453
109724
  const runtime5 = options.resolveExecutable("bun");
109454
109725
  const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
@@ -109465,7 +109736,7 @@ function createAncestorCliCandidates(options) {
109465
109736
  runtimeAvailable: runtime5.available
109466
109737
  });
109467
109738
  }
109468
- const parentDirectory = resolve20(currentDirectory, "..");
109739
+ const parentDirectory = resolve22(currentDirectory, "..");
109469
109740
  if (parentDirectory === currentDirectory)
109470
109741
  return candidates;
109471
109742
  currentDirectory = parentDirectory;
@@ -109510,7 +109781,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
109510
109781
  ].join(";");
109511
109782
  function getModuleDirectory(moduleUrl) {
109512
109783
  try {
109513
- return dirname30(fileURLToPath7(moduleUrl));
109784
+ return dirname32(fileURLToPath7(moduleUrl));
109514
109785
  } catch (error51) {
109515
109786
  if (!(error51 instanceof Error))
109516
109787
  throw error51;
@@ -109518,11 +109789,11 @@ function getModuleDirectory(moduleUrl) {
109518
109789
  }
109519
109790
  }
109520
109791
  function findBootstrapRoot(candidates, pathExists) {
109521
- return candidates.find((candidate2) => pathExists(resolve21(candidate2.root, "package.json")))?.root ?? process.cwd();
109792
+ return candidates.find((candidate2) => pathExists(resolve23(candidate2.root, "package.json")))?.root ?? process.cwd();
109522
109793
  }
109523
109794
  function readDaemonPackageVersion(root) {
109524
109795
  try {
109525
- const packageJson = JSON.parse(readFileSync34(resolve21(root, PACKAGE_REL, "package.json"), "utf-8"));
109796
+ const packageJson = JSON.parse(readFileSync35(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
109526
109797
  return DaemonPackageSchema.parse(packageJson).version;
109527
109798
  } catch (error51) {
109528
109799
  if (!(error51 instanceof Error))
@@ -109534,17 +109805,17 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
109534
109805
  const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
109535
109806
  const bun = resolveExecutable("bun");
109536
109807
  const npm = resolveExecutable("npm");
109537
- const packageManifestPath = resolve21(root, PACKAGE_REL, "package.json");
109808
+ const packageManifestPath = resolve23(root, PACKAGE_REL, "package.json");
109538
109809
  return {
109539
109810
  command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
109540
109811
  root,
109541
- path: resolve21(root, PACKAGE_REL, DIST_CLI_REL),
109812
+ path: resolve23(root, PACKAGE_REL, DIST_CLI_REL),
109542
109813
  exists: runtime5.available && npm.available && pathExists(packageManifestPath),
109543
109814
  runtimeAvailable: runtime5.available
109544
109815
  };
109545
109816
  }
109546
109817
  function resolveLspCommand(options = {}) {
109547
- const pathExists = options.exists ?? existsSync54;
109818
+ const pathExists = options.exists ?? existsSync56;
109548
109819
  const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
109549
109820
  const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
109550
109821
  const candidates = moduleDirectory ? createAncestorCliCandidates({
@@ -109554,7 +109825,7 @@ function resolveLspCommand(options = {}) {
109554
109825
  sourceCliRel: SOURCE_CLI_REL,
109555
109826
  pathExists,
109556
109827
  resolveExecutable,
109557
- isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
109828
+ isSourceCandidateAvailable: ({ root }) => pathExists(resolve23(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
109558
109829
  }) : [];
109559
109830
  const distCandidate = candidates.find((candidate2) => hasCliSuffix(candidate2.path, DIST_CLI_REL) && candidate2.exists);
109560
109831
  if (distCandidate) {
@@ -109568,7 +109839,7 @@ function resolveLspCommand(options = {}) {
109568
109839
  }
109569
109840
  function createLspMcpConfig(options = {}) {
109570
109841
  const resolvedCommand = resolveLspCommand(options);
109571
- const cwd = resolve21(options.cwd ?? process.cwd());
109842
+ const cwd = resolve23(options.cwd ?? process.cwd());
109572
109843
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
109573
109844
  const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
109574
109845
  return {
@@ -109577,9 +109848,9 @@ function createLspMcpConfig(options = {}) {
109577
109848
  enabled: resolvedCommand.exists,
109578
109849
  cwd,
109579
109850
  environment: {
109580
- LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve21(cwd, configPath)).join(delimiter3),
109581
- LSP_TOOLS_MCP_USER_CONFIG: resolve21(configDir, "lsp.json"),
109582
- LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve21(configDir, "lsp-install-decisions.json"),
109851
+ LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
109852
+ LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
109853
+ LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
109583
109854
  ...sourceVersion ? {
109584
109855
  [OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
109585
109856
  [OMO_LSP_DAEMON_VERSION]: sourceVersion
@@ -109604,24 +109875,24 @@ function getInstalledLspServers(options = {}) {
109604
109875
 
109605
109876
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
109606
109877
  init_shared();
109607
- import { existsSync as existsSync55, readFileSync as readFileSync35 } from "node:fs";
109608
- import { homedir as homedir18 } from "node:os";
109609
- import { join as join81 } from "node:path";
109878
+ import { existsSync as existsSync57, readFileSync as readFileSync36 } from "node:fs";
109879
+ import { homedir as homedir20 } from "node:os";
109880
+ import { join as join84 } from "node:path";
109610
109881
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
109611
109882
  function getMcpConfigPaths() {
109612
109883
  return [
109613
- join81(homedir18(), ".claude", ".mcp.json"),
109614
- join81(process.cwd(), ".mcp.json"),
109615
- join81(process.cwd(), ".claude", ".mcp.json")
109884
+ join84(homedir20(), ".claude", ".mcp.json"),
109885
+ join84(process.cwd(), ".mcp.json"),
109886
+ join84(process.cwd(), ".claude", ".mcp.json")
109616
109887
  ];
109617
109888
  }
109618
109889
  function loadUserMcpConfig() {
109619
109890
  const servers = {};
109620
109891
  for (const configPath of getMcpConfigPaths()) {
109621
- if (!existsSync55(configPath))
109892
+ if (!existsSync57(configPath))
109622
109893
  continue;
109623
109894
  try {
109624
- const content = readFileSync35(configPath, "utf-8");
109895
+ const content = readFileSync36(configPath, "utf-8");
109625
109896
  const config4 = parseJsonc(content);
109626
109897
  if (config4.mcpServers) {
109627
109898
  Object.assign(servers, config4.mcpServers);
@@ -109756,17 +110027,17 @@ async function checkTools() {
109756
110027
 
109757
110028
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
109758
110029
  init_src5();
109759
- import { existsSync as existsSync56, readFileSync as readFileSync36 } from "node:fs";
110030
+ import { existsSync as existsSync58, readFileSync as readFileSync37 } from "node:fs";
109760
110031
  function isTelemetryState(value) {
109761
110032
  return value !== null && typeof value === "object" && !Array.isArray(value);
109762
110033
  }
109763
110034
  function readLastActiveDay(stateFilePath) {
109764
- if (!existsSync56(stateFilePath)) {
110035
+ if (!existsSync58(stateFilePath)) {
109765
110036
  return "never";
109766
110037
  }
109767
110038
  let parsed;
109768
110039
  try {
109769
- parsed = JSON.parse(readFileSync36(stateFilePath, "utf-8"));
110040
+ parsed = JSON.parse(readFileSync37(stateFilePath, "utf-8"));
109770
110041
  } catch (error51) {
109771
110042
  if (error51 instanceof Error) {
109772
110043
  return "unreadable";
@@ -109824,17 +110095,17 @@ async function probeBinary(cmd, args, spawnImpl) {
109824
110095
  }
109825
110096
 
109826
110097
  // packages/team-core/src/team-registry/paths.ts
109827
- import { homedir as homedir19 } from "node:os";
110098
+ import { homedir as homedir21 } from "node:os";
109828
110099
  import path12 from "node:path";
109829
110100
  function resolveBaseDir(config4) {
109830
- return expandHomeDirectory(config4.base_dir ?? path12.join(homedir19(), ".omo"));
110101
+ return expandHomeDirectory(config4.base_dir ?? path12.join(homedir21(), ".omo"));
109831
110102
  }
109832
110103
  function expandHomeDirectory(directoryPath3) {
109833
110104
  if (directoryPath3 === "~") {
109834
- return homedir19();
110105
+ return homedir21();
109835
110106
  }
109836
110107
  if (directoryPath3.startsWith("~/") || directoryPath3.startsWith("~\\")) {
109837
- return path12.join(homedir19(), directoryPath3.slice(2));
110108
+ return path12.join(homedir21(), directoryPath3.slice(2));
109838
110109
  }
109839
110110
  return directoryPath3;
109840
110111
  }
@@ -109891,10 +110162,10 @@ async function pathExists(dir) {
109891
110162
 
109892
110163
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
109893
110164
  init_src2();
109894
- import { existsSync as existsSync57 } from "node:fs";
110165
+ import { existsSync as existsSync59 } from "node:fs";
109895
110166
  import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "node:fs/promises";
109896
- import { homedir as homedir20 } from "node:os";
109897
- import { basename as basename11, join as join82, resolve as resolve22 } from "node:path";
110167
+ import { homedir as homedir22 } from "node:os";
110168
+ import { basename as basename11, join as join85, resolve as resolve24 } from "node:path";
109898
110169
  // packages/omo-opencode/package.json
109899
110170
  var package_default3 = {
109900
110171
  name: "@oh-my-opencode/omo-opencode",
@@ -109959,13 +110230,13 @@ var CODEX_BIN_NAMES = [
109959
110230
  "omo-git-bash-hook"
109960
110231
  ];
109961
110232
  async function gatherCodexSummary(deps = {}) {
109962
- const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir20(), ".codex"));
110233
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir22(), ".codex"));
109963
110234
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
109964
110235
  const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
109965
110236
  const pluginRoot = await resolveInstalledPluginRoot(codexHome);
109966
- const manifest2 = pluginRoot === null ? null : await readJson(join82(pluginRoot, ".codex-plugin", "plugin.json"));
109967
- const installSnapshot = pluginRoot === null ? null : await readJson(join82(pluginRoot, "lazycodex-install.json"));
109968
- const configPath = join82(codexHome, "config.toml");
110237
+ const manifest2 = pluginRoot === null ? null : await readJson(join85(pluginRoot, ".codex-plugin", "plugin.json"));
110238
+ const installSnapshot = pluginRoot === null ? null : await readJson(join85(pluginRoot, "lazycodex-install.json"));
110239
+ const configPath = join85(codexHome, "config.toml");
109969
110240
  const pluginVersion = stringField(manifest2, "version");
109970
110241
  return {
109971
110242
  codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -110022,7 +110293,7 @@ function buildCodexIssues(summary) {
110022
110293
  if (summary.pluginRoot === null) {
110023
110294
  issues.push({
110024
110295
  title: "OMO Codex plugin is not installed",
110025
- description: `Expected cached plugin at ${join82("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
110296
+ description: `Expected cached plugin at ${join85("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
110026
110297
  fix: "Run: npx lazycodex-ai install",
110027
110298
  severity: "error",
110028
110299
  affects: ["plugin loading"]
@@ -110087,15 +110358,15 @@ function buildCodexIssues(summary) {
110087
110358
  return issues;
110088
110359
  }
110089
110360
  async function resolveInstalledPluginRoot(codexHome) {
110090
- const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
110091
- if (!existsSync57(pluginRoot))
110361
+ const pluginRoot = join85(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
110362
+ if (!existsSync59(pluginRoot))
110092
110363
  return null;
110093
110364
  const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
110094
110365
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
110095
- return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
110366
+ return candidates.length === 0 ? null : join85(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
110096
110367
  }
110097
110368
  async function readCodexConfigSummary(configPath) {
110098
- if (!existsSync57(configPath)) {
110369
+ if (!existsSync59(configPath)) {
110099
110370
  return {
110100
110371
  exists: false,
110101
110372
  marketplaceConfigured: false,
@@ -110120,14 +110391,14 @@ async function readCodexConfigSummary(configPath) {
110120
110391
  async function readLinkedBins(binDir) {
110121
110392
  const linked = [];
110122
110393
  for (const name of CODEX_BIN_NAMES) {
110123
- if (await pathExists2(join82(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
110394
+ if (await pathExists2(join85(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
110124
110395
  linked.push(name);
110125
110396
  }
110126
110397
  return linked;
110127
110398
  }
110128
110399
  async function readLinkedAgents(codexHome) {
110129
- const agentsDir = join82(codexHome, "agents");
110130
- if (!existsSync57(agentsDir))
110400
+ const agentsDir = join85(codexHome, "agents");
110401
+ if (!existsSync59(agentsDir))
110131
110402
  return [];
110132
110403
  const entries = await readdir14(agentsDir, { withFileTypes: true });
110133
110404
  return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename11(entry.name, ".toml")).sort();
@@ -110173,16 +110444,16 @@ function formatCompanionPluginStatus(config4) {
110173
110444
  return "none";
110174
110445
  }
110175
110446
  function readCompanionLifecycleHookStateEvents(content) {
110176
- const events = new Set;
110447
+ const events2 = new Set;
110177
110448
  for (const section of splitTomlSections(content)) {
110178
110449
  if (section.header === null)
110179
110450
  continue;
110180
110451
  const key = parseHookStateHeaderKey(section.header);
110181
110452
  const event = key === null ? null : companionLifecycleEventFromHookStateKey(key);
110182
110453
  if (event !== null)
110183
- events.add(event);
110454
+ events2.add(event);
110184
110455
  }
110185
- return [...events].sort(compareCompanionLifecycleEvents);
110456
+ return [...events2].sort(compareCompanionLifecycleEvents);
110186
110457
  }
110187
110458
  function companionLifecycleEventFromHookStateKey(key) {
110188
110459
  if (!key.startsWith(`${COMPANION_PLUGIN_KEY}:`))
@@ -110196,8 +110467,8 @@ function compareCompanionLifecycleEvents(left, right) {
110196
110467
  function companionLifecycleEventOrder(event) {
110197
110468
  return event === "session_start" ? 0 : event === "stop" ? 1 : 2;
110198
110469
  }
110199
- function formatCompanionLifecycleEvents(events) {
110200
- return events.map(formatCompanionLifecycleEvent).join(", ");
110470
+ function formatCompanionLifecycleEvents(events2) {
110471
+ return events2.map(formatCompanionLifecycleEvent).join(", ");
110201
110472
  }
110202
110473
  function formatCompanionLifecycleEvent(event) {
110203
110474
  switch (event) {
@@ -110241,8 +110512,8 @@ async function pathExists2(path14) {
110241
110512
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
110242
110513
  init_src2();
110243
110514
  import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "node:fs/promises";
110244
- import { homedir as homedir21 } from "node:os";
110245
- import { dirname as dirname31, isAbsolute as isAbsolute12, join as join83, relative as relative9, resolve as resolve23, sep as sep9 } from "node:path";
110515
+ import { homedir as homedir23 } from "node:os";
110516
+ import { dirname as dirname33, isAbsolute as isAbsolute12, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "node:path";
110246
110517
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
110247
110518
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
110248
110519
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -110252,7 +110523,7 @@ async function checkCodexComponents(deps = {}) {
110252
110523
  const env3 = deps.env ?? process.env;
110253
110524
  const platform = deps.platform ?? process.platform;
110254
110525
  const arch = deps.arch ?? process.arch;
110255
- const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join83(homedir21(), ".codex"));
110526
+ const codexHome = resolve25(deps.codexHome ?? env3["CODEX_HOME"] ?? join86(homedir23(), ".codex"));
110256
110527
  const summary = await gatherCodexSummary({ ...deps, codexHome });
110257
110528
  if (summary.pluginRoot === null) {
110258
110529
  return {
@@ -110277,7 +110548,7 @@ async function checkCodexComponents(deps = {}) {
110277
110548
  });
110278
110549
  }
110279
110550
  const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
110280
- const runtimeSgPath = join83(runtimeSgDir, sgBinaryName(platform));
110551
+ const runtimeSgPath = join86(runtimeSgDir, sgBinaryName(platform));
110281
110552
  const sg = findSgBinarySync({
110282
110553
  arch,
110283
110554
  env: env3,
@@ -110316,8 +110587,8 @@ async function auditBundleTargets(pluginRoot) {
110316
110587
  const manifest2 = await readJson2(manifestPath);
110317
110588
  if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
110318
110589
  continue;
110319
- const manifestRoot = dirname31(manifestPath);
110320
- const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
110590
+ const manifestRoot = dirname33(manifestPath);
110591
+ const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
110321
110592
  for (const server2 of Object.values(manifest2["mcpServers"])) {
110322
110593
  if (!isRecord12(server2) || !Array.isArray(server2["args"]))
110323
110594
  continue;
@@ -110337,7 +110608,7 @@ async function auditBundleTargets(pluginRoot) {
110337
110608
  continue;
110338
110609
  const commands2 = [];
110339
110610
  collectHookCommands(manifest2, commands2);
110340
- const hookPluginRoot = dirname31(dirname31(hookManifestPath));
110611
+ const hookPluginRoot = dirname33(dirname33(hookManifestPath));
110341
110612
  for (const command of commands2) {
110342
110613
  for (const relativePath of extractPluginRootPaths(command)) {
110343
110614
  referencedCount += 1;
@@ -110359,8 +110630,8 @@ function recordBrokenTarget(broken, classified, origin) {
110359
110630
  broken.push(entry);
110360
110631
  }
110361
110632
  async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
110362
- const targetPath = resolve23(baseRoot, relativePath);
110363
- const bundleRootPath = resolve23(bundleRoot);
110633
+ const targetPath = resolve25(baseRoot, relativePath);
110634
+ const bundleRootPath = resolve25(bundleRoot);
110364
110635
  const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
110365
110636
  if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
110366
110637
  if (allowEscape)
@@ -110376,7 +110647,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
110376
110647
  }
110377
110648
  async function findHookManifestPaths(root) {
110378
110649
  const paths3 = await findManifestPaths(root, "hooks.json");
110379
- return paths3.filter((path14) => dirname31(path14).endsWith(`${sep9}hooks`));
110650
+ return paths3.filter((path14) => dirname33(path14).endsWith(`${sep9}hooks`));
110380
110651
  }
110381
110652
  async function findManifestPaths(root, manifestName) {
110382
110653
  let entries;
@@ -110389,7 +110660,7 @@ async function findManifestPaths(root, manifestName) {
110389
110660
  for (const entry of entries) {
110390
110661
  if (entry.name === "node_modules" || entry.name === ".git")
110391
110662
  continue;
110392
- const entryPath = join83(root, entry.name);
110663
+ const entryPath = join86(root, entry.name);
110393
110664
  if (entry.isDirectory()) {
110394
110665
  paths3.push(...await findManifestPaths(entryPath, manifestName));
110395
110666
  continue;
@@ -110433,18 +110704,18 @@ function isPluginRuntimePathArg(arg) {
110433
110704
  return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
110434
110705
  }
110435
110706
  function runtimeSgDirectory(codexHome, platform, arch) {
110436
- return join83(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
110707
+ return join86(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
110437
110708
  }
110438
110709
  function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
110439
110710
  const override = env3[SG_PATH_ENV_KEY]?.trim();
110440
110711
  if (override !== undefined && override.length > 0 && sgPath === override)
110441
110712
  return `env override ${SG_PATH_ENV_KEY}`;
110442
- if (sgPath === join83(runtimeSgDir, sgBinaryName(platform)))
110713
+ if (sgPath === join86(runtimeSgDir, sgBinaryName(platform)))
110443
110714
  return "runtime dir";
110444
110715
  return "PATH";
110445
110716
  }
110446
110717
  async function readBootstrapStateSummary(codexHome) {
110447
- const statePath = join83(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
110718
+ const statePath = join86(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
110448
110719
  const raw = await readJson2(statePath);
110449
110720
  if (raw === null)
110450
110721
  return null;
@@ -110520,24 +110791,24 @@ function isRecord12(value) {
110520
110791
  }
110521
110792
 
110522
110793
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
110523
- import { existsSync as existsSync58 } from "node:fs";
110794
+ import { existsSync as existsSync60 } from "node:fs";
110524
110795
  import { readFile as readFile29 } from "node:fs/promises";
110525
- import { homedir as homedir22 } from "node:os";
110526
- import { join as join84, resolve as resolve24 } from "node:path";
110796
+ import { homedir as homedir24 } from "node:os";
110797
+ import { join as join87, resolve as resolve26 } from "node:path";
110527
110798
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
110528
110799
  var CHECK_NAME = "codex-runtime-wrapper";
110529
110800
  var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
110530
110801
  async function checkCodexRuntimeWrapper(deps = {}) {
110531
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir22(), ".codex"));
110802
+ const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join87(homedir24(), ".codex"));
110532
110803
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
110533
110804
  const platform = deps.platform ?? process.platform;
110534
- const wrapperPath = join84(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
110535
- const legacyWrapperPath = join84(binDir, platform === "win32" ? "omo.cmd" : "omo");
110805
+ const wrapperPath = join87(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
110806
+ const legacyWrapperPath = join87(binDir, platform === "win32" ? "omo.cmd" : "omo");
110536
110807
  const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
110537
110808
  const issues = [];
110538
110809
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
110539
110810
  const targetPath = parseRuntimeTargetPath(wrapper);
110540
- if (targetPath !== null && !existsSync58(targetPath)) {
110811
+ if (targetPath !== null && !existsSync60(targetPath)) {
110541
110812
  issues.push({
110542
110813
  title: "omo-agent-toolkit runtime wrapper target is missing",
110543
110814
  description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
@@ -111051,24 +111322,24 @@ Doctor failed unexpectedly: ${message}`];
111051
111322
  // packages/mcp-client-core/src/mcp-oauth/storage.ts
111052
111323
  import { createHash as createHash6 } from "node:crypto";
111053
111324
  import {
111054
- chmodSync as chmodSync4,
111055
- existsSync as existsSync61,
111056
- mkdirSync as mkdirSync14,
111325
+ chmodSync as chmodSync5,
111326
+ existsSync as existsSync63,
111327
+ mkdirSync as mkdirSync15,
111057
111328
  readdirSync as readdirSync11,
111058
- readFileSync as readFileSync38,
111329
+ readFileSync as readFileSync39,
111059
111330
  renameSync as renameSync7,
111060
111331
  unlinkSync as unlinkSync9,
111061
- writeFileSync as writeFileSync11
111332
+ writeFileSync as writeFileSync12
111062
111333
  } from "node:fs";
111063
- import { basename as basename12, dirname as dirname32, join as join87 } from "node:path";
111334
+ import { basename as basename12, dirname as dirname34, join as join90 } from "node:path";
111064
111335
 
111065
111336
  // packages/mcp-client-core/src/config-dir.ts
111066
- import { existsSync as existsSync59, realpathSync as realpathSync8 } from "node:fs";
111067
- import { homedir as homedir23 } from "node:os";
111068
- import { join as join85, resolve as resolve25 } from "node:path";
111337
+ import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
111338
+ import { homedir as homedir25 } from "node:os";
111339
+ import { join as join88, resolve as resolve27 } from "node:path";
111069
111340
  function resolveConfigPath2(pathValue) {
111070
- const resolvedPath = resolve25(pathValue);
111071
- if (!existsSync59(resolvedPath))
111341
+ const resolvedPath = resolve27(pathValue);
111342
+ if (!existsSync61(resolvedPath))
111072
111343
  return resolvedPath;
111073
111344
  try {
111074
111345
  return realpathSync8(resolvedPath);
@@ -111083,13 +111354,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
111083
111354
  if (customConfigDir) {
111084
111355
  return resolveConfigPath2(customConfigDir);
111085
111356
  }
111086
- const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join85(homedir23(), ".config");
111087
- return resolveConfigPath2(join85(xdgConfigDir, "opencode"));
111357
+ const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join88(homedir25(), ".config");
111358
+ return resolveConfigPath2(join88(xdgConfigDir, "opencode"));
111088
111359
  }
111089
111360
 
111090
111361
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
111091
- import { chmodSync as chmodSync3, existsSync as existsSync60, readFileSync as readFileSync37, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
111092
- import { join as join86 } from "node:path";
111362
+ import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "node:fs";
111363
+ import { join as join89 } from "node:path";
111093
111364
  var INDEX_FILE_NAME = "index.json";
111094
111365
  function isTokenIndex(value) {
111095
111366
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -111097,14 +111368,14 @@ function isTokenIndex(value) {
111097
111368
  return Object.values(value).every((entry) => typeof entry === "string");
111098
111369
  }
111099
111370
  function getIndexPath(storageDir) {
111100
- return join86(storageDir, INDEX_FILE_NAME);
111371
+ return join89(storageDir, INDEX_FILE_NAME);
111101
111372
  }
111102
111373
  function readTokenIndex(storageDir) {
111103
111374
  const indexPath = getIndexPath(storageDir);
111104
- if (!existsSync60(indexPath))
111375
+ if (!existsSync62(indexPath))
111105
111376
  return {};
111106
111377
  try {
111107
- const parsed = JSON.parse(readFileSync37(indexPath, "utf-8"));
111378
+ const parsed = JSON.parse(readFileSync38(indexPath, "utf-8"));
111108
111379
  return isTokenIndex(parsed) ? parsed : {};
111109
111380
  } catch (readError) {
111110
111381
  if (!(readError instanceof Error))
@@ -111116,8 +111387,8 @@ function writeTokenIndex(storageDir, index) {
111116
111387
  try {
111117
111388
  const indexPath = getIndexPath(storageDir);
111118
111389
  const tempPath = `${indexPath}.tmp.${Date.now()}`;
111119
- writeFileSync10(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
111120
- chmodSync3(tempPath, 384);
111390
+ writeFileSync11(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
111391
+ chmodSync4(tempPath, 384);
111121
111392
  renameSync6(tempPath, indexPath);
111122
111393
  return true;
111123
111394
  } catch (writeError) {
@@ -111141,16 +111412,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
111141
111412
  var STORAGE_DIR_NAME = "mcp-oauth";
111142
111413
  var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
111143
111414
  function getMcpOauthStorageDir() {
111144
- return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
111415
+ return join90(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
111145
111416
  }
111146
111417
  function getMcpOauthServerHash(serverHost, resource) {
111147
111418
  return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
111148
111419
  }
111149
111420
  function getMcpOauthStoragePath(serverHost, resource) {
111150
- return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
111421
+ return join90(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
111151
111422
  }
111152
111423
  function getLegacyStoragePath() {
111153
- return join87(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
111424
+ return join90(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
111154
111425
  }
111155
111426
  function normalizeHost2(serverHost) {
111156
111427
  let host = serverHost.trim();
@@ -111211,10 +111482,10 @@ function isOAuthTokenData(value) {
111211
111482
  return clientSecret === undefined || typeof clientSecret === "string";
111212
111483
  }
111213
111484
  function readTokenFile(filePath) {
111214
- if (!existsSync61(filePath))
111485
+ if (!existsSync63(filePath))
111215
111486
  return null;
111216
111487
  try {
111217
- const parsed = JSON.parse(readFileSync38(filePath, "utf-8"));
111488
+ const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
111218
111489
  return isOAuthTokenData(parsed) ? parsed : null;
111219
111490
  } catch (readError) {
111220
111491
  if (!(readError instanceof Error))
@@ -111224,10 +111495,10 @@ function readTokenFile(filePath) {
111224
111495
  }
111225
111496
  function readLegacyStore() {
111226
111497
  const filePath = getLegacyStoragePath();
111227
- if (!existsSync61(filePath))
111498
+ if (!existsSync63(filePath))
111228
111499
  return null;
111229
111500
  try {
111230
- const parsed = JSON.parse(readFileSync38(filePath, "utf-8"));
111501
+ const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
111231
111502
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
111232
111503
  return null;
111233
111504
  const result = {};
@@ -111244,13 +111515,13 @@ function readLegacyStore() {
111244
111515
  }
111245
111516
  function writeTokenFile(filePath, token) {
111246
111517
  try {
111247
- const dir = dirname32(filePath);
111248
- if (!existsSync61(dir)) {
111249
- mkdirSync14(dir, { recursive: true });
111518
+ const dir = dirname34(filePath);
111519
+ if (!existsSync63(dir)) {
111520
+ mkdirSync15(dir, { recursive: true });
111250
111521
  }
111251
111522
  const tempPath = `${filePath}.tmp.${Date.now()}`;
111252
- writeFileSync11(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
111253
- chmodSync4(tempPath, 384);
111523
+ writeFileSync12(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
111524
+ chmodSync5(tempPath, 384);
111254
111525
  renameSync7(tempPath, filePath);
111255
111526
  return true;
111256
111527
  } catch (writeError) {
@@ -111269,7 +111540,7 @@ function saveToken(serverHost, resource, token) {
111269
111540
  }
111270
111541
  function deleteToken(serverHost, resource) {
111271
111542
  const filePath = getMcpOauthStoragePath(serverHost, resource);
111272
- if (!existsSync61(filePath))
111543
+ if (!existsSync63(filePath))
111273
111544
  return deleteLegacyToken(serverHost, resource);
111274
111545
  try {
111275
111546
  unlinkSync9(filePath);
@@ -111291,7 +111562,7 @@ function deleteLegacyToken(serverHost, resource) {
111291
111562
  if (Object.keys(store2).length === 0) {
111292
111563
  try {
111293
111564
  const filePath = getLegacyStoragePath();
111294
- if (existsSync61(filePath))
111565
+ if (existsSync63(filePath))
111295
111566
  unlinkSync9(filePath);
111296
111567
  return true;
111297
111568
  } catch (deleteError) {
@@ -111305,8 +111576,8 @@ function deleteLegacyToken(serverHost, resource) {
111305
111576
  function writeLegacyStore(store2) {
111306
111577
  try {
111307
111578
  const filePath = getLegacyStoragePath();
111308
- writeFileSync11(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
111309
- chmodSync4(filePath, 384);
111579
+ writeFileSync12(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
111580
+ chmodSync5(filePath, 384);
111310
111581
  return true;
111311
111582
  } catch (writeError) {
111312
111583
  if (!(writeError instanceof Error))
@@ -111329,7 +111600,7 @@ function listTokensByHost(serverHost) {
111329
111600
  for (const [hash2, indexedKey] of Object.entries(index)) {
111330
111601
  if (!indexedKey.startsWith(prefix))
111331
111602
  continue;
111332
- const indexedToken = readTokenFile(join87(getMcpOauthStorageDir(), `${hash2}.json`));
111603
+ const indexedToken = readTokenFile(join90(getMcpOauthStorageDir(), `${hash2}.json`));
111333
111604
  if (indexedToken)
111334
111605
  result[indexedKey] = indexedToken;
111335
111606
  }
@@ -111338,13 +111609,13 @@ function listTokensByHost(serverHost) {
111338
111609
  function listAllTokens() {
111339
111610
  const result = { ...readLegacyStore() ?? {} };
111340
111611
  const dir = getMcpOauthStorageDir();
111341
- if (!existsSync61(dir))
111612
+ if (!existsSync63(dir))
111342
111613
  return result;
111343
111614
  const index = readTokenIndex(dir);
111344
111615
  for (const entry of readdirSync11(dir, { withFileTypes: true })) {
111345
111616
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
111346
111617
  continue;
111347
- const token = readTokenFile(join87(dir, entry.name));
111618
+ const token = readTokenFile(join90(dir, entry.name));
111348
111619
  const hash2 = basename12(entry.name, ".json");
111349
111620
  if (token)
111350
111621
  result[index[hash2] ?? hash2] = token;
@@ -111544,7 +111815,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
111544
111815
  }
111545
111816
  var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
111546
111817
  function startCallbackServer(port) {
111547
- return new Promise((resolve26, reject) => {
111818
+ return new Promise((resolve28, reject) => {
111548
111819
  let timeoutId;
111549
111820
  const server2 = createServer2((request, response) => {
111550
111821
  clearTimeout(timeoutId);
@@ -111570,7 +111841,7 @@ function startCallbackServer(port) {
111570
111841
  response.writeHead(200, { "content-type": "text/html" });
111571
111842
  response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
111572
111843
  server2.close();
111573
- resolve26({ code, state: state2 });
111844
+ resolve28({ code, state: state2 });
111574
111845
  });
111575
111846
  timeoutId = setTimeout(() => {
111576
111847
  server2.close();
@@ -111910,7 +112181,7 @@ function createMcpOAuthCommand() {
111910
112181
  }
111911
112182
 
111912
112183
  // packages/omo-opencode/src/cli/boulder/boulder.ts
111913
- import { existsSync as existsSync62 } from "node:fs";
112184
+ import { existsSync as existsSync64 } from "node:fs";
111914
112185
 
111915
112186
  // packages/omo-opencode/src/cli/boulder/formatter.ts
111916
112187
  var import_picocolors22 = __toESM(require_picocolors(), 1);
@@ -112047,10 +112318,10 @@ async function boulder(options) {
112047
112318
  const boulderFilePath = getBoulderFilePath(directory);
112048
112319
  const state2 = readBoulderState(directory);
112049
112320
  if (!state2) {
112050
- const message = existsSync62(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
112321
+ const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
112051
112322
  process.stderr.write(`${message}
112052
112323
  `);
112053
- return existsSync62(boulderFilePath) ? 2 : 1;
112324
+ return existsSync64(boulderFilePath) ? 2 : 1;
112054
112325
  }
112055
112326
  const works = getBoulderWorks(state2);
112056
112327
  const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
@@ -112068,12 +112339,12 @@ async function boulder(options) {
112068
112339
  }
112069
112340
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
112070
112341
  import { spawn as spawn5 } from "node:child_process";
112071
- import { existsSync as existsSync63, readFileSync as readFileSync39, realpathSync as realpathSync9 } from "node:fs";
112072
- import { homedir as homedir24 } from "node:os";
112342
+ import { existsSync as existsSync65, readFileSync as readFileSync40, realpathSync as realpathSync9 } from "node:fs";
112343
+ import { homedir as homedir26 } from "node:os";
112073
112344
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
112074
112345
  function resolveCodexUlwLoopCommand(input = {}) {
112075
112346
  const env3 = input.env ?? process.env;
112076
- const homeDir = input.homeDir ?? homedir24();
112347
+ const homeDir = input.homeDir ?? homedir26();
112077
112348
  const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
112078
112349
  if (localComponentBin !== null)
112079
112350
  return { executable: localComponentBin, argsPrefix: [] };
@@ -112096,29 +112367,29 @@ async function codexUlwLoop(args) {
112096
112367
  console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
112097
112368
  return 1;
112098
112369
  }
112099
- const { promise: promise2, resolve: resolve26 } = Promise.withResolvers();
112370
+ const { promise: promise2, resolve: resolve28 } = Promise.withResolvers();
112100
112371
  const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
112101
112372
  stdio: "inherit",
112102
112373
  env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
112103
112374
  });
112104
112375
  child.on("error", (error51) => {
112105
112376
  console.error(error51.message);
112106
- resolve26(1);
112377
+ resolve28(1);
112107
112378
  });
112108
- child.on("close", (code) => resolve26(code ?? 1));
112379
+ child.on("close", (code) => resolve28(code ?? 1));
112109
112380
  return promise2;
112110
112381
  }
112111
112382
  function resolveLocalUlwLoopBin(env3, homeDir) {
112112
112383
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
112113
- return candidates.find((candidate2) => existsSync63(candidate2)) ?? null;
112384
+ return candidates.find((candidate2) => existsSync65(candidate2)) ?? null;
112114
112385
  }
112115
112386
  function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
112116
112387
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
112117
- return candidates.find((candidate2) => existsSync63(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
112388
+ return candidates.find((candidate2) => existsSync65(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
112118
112389
  }
112119
112390
  function isGeneratedRuntimeWrapper(candidate2) {
112120
112391
  try {
112121
- return readFileSync39(candidate2, "utf8").includes(RUNTIME_WRAPPER_MARKER);
112392
+ return readFileSync40(candidate2, "utf8").includes(RUNTIME_WRAPPER_MARKER);
112122
112393
  } catch (error51) {
112123
112394
  if (error51 instanceof Error)
112124
112395
  return false;