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

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 (196) 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 +797 -465
  15. package/dist/cli/run/on-complete-hook.d.ts +2 -0
  16. package/dist/cli-node/index.js +797 -465
  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 +1511 -1140
  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/tui.js +176 -14
  38. package/package.json +21 -19
  39. package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
  40. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
  41. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +60 -7
  42. package/packages/lsp-core/src/lsp/client-wrapper.ts +69 -16
  43. package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
  44. package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
  45. package/packages/lsp-core/src/tools/navigation.ts +4 -2
  46. package/packages/lsp-core/src/tools/rename.ts +4 -2
  47. package/packages/lsp-core/src/tools/symbols.ts +1 -1
  48. package/packages/lsp-daemon/dist/cli.js +83 -29
  49. package/packages/lsp-daemon/dist/client.js +76 -22
  50. package/packages/lsp-daemon/dist/index.js +81 -27
  51. package/packages/lsp-tools-mcp/dist/cli.js +76 -22
  52. package/packages/lsp-tools-mcp/dist/mcp.js +76 -22
  53. package/packages/lsp-tools-mcp/dist/tools.js +76 -22
  54. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  55. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  56. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  57. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +118 -8
  58. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +118 -8
  59. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  60. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  61. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  62. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  63. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  64. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  65. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  66. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
  67. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  68. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +83 -29
  69. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  70. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  71. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  72. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  73. package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
  74. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
  75. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
  76. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
  77. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
  78. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
  79. package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
  80. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
  81. package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
  82. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
  83. package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +3 -2
  84. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  85. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  86. package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +0 -3
  87. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +2 -16
  88. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  89. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  90. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
  91. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +24 -12
  92. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
  93. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  94. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  95. package/packages/omo-codex/plugin/components/ultrawork/directive.md +6 -0
  96. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  97. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  98. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +6 -0
  99. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +2 -2
  100. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +27 -3
  101. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
  102. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
  103. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
  104. package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
  105. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +6 -0
  106. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  107. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  108. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +3 -2
  109. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
  110. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
  111. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
  112. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
  113. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
  114. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +2 -35
  115. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
  116. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  117. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  118. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  119. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  120. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  121. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  122. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  123. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  124. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  125. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  126. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  127. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  128. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  129. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  130. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  131. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  132. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  133. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  134. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  135. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  136. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  137. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  138. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  139. package/packages/omo-codex/plugin/package-lock.json +20 -20
  140. package/packages/omo-codex/plugin/package.json +1 -1
  141. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
  142. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  143. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
  144. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  145. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +10 -7
  146. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
  147. package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
  148. package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  149. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  150. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
  151. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
  152. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +6 -0
  153. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
  154. package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
  155. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
  156. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +2 -2
  157. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +27 -3
  158. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
  159. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
  160. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
  161. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
  162. package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
  163. package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
  164. package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
  165. package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
  166. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
  167. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
  168. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
  169. package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
  170. package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
  171. package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
  172. package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
  173. package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
  174. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
  175. package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
  176. package/packages/omo-codex/scripts/install-dist/install-local.mjs +57 -19
  177. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
  178. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
  179. package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  180. package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
  181. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  182. package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
  183. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
  184. package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
  185. package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  186. package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  187. package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
  188. package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +11 -11
  189. package/packages/shared-skills/skills/ulw-plan/SKILL.md +2 -2
  190. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +27 -3
  191. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
  192. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
  193. package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
  194. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
  195. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
  196. package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
package/dist/cli/index.js CHANGED
@@ -1019,7 +1019,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1019
1019
  this._exitCallback = (err) => {
1020
1020
  if (err.code !== "commander.executeSubCommandAsync") {
1021
1021
  throw err;
1022
- } else {}
1022
+ }
1023
1023
  };
1024
1024
  }
1025
1025
  return this;
@@ -2145,7 +2145,7 @@ var package_default;
2145
2145
  var init_package = __esm(() => {
2146
2146
  package_default = {
2147
2147
  name: "oh-my-opencode",
2148
- version: "5.0.0-beta.1",
2148
+ version: "5.0.0-beta.10",
2149
2149
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2150
2150
  main: "./dist/index.js",
2151
2151
  types: "dist/index.d.ts",
@@ -2281,6 +2281,7 @@ var init_package = __esm(() => {
2281
2281
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
2282
2282
  test: "bun test",
2283
2283
  "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",
2284
+ "test:fast": "bun run script/test-fast.ts",
2284
2285
  "test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
2285
2286
  "test:windows-codex": "bun run test:codex",
2286
2287
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
@@ -2325,7 +2326,7 @@ var init_package = __esm(() => {
2325
2326
  zod: "^4.4.3"
2326
2327
  },
2327
2328
  devDependencies: {
2328
- "@code-yeongyu/senpi": "2026.8.9-2",
2329
+ "@code-yeongyu/senpi": "2026.8.18-2",
2329
2330
  "@oh-my-opencode/agents-md-core": "workspace:*",
2330
2331
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
2331
2332
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -2341,6 +2342,7 @@ var init_package = __esm(() => {
2341
2342
  "@oh-my-opencode/model-core": "workspace:*",
2342
2343
  "@oh-my-opencode/omo-codex": "workspace:*",
2343
2344
  "@oh-my-opencode/omo-config-core": "workspace:*",
2345
+ "@oh-my-opencode/omo-opencode": "workspace:*",
2344
2346
  "@oh-my-opencode/omo-senpi": "workspace:*",
2345
2347
  "@oh-my-opencode/openclaw-core": "workspace:*",
2346
2348
  "@oh-my-opencode/pi-goal": "workspace:*",
@@ -2356,7 +2358,7 @@ var init_package = __esm(() => {
2356
2358
  "@oh-my-opencode/utils": "workspace:*",
2357
2359
  "@types/js-yaml": "^4.0.9",
2358
2360
  "@types/picomatch": "^4.0.3",
2359
- "@typescript/native-preview": "7.0.0-dev.20260518.1",
2361
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
2360
2362
  "@xterm/addon-unicode11": "^0.9.0",
2361
2363
  "@xterm/xterm": "^6.0.0",
2362
2364
  "bun-types": "1.3.14",
@@ -2365,24 +2367,24 @@ var init_package = __esm(() => {
2365
2367
  typescript: "^7.0.2"
2366
2368
  },
2367
2369
  optionalDependencies: {
2368
- "oh-my-opencode-darwin-arm64": "5.0.0-beta.1",
2369
- "oh-my-opencode-darwin-x64": "5.0.0-beta.1",
2370
- "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.1",
2371
- "oh-my-opencode-linux-arm64": "5.0.0-beta.1",
2372
- "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.1",
2373
- "oh-my-opencode-linux-x64": "5.0.0-beta.1",
2374
- "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.1",
2375
- "oh-my-opencode-linux-x64-musl": "5.0.0-beta.1",
2376
- "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.1",
2377
- "oh-my-opencode-windows-arm64": "5.0.0-beta.1",
2378
- "oh-my-opencode-windows-x64": "5.0.0-beta.1",
2379
- "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.1"
2370
+ "oh-my-opencode-darwin-arm64": "5.0.0-beta.10",
2371
+ "oh-my-opencode-darwin-x64": "5.0.0-beta.10",
2372
+ "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.10",
2373
+ "oh-my-opencode-linux-arm64": "5.0.0-beta.10",
2374
+ "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.10",
2375
+ "oh-my-opencode-linux-x64": "5.0.0-beta.10",
2376
+ "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.10",
2377
+ "oh-my-opencode-linux-x64-musl": "5.0.0-beta.10",
2378
+ "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.10",
2379
+ "oh-my-opencode-windows-arm64": "5.0.0-beta.10",
2380
+ "oh-my-opencode-windows-x64": "5.0.0-beta.10",
2381
+ "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.10"
2380
2382
  },
2381
2383
  overrides: {
2382
- "@earendil-works/pi-agent-core": "0.80.3",
2383
- "@earendil-works/pi-ai": "0.80.3",
2384
- "@earendil-works/pi-coding-agent": "0.80.3",
2385
- "@earendil-works/pi-tui": "0.80.3",
2384
+ "@earendil-works/pi-agent-core": "0.84.2",
2385
+ "@earendil-works/pi-ai": "0.84.2",
2386
+ "@earendil-works/pi-coding-agent": "0.84.2",
2387
+ "@earendil-works/pi-tui": "0.84.2",
2386
2388
  hono: "^4.12.18",
2387
2389
  "@hono/node-server": "^1.19.13",
2388
2390
  "express-rate-limit": "^8.5.1",
@@ -18761,7 +18763,7 @@ function finalize(ctx, schema) {
18761
18763
  result.$schema = "http://json-schema.org/draft-07/schema#";
18762
18764
  } else if (ctx.target === "draft-04") {
18763
18765
  result.$schema = "http://json-schema.org/draft-04/schema#";
18764
- } else if (ctx.target === "openapi-3.0") {} else {}
18766
+ } else if (ctx.target === "openapi-3.0") {}
18765
18767
  if (ctx.external?.uri) {
18766
18768
  const id = ctx.external.registry.get(schema)?.id;
18767
18769
  if (!id)
@@ -19022,7 +19024,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
19022
19024
  if (val === undefined) {
19023
19025
  if (ctx.unrepresentable === "throw") {
19024
19026
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
19025
- } else {}
19027
+ }
19026
19028
  } else if (typeof val === "bigint") {
19027
19029
  if (ctx.unrepresentable === "throw") {
19028
19030
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -22404,15 +22406,16 @@ var init_codegraph = __esm(() => {
22404
22406
  });
22405
22407
 
22406
22408
  // packages/omo-config-core/src/schema/memory.ts
22407
- var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
22409
+ var OmoMemoryReflectionTriggerSchema, OmoMemoryReflectionSchema, OmoMemorySyncSchema, OmoMemorySearchSchema, OmoMemoryNudgeSchema, OmoMemoryFactsSchema, OmoMemoryDreamSchema, OmoMemoryPeopleSchema, OmoMemorySoulSchema, OmoMemoryReflectionTriggerLayerSchema, OmoMemoryReflectionLayerSchema, OmoMemorySyncLayerSchema, OmoMemorySearchLayerSchema, OmoMemoryNudgeLayerSchema, OmoMemoryFactsLayerSchema, OmoMemoryDreamLayerSchema, OmoMemoryPeopleLayerSchema, OmoMemorySoulLayerSchema, OmoMemoryAgentOverridesSchema, OmoMemorySettingsSchema, OmoMemorySettingsLayerSchema;
22408
22410
  var init_memory = __esm(() => {
22409
22411
  init_zod();
22410
22412
  OmoMemoryReflectionTriggerSchema = object({
22411
- step_count: number2().int().nonnegative().default(0),
22413
+ step_count: number2().int().nonnegative().default(25),
22412
22414
  on_compaction: boolean2().default(true)
22413
22415
  }).strict();
22414
22416
  OmoMemoryReflectionSchema = object({
22415
- trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 0, on_compaction: true }),
22417
+ enabled: boolean2().default(true),
22418
+ trigger: OmoMemoryReflectionTriggerSchema.default({ step_count: 25, on_compaction: true }),
22416
22419
  merge: _enum2(["auto", "integration"]).default("auto"),
22417
22420
  category: string2().min(1).default("quick"),
22418
22421
  timeout_minutes: number2().int().positive().default(15),
@@ -22425,11 +22428,36 @@ var init_memory = __esm(() => {
22425
22428
  OmoMemorySearchSchema = object({
22426
22429
  enabled: boolean2().default(true)
22427
22430
  }).strict();
22431
+ OmoMemoryNudgeSchema = object({
22432
+ enabled: boolean2().default(true),
22433
+ every_user_turns: number2().int().min(1).default(10)
22434
+ }).strict();
22435
+ OmoMemoryFactsSchema = object({
22436
+ enabled: boolean2().default(true),
22437
+ debounce_settles: number2().int().min(1).default(4)
22438
+ }).strict();
22439
+ OmoMemoryDreamSchema = object({
22440
+ enabled: boolean2().default(true),
22441
+ idle_minutes: number2().int().min(0).default(30),
22442
+ min_hours_between: number2().int().min(1).default(24),
22443
+ shutdown_launch: boolean2().default(true),
22444
+ auto_select_max: number2().int().min(1).max(10).default(5),
22445
+ auto_select_max_chars: number2().int().min(1e4).default(150000)
22446
+ }).strict();
22447
+ OmoMemoryPeopleSchema = object({
22448
+ enabled: boolean2().default(true),
22449
+ max_entries: number2().int().min(1).max(100).default(40),
22450
+ max_entry_chars: number2().int().min(50).max(500).default(200)
22451
+ }).strict();
22452
+ OmoMemorySoulSchema = object({
22453
+ edit_notice: boolean2().default(true)
22454
+ }).strict();
22428
22455
  OmoMemoryReflectionTriggerLayerSchema = object({
22429
22456
  step_count: number2().int().nonnegative().optional(),
22430
22457
  on_compaction: boolean2().optional()
22431
22458
  }).strict();
22432
22459
  OmoMemoryReflectionLayerSchema = object({
22460
+ enabled: boolean2().optional(),
22433
22461
  trigger: OmoMemoryReflectionTriggerLayerSchema.optional(),
22434
22462
  merge: _enum2(["auto", "integration"]).optional(),
22435
22463
  category: string2().min(1).optional(),
@@ -22443,10 +22471,39 @@ var init_memory = __esm(() => {
22443
22471
  OmoMemorySearchLayerSchema = object({
22444
22472
  enabled: boolean2().optional()
22445
22473
  }).strict();
22474
+ OmoMemoryNudgeLayerSchema = object({
22475
+ enabled: boolean2().optional(),
22476
+ every_user_turns: number2().int().min(1).optional()
22477
+ }).strict();
22478
+ OmoMemoryFactsLayerSchema = object({
22479
+ enabled: boolean2().optional(),
22480
+ debounce_settles: number2().int().min(1).optional()
22481
+ }).strict();
22482
+ OmoMemoryDreamLayerSchema = object({
22483
+ enabled: boolean2().optional(),
22484
+ idle_minutes: number2().int().min(0).optional(),
22485
+ min_hours_between: number2().int().min(1).optional(),
22486
+ shutdown_launch: boolean2().optional(),
22487
+ auto_select_max: number2().int().min(1).max(10).optional(),
22488
+ auto_select_max_chars: number2().int().min(1e4).optional()
22489
+ }).strict();
22490
+ OmoMemoryPeopleLayerSchema = object({
22491
+ enabled: boolean2().optional(),
22492
+ max_entries: number2().int().min(1).max(100).optional(),
22493
+ max_entry_chars: number2().int().min(50).max(500).optional()
22494
+ }).strict();
22495
+ OmoMemorySoulLayerSchema = object({
22496
+ edit_notice: boolean2().optional()
22497
+ }).strict();
22446
22498
  OmoMemoryAgentOverridesSchema = object({
22447
22499
  enabled: boolean2().optional(),
22448
22500
  agent: string2().min(1).optional(),
22449
22501
  reflection: OmoMemoryReflectionLayerSchema.optional(),
22502
+ nudge: OmoMemoryNudgeLayerSchema.optional(),
22503
+ facts: OmoMemoryFactsLayerSchema.optional(),
22504
+ dream: OmoMemoryDreamLayerSchema.optional(),
22505
+ people: OmoMemoryPeopleLayerSchema.optional(),
22506
+ soul: OmoMemorySoulLayerSchema.optional(),
22450
22507
  sync: OmoMemorySyncLayerSchema.optional(),
22451
22508
  search: OmoMemorySearchLayerSchema.optional(),
22452
22509
  compile_warn_tokens: number2().int().positive().optional()
@@ -22454,13 +22511,27 @@ var init_memory = __esm(() => {
22454
22511
  OmoMemorySettingsSchema = object({
22455
22512
  enabled: boolean2().default(true),
22456
22513
  agent: string2().min(1).default("auto"),
22514
+ tool_exposure: _enum2(["direct", "search"]).default("direct"),
22457
22515
  reflection: OmoMemoryReflectionSchema.default({
22458
- trigger: { step_count: 0, on_compaction: true },
22516
+ enabled: true,
22517
+ trigger: { step_count: 25, on_compaction: true },
22459
22518
  merge: "auto",
22460
22519
  category: "quick",
22461
22520
  timeout_minutes: 15,
22462
22521
  sandbox: "auto"
22463
22522
  }),
22523
+ nudge: OmoMemoryNudgeSchema.default({ enabled: true, every_user_turns: 10 }),
22524
+ facts: OmoMemoryFactsSchema.default({ enabled: true, debounce_settles: 4 }),
22525
+ dream: OmoMemoryDreamSchema.default({
22526
+ enabled: true,
22527
+ idle_minutes: 30,
22528
+ min_hours_between: 24,
22529
+ shutdown_launch: true,
22530
+ auto_select_max: 5,
22531
+ auto_select_max_chars: 150000
22532
+ }),
22533
+ people: OmoMemoryPeopleSchema.default({ enabled: true, max_entries: 40, max_entry_chars: 200 }),
22534
+ soul: OmoMemorySoulSchema.default({ edit_notice: true }),
22464
22535
  sync: OmoMemorySyncSchema.default({ enabled: true }),
22465
22536
  search: OmoMemorySearchSchema.default({ enabled: true }),
22466
22537
  compile_warn_tokens: number2().int().positive().default(30000),
@@ -22469,7 +22540,13 @@ var init_memory = __esm(() => {
22469
22540
  OmoMemorySettingsLayerSchema = object({
22470
22541
  enabled: boolean2().optional(),
22471
22542
  agent: string2().min(1).optional(),
22543
+ tool_exposure: _enum2(["direct", "search"]).optional(),
22472
22544
  reflection: OmoMemoryReflectionLayerSchema.optional(),
22545
+ nudge: OmoMemoryNudgeLayerSchema.optional(),
22546
+ facts: OmoMemoryFactsLayerSchema.optional(),
22547
+ dream: OmoMemoryDreamLayerSchema.optional(),
22548
+ people: OmoMemoryPeopleLayerSchema.optional(),
22549
+ soul: OmoMemorySoulLayerSchema.optional(),
22473
22550
  sync: OmoMemorySyncLayerSchema.optional(),
22474
22551
  search: OmoMemorySearchLayerSchema.optional(),
22475
22552
  compile_warn_tokens: number2().int().positive().optional(),
@@ -22508,7 +22585,7 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
22508
22585
  residency_max_children: record2["residency_max_children"] ?? Math.max(8, resolveParallelism() * 3)
22509
22586
  });
22510
22587
  }
22511
- var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskSettingsSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
22588
+ var ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
22512
22589
  var init_task = __esm(() => {
22513
22590
  init_zod();
22514
22591
  ResidencyMaxChildrenInputSchema = union([number2().int().positive(), literal("unlimited")]);
@@ -22525,6 +22602,16 @@ var init_task = __esm(() => {
22525
22602
  OmoTaskWarningsSchema = object({
22526
22603
  unavailable_categories: boolean2().default(true)
22527
22604
  }).strict();
22605
+ OmoTaskDagSettingsSchema = object({
22606
+ max_nodes_per_run: number2().int().positive().default(64),
22607
+ max_runs_per_session: number2().int().positive().default(16),
22608
+ subscriber_ring: number2().int().positive().default(1000),
22609
+ heartbeat_ms: number2().int().positive().default(15000),
22610
+ history_default_limit: number2().int().positive().default(256),
22611
+ history_max_limit: number2().int().positive().default(1000),
22612
+ retention_days: number2().int().positive().default(7),
22613
+ max_prompt_bytes: number2().int().positive().default(262144)
22614
+ }).strict();
22528
22615
  OmoTaskSettingsSchema = object({
22529
22616
  default_execution_mode: _enum2(["in-process", "process"]).default("in-process"),
22530
22617
  default_concurrency: number2().int().positive().default(5),
@@ -22542,7 +22629,18 @@ var init_task = __esm(() => {
22542
22629
  max_members: 8,
22543
22630
  max_parallel_members: 4,
22544
22631
  max_wall_clock_minutes: 120
22545
- })
22632
+ }),
22633
+ dag: OmoTaskDagSettingsSchema.optional()
22634
+ }).strict();
22635
+ OmoTaskDagSettingsLayerSchema = object({
22636
+ max_nodes_per_run: number2().int().positive().optional(),
22637
+ max_runs_per_session: number2().int().positive().optional(),
22638
+ subscriber_ring: number2().int().positive().optional(),
22639
+ heartbeat_ms: number2().int().positive().optional(),
22640
+ history_default_limit: number2().int().positive().optional(),
22641
+ history_max_limit: number2().int().positive().optional(),
22642
+ retention_days: number2().int().positive().optional(),
22643
+ max_prompt_bytes: number2().int().positive().optional()
22546
22644
  }).strict();
22547
22645
  OmoTaskWaitLayerSchema = object({
22548
22646
  min_ms: number2().int().positive().optional(),
@@ -22570,7 +22668,8 @@ var init_task = __esm(() => {
22570
22668
  resume_children: boolean2().optional(),
22571
22669
  warnings: OmoTaskWarningsLayerSchema.optional(),
22572
22670
  wait: OmoTaskWaitLayerSchema.optional(),
22573
- team: OmoTaskTeamSettingsLayerSchema.optional()
22671
+ team: OmoTaskTeamSettingsLayerSchema.optional(),
22672
+ dag: OmoTaskDagSettingsLayerSchema.optional()
22574
22673
  }).strict();
22575
22674
  });
22576
22675
 
@@ -22625,6 +22724,19 @@ var init_team = __esm(() => {
22625
22724
  OmoTeamsConfigLayerSchema = record(string2(), OmoTeamSpecLayerSchema);
22626
22725
  });
22627
22726
 
22727
+ // packages/omo-config-core/src/schema/telemetry.ts
22728
+ var OmoTelemetrySettingsShape, OmoTelemetrySettingsLayerSchema, OmoTelemetrySettingsSchema;
22729
+ var init_telemetry = __esm(() => {
22730
+ init_zod();
22731
+ OmoTelemetrySettingsShape = {
22732
+ enabled: boolean2()
22733
+ };
22734
+ OmoTelemetrySettingsLayerSchema = object(OmoTelemetrySettingsShape).partial().strict();
22735
+ OmoTelemetrySettingsSchema = OmoTelemetrySettingsLayerSchema.extend({
22736
+ enabled: boolean2().default(true)
22737
+ }).strict();
22738
+ });
22739
+
22628
22740
  // packages/omo-config-core/src/schema/config.ts
22629
22741
  var OmoOpenCodeHarnessConfigSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
22630
22742
  var init_config = __esm(() => {
@@ -22636,6 +22748,7 @@ var init_config = __esm(() => {
22636
22748
  init_model_catalog();
22637
22749
  init_task();
22638
22750
  init_team();
22751
+ init_telemetry();
22639
22752
  OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
22640
22753
  OmoTypedHarnessConfigSchema = object({
22641
22754
  categories: OmoCategoriesConfigSchema.optional(),
@@ -22644,7 +22757,8 @@ var init_config = __esm(() => {
22644
22757
  task: OmoTaskSettingsLayerSchema.optional(),
22645
22758
  teams: OmoTeamsConfigLayerSchema.optional(),
22646
22759
  models: OmoModelCatalogLayerSchema.optional(),
22647
- memory: OmoMemorySettingsLayerSchema.optional()
22760
+ memory: OmoMemorySettingsLayerSchema.optional(),
22761
+ telemetry: OmoTelemetrySettingsLayerSchema.optional()
22648
22762
  }).strict();
22649
22763
  OmoConfigProfileSchema = object({
22650
22764
  categories: OmoCategoriesConfigSchema.optional(),
@@ -22654,6 +22768,7 @@ var init_config = __esm(() => {
22654
22768
  teams: OmoTeamsConfigLayerSchema.optional(),
22655
22769
  models: OmoModelCatalogLayerSchema.optional(),
22656
22770
  memory: OmoMemorySettingsLayerSchema.optional(),
22771
+ telemetry: OmoTelemetrySettingsLayerSchema.optional(),
22657
22772
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
22658
22773
  "[senpi]": OmoTypedHarnessConfigSchema.optional(),
22659
22774
  "[codex]": OmoTypedHarnessConfigSchema.optional()
@@ -22667,6 +22782,7 @@ var init_config = __esm(() => {
22667
22782
  teams: OmoTeamsConfigSchema.optional(),
22668
22783
  models: OmoModelCatalogSchema.optional(),
22669
22784
  memory: OmoMemorySettingsSchema.optional(),
22785
+ telemetry: OmoTelemetrySettingsSchema.optional(),
22670
22786
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
22671
22787
  "[senpi]": OmoTypedHarnessConfigSchema.optional(),
22672
22788
  "[codex]": OmoTypedHarnessConfigSchema.optional(),
@@ -22683,6 +22799,7 @@ var init_config = __esm(() => {
22683
22799
  teams: OmoTeamsConfigLayerSchema.optional(),
22684
22800
  models: OmoModelCatalogLayerSchema.optional(),
22685
22801
  memory: OmoMemorySettingsLayerSchema.optional(),
22802
+ telemetry: OmoTelemetrySettingsLayerSchema.optional(),
22686
22803
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
22687
22804
  "[senpi]": OmoTypedHarnessConfigSchema.optional(),
22688
22805
  "[codex]": OmoTypedHarnessConfigSchema.optional(),
@@ -22705,6 +22822,7 @@ var init_schema = __esm(() => {
22705
22822
  init_model_ref();
22706
22823
  init_task();
22707
22824
  init_team();
22825
+ init_telemetry();
22708
22826
  });
22709
22827
 
22710
22828
  // packages/omo-config-core/src/loader/merge.ts
@@ -24267,16 +24385,30 @@ function invocationsForPlatform(scriptPath, platform) {
24267
24385
  async function runInvocation(input) {
24268
24386
  const child = input.spawnProcess(input.invocation.command, input.invocation.args, { cwd: input.skillDir, env: input.env });
24269
24387
  let timedOut = false;
24388
+ let terminateDeadline;
24389
+ let terminateDeadlineGrace;
24390
+ const killIgnored = new Promise((_, reject) => {
24391
+ terminateDeadline = () => reject(new Error("ast-grep install child ignored termination"));
24392
+ });
24270
24393
  const timeout = setTimeout(() => {
24271
24394
  timedOut = true;
24272
24395
  child.kill();
24396
+ terminateDeadlineGrace = setTimeout(() => terminateDeadline?.(), KILL_GRACE_MS);
24273
24397
  }, input.timeoutMs);
24274
- timeout.unref?.();
24275
24398
  try {
24276
- const outcome = await child.outcome;
24277
- return timedOut ? { kind: "timed-out" } : outcome;
24399
+ const outcome = await Promise.race([child.outcome, killIgnored]);
24400
+ if (timedOut)
24401
+ return { kind: "timed-out" };
24402
+ return outcome;
24403
+ } catch (error51) {
24404
+ if (error51 instanceof Error && error51.message.includes("ignored termination")) {
24405
+ return { kind: "spawn-error", error: error51, missingExecutable: false };
24406
+ }
24407
+ throw error51;
24278
24408
  } finally {
24279
24409
  clearTimeout(timeout);
24410
+ if (terminateDeadlineGrace !== undefined)
24411
+ clearTimeout(terminateDeadlineGrace);
24280
24412
  }
24281
24413
  }
24282
24414
  function failedReason(outcome) {
@@ -24313,7 +24445,7 @@ async function runAstGrepSkillInstall(options) {
24313
24445
  return { kind: "failed", reason: String(error51) };
24314
24446
  }
24315
24447
  }
24316
- var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", AST_GREP_INSTALL_TIMEOUT_MS = 30000;
24448
+ var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR", KILL_GRACE_MS = 1000, AST_GREP_INSTALL_TIMEOUT_MS = 30000;
24317
24449
  var init_install_script = __esm(() => {
24318
24450
  init_sg_manifest();
24319
24451
  });
@@ -26376,10 +26508,10 @@ var init_category_model_requirements = __esm(() => {
26376
26508
  quick: {
26377
26509
  fallbackChain: [
26378
26510
  { providers: ["kimi-for-coding"], model: "kimi-for-coding-highspeed" },
26379
- { providers: ["quotio-openai"], model: "gpt-5.6-luna-fast", variant: "low" },
26511
+ { providers: ["openai-codex"], model: "gpt-5.6-luna-fast", variant: "low" },
26380
26512
  { providers: ["deepseek"], model: "deepseek-v4-flash", variant: "off" },
26381
26513
  {
26382
- providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "opencode-go", "vercel"],
26514
+ providers: ["qwen-token-plan", "alibaba-token-plan", "bailian-coding-plan", "vercel"],
26383
26515
  model: "qwen3.6-flash",
26384
26516
  variant: "low"
26385
26517
  },
@@ -26395,6 +26527,11 @@ var init_category_model_requirements = __esm(() => {
26395
26527
  },
26396
26528
  "unspecified-low": {
26397
26529
  fallbackChain: [
26530
+ {
26531
+ providers: ["xai", "github-copilot", "opencode", "vercel"],
26532
+ model: "grok-4.6",
26533
+ variant: "xhigh"
26534
+ },
26398
26535
  {
26399
26536
  providers: ["openai", "quotio-openai", "github-copilot", "opencode", "vercel"],
26400
26537
  model: "gpt-5.6-terra",
@@ -27629,6 +27766,7 @@ var init_context_limit_resolver2 = () => {};
27629
27766
 
27630
27767
  // packages/omo-opencode/src/shared/normalize-sdk-response.ts
27631
27768
  function normalizeSDKResponse(response, fallback, options) {
27769
+ const fallbackIsArray = Array.isArray(fallback);
27632
27770
  if (response == null) {
27633
27771
  return fallback;
27634
27772
  }
@@ -27638,14 +27776,17 @@ function normalizeSDKResponse(response, fallback, options) {
27638
27776
  if (typeof response === "object" && "data" in response) {
27639
27777
  const data = response.data;
27640
27778
  if (data != null) {
27779
+ if (fallbackIsArray && !Array.isArray(data)) {
27780
+ return fallback;
27781
+ }
27641
27782
  return data;
27642
27783
  }
27643
- if (options?.preferResponseOnMissingData === true) {
27784
+ if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
27644
27785
  return response;
27645
27786
  }
27646
27787
  return fallback;
27647
27788
  }
27648
- if (options?.preferResponseOnMissingData === true) {
27789
+ if (options?.preferResponseOnMissingData === true && !fallbackIsArray) {
27649
27790
  return response;
27650
27791
  }
27651
27792
  return fallback;
@@ -28125,7 +28266,7 @@ This is NOT a default choice - it's for genuinely unclassifiable moderate-effort
28125
28266
  </Category_Context>
28126
28267
 
28127
28268
  <Caller_Warning>
28128
- THIS CATEGORY USES A LIGHTWEIGHT MODEL (gpt-5.6-luna).
28269
+ THIS CATEGORY USES GROK 4.6 (xhigh).
28129
28270
 
28130
28271
  **PROVIDE CLEAR STRUCTURE:**
28131
28272
  1. MUST DO: Enumerate required actions explicitly
@@ -28157,7 +28298,7 @@ var init_openai_categories = __esm(() => {
28157
28298
  },
28158
28299
  {
28159
28300
  name: "unspecified-low",
28160
- config: { model: "openai/gpt-5.6-luna", variant: "xhigh" },
28301
+ config: { model: "xai/grok-4.6", variant: "xhigh" },
28161
28302
  description: "Tasks that don't fit other categories, low effort required",
28162
28303
  promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
28163
28304
  }
@@ -83054,6 +83195,47 @@ var init_model_capabilities_generated = __esm(() => {
83054
83195
  input: 272000,
83055
83196
  output: 128000
83056
83197
  }
83198
+ },
83199
+ "grok-4.6": {
83200
+ id: "grok-4.6",
83201
+ family: "grok",
83202
+ reasoning: true,
83203
+ temperature: true,
83204
+ toolCall: true,
83205
+ modalities: {
83206
+ input: [
83207
+ "text",
83208
+ "image"
83209
+ ],
83210
+ output: [
83211
+ "text"
83212
+ ]
83213
+ },
83214
+ limit: {
83215
+ context: 500000,
83216
+ output: 500000
83217
+ }
83218
+ },
83219
+ "xai/grok-4.6": {
83220
+ id: "xai/grok-4.6",
83221
+ family: "grok",
83222
+ reasoning: true,
83223
+ temperature: true,
83224
+ toolCall: true,
83225
+ modalities: {
83226
+ input: [
83227
+ "text",
83228
+ "image",
83229
+ "pdf"
83230
+ ],
83231
+ output: [
83232
+ "text"
83233
+ ]
83234
+ },
83235
+ limit: {
83236
+ context: 500000,
83237
+ output: 500000
83238
+ }
83057
83239
  }
83058
83240
  }
83059
83241
  };
@@ -83095,21 +83277,21 @@ var init_session_cursor = __esm(() => {
83095
83277
  });
83096
83278
 
83097
83279
  // packages/omo-opencode/src/shared/shell-env.ts
83098
- function detectShellType() {
83099
- if (process.env.SHELL) {
83100
- const shell = process.env.SHELL;
83280
+ function detectShellType(platform = process.platform, env2 = process.env) {
83281
+ if (env2.SHELL) {
83282
+ const shell = env2.SHELL;
83101
83283
  if (shell.includes("csh") || shell.includes("tcsh")) {
83102
83284
  return "csh";
83103
83285
  }
83104
83286
  return "unix";
83105
83287
  }
83106
- if (process.platform === "win32" && (process.env.BASH_VERSION || process.env.MSYSTEM || process.env.WSL_DISTRO_NAME)) {
83288
+ if (platform === "win32" && (env2.BASH_VERSION || env2.MSYSTEM || env2.WSL_DISTRO_NAME)) {
83107
83289
  return "unix";
83108
83290
  }
83109
- if (process.env.PSModulePath) {
83291
+ if (env2.PSModulePath) {
83110
83292
  return "powershell";
83111
83293
  }
83112
- return process.platform === "win32" ? "cmd" : "unix";
83294
+ return platform === "win32" ? "cmd" : "unix";
83113
83295
  }
83114
83296
  var init_shell_env = () => {};
83115
83297
 
@@ -88712,7 +88894,7 @@ var init_activity_state = __esm(() => {
88712
88894
  });
88713
88895
 
88714
88896
  // packages/telemetry-core/src/constants.ts
88715
- var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
88897
+ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74", UNCONFIGURED_POSTHOG_API_KEY = "phc_REPLACE_ME_OMO_NATIVE";
88716
88898
 
88717
88899
  // packages/telemetry-core/src/diagnostics.ts
88718
88900
  import { appendFileSync as appendFileSync2, existsSync as existsSync27, mkdirSync as mkdirSync9, readFileSync as readFileSync13 } from "fs";
@@ -88850,6 +89032,9 @@ function shouldDisableTelemetry(input) {
88850
89032
  const env2 = input.env ?? process.env;
88851
89033
  const globalPrefix = input.globalEnvPrefix ?? "OMO";
88852
89034
  const prefixes = Array.from(new Set([globalPrefix, input.productEnvPrefix]));
89035
+ if (isDisableFlag(env2["DO_NOT_TRACK"])) {
89036
+ return true;
89037
+ }
88853
89038
  for (const prefix of prefixes) {
88854
89039
  if (isDisableFlag(env2[`${prefix}_DISABLE_POSTHOG`])) {
88855
89040
  return true;
@@ -88863,6 +89048,13 @@ function shouldDisableTelemetry(input) {
88863
89048
  function getTelemetryApiKey(env2 = process.env, defaultApiKey = DEFAULT_POSTHOG_API_KEY) {
88864
89049
  return env2["POSTHOG_API_KEY"]?.trim() ?? defaultApiKey;
88865
89050
  }
89051
+ function isConfiguredTelemetryApiKey(apiKey) {
89052
+ const normalized = apiKey.trim();
89053
+ return normalized.length > 0 && normalized !== UNCONFIGURED_POSTHOG_API_KEY;
89054
+ }
89055
+ function hasTelemetryApiKey(env2, defaultApiKey) {
89056
+ return isConfiguredTelemetryApiKey(getTelemetryApiKey(env2, defaultApiKey));
89057
+ }
88866
89058
  function getTelemetryHost(env2 = process.env, defaultHost = DEFAULT_POSTHOG_HOST) {
88867
89059
  return env2["POSTHOG_HOST"]?.trim() || defaultHost;
88868
89060
  }
@@ -88872,17 +89064,6 @@ var init_env2 = __esm(() => {
88872
89064
  SEND_OPT_OUT_VALUES = ["0", "false", "no", "yes"];
88873
89065
  });
88874
89066
 
88875
- // packages/telemetry-core/src/machine-id.ts
88876
- import { createHash as createHash4 } from "crypto";
88877
- import os4 from "os";
88878
- function getDefaultTelemetryOsProvider() {
88879
- return os4;
88880
- }
88881
- function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
88882
- return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
88883
- }
88884
- var init_machine_id = () => {};
88885
-
88886
89067
  // node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
88887
89068
  import { dirname as dirname17, posix as posix7, sep as sep7 } from "path";
88888
89069
  function createModulerModifier() {
@@ -94257,6 +94438,17 @@ var init_index_node = __esm(() => {
94257
94438
  };
94258
94439
  });
94259
94440
 
94441
+ // packages/telemetry-core/src/machine-id.ts
94442
+ import { createHash as createHash4 } from "crypto";
94443
+ import os4 from "os";
94444
+ function getDefaultTelemetryOsProvider() {
94445
+ return os4;
94446
+ }
94447
+ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
94448
+ return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
94449
+ }
94450
+ var init_machine_id = () => {};
94451
+
94260
94452
  // packages/telemetry-core/src/posthog-client.ts
94261
94453
  class PostHogTelemetryTransport {
94262
94454
  #client;
@@ -94278,7 +94470,7 @@ function createDefaultPostHogTransport(apiKey, options) {
94278
94470
  }
94279
94471
  function isTelemetryClientEnabled(input) {
94280
94472
  const env2 = input.env ?? process.env;
94281
- return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) && getTelemetryApiKey(env2, input.product.defaultApiKey).length > 0;
94473
+ return !shouldDisableTelemetry({ env: env2, productEnvPrefix: input.product.productEnvPrefix }) && hasTelemetryApiKey(env2, input.product.defaultApiKey);
94282
94474
  }
94283
94475
  function createTelemetryClient(input) {
94284
94476
  if (!isTelemetryClientEnabled(input)) {
@@ -94344,7 +94536,8 @@ function createTransport(input) {
94344
94536
  flushAt: 1,
94345
94537
  flushInterval: 0,
94346
94538
  host: getTelemetryHost(env2, input.product.defaultHost),
94347
- disableGeoip: false
94539
+ disableGeoip: input.product.disableGeoip ?? false,
94540
+ ...input.product.transportOptions
94348
94541
  });
94349
94542
  } catch (error51) {
94350
94543
  input.diagnostics?.({
@@ -94421,6 +94614,17 @@ var init_posthog_client = __esm(() => {
94421
94614
  };
94422
94615
  });
94423
94616
 
94617
+ // packages/telemetry-core/src/events.ts
94618
+ var ALLOWED_DOLLAR_KEYS;
94619
+ var init_events = __esm(() => {
94620
+ ALLOWED_DOLLAR_KEYS = new Set([
94621
+ "$os",
94622
+ "$os_version",
94623
+ "$process_person_profile",
94624
+ "$session_id"
94625
+ ]);
94626
+ });
94627
+
94424
94628
  // packages/telemetry-core/src/record-daily-active.ts
94425
94629
  var init_record_daily_active = () => {};
94426
94630
 
@@ -94429,6 +94633,7 @@ var init_src5 = __esm(() => {
94429
94633
  init_activity_state();
94430
94634
  init_diagnostics();
94431
94635
  init_env2();
94636
+ init_events();
94432
94637
  init_machine_id();
94433
94638
  init_posthog_client();
94434
94639
  init_record_daily_active();
@@ -94439,7 +94644,7 @@ var package_default2;
94439
94644
  var init_package2 = __esm(() => {
94440
94645
  package_default2 = {
94441
94646
  name: "@oh-my-opencode/omo-codex",
94442
- version: "5.0.0-beta.1",
94647
+ version: "5.0.0-beta.10",
94443
94648
  type: "module",
94444
94649
  private: true,
94445
94650
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -94653,7 +94858,7 @@ __export(exports_telemetry, {
94653
94858
  __resetOsProviderForTesting: () => __resetOsProviderForTesting,
94654
94859
  __resetActivityStateProviderForTesting: () => __resetActivityStateProviderForTesting
94655
94860
  });
94656
- var init_telemetry = __esm(() => {
94861
+ var init_telemetry2 = __esm(() => {
94657
94862
  init_posthog();
94658
94863
  });
94659
94864
 
@@ -95408,20 +95613,20 @@ var init_update_toasts = __esm(() => {
95408
95613
  });
95409
95614
 
95410
95615
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
95411
- import { existsSync as existsSync46 } from "fs";
95412
- import { dirname as dirname28, join as join73 } from "path";
95616
+ import { existsSync as existsSync48 } from "fs";
95617
+ import { dirname as dirname30, join as join76 } from "path";
95413
95618
  import { fileURLToPath as fileURLToPath5 } from "url";
95414
95619
  function defaultGetModuleHostingWorkspace() {
95415
95620
  try {
95416
- const currentDir = dirname28(fileURLToPath5(import.meta.url));
95621
+ const currentDir = dirname30(fileURLToPath5(import.meta.url));
95417
95622
  const pkgJsonPath = findPackageJsonUp(currentDir);
95418
95623
  if (!pkgJsonPath)
95419
95624
  return null;
95420
- const pkgDir = dirname28(pkgJsonPath);
95421
- const nodeModulesDir = dirname28(pkgDir);
95625
+ const pkgDir = dirname30(pkgJsonPath);
95626
+ const nodeModulesDir = dirname30(pkgDir);
95422
95627
  if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
95423
95628
  return null;
95424
- return dirname28(nodeModulesDir);
95629
+ return dirname30(nodeModulesDir);
95425
95630
  } catch (error51) {
95426
95631
  if (error51 instanceof Error) {
95427
95632
  return null;
@@ -95562,8 +95767,8 @@ var init_background_update_check = __esm(() => {
95562
95767
  init_package_json_locator();
95563
95768
  init_update_toasts();
95564
95769
  defaultDeps4 = {
95565
- existsSync: existsSync46,
95566
- join: join73,
95770
+ existsSync: existsSync48,
95771
+ join: join76,
95567
95772
  runBunInstallWithDetails,
95568
95773
  log: log2,
95569
95774
  getOpenCodeCacheDir,
@@ -95726,7 +95931,7 @@ async function showSpinnerToast(ctx, version3, message) {
95726
95931
  duration: frameInterval + 50
95727
95932
  }
95728
95933
  }).catch(ignoreToastError);
95729
- await new Promise((resolve20) => setTimeout(resolve20, frameInterval));
95934
+ await new Promise((resolve22) => setTimeout(resolve22, frameInterval));
95730
95935
  }
95731
95936
  }
95732
95937
  var SISYPHUS_SPINNER;
@@ -100518,7 +100723,7 @@ async function installAstGrepForCodex(options) {
100518
100723
  // packages/omo-codex/src/install/codex-install-telemetry.ts
100519
100724
  async function trackCodexInstallTelemetry() {
100520
100725
  try {
100521
- const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry(), exports_telemetry));
100726
+ const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry2(), exports_telemetry));
100522
100727
  const posthog = createInstallPostHog2();
100523
100728
  posthog.trackActive(getPostHogDistinctId2(), "install_completed");
100524
100729
  await posthog.shutdown();
@@ -101338,22 +101543,136 @@ function nodeErrorCode6(error51) {
101338
101543
  var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
101339
101544
  // packages/omo-senpi/src/install/install-senpi.ts
101340
101545
  import { execFile as execFile4 } from "child_process";
101341
- import { createHash as createHash5 } from "crypto";
101342
- import { constants as constants8, existsSync as existsSync30 } from "fs";
101343
- import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
101344
- import { homedir as homedir9 } from "os";
101345
- import { dirname as dirname22, join as join60, resolve as resolve18 } from "path";
101546
+ import { existsSync as existsSync32 } from "fs";
101547
+ import { homedir as homedir11 } from "os";
101548
+ import { dirname as dirname24, join as join63, resolve as resolve20 } from "path";
101346
101549
  import { fileURLToPath } from "url";
101347
101550
  import { promisify as promisify2 } from "util";
101348
101551
 
101552
+ // packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
101553
+ import { existsSync as existsSync30 } from "fs";
101554
+ import { homedir as homedir9 } from "os";
101555
+ import { join as join59, resolve as resolve17 } from "path";
101556
+ var AGENT_DIR_ENV_NAMES = [
101557
+ "OMO_CODING_AGENT_DIR",
101558
+ "SENPI_CODING_AGENT_DIR",
101559
+ "PI_CODING_AGENT_DIR"
101560
+ ];
101561
+ var AGENT_HOME_SENTINEL = "settings.json";
101562
+ function resolveAgentHome(options) {
101563
+ const { env: env3, homeDir = homedir9(), exists: exists7 = existsSync30 } = options;
101564
+ for (const name of AGENT_DIR_ENV_NAMES) {
101565
+ const configured = env3[name]?.trim();
101566
+ if (configured)
101567
+ return resolve17(configured);
101568
+ }
101569
+ const brandedHome = join59(homeDir, ".omo");
101570
+ const canonical = join59(brandedHome, "agent");
101571
+ if (exists7(join59(canonical, AGENT_HOME_SENTINEL)))
101572
+ return canonical;
101573
+ if (exists7(join59(brandedHome, AGENT_HOME_SENTINEL)))
101574
+ return brandedHome;
101575
+ return join59(homeDir, ".senpi", "agent");
101576
+ }
101577
+
101578
+ // packages/omo-senpi/src/install/local-launcher.ts
101579
+ import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "fs";
101580
+ import { homedir as homedir10 } from "os";
101581
+ import { dirname as dirname21, join as join60, resolve as resolve18 } from "path";
101582
+ var MARKER = "omo-local-launcher";
101583
+ function localLauncherPath(homeDir = homedir10()) {
101584
+ return join60(homeDir, ".local", "bin", "omo");
101585
+ }
101586
+ function localLauncherCmdPath(homeDir = homedir10()) {
101587
+ return join60(homeDir, ".local", "bin", "omo.cmd");
101588
+ }
101589
+ function renderLocalLauncher(options) {
101590
+ const brand = {
101591
+ name: "omo",
101592
+ displayVersion: options.version ?? "local",
101593
+ configDir: ".omo",
101594
+ flatLayout: false,
101595
+ envPrefix: "OMO",
101596
+ userAgent: "omo",
101597
+ originator: "omo",
101598
+ update: {
101599
+ packageName: "omo-ai",
101600
+ distTag: "beta",
101601
+ command: "npm i -g omo-ai@beta",
101602
+ changelogUrl: "https://github.com/code-yeongyu/oh-my-openagent/releases"
101603
+ }
101604
+ };
101605
+ return `#!/usr/bin/env node
101606
+ // ${MARKER}: generated by the omo-senpi installer. Delete this file to remove the local launcher.
101607
+ import { spawn } from "node:child_process"
101608
+ import { homedir } from "node:os"
101609
+ import { join } from "node:path"
101610
+
101611
+ const brand = ${JSON.stringify(brand)}
101612
+ const cli = process.env.OMO_SENPI_CLI_PATH ?? ${JSON.stringify(options.senpiCliPath)}
101613
+ const plugin = process.env.OMO_PLUGIN_ROOT ?? ${JSON.stringify(options.pluginPath)}
101614
+ // The same directory the published launcher pins, so a local install shares one state location
101615
+ // with the published one and with anything either of them spawns.
101616
+ const agentDir = process.env.OMO_CODING_AGENT_DIR ?? process.env.SENPI_CODING_AGENT_DIR
101617
+ ?? process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".omo", "agent")
101618
+ const env = {
101619
+ ...process.env,
101620
+ SENPI_BRAND: JSON.stringify(brand),
101621
+ OMO_NATIVE: "1",
101622
+ OMO_CODING_AGENT_DIR: agentDir,
101623
+ SENPI_CODING_AGENT_DIR: agentDir,
101624
+ }
101625
+ // Anything resolving the product by name must re-enter through this launcher, never the engine.
101626
+ env.OMO_BIN = process.argv[1]
101627
+ const selfUpdate = process.argv[2] === "update"
101628
+ && process.argv.slice(3).every((arg) => arg.startsWith("-") || ["self", "senpi", "omo"].includes(arg))
101629
+ && !process.argv.slice(3).some((arg) => arg === "--extensions" || arg === "--models")
101630
+ if (selfUpdate) {
101631
+ console.log("omo is updated via npm: npm i -g omo-ai@beta")
101632
+ process.exit(0)
101633
+ }
101634
+ const child = spawn(process.execPath, [cli, "--extension", plugin, ...process.argv.slice(2)], {
101635
+ env,
101636
+ stdio: "inherit",
101637
+ })
101638
+ child.on("close", (code, signal) => {
101639
+ if (signal) {
101640
+ process.kill(process.pid, signal)
101641
+ return
101642
+ }
101643
+ process.exitCode = code ?? 1
101644
+ })
101645
+ `;
101646
+ }
101647
+ function installLocalLauncher(options) {
101648
+ const path6 = localLauncherPath(options.homeDir);
101649
+ if (existsSync31(path6) && !readFileSync14(path6, "utf8").includes(MARKER))
101650
+ return;
101651
+ mkdirSync10(dirname21(path6), { recursive: true });
101652
+ writeFileSync6(path6, renderLocalLauncher(options));
101653
+ chmodSync3(path6, 493);
101654
+ if ((options.platform ?? process.platform) === "win32") {
101655
+ writeFileSync6(localLauncherCmdPath(options.homeDir), `@echo off\r
101656
+ node "%~dp0omo" %*\r
101657
+ `);
101658
+ }
101659
+ return path6;
101660
+ }
101661
+
101662
+ // packages/omo-senpi/src/install/plugin-artifacts.ts
101663
+ import { createHash as createHash5 } from "crypto";
101664
+ import { constants as constants8 } from "fs";
101665
+ import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
101666
+ import { dirname as dirname23, join as join62 } from "path";
101667
+
101349
101668
  // packages/omo-senpi/src/install/senpi-settings.ts
101350
101669
  import { constants as constants7 } from "fs";
101351
101670
  import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "fs/promises";
101352
- import { dirname as dirname21, join as join59, resolve as resolve17 } from "path";
101671
+ import { dirname as dirname22, join as join61, resolve as resolve19 } from "path";
101353
101672
  var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
101354
101673
  var LEGACY_BUILTIN_SHADOW_PACKAGES = [
101355
- join59("packages", "pi-goal"),
101356
- join59("packages", "pi-webfetch")
101674
+ join61("packages", "pi-goal"),
101675
+ join61("packages", "pi-webfetch")
101357
101676
  ];
101358
101677
  async function readSettings(settingsPath) {
101359
101678
  let raw;
@@ -101382,13 +101701,13 @@ function dedupePackages(packages) {
101382
101701
  return [...new Set(packages)];
101383
101702
  }
101384
101703
  function removeLegacyBuiltinShadows(packages, repoRoot, agentDir) {
101385
- const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve17(repoRoot, path6)));
101386
- return packages.filter((entry) => !shadowPaths.has(resolve17(agentDir, entry)));
101704
+ const shadowPaths = new Set(LEGACY_BUILTIN_SHADOW_PACKAGES.map((path6) => resolve19(repoRoot, path6)));
101705
+ return packages.filter((entry) => !shadowPaths.has(resolve19(agentDir, entry)));
101387
101706
  }
101388
101707
  async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir) {
101389
- const currentPath = resolve17(currentPluginPath);
101708
+ const currentPath = resolve19(currentPluginPath);
101390
101709
  const entries = await Promise.all(packages.map(async (entry) => {
101391
- const packagePath = resolve17(agentDir, entry);
101710
+ const packagePath = resolve19(agentDir, entry);
101392
101711
  if (packagePath === currentPath)
101393
101712
  return currentPath;
101394
101713
  return await readPackageName(packagePath) === OMO_SENPI_PACKAGE_NAME ? undefined : entry;
@@ -101396,7 +101715,7 @@ async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir
101396
101715
  return entries.filter((entry) => entry !== undefined);
101397
101716
  }
101398
101717
  async function writeSettingsAtomically(settingsPath, settings) {
101399
- await mkdir9(dirname21(settingsPath), { recursive: true });
101718
+ await mkdir9(dirname22(settingsPath), { recursive: true });
101400
101719
  const backupPath = await nextBackupPath(settingsPath);
101401
101720
  if (await fileExists(settingsPath)) {
101402
101721
  await copyFile3(settingsPath, backupPath);
@@ -101428,7 +101747,7 @@ function isRecord10(value) {
101428
101747
  async function readPackageName(packagePath) {
101429
101748
  let raw;
101430
101749
  try {
101431
- raw = await readFile25(join59(packagePath, "package.json"), "utf8");
101750
+ raw = await readFile25(join61(packagePath, "package.json"), "utf8");
101432
101751
  } catch (error51) {
101433
101752
  if (isErrno(error51, "ENOENT") || isErrno(error51, "ENOTDIR"))
101434
101753
  return;
@@ -101451,89 +101770,56 @@ function isErrno(error51, code) {
101451
101770
  return error51 instanceof Error && "code" in error51 && error51.code === code;
101452
101771
  }
101453
101772
 
101454
- // packages/omo-senpi/src/install/install-senpi.ts
101455
- var execFileAsync2 = promisify2(execFile4);
101773
+ // packages/omo-senpi/src/install/plugin-artifacts.ts
101456
101774
  var REQUIRED_PLUGIN_ARTIFACTS = [
101457
- join60("extensions", "omo.js"),
101458
- join60("extensions", "reflection-persona.md"),
101459
- join60("skills", "ast-grep", "SKILL.md"),
101460
- join60("skills", "coding-agent-sessions", "SKILL.md"),
101461
- join60("skills", "debugging", "SKILL.md"),
101462
- join60("skills", "frontend", "SKILL.md"),
101463
- join60("skills", "git-master", "SKILL.md"),
101464
- join60("skills", "init-deep", "SKILL.md"),
101465
- join60("skills", "lsp-setup", "SKILL.md"),
101466
- join60("skills", "programming", "SKILL.md"),
101467
- join60("skills", "refactor", "SKILL.md"),
101468
- join60("skills", "remove-ai-slops", "SKILL.md"),
101469
- join60("skills", "review-work", "SKILL.md"),
101470
- join60("skills", "start-work", "SKILL.md"),
101471
- join60("skills", "ultimate-browsing", "SKILL.md"),
101472
- join60("skills", "ultrawork", "SKILL.md"),
101473
- join60("skills", "ulw-loop", "SKILL.md"),
101474
- join60("skills", "ulw-plan", "SKILL.md"),
101475
- join60("skills", "ulw-research", "SKILL.md"),
101476
- join60("skills", "visual-qa", "SKILL.md"),
101477
- join60("runtime", "ast-grep-mcp", "cli.js"),
101478
- join60("runtime", "agent-toolkit", "cli.js"),
101479
- join60("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
101480
- join60("runtime", "agent-toolkit", "omo-agent-toolkit"),
101481
- join60("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
101482
- join60("runtime", "lsp-daemon", "dist", "cli.js"),
101483
- join60("runtime", "lsp-daemon", "dist", "index.js"),
101484
- join60("runtime", "lsp-daemon", "dist", "index.d.ts"),
101485
- join60("runtime", "lsp-daemon", "dist", "daemon-client.js"),
101486
- join60("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
101487
- join60("runtime", "lsp-daemon", "dist", "package.json"),
101488
- join60("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
101489
- join60("scripts", "install.mjs")
101775
+ join62("extensions", "omo.js"),
101776
+ join62("extensions", "omo-task.js"),
101777
+ join62("extensions", "omo-member.js"),
101778
+ join62("extensions", "memory-run-supervisor.mjs"),
101779
+ join62("extensions", "reflection-persona.md"),
101780
+ join62("extensions", "dream-persona.md"),
101781
+ join62("extensions", "facts-persona.md"),
101782
+ join62("skills", "ast-grep", "SKILL.md"),
101783
+ join62("skills", "coding-agent-sessions", "SKILL.md"),
101784
+ join62("skills", "debugging", "SKILL.md"),
101785
+ join62("skills", "frontend", "SKILL.md"),
101786
+ join62("skills", "git-master", "SKILL.md"),
101787
+ join62("skills", "init-deep", "SKILL.md"),
101788
+ join62("skills", "lsp-setup", "SKILL.md"),
101789
+ join62("skills", "programming", "SKILL.md"),
101790
+ join62("skills", "refactor", "SKILL.md"),
101791
+ join62("skills", "remove-ai-slops", "SKILL.md"),
101792
+ join62("skills", "review-work", "SKILL.md"),
101793
+ join62("skills", "start-work", "SKILL.md"),
101794
+ join62("skills", "ultimate-browsing", "SKILL.md"),
101795
+ join62("skills", "ultrawork", "SKILL.md"),
101796
+ join62("skills", "ulw-loop", "SKILL.md"),
101797
+ join62("skills", "ulw-plan", "SKILL.md"),
101798
+ join62("skills", "ulw-research", "SKILL.md"),
101799
+ join62("skills", "visual-qa", "SKILL.md"),
101800
+ join62("runtime", "ast-grep-mcp", "cli.js"),
101801
+ join62("runtime", "agent-toolkit", "cli.js"),
101802
+ join62("runtime", "agent-toolkit", "ulw-loop", "cli.js"),
101803
+ join62("runtime", "agent-toolkit", "omo-agent-toolkit"),
101804
+ join62("runtime", "agent-toolkit", "omo-agent-toolkit.cmd"),
101805
+ join62("runtime", "lsp-daemon", "dist", "cli.js"),
101806
+ join62("runtime", "lsp-daemon", "dist", "index.js"),
101807
+ join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
101808
+ join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
101809
+ join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
101810
+ join62("runtime", "lsp-daemon", "dist", "package.json"),
101811
+ join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
101812
+ join62("scripts", "install.mjs")
101490
101813
  ];
101491
- async function runSenpiInstaller(options = {}) {
101492
- const context = resolveInstallContext(options);
101493
- await ensurePluginArtifacts(context);
101494
- const settings = await readSettings(context.settingsPath);
101495
- const before = JSON.stringify(settings);
101496
- const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
101497
- if (!packages.includes(context.pluginPath))
101498
- packages.push(context.pluginPath);
101499
- settings.packages = packages;
101500
- const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
101501
- return {
101502
- ok: true,
101503
- action: "install",
101504
- agentDir: context.agentDir,
101505
- settingsPath: context.settingsPath,
101506
- pluginPath: context.pluginPath,
101507
- changed: JSON.stringify(settings) !== before,
101508
- backupPath
101509
- };
101510
- }
101511
- function resolveInstallContext(options) {
101512
- const env3 = options.env ?? process.env;
101513
- const allowBuild = options.pluginPath === undefined;
101514
- const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname22(fileURLToPath(import.meta.url))) : dirname22(resolve18(options.pluginPath))));
101515
- const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join60(homedir9(), ".senpi", "agent"));
101516
- const pluginPath = resolve18(options.pluginPath ?? join60(repoRoot, "packages", "omo-senpi", "plugin"));
101517
- return {
101518
- env: env3,
101519
- repoRoot,
101520
- agentDir,
101521
- settingsPath: join60(agentDir, "settings.json"),
101522
- pluginPath,
101523
- platform: options.platform ?? process.platform,
101524
- allowBuild,
101525
- runCommand: options.runCommand ?? defaultRunCommand3
101526
- };
101527
- }
101528
101814
  async function ensurePluginArtifacts(context) {
101529
101815
  if (context.allowBuild) {
101530
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
101531
- await context.runCommand("node", [join60("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
101532
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
101533
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
101534
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
101535
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
101536
- await context.runCommand("node", [join60(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
101816
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
101817
+ await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
101818
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
101819
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
101820
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
101821
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
101822
+ await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-agent-toolkit.mjs")], { cwd: context.repoRoot });
101537
101823
  }
101538
101824
  if (await hasMissingPluginArtifact(context.pluginPath)) {
101539
101825
  throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
@@ -101542,14 +101828,14 @@ async function ensurePluginArtifacts(context) {
101542
101828
  }
101543
101829
  async function hasMissingPluginArtifact(pluginPath) {
101544
101830
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
101545
- if (!await fileExists2(join60(pluginPath, artifact)))
101831
+ if (!await fileExists2(join62(pluginPath, artifact)))
101546
101832
  return true;
101547
101833
  }
101548
101834
  return false;
101549
101835
  }
101550
101836
  async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
101551
- const runtimeEntry = join60(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
101552
- const manifestPath = join60(dirname22(runtimeEntry), "manifest.json");
101837
+ const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
101838
+ const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
101553
101839
  let runtimeStat;
101554
101840
  try {
101555
101841
  runtimeStat = await stat6(runtimeEntry);
@@ -101596,6 +101882,63 @@ function astGrepIntegrityError(runtimeEntry, reason) {
101596
101882
  function messageOf(error51) {
101597
101883
  return error51 instanceof Error ? error51.message : String(error51);
101598
101884
  }
101885
+ async function fileExists2(path6) {
101886
+ try {
101887
+ await access2(path6, constants8.F_OK);
101888
+ return true;
101889
+ } catch (error51) {
101890
+ if (isErrno2(error51, "ENOENT"))
101891
+ return false;
101892
+ throw error51;
101893
+ }
101894
+ }
101895
+ function isErrno2(error51, code) {
101896
+ return error51 instanceof Error && "code" in error51 && error51.code === code;
101897
+ }
101898
+
101899
+ // packages/omo-senpi/src/install/install-senpi.ts
101900
+ var execFileAsync2 = promisify2(execFile4);
101901
+ async function runSenpiInstaller(options = {}) {
101902
+ const context = resolveInstallContext(options);
101903
+ await ensurePluginArtifacts(context);
101904
+ const settings = await readSettings(context.settingsPath);
101905
+ const before = JSON.stringify(settings);
101906
+ const packages = dedupePackages(await removeSupersededOmoPackages(removeLegacyBuiltinShadows(dedupePackages(readPackages(settings)), context.repoRoot, context.agentDir), context.pluginPath, context.agentDir));
101907
+ if (!packages.includes(context.pluginPath))
101908
+ packages.push(context.pluginPath);
101909
+ settings.packages = packages;
101910
+ const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
101911
+ installLocalLauncher({
101912
+ pluginPath: context.pluginPath,
101913
+ senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js")
101914
+ });
101915
+ return {
101916
+ ok: true,
101917
+ action: "install",
101918
+ agentDir: context.agentDir,
101919
+ settingsPath: context.settingsPath,
101920
+ pluginPath: context.pluginPath,
101921
+ changed: JSON.stringify(settings) !== before,
101922
+ backupPath
101923
+ };
101924
+ }
101925
+ function resolveInstallContext(options) {
101926
+ const env3 = options.env ?? process.env;
101927
+ const allowBuild = options.pluginPath === undefined;
101928
+ const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
101929
+ const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
101930
+ const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
101931
+ return {
101932
+ env: env3,
101933
+ repoRoot,
101934
+ agentDir,
101935
+ settingsPath: join63(agentDir, "settings.json"),
101936
+ pluginPath,
101937
+ platform: options.platform ?? process.platform,
101938
+ allowBuild,
101939
+ runCommand: options.runCommand ?? defaultRunCommand3
101940
+ };
101941
+ }
101599
101942
  async function defaultRunCommand3(command, args, options) {
101600
101943
  const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
101601
101944
  if (result.stderr.trim().length > 0)
@@ -101606,27 +101949,14 @@ async function defaultRunCommand3(command, args, options) {
101606
101949
  function findRepoRoot2(importerDir) {
101607
101950
  let current = importerDir;
101608
101951
  for (let depth = 0;depth <= 7; depth += 1) {
101609
- if (fileExistsSync(join60(current, "packages", "omo-senpi", "plugin", "package.json")))
101952
+ if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
101610
101953
  return current;
101611
- current = resolve18(current, "..");
101954
+ current = resolve20(current, "..");
101612
101955
  }
101613
101956
  throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
101614
101957
  }
101615
- async function fileExists2(path6) {
101616
- try {
101617
- await access2(path6, constants8.F_OK);
101618
- return true;
101619
- } catch (error51) {
101620
- if (isErrno2(error51, "ENOENT"))
101621
- return false;
101622
- throw error51;
101623
- }
101624
- }
101625
101958
  function fileExistsSync(path6) {
101626
- return existsSync30(path6);
101627
- }
101628
- function isErrno2(error51, code) {
101629
- return error51 instanceof Error && "code" in error51 && error51.code === code;
101959
+ return existsSync32(path6);
101630
101960
  }
101631
101961
  // packages/omo-opencode/src/cli/star-request.ts
101632
101962
  import { execFile as execFile5 } from "child_process";
@@ -101662,26 +101992,26 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
101662
101992
  init_provider_availability();
101663
101993
 
101664
101994
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
101665
- import { existsSync as existsSync32, mkdirSync as mkdirSync10, readFileSync as readFileSync15 } from "fs";
101666
- import { join as join62 } from "path";
101995
+ import { existsSync as existsSync34, mkdirSync as mkdirSync11, readFileSync as readFileSync16 } from "fs";
101996
+ import { join as join65 } from "path";
101667
101997
 
101668
101998
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
101669
101999
  init_shared();
101670
- import { existsSync as existsSync31, readFileSync as readFileSync14 } from "fs";
101671
- import { join as join61 } from "path";
102000
+ import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
102001
+ import { join as join64 } from "path";
101672
102002
  var TUI_SUBPATH = "tui";
101673
102003
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
101674
102004
  function fileEntryPackageJsonPath(entry) {
101675
102005
  let path6 = entry.slice("file:".length);
101676
102006
  if (path6.startsWith("//"))
101677
102007
  path6 = path6.slice(2);
101678
- return join61(path6, "package.json");
102008
+ return join64(path6, "package.json");
101679
102009
  }
101680
102010
  function packageJsonExportsTui(pkgJsonPath) {
101681
- if (!existsSync31(pkgJsonPath))
102011
+ if (!existsSync33(pkgJsonPath))
101682
102012
  return null;
101683
102013
  try {
101684
- const parsed = JSON.parse(readFileSync14(pkgJsonPath, "utf-8"));
102014
+ const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
101685
102015
  if (parsed.exports === undefined)
101686
102016
  return null;
101687
102017
  if (typeof parsed.exports === "string")
@@ -101713,16 +102043,16 @@ function packageExportsTuiForServerEntry(entry) {
101713
102043
  const packageName = packageNameFromServerEntry(entry);
101714
102044
  if (packageName === null)
101715
102045
  return null;
101716
- return packageJsonExportsTui(join61(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
102046
+ return packageJsonExportsTui(join64(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
101717
102047
  }
101718
102048
  function isOurFilePluginEntry(entry) {
101719
102049
  if (typeof entry !== "string" || !entry.startsWith("file:"))
101720
102050
  return false;
101721
102051
  try {
101722
102052
  const pkgJsonPath = fileEntryPackageJsonPath(entry);
101723
- if (!existsSync31(pkgJsonPath))
102053
+ if (!existsSync33(pkgJsonPath))
101724
102054
  return false;
101725
- const parsed = JSON.parse(readFileSync14(pkgJsonPath, "utf-8"));
102055
+ const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
101726
102056
  return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
101727
102057
  } catch (error51) {
101728
102058
  log2("[tui-plugin-config] Failed to inspect file plugin package", {
@@ -101755,12 +102085,12 @@ function isCanonicalNamedTuiPluginEntry(entry) {
101755
102085
  }
101756
102086
  function detectServerPluginRegistration() {
101757
102087
  const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
101758
- const configPath = existsSync31(paths2.configJsonc) ? paths2.configJsonc : existsSync31(paths2.configJson) ? paths2.configJson : null;
102088
+ const configPath = existsSync33(paths2.configJsonc) ? paths2.configJsonc : existsSync33(paths2.configJson) ? paths2.configJson : null;
101759
102089
  if (!configPath) {
101760
102090
  return { registered: false, configPath: null, entry: null, packageExportsTui: null };
101761
102091
  }
101762
102092
  try {
101763
- const parsed = parseJsonc(readFileSync14(configPath, "utf-8"));
102093
+ const parsed = parseJsonc(readFileSync15(configPath, "utf-8"));
101764
102094
  const plugins = parsed.plugin ?? [];
101765
102095
  const serverEntry = plugins.find(isServerPluginEntry);
101766
102096
  return {
@@ -101778,8 +102108,8 @@ function detectServerPluginRegistration() {
101778
102108
  }
101779
102109
  }
101780
102110
  function detectTuiPluginRegistration() {
101781
- const tuiJsonPath = join61(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
101782
- if (!existsSync31(tuiJsonPath)) {
102111
+ const tuiJsonPath = join64(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
102112
+ if (!existsSync33(tuiJsonPath)) {
101783
102113
  return {
101784
102114
  registered: false,
101785
102115
  configPath: tuiJsonPath,
@@ -101790,7 +102120,7 @@ function detectTuiPluginRegistration() {
101790
102120
  };
101791
102121
  }
101792
102122
  try {
101793
- const parsed = parseJsonc(readFileSync14(tuiJsonPath, "utf-8"));
102123
+ const parsed = parseJsonc(readFileSync15(tuiJsonPath, "utf-8"));
101794
102124
  const plugins = parsed.plugin ?? [];
101795
102125
  return {
101796
102126
  registered: plugins.some(isTuiPluginEntry),
@@ -101923,7 +102253,7 @@ init_shared();
101923
102253
  init_write_file_atomically();
101924
102254
  function readConfig(path6) {
101925
102255
  try {
101926
- const parsed = parseJsonc(readFileSync15(path6, "utf-8"));
102256
+ const parsed = parseJsonc(readFileSync16(path6, "utf-8"));
101927
102257
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
101928
102258
  return parsed;
101929
102259
  }
@@ -101934,11 +102264,11 @@ function readConfig(path6) {
101934
102264
  return null;
101935
102265
  }
101936
102266
  function readServerConfig(configDir) {
101937
- const jsoncPath = join62(configDir, "opencode.jsonc");
101938
- if (existsSync32(jsoncPath))
102267
+ const jsoncPath = join65(configDir, "opencode.jsonc");
102268
+ if (existsSync34(jsoncPath))
101939
102269
  return readConfig(jsoncPath);
101940
- const jsonPath = join62(configDir, "opencode.json");
101941
- if (existsSync32(jsonPath))
102270
+ const jsonPath = join65(configDir, "opencode.json");
102271
+ if (existsSync34(jsonPath))
101942
102272
  return readConfig(jsonPath);
101943
102273
  return null;
101944
102274
  }
@@ -101958,7 +102288,7 @@ function desiredTuiEntry(serverEntry) {
101958
102288
  return null;
101959
102289
  }
101960
102290
  function readTuiConfig(tuiJsonPath) {
101961
- if (!existsSync32(tuiJsonPath)) {
102291
+ if (!existsSync34(tuiJsonPath)) {
101962
102292
  return { config: {}, malformed: false };
101963
102293
  }
101964
102294
  const config3 = readConfig(tuiJsonPath);
@@ -101979,7 +102309,7 @@ function ensureTuiPluginEntry(opts = {}) {
101979
102309
  if (!desiredEntry) {
101980
102310
  return { changed: false, reason: "no-server-entry" };
101981
102311
  }
101982
- const tuiJsonPath = join62(configDir, "tui.json");
102312
+ const tuiJsonPath = join65(configDir, "tui.json");
101983
102313
  const { config: config3, malformed } = readTuiConfig(tuiJsonPath);
101984
102314
  if (malformed) {
101985
102315
  return { changed: false, reason: "malformed" };
@@ -101988,22 +102318,22 @@ function ensureTuiPluginEntry(opts = {}) {
101988
102318
  if (plugins.includes(desiredEntry)) {
101989
102319
  return { changed: false, reason: "already-present" };
101990
102320
  }
101991
- mkdirSync10(configDir, { recursive: true });
102321
+ mkdirSync11(configDir, { recursive: true });
101992
102322
  writeFileAtomically2(tuiJsonPath, formatConfig({ ...config3, plugin: [...plugins, desiredEntry] }));
101993
102323
  return { changed: true, reason: "added" };
101994
102324
  }
101995
102325
 
101996
102326
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
101997
- import { homedir as homedir10 } from "os";
101998
- import { join as join63 } from "path";
102327
+ import { homedir as homedir12 } from "os";
102328
+ import { join as join66 } from "path";
101999
102329
 
102000
102330
  // packages/shared-skills/index.mjs
102001
- import { existsSync as existsSync33 } from "fs";
102331
+ import { existsSync as existsSync35 } from "fs";
102002
102332
  import { fileURLToPath as fileURLToPath2 } from "url";
102003
102333
  var SKILLS_PROBE_SPECIFIERS = ["./skills/", "../skills/", "../../skills/"];
102004
102334
  function sharedSkillsRootPath() {
102005
102335
  const candidates = SKILLS_PROBE_SPECIFIERS.map((specifier) => fileURLToPath2(new URL(specifier, import.meta.url)));
102006
- return candidates.find((candidate2) => existsSync33(candidate2)) ?? candidates[0];
102336
+ return candidates.find((candidate2) => existsSync35(candidate2)) ?? candidates[0];
102007
102337
  }
102008
102338
 
102009
102339
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
@@ -102017,9 +102347,9 @@ function describeResult2(result) {
102017
102347
  }
102018
102348
  async function installAstGrepForOpenCode(options = {}) {
102019
102349
  const platform = options.platform ?? process.platform;
102020
- const baseDir = join63(options.homeDir ?? homedir10(), ".omo");
102350
+ const baseDir = join66(options.homeDir ?? homedir12(), ".omo");
102021
102351
  const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
102022
- const skillDir = join63(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
102352
+ const skillDir = join66(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
102023
102353
  const installer = options.installer ?? runAstGrepSkillInstall;
102024
102354
  try {
102025
102355
  const result = await installer({ platform, skillDir, targetDir });
@@ -105822,7 +106152,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
105822
106152
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
105823
106153
  init_bun_which_shim();
105824
106154
  init_spawn_with_windows_hide();
105825
- import { delimiter as delimiter2, dirname as dirname23, posix as posix9, win32 as win325 } from "path";
106155
+ import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "path";
105826
106156
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
105827
106157
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
105828
106158
  function getCommandCandidates(platform) {
@@ -105880,7 +106210,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
105880
106210
  return null;
105881
106211
  }
105882
106212
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
105883
- const preferredDir = dirname23(binaryPath);
106213
+ const preferredDir = dirname25(binaryPath);
105884
106214
  const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
105885
106215
  return [preferredDir, ...existing].join(delimiter2);
105886
106216
  }
@@ -106049,7 +106379,7 @@ async function resolveSession(options) {
106049
106379
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
106050
106380
  const delay2 = retryDelayMs * attempt;
106051
106381
  console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
106052
- await new Promise((resolve19) => setTimeout(resolve19, delay2));
106382
+ await new Promise((resolve21) => setTimeout(resolve21, delay2));
106053
106383
  }
106054
106384
  continue;
106055
106385
  }
@@ -106060,7 +106390,7 @@ async function resolveSession(options) {
106060
106390
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
106061
106391
  const delay2 = retryDelayMs * attempt;
106062
106392
  console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
106063
- await new Promise((resolve19) => setTimeout(resolve19, delay2));
106393
+ await new Promise((resolve21) => setTimeout(resolve21, delay2));
106064
106394
  }
106065
106395
  }
106066
106396
  throw new Error("Failed to create session after all retries");
@@ -106099,7 +106429,7 @@ function createJsonOutputManager(options = {}) {
106099
106429
 
106100
106430
  // packages/omo-opencode/src/cli/run/on-complete-hook.ts
106101
106431
  init_spawn_with_windows_hide();
106102
- init_shared();
106432
+ init_shell_env();
106103
106433
  init_logger2();
106104
106434
  var defaultDeps3 = {
106105
106435
  spawnWithWindowsHide,
@@ -106119,15 +106449,15 @@ async function readOutput(stream, streamName, deps = defaultDeps3) {
106119
106449
  return "";
106120
106450
  }
106121
106451
  }
106122
- function resolveHookShellCommand(command) {
106123
- const shellType = detectShellType();
106452
+ function resolveHookShellCommand(command, platform, env3) {
106453
+ const shellType = detectShellType(platform, env3);
106124
106454
  switch (shellType) {
106125
106455
  case "powershell": {
106126
- const powershellExecutable = process.platform === "win32" ? "powershell.exe" : "pwsh";
106456
+ const powershellExecutable = platform === "win32" ? "powershell.exe" : "pwsh";
106127
106457
  return [powershellExecutable, "-NoProfile", "-Command", command];
106128
106458
  }
106129
106459
  case "cmd":
106130
- return [process.env.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
106460
+ return [env3.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
106131
106461
  case "csh":
106132
106462
  return ["csh", "-c", command];
106133
106463
  case "unix":
@@ -106143,10 +106473,12 @@ async function executeOnCompleteHook(options, deps = defaultDeps3) {
106143
106473
  }
106144
106474
  deps.log("Running on-complete hook", { command: trimmedCommand });
106145
106475
  try {
106146
- const shellCommand = resolveHookShellCommand(trimmedCommand);
106476
+ const platform = deps.platform ?? process.platform;
106477
+ const env3 = deps.env ?? process.env;
106478
+ const shellCommand = resolveHookShellCommand(trimmedCommand, platform, env3);
106147
106479
  const proc = deps.spawnWithWindowsHide(shellCommand, {
106148
106480
  env: {
106149
- ...process.env,
106481
+ ...env3,
106150
106482
  SESSION_ID: sessionId,
106151
106483
  EXIT_CODE: String(exitCode),
106152
106484
  DURATION_MS: String(durationMs),
@@ -106458,26 +106790,26 @@ function isClosingFence(line, fence) {
106458
106790
  return run?.charAt(0) === fence.marker && run.length >= fence.length;
106459
106791
  }
106460
106792
  // packages/boulder-state/src/top-level-task.ts
106461
- import { existsSync as existsSync34, readFileSync as readFileSync16 } from "fs";
106793
+ import { existsSync as existsSync36, readFileSync as readFileSync17 } from "fs";
106462
106794
  function readCurrentTopLevelTask(planPath) {
106463
- if (!existsSync34(planPath)) {
106795
+ if (!existsSync36(planPath)) {
106464
106796
  return null;
106465
106797
  }
106466
106798
  try {
106467
- const content = readFileSync16(planPath, "utf-8");
106799
+ const content = readFileSync17(planPath, "utf-8");
106468
106800
  return parseCurrentTopLevelTask(content);
106469
106801
  } catch {
106470
106802
  return null;
106471
106803
  }
106472
106804
  }
106473
106805
  // packages/boulder-state/src/storage/path.ts
106474
- import { existsSync as existsSync35 } from "fs";
106475
- import { isAbsolute as isAbsolute11, join as join64, relative as relative8, resolve as resolve19 } from "path";
106806
+ import { existsSync as existsSync37 } from "fs";
106807
+ import { isAbsolute as isAbsolute11, join as join67, relative as relative8, resolve as resolve21 } from "path";
106476
106808
  function getBoulderFilePath(directory) {
106477
- return join64(directory, BOULDER_DIR, BOULDER_FILE);
106809
+ return join67(directory, BOULDER_DIR, BOULDER_FILE);
106478
106810
  }
106479
106811
  function resolveTrackedPath(baseDirectory, trackedPath) {
106480
- return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
106812
+ return isAbsolute11(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
106481
106813
  }
106482
106814
  function resolveBoulderPlanPath(directory, state) {
106483
106815
  const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
@@ -106485,26 +106817,26 @@ function resolveBoulderPlanPath(directory, state) {
106485
106817
  if (!worktreePath) {
106486
106818
  return absolutePlanPath;
106487
106819
  }
106488
- const absoluteDirectory = resolve19(directory);
106820
+ const absoluteDirectory = resolve21(directory);
106489
106821
  const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
106490
106822
  if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
106491
106823
  return absolutePlanPath;
106492
106824
  }
106493
106825
  const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
106494
- const worktreePlanPath = resolve19(absoluteWorktreePath, relativePlanPath);
106495
- return existsSync35(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
106826
+ const worktreePlanPath = resolve21(absoluteWorktreePath, relativePlanPath);
106827
+ return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
106496
106828
  }
106497
106829
  function resolveBoulderPlanPathForWork(directory, work) {
106498
106830
  return resolveBoulderPlanPath(directory, work);
106499
106831
  }
106500
106832
  // packages/boulder-state/src/storage/plan-progress.ts
106501
- import { existsSync as existsSync36, readFileSync as readFileSync17, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
106833
+ import { existsSync as existsSync38, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
106502
106834
  function getPlanProgress(planPath) {
106503
- if (!existsSync36(planPath)) {
106835
+ if (!existsSync38(planPath)) {
106504
106836
  return { total: 0, completed: 0, isComplete: false };
106505
106837
  }
106506
106838
  try {
106507
- const content = readFileSync17(planPath, "utf-8");
106839
+ const content = readFileSync18(planPath, "utf-8");
106508
106840
  const checklist = parsePlanChecklist(content);
106509
106841
  return {
106510
106842
  total: checklist.total,
@@ -106583,14 +106915,14 @@ function selectMirrorWork(state) {
106583
106915
  return sorted[0] ?? null;
106584
106916
  }
106585
106917
  // packages/boulder-state/src/storage/read-state.ts
106586
- import { existsSync as existsSync37, readFileSync as readFileSync18 } from "fs";
106918
+ import { existsSync as existsSync39, readFileSync as readFileSync19 } from "fs";
106587
106919
  function readBoulderState(directory) {
106588
106920
  const filePath = getBoulderFilePath(directory);
106589
- if (!existsSync37(filePath)) {
106921
+ if (!existsSync39(filePath)) {
106590
106922
  return null;
106591
106923
  }
106592
106924
  try {
106593
- const content = readFileSync18(filePath, "utf-8");
106925
+ const content = readFileSync19(filePath, "utf-8");
106594
106926
  const parsed = JSON.parse(content);
106595
106927
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || Object.keys(parsed).length === 0) {
106596
106928
  return null;
@@ -106656,17 +106988,17 @@ init_state();
106656
106988
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
106657
106989
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
106658
106990
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
106659
- import { existsSync as existsSync38, mkdirSync as mkdirSync11, readFileSync as readFileSync19, rmSync, writeFileSync as writeFileSync6 } from "fs";
106660
- import { join as join65 } from "path";
106991
+ import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
106992
+ import { join as join68 } from "path";
106661
106993
  function getMarkerPath(directory, sessionID) {
106662
- return join65(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
106994
+ return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
106663
106995
  }
106664
106996
  function readContinuationMarker(directory, sessionID) {
106665
106997
  const markerPath = getMarkerPath(directory, sessionID);
106666
- if (!existsSync38(markerPath))
106998
+ if (!existsSync40(markerPath))
106667
106999
  return null;
106668
107000
  try {
106669
- const raw = readFileSync19(markerPath, "utf-8");
107001
+ const raw = readFileSync20(markerPath, "utf-8");
106670
107002
  const parsed = JSON.parse(raw);
106671
107003
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
106672
107004
  return null;
@@ -106731,8 +107063,8 @@ async function isSessionInBoulderLineage(input) {
106731
107063
  // packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
106732
107064
  init_shared();
106733
107065
  init_compaction_marker();
106734
- import { readFileSync as readFileSync20, readdirSync as readdirSync8 } from "fs";
106735
- import { join as join66 } from "path";
107066
+ import { readFileSync as readFileSync21, readdirSync as readdirSync8 } from "fs";
107067
+ import { join as join69 } from "path";
106736
107068
  var defaultSessionLastAgentDeps = {
106737
107069
  getMessageDir,
106738
107070
  isSqliteBackend,
@@ -106792,7 +107124,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
106792
107124
  try {
106793
107125
  const messages = readdirSync8(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
106794
107126
  try {
106795
- const content = readFileSync20(join66(messageDir, fileName), "utf-8");
107127
+ const content = readFileSync21(join69(messageDir, fileName), "utf-8");
106796
107128
  const parsed = JSON.parse(content);
106797
107129
  return {
106798
107130
  fileName,
@@ -106835,8 +107167,8 @@ init_agent_display_names();
106835
107167
 
106836
107168
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
106837
107169
  init_frontmatter2();
106838
- import { existsSync as existsSync39, readFileSync as readFileSync21, writeFileSync as writeFileSync7, unlinkSync as unlinkSync6, mkdirSync as mkdirSync12 } from "fs";
106839
- import { dirname as dirname24, join as join67 } from "path";
107170
+ import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
107171
+ import { dirname as dirname26, join as join70 } from "path";
106840
107172
 
106841
107173
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
106842
107174
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -106845,15 +107177,15 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
106845
107177
 
106846
107178
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
106847
107179
  function getStateFilePath(directory, customPath) {
106848
- return customPath ? join67(directory, customPath) : join67(directory, DEFAULT_STATE_FILE);
107180
+ return customPath ? join70(directory, customPath) : join70(directory, DEFAULT_STATE_FILE);
106849
107181
  }
106850
107182
  function readState(directory, customPath) {
106851
107183
  const filePath = getStateFilePath(directory, customPath);
106852
- if (!existsSync39(filePath)) {
107184
+ if (!existsSync41(filePath)) {
106853
107185
  return null;
106854
107186
  }
106855
107187
  try {
106856
- const content = readFileSync21(filePath, "utf-8");
107188
+ const content = readFileSync22(filePath, "utf-8");
106857
107189
  const { data, body } = parseFrontmatter(content);
106858
107190
  const active = data.active;
106859
107191
  const iteration = data.iteration;
@@ -107079,7 +107411,7 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
107079
107411
  const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
107080
107412
  const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
107081
107413
  const now = options.now ?? Date.now;
107082
- const sleep = options.sleep ?? ((ms) => new Promise((resolve20) => setTimeout(resolve20, ms)));
107414
+ const sleep = options.sleep ?? ((ms) => new Promise((resolve22) => setTimeout(resolve22, ms)));
107083
107415
  let consecutiveCompleteChecks = 0;
107084
107416
  let errorCycleCount = 0;
107085
107417
  let firstWorkTimestamp = null;
@@ -107244,7 +107576,7 @@ function createAbortError() {
107244
107576
  return error51;
107245
107577
  }
107246
107578
  function sleep(delayMs) {
107247
- return new Promise((resolve20) => setTimeout(resolve20, delayMs));
107579
+ return new Promise((resolve22) => setTimeout(resolve22, delayMs));
107248
107580
  }
107249
107581
  function hasPromptStartEvidence(eventState) {
107250
107582
  return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
@@ -107619,7 +107951,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
107619
107951
  async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
107620
107952
  const completed = await Promise.race([
107621
107953
  eventProcessor.then(() => true),
107622
- new Promise((resolve20) => setTimeout(() => resolve20(false), timeoutMs))
107954
+ new Promise((resolve22) => setTimeout(() => resolve22(false), timeoutMs))
107623
107955
  ]);
107624
107956
  }
107625
107957
  async function run(options) {
@@ -107682,10 +108014,10 @@ Interrupted. Shutting down...`));
107682
108014
  abortController,
107683
108015
  verbose: options.verbose ?? false
107684
108016
  };
107685
- const events = await client3.event.subscribe({ query: { directory } });
108017
+ const events2 = await client3.event.subscribe({ query: { directory } });
107686
108018
  const eventState = createEventState();
107687
108019
  eventState.agentColorsByName = await loadAgentProfileColors(client3);
107688
- const eventProcessor = processEvents(ctx, events.stream, eventState).catch(() => {});
108020
+ const eventProcessor = processEvents(ctx, events2.stream, eventState).catch(() => {});
107689
108021
  const promptResult = await dispatchInternalPrompt({
107690
108022
  mode: "async",
107691
108023
  client: client3,
@@ -107945,14 +108277,14 @@ async function getLocalVersion(options = {}) {
107945
108277
  }
107946
108278
  }
107947
108279
  // packages/omo-opencode/src/cli/doctor/checks/system.ts
107948
- import { existsSync as existsSync50, readFileSync as readFileSync31 } from "fs";
108280
+ import { existsSync as existsSync52, readFileSync as readFileSync32 } from "fs";
107949
108281
 
107950
108282
  // packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
107951
108283
  init_extract_semver();
107952
108284
  init_bun_which_shim();
107953
- import { existsSync as existsSync47, accessSync as accessSync4, constants as constants11 } from "fs";
107954
- import { homedir as homedir13 } from "os";
107955
- import { join as join74 } from "path";
108285
+ import { existsSync as existsSync49, accessSync as accessSync4, constants as constants11 } from "fs";
108286
+ import { homedir as homedir15 } from "os";
108287
+ import { join as join77 } from "path";
107956
108288
 
107957
108289
  // packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
107958
108290
  init_spawn_with_windows_hide();
@@ -107991,8 +108323,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
107991
108323
  const stdoutPromise = readSpawnStream(proc.stdout);
107992
108324
  const stderrPromise = readSpawnStream(proc.stderr);
107993
108325
  let timer;
107994
- const timeoutPromise = new Promise((resolve20) => {
107995
- timer = setTimeout(() => resolve20("timeout"), timeoutMs);
108326
+ const timeoutPromise = new Promise((resolve22) => {
108327
+ timer = setTimeout(() => resolve22("timeout"), timeoutMs);
107996
108328
  });
107997
108329
  const processPromise = (async () => {
107998
108330
  await proc.exited;
@@ -108039,22 +108371,22 @@ function isExecutable2(path12) {
108039
108371
  }
108040
108372
  }
108041
108373
  function getDesktopAppPaths(platform) {
108042
- const home = homedir13();
108374
+ const home = homedir15();
108043
108375
  switch (platform) {
108044
108376
  case "darwin":
108045
108377
  return [
108046
108378
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
108047
- join74(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
108379
+ join77(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
108048
108380
  ];
108049
108381
  case "win32": {
108050
108382
  const programFiles = process.env.ProgramFiles;
108051
108383
  const localAppData = process.env.LOCALAPPDATA;
108052
108384
  const paths2 = [];
108053
108385
  if (programFiles) {
108054
- paths2.push(join74(programFiles, "OpenCode", "OpenCode.exe"));
108386
+ paths2.push(join77(programFiles, "OpenCode", "OpenCode.exe"));
108055
108387
  }
108056
108388
  if (localAppData) {
108057
- paths2.push(join74(localAppData, "OpenCode", "OpenCode.exe"));
108389
+ paths2.push(join77(localAppData, "OpenCode", "OpenCode.exe"));
108058
108390
  }
108059
108391
  return paths2;
108060
108392
  }
@@ -108062,8 +108394,8 @@ function getDesktopAppPaths(platform) {
108062
108394
  return [
108063
108395
  "/usr/bin/opencode",
108064
108396
  "/usr/lib/opencode/opencode",
108065
- join74(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
108066
- join74(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
108397
+ join77(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
108398
+ join77(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
108067
108399
  ];
108068
108400
  default:
108069
108401
  return [];
@@ -108075,7 +108407,7 @@ function buildVersionCommand(binaryPath, platform) {
108075
108407
  }
108076
108408
  return [binaryPath, "--version"];
108077
108409
  }
108078
- function findDesktopBinary(platform = process.platform, checkExists = existsSync47) {
108410
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
108079
108411
  for (const desktopPath of getDesktopAppPaths(platform)) {
108080
108412
  if (checkExists(desktopPath)) {
108081
108413
  return { binary: "opencode", path: desktopPath };
@@ -108083,7 +108415,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
108083
108415
  }
108084
108416
  return null;
108085
108417
  }
108086
- async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync47) {
108418
+ async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
108087
108419
  for (const binary of OPENCODE_BINARIES2) {
108088
108420
  const path12 = bunWhich(binary);
108089
108421
  if (path12 && checkExists(path12)) {
@@ -108095,7 +108427,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
108095
108427
  const candidates = getCommandCandidates2(platform);
108096
108428
  for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
108097
108429
  for (const command of candidates) {
108098
- const fullPath = join74(entry, command);
108430
+ const fullPath = join77(entry, command);
108099
108431
  if (checkExists(fullPath) && isExecutable2(fullPath)) {
108100
108432
  return { binary: command, path: fullPath };
108101
108433
  }
@@ -108141,12 +108473,12 @@ function compareVersions3(current, minimum) {
108141
108473
 
108142
108474
  // packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
108143
108475
  init_shared();
108144
- import { existsSync as existsSync48, readFileSync as readFileSync29 } from "fs";
108476
+ import { existsSync as existsSync50, readFileSync as readFileSync30 } from "fs";
108145
108477
  function detectConfigPath() {
108146
108478
  const paths2 = getOpenCodeConfigPaths({ binary: "opencode", version: null });
108147
- if (existsSync48(paths2.configJsonc))
108479
+ if (existsSync50(paths2.configJsonc))
108148
108480
  return paths2.configJsonc;
108149
- if (existsSync48(paths2.configJson))
108481
+ if (existsSync50(paths2.configJson))
108150
108482
  return paths2.configJson;
108151
108483
  return null;
108152
108484
  }
@@ -108192,7 +108524,7 @@ function getPluginInfo() {
108192
108524
  };
108193
108525
  }
108194
108526
  try {
108195
- const content = readFileSync29(configPath, "utf-8");
108527
+ const content = readFileSync30(configPath, "utf-8");
108196
108528
  const parsedConfig = parseJsonc(content);
108197
108529
  const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
108198
108530
  if (!pluginEntry) {
@@ -108234,39 +108566,39 @@ init_file_utils2();
108234
108566
  init_checker();
108235
108567
  init_auto_update_checker();
108236
108568
  init_package_json_locator();
108237
- import { existsSync as existsSync49, readFileSync as readFileSync30, readdirSync as readdirSync10 } from "fs";
108569
+ import { existsSync as existsSync51, readFileSync as readFileSync31, readdirSync as readdirSync10 } from "fs";
108238
108570
  import { createRequire as createRequire2 } from "module";
108239
- import { homedir as homedir14 } from "os";
108240
- import { join as join75 } from "path";
108571
+ import { homedir as homedir16 } from "os";
108572
+ import { join as join78 } from "path";
108241
108573
  import { fileURLToPath as fileURLToPath6 } from "url";
108242
108574
  init_shared();
108243
108575
  function getPlatformDefaultCacheDir(platform = process.platform) {
108244
108576
  if (platform === "darwin")
108245
- return join75(homedir14(), "Library", "Caches");
108577
+ return join78(homedir16(), "Library", "Caches");
108246
108578
  if (platform === "win32")
108247
- return process.env.LOCALAPPDATA ?? join75(homedir14(), "AppData", "Local");
108248
- return join75(homedir14(), ".cache");
108579
+ return process.env.LOCALAPPDATA ?? join78(homedir16(), "AppData", "Local");
108580
+ return join78(homedir16(), ".cache");
108249
108581
  }
108250
108582
  function resolveOpenCodeCacheDir() {
108251
108583
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
108252
108584
  if (xdgCacheHome)
108253
- return join75(xdgCacheHome, "opencode");
108585
+ return join78(xdgCacheHome, "opencode");
108254
108586
  const fromShared = getOpenCodeCacheDir();
108255
- const platformDefault = join75(getPlatformDefaultCacheDir(), "opencode");
108256
- if (existsSync49(fromShared) || !existsSync49(platformDefault))
108587
+ const platformDefault = join78(getPlatformDefaultCacheDir(), "opencode");
108588
+ if (existsSync51(fromShared) || !existsSync51(platformDefault))
108257
108589
  return fromShared;
108258
108590
  return platformDefault;
108259
108591
  }
108260
108592
  function resolveExistingDir(dirPath) {
108261
- if (!existsSync49(dirPath))
108593
+ if (!existsSync51(dirPath))
108262
108594
  return dirPath;
108263
108595
  return resolveSymlink(dirPath);
108264
108596
  }
108265
108597
  function readPackageJson(filePath) {
108266
- if (!existsSync49(filePath))
108598
+ if (!existsSync51(filePath))
108267
108599
  return null;
108268
108600
  try {
108269
- const content = readFileSync30(filePath, "utf-8");
108601
+ const content = readFileSync31(filePath, "utf-8");
108270
108602
  return parseJsonc(content);
108271
108603
  } catch (error51) {
108272
108604
  if (!(error51 instanceof Error)) {
@@ -108284,26 +108616,26 @@ function normalizeVersion(value) {
108284
108616
  function createPackageCandidates(rootDir) {
108285
108617
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
108286
108618
  packageName,
108287
- installedPackagePath: join75(rootDir, "node_modules", packageName, "package.json")
108619
+ installedPackagePath: join78(rootDir, "node_modules", packageName, "package.json")
108288
108620
  }));
108289
108621
  }
108290
108622
  function createTaggedInstallCandidates(rootDir) {
108291
- const packagesDir = join75(rootDir, "packages");
108292
- if (!existsSync49(packagesDir))
108623
+ const packagesDir = join78(rootDir, "packages");
108624
+ if (!existsSync51(packagesDir))
108293
108625
  return [];
108294
108626
  const candidates = [];
108295
108627
  for (const entryName of readdirSync10(packagesDir).sort()) {
108296
108628
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
108297
108629
  if (packageName === undefined)
108298
108630
  continue;
108299
- const installDir = join75(packagesDir, entryName);
108631
+ const installDir = join78(packagesDir, entryName);
108300
108632
  candidates.push({
108301
108633
  cacheDir: installDir,
108302
- cachePackagePath: join75(installDir, "package.json"),
108634
+ cachePackagePath: join78(installDir, "package.json"),
108303
108635
  packageCandidates: [
108304
108636
  {
108305
108637
  packageName,
108306
- installedPackagePath: join75(installDir, "node_modules", packageName, "package.json")
108638
+ installedPackagePath: join78(installDir, "node_modules", packageName, "package.json")
108307
108639
  }
108308
108640
  ]
108309
108641
  });
@@ -108311,7 +108643,7 @@ function createTaggedInstallCandidates(rootDir) {
108311
108643
  return candidates;
108312
108644
  }
108313
108645
  function selectInstalledPackage(candidate2) {
108314
- return candidate2.packageCandidates.find((packageCandidate) => existsSync49(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
108646
+ return candidate2.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate2.packageCandidates[0];
108315
108647
  }
108316
108648
  function getExpectedVersion(cachePackage, packageName) {
108317
108649
  return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
@@ -108322,7 +108654,7 @@ function resolveInstalledPackageJsonPath() {
108322
108654
  for (const packageName of ACCEPTED_PACKAGE_NAMES) {
108323
108655
  try {
108324
108656
  const packageJsonPath = require2.resolve(`${packageName}/package.json`);
108325
- if (existsSync49(packageJsonPath)) {
108657
+ if (existsSync51(packageJsonPath)) {
108326
108658
  return { packageName, packageJsonPath };
108327
108659
  }
108328
108660
  } catch {
@@ -108348,22 +108680,22 @@ function getLoadedPluginVersion() {
108348
108680
  const candidates = [
108349
108681
  {
108350
108682
  cacheDir: configDir,
108351
- cachePackagePath: join75(configDir, "package.json"),
108683
+ cachePackagePath: join78(configDir, "package.json"),
108352
108684
  packageCandidates: createPackageCandidates(configDir)
108353
108685
  },
108354
108686
  ...createTaggedInstallCandidates(configDir),
108355
108687
  {
108356
108688
  cacheDir,
108357
- cachePackagePath: join75(cacheDir, "package.json"),
108689
+ cachePackagePath: join78(cacheDir, "package.json"),
108358
108690
  packageCandidates: createPackageCandidates(cacheDir)
108359
108691
  },
108360
108692
  ...createTaggedInstallCandidates(cacheDir)
108361
108693
  ];
108362
- const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync49(packageCandidate.installedPackagePath))) ?? candidates[0];
108694
+ const selectedCandidate = candidates.find((candidate2) => candidate2.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
108363
108695
  const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
108364
108696
  const selectedPackage = selectInstalledPackage(selectedCandidate);
108365
108697
  const candidateInstalledPath = selectedPackage.installedPackagePath;
108366
- const candidateExists = existsSync49(candidateInstalledPath);
108698
+ const candidateExists = existsSync51(candidateInstalledPath);
108367
108699
  const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
108368
108700
  const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
108369
108701
  const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
@@ -108399,8 +108731,8 @@ var defaultDeps6 = {
108399
108731
  getLoadedPluginVersion,
108400
108732
  getLatestPluginVersion,
108401
108733
  getSuggestedInstallTag,
108402
- configExists: existsSync50,
108403
- readConfigFile: (path12) => readFileSync31(path12, "utf-8"),
108734
+ configExists: existsSync52,
108735
+ readConfigFile: (path12) => readFileSync32(path12, "utf-8"),
108404
108736
  parseConfigContent: (content) => parseJsonc(content)
108405
108737
  };
108406
108738
  var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
@@ -108545,26 +108877,26 @@ async function checkSystem(deps = defaultDeps6) {
108545
108877
 
108546
108878
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
108547
108879
  init_shared();
108548
- import { existsSync as existsSync51, readFileSync as readFileSync32 } from "fs";
108549
- import { homedir as homedir15 } from "os";
108550
- import { join as join76 } from "path";
108880
+ import { existsSync as existsSync53, readFileSync as readFileSync33 } from "fs";
108881
+ import { homedir as homedir17 } from "os";
108882
+ import { join as join79 } from "path";
108551
108883
  function getUserConfigDir2() {
108552
108884
  const xdgConfig = process.env.XDG_CONFIG_HOME;
108553
108885
  if (xdgConfig)
108554
- return join76(xdgConfig, "opencode");
108555
- return join76(homedir15(), ".config", "opencode");
108886
+ return join79(xdgConfig, "opencode");
108887
+ return join79(homedir17(), ".config", "opencode");
108556
108888
  }
108557
108889
  function loadCustomProviderNames() {
108558
108890
  const configDir = getUserConfigDir2();
108559
108891
  const candidatePaths = [
108560
- join76(configDir, "opencode.json"),
108561
- join76(configDir, "opencode.jsonc")
108892
+ join79(configDir, "opencode.json"),
108893
+ join79(configDir, "opencode.jsonc")
108562
108894
  ];
108563
108895
  for (const configPath of candidatePaths) {
108564
- if (!existsSync51(configPath))
108896
+ if (!existsSync53(configPath))
108565
108897
  continue;
108566
108898
  try {
108567
- const content = readFileSync32(configPath, "utf-8");
108899
+ const content = readFileSync33(configPath, "utf-8");
108568
108900
  const data = parseJsonc(content);
108569
108901
  if (data?.provider && typeof data.provider === "object") {
108570
108902
  return Object.keys(data.provider);
@@ -108579,16 +108911,16 @@ function loadCustomProviderNames() {
108579
108911
  return [];
108580
108912
  }
108581
108913
  function loadAvailableModelsFromCache() {
108582
- const cacheFile = join76(getOpenCodeCacheDir(), "models.json");
108914
+ const cacheFile = join79(getOpenCodeCacheDir(), "models.json");
108583
108915
  const customProviders = loadCustomProviderNames();
108584
- if (!existsSync51(cacheFile)) {
108916
+ if (!existsSync53(cacheFile)) {
108585
108917
  if (customProviders.length > 0) {
108586
108918
  return { providers: customProviders, modelCount: 0, cacheExists: true };
108587
108919
  }
108588
108920
  return { providers: [], modelCount: 0, cacheExists: false };
108589
108921
  }
108590
108922
  try {
108591
- const content = readFileSync32(cacheFile, "utf-8");
108923
+ const content = readFileSync33(cacheFile, "utf-8");
108592
108924
  const data = parseJsonc(content);
108593
108925
  const cacheProviders = Object.keys(data);
108594
108926
  let modelCount = 0;
@@ -108641,7 +108973,7 @@ function loadOmoConfig2() {
108641
108973
 
108642
108974
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
108643
108975
  init_shared();
108644
- import { join as join77 } from "path";
108976
+ import { join as join80 } from "path";
108645
108977
 
108646
108978
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
108647
108979
  function formatModelWithVariant(model, variant) {
@@ -108683,7 +109015,7 @@ function formatCapabilityResolutionLabel(mode) {
108683
109015
  }
108684
109016
  function buildModelResolutionDetails(options) {
108685
109017
  const details = [];
108686
- const cacheFile = join77(getOpenCodeCacheDir(), "models.json");
109018
+ const cacheFile = join80(getOpenCodeCacheDir(), "models.json");
108687
109019
  details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
108688
109020
  details.push("");
108689
109021
  if (options.available.cacheExists) {
@@ -108992,8 +109324,8 @@ async function checkConfig() {
108992
109324
 
108993
109325
  // packages/omo-opencode/src/cli/doctor/checks/deprecated-reasoning-keys.ts
108994
109326
  init_main();
108995
- import { existsSync as existsSync52, readFileSync as readFileSync33 } from "fs";
108996
- import { join as join78 } from "path";
109327
+ import { existsSync as existsSync54, readFileSync as readFileSync34 } from "fs";
109328
+ import { join as join81 } from "path";
108997
109329
  var CANONICAL_REPLACEMENT = new Map([
108998
109330
  ["variant", "reasoning"],
108999
109331
  ["reasoningEffort", "reasoning"],
@@ -109048,16 +109380,16 @@ function userConfigPaths() {
109048
109380
  const home = process.env.HOME ?? process.env.USERPROFILE;
109049
109381
  if (home === undefined || home.length === 0)
109050
109382
  return [];
109051
- return [join78(home, ".omo", "omo.jsonc"), join78(home, ".omo", "omo.json")];
109383
+ return [join81(home, ".omo", "omo.jsonc"), join81(home, ".omo", "omo.json")];
109052
109384
  }
109053
109385
  async function checkDeprecatedReasoningKeys() {
109054
109386
  const issues = [];
109055
109387
  const scanned = [];
109056
109388
  for (const configPath of userConfigPaths()) {
109057
- if (!existsSync52(configPath))
109389
+ if (!existsSync54(configPath))
109058
109390
  continue;
109059
109391
  scanned.push(configPath);
109060
- const parsed = parse2(readFileSync33(configPath, "utf-8"));
109392
+ const parsed = parse2(readFileSync34(configPath, "utf-8"));
109061
109393
  issues.push(...collectIssues(configPath, parsed, ""));
109062
109394
  }
109063
109395
  return {
@@ -109071,28 +109403,28 @@ async function checkDeprecatedReasoningKeys() {
109071
109403
 
109072
109404
  // packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
109073
109405
  init_src2();
109074
- import { existsSync as existsSync53 } from "fs";
109406
+ import { existsSync as existsSync55 } from "fs";
109075
109407
  import { createRequire as createRequire3 } from "module";
109076
- import { homedir as homedir17 } from "os";
109077
- import { dirname as dirname29, join as join80 } from "path";
109408
+ import { homedir as homedir19 } from "os";
109409
+ import { dirname as dirname31, join as join83 } from "path";
109078
109410
 
109079
109411
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
109080
- import { join as join79 } from "path";
109081
- import { homedir as homedir16, tmpdir as tmpdir4 } from "os";
109412
+ import { join as join82 } from "path";
109413
+ import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
109082
109414
  init_binary_downloader();
109083
109415
  init_logger2();
109084
109416
  init_plugin_identity();
109085
109417
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
109086
- var DEBUG_FILE = join79(tmpdir4(), "comment-checker-debug.log");
109418
+ var DEBUG_FILE = join82(tmpdir4(), "comment-checker-debug.log");
109087
109419
  function getCacheDir2() {
109088
109420
  if (process.platform === "win32") {
109089
109421
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
109090
- const base2 = localAppData || join79(homedir16(), "AppData", "Local");
109091
- return join79(base2, CACHE_DIR_NAME, "bin");
109422
+ const base2 = localAppData || join82(homedir18(), "AppData", "Local");
109423
+ return join82(base2, CACHE_DIR_NAME, "bin");
109092
109424
  }
109093
109425
  const xdgCache = process.env.XDG_CACHE_HOME;
109094
- const base = xdgCache || join79(homedir16(), ".cache");
109095
- return join79(base, CACHE_DIR_NAME, "bin");
109426
+ const base = xdgCache || join82(homedir18(), ".cache");
109427
+ return join82(base, CACHE_DIR_NAME, "bin");
109096
109428
  }
109097
109429
  function getBinaryName() {
109098
109430
  return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -109142,7 +109474,7 @@ async function getBinaryVersion(binary) {
109142
109474
  }
109143
109475
  }
109144
109476
  async function checkAstGrepCli() {
109145
- const runtimeDir = astGrepRuntimeDir(join80(homedir17(), ".omo"));
109477
+ const runtimeDir = astGrepRuntimeDir(join83(homedir19(), ".omo"));
109146
109478
  const sgPath = findSgBinarySync({ runtimeDir });
109147
109479
  if (sgPath === null) {
109148
109480
  return {
@@ -109171,12 +109503,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
109171
109503
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
109172
109504
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
109173
109505
  try {
109174
- const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
109175
- const vendorPath = join80(packageDir, "vendor", platformKey, binaryName);
109176
- if (existsSync53(vendorPath))
109506
+ const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
109507
+ const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
109508
+ if (existsSync55(vendorPath))
109177
109509
  return vendorPath;
109178
- const binPath = join80(packageDir, "bin", binaryName);
109179
- if (existsSync53(binPath))
109510
+ const binPath = join83(packageDir, "bin", binaryName);
109511
+ if (existsSync55(binPath))
109180
109512
  return binPath;
109181
109513
  } catch (error51) {
109182
109514
  if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
@@ -109322,8 +109654,8 @@ async function getGhCliInfo(dependencies = {}) {
109322
109654
  // packages/omo-opencode/src/mcp/lsp.ts
109323
109655
  init_zod();
109324
109656
  init_opencode_config_dir();
109325
- import { existsSync as existsSync54, readFileSync as readFileSync34 } from "fs";
109326
- import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "path";
109657
+ import { existsSync as existsSync56, readFileSync as readFileSync35 } from "fs";
109658
+ import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "path";
109327
109659
  import { fileURLToPath as fileURLToPath7 } from "url";
109328
109660
 
109329
109661
  // packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -109370,7 +109702,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
109370
109702
  }
109371
109703
 
109372
109704
  // packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
109373
- import { resolve as resolve20 } from "path";
109705
+ import { resolve as resolve22 } from "path";
109374
109706
  function resolveJavaScriptRuntime(resolveExecutable) {
109375
109707
  const node = resolveExecutable("node");
109376
109708
  return node.available ? node : resolveExecutable("bun");
@@ -109378,9 +109710,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
109378
109710
  function createAncestorCliCandidates(options) {
109379
109711
  const candidates = [];
109380
109712
  const seenPaths = new Set;
109381
- let currentDirectory = resolve20(options.startDirectory);
109713
+ let currentDirectory = resolve22(options.startDirectory);
109382
109714
  while (true) {
109383
- const distCliPath = resolve20(currentDirectory, options.packageRel, options.distCliRel);
109715
+ const distCliPath = resolve22(currentDirectory, options.packageRel, options.distCliRel);
109384
109716
  if (!seenPaths.has(distCliPath)) {
109385
109717
  const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
109386
109718
  seenPaths.add(distCliPath);
@@ -109392,7 +109724,7 @@ function createAncestorCliCandidates(options) {
109392
109724
  runtimeAvailable: runtime5.available
109393
109725
  });
109394
109726
  }
109395
- const sourceCliPath = resolve20(currentDirectory, options.packageRel, options.sourceCliRel);
109727
+ const sourceCliPath = resolve22(currentDirectory, options.packageRel, options.sourceCliRel);
109396
109728
  if (!seenPaths.has(sourceCliPath)) {
109397
109729
  const runtime5 = options.resolveExecutable("bun");
109398
109730
  const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
@@ -109409,7 +109741,7 @@ function createAncestorCliCandidates(options) {
109409
109741
  runtimeAvailable: runtime5.available
109410
109742
  });
109411
109743
  }
109412
- const parentDirectory = resolve20(currentDirectory, "..");
109744
+ const parentDirectory = resolve22(currentDirectory, "..");
109413
109745
  if (parentDirectory === currentDirectory)
109414
109746
  return candidates;
109415
109747
  currentDirectory = parentDirectory;
@@ -109454,7 +109786,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
109454
109786
  ].join(";");
109455
109787
  function getModuleDirectory(moduleUrl) {
109456
109788
  try {
109457
- return dirname30(fileURLToPath7(moduleUrl));
109789
+ return dirname32(fileURLToPath7(moduleUrl));
109458
109790
  } catch (error51) {
109459
109791
  if (!(error51 instanceof Error))
109460
109792
  throw error51;
@@ -109462,11 +109794,11 @@ function getModuleDirectory(moduleUrl) {
109462
109794
  }
109463
109795
  }
109464
109796
  function findBootstrapRoot(candidates, pathExists) {
109465
- return candidates.find((candidate2) => pathExists(resolve21(candidate2.root, "package.json")))?.root ?? process.cwd();
109797
+ return candidates.find((candidate2) => pathExists(resolve23(candidate2.root, "package.json")))?.root ?? process.cwd();
109466
109798
  }
109467
109799
  function readDaemonPackageVersion(root) {
109468
109800
  try {
109469
- const packageJson = JSON.parse(readFileSync34(resolve21(root, PACKAGE_REL, "package.json"), "utf-8"));
109801
+ const packageJson = JSON.parse(readFileSync35(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
109470
109802
  return DaemonPackageSchema.parse(packageJson).version;
109471
109803
  } catch (error51) {
109472
109804
  if (!(error51 instanceof Error))
@@ -109478,17 +109810,17 @@ function createBootstrapCandidate(root, pathExists, resolveExecutable) {
109478
109810
  const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
109479
109811
  const bun = resolveExecutable("bun");
109480
109812
  const npm = resolveExecutable("npm");
109481
- const packageManifestPath = resolve21(root, PACKAGE_REL, "package.json");
109813
+ const packageManifestPath = resolve23(root, PACKAGE_REL, "package.json");
109482
109814
  return {
109483
109815
  command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
109484
109816
  root,
109485
- path: resolve21(root, PACKAGE_REL, DIST_CLI_REL),
109817
+ path: resolve23(root, PACKAGE_REL, DIST_CLI_REL),
109486
109818
  exists: runtime5.available && npm.available && pathExists(packageManifestPath),
109487
109819
  runtimeAvailable: runtime5.available
109488
109820
  };
109489
109821
  }
109490
109822
  function resolveLspCommand(options = {}) {
109491
- const pathExists = options.exists ?? existsSync54;
109823
+ const pathExists = options.exists ?? existsSync56;
109492
109824
  const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
109493
109825
  const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
109494
109826
  const candidates = moduleDirectory ? createAncestorCliCandidates({
@@ -109498,7 +109830,7 @@ function resolveLspCommand(options = {}) {
109498
109830
  sourceCliRel: SOURCE_CLI_REL,
109499
109831
  pathExists,
109500
109832
  resolveExecutable,
109501
- isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
109833
+ isSourceCandidateAvailable: ({ root }) => pathExists(resolve23(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
109502
109834
  }) : [];
109503
109835
  const distCandidate = candidates.find((candidate2) => hasCliSuffix(candidate2.path, DIST_CLI_REL) && candidate2.exists);
109504
109836
  if (distCandidate) {
@@ -109512,7 +109844,7 @@ function resolveLspCommand(options = {}) {
109512
109844
  }
109513
109845
  function createLspMcpConfig(options = {}) {
109514
109846
  const resolvedCommand = resolveLspCommand(options);
109515
- const cwd = resolve21(options.cwd ?? process.cwd());
109847
+ const cwd = resolve23(options.cwd ?? process.cwd());
109516
109848
  const configDir = getOpenCodeConfigDir({ binary: "opencode" });
109517
109849
  const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
109518
109850
  return {
@@ -109521,9 +109853,9 @@ function createLspMcpConfig(options = {}) {
109521
109853
  enabled: resolvedCommand.exists,
109522
109854
  cwd,
109523
109855
  environment: {
109524
- LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve21(cwd, configPath)).join(delimiter3),
109525
- LSP_TOOLS_MCP_USER_CONFIG: resolve21(configDir, "lsp.json"),
109526
- LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve21(configDir, "lsp-install-decisions.json"),
109856
+ LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
109857
+ LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
109858
+ LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
109527
109859
  ...sourceVersion ? {
109528
109860
  [OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
109529
109861
  [OMO_LSP_DAEMON_VERSION]: sourceVersion
@@ -109548,24 +109880,24 @@ function getInstalledLspServers(options = {}) {
109548
109880
 
109549
109881
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
109550
109882
  init_shared();
109551
- import { existsSync as existsSync55, readFileSync as readFileSync35 } from "fs";
109552
- import { homedir as homedir18 } from "os";
109553
- import { join as join81 } from "path";
109883
+ import { existsSync as existsSync57, readFileSync as readFileSync36 } from "fs";
109884
+ import { homedir as homedir20 } from "os";
109885
+ import { join as join84 } from "path";
109554
109886
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
109555
109887
  function getMcpConfigPaths() {
109556
109888
  return [
109557
- join81(homedir18(), ".claude", ".mcp.json"),
109558
- join81(process.cwd(), ".mcp.json"),
109559
- join81(process.cwd(), ".claude", ".mcp.json")
109889
+ join84(homedir20(), ".claude", ".mcp.json"),
109890
+ join84(process.cwd(), ".mcp.json"),
109891
+ join84(process.cwd(), ".claude", ".mcp.json")
109560
109892
  ];
109561
109893
  }
109562
109894
  function loadUserMcpConfig() {
109563
109895
  const servers = {};
109564
109896
  for (const configPath of getMcpConfigPaths()) {
109565
- if (!existsSync55(configPath))
109897
+ if (!existsSync57(configPath))
109566
109898
  continue;
109567
109899
  try {
109568
- const content = readFileSync35(configPath, "utf-8");
109900
+ const content = readFileSync36(configPath, "utf-8");
109569
109901
  const config4 = parseJsonc(content);
109570
109902
  if (config4.mcpServers) {
109571
109903
  Object.assign(servers, config4.mcpServers);
@@ -109700,17 +110032,17 @@ async function checkTools() {
109700
110032
 
109701
110033
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
109702
110034
  init_src5();
109703
- import { existsSync as existsSync56, readFileSync as readFileSync36 } from "fs";
110035
+ import { existsSync as existsSync58, readFileSync as readFileSync37 } from "fs";
109704
110036
  function isTelemetryState(value) {
109705
110037
  return value !== null && typeof value === "object" && !Array.isArray(value);
109706
110038
  }
109707
110039
  function readLastActiveDay(stateFilePath) {
109708
- if (!existsSync56(stateFilePath)) {
110040
+ if (!existsSync58(stateFilePath)) {
109709
110041
  return "never";
109710
110042
  }
109711
110043
  let parsed;
109712
110044
  try {
109713
- parsed = JSON.parse(readFileSync36(stateFilePath, "utf-8"));
110045
+ parsed = JSON.parse(readFileSync37(stateFilePath, "utf-8"));
109714
110046
  } catch (error51) {
109715
110047
  if (error51 instanceof Error) {
109716
110048
  return "unreadable";
@@ -109768,17 +110100,17 @@ async function probeBinary(cmd, args, spawnImpl) {
109768
110100
  }
109769
110101
 
109770
110102
  // packages/team-core/src/team-registry/paths.ts
109771
- import { homedir as homedir19 } from "os";
110103
+ import { homedir as homedir21 } from "os";
109772
110104
  import path12 from "path";
109773
110105
  function resolveBaseDir(config4) {
109774
- return expandHomeDirectory(config4.base_dir ?? path12.join(homedir19(), ".omo"));
110106
+ return expandHomeDirectory(config4.base_dir ?? path12.join(homedir21(), ".omo"));
109775
110107
  }
109776
110108
  function expandHomeDirectory(directoryPath3) {
109777
110109
  if (directoryPath3 === "~") {
109778
- return homedir19();
110110
+ return homedir21();
109779
110111
  }
109780
110112
  if (directoryPath3.startsWith("~/") || directoryPath3.startsWith("~\\")) {
109781
- return path12.join(homedir19(), directoryPath3.slice(2));
110113
+ return path12.join(homedir21(), directoryPath3.slice(2));
109782
110114
  }
109783
110115
  return directoryPath3;
109784
110116
  }
@@ -109835,10 +110167,10 @@ async function pathExists(dir) {
109835
110167
 
109836
110168
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
109837
110169
  init_src2();
109838
- import { existsSync as existsSync57 } from "fs";
110170
+ import { existsSync as existsSync59 } from "fs";
109839
110171
  import { lstat as lstat15, readdir as readdir14, readFile as readFile27 } from "fs/promises";
109840
- import { homedir as homedir20 } from "os";
109841
- import { basename as basename11, join as join82, resolve as resolve22 } from "path";
110172
+ import { homedir as homedir22 } from "os";
110173
+ import { basename as basename11, join as join85, resolve as resolve24 } from "path";
109842
110174
  // packages/omo-opencode/package.json
109843
110175
  var package_default3 = {
109844
110176
  name: "@oh-my-opencode/omo-opencode",
@@ -109903,13 +110235,13 @@ var CODEX_BIN_NAMES = [
109903
110235
  "omo-git-bash-hook"
109904
110236
  ];
109905
110237
  async function gatherCodexSummary(deps = {}) {
109906
- const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir20(), ".codex"));
110238
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join85(homedir22(), ".codex"));
109907
110239
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
109908
110240
  const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
109909
110241
  const pluginRoot = await resolveInstalledPluginRoot(codexHome);
109910
- const manifest2 = pluginRoot === null ? null : await readJson(join82(pluginRoot, ".codex-plugin", "plugin.json"));
109911
- const installSnapshot = pluginRoot === null ? null : await readJson(join82(pluginRoot, "lazycodex-install.json"));
109912
- const configPath = join82(codexHome, "config.toml");
110242
+ const manifest2 = pluginRoot === null ? null : await readJson(join85(pluginRoot, ".codex-plugin", "plugin.json"));
110243
+ const installSnapshot = pluginRoot === null ? null : await readJson(join85(pluginRoot, "lazycodex-install.json"));
110244
+ const configPath = join85(codexHome, "config.toml");
109913
110245
  const pluginVersion = stringField(manifest2, "version");
109914
110246
  return {
109915
110247
  codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -109966,7 +110298,7 @@ function buildCodexIssues(summary) {
109966
110298
  if (summary.pluginRoot === null) {
109967
110299
  issues.push({
109968
110300
  title: "OMO Codex plugin is not installed",
109969
- description: `Expected cached plugin at ${join82("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
110301
+ description: `Expected cached plugin at ${join85("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
109970
110302
  fix: "Run: npx lazycodex-ai install",
109971
110303
  severity: "error",
109972
110304
  affects: ["plugin loading"]
@@ -110031,15 +110363,15 @@ function buildCodexIssues(summary) {
110031
110363
  return issues;
110032
110364
  }
110033
110365
  async function resolveInstalledPluginRoot(codexHome) {
110034
- const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
110035
- if (!existsSync57(pluginRoot))
110366
+ const pluginRoot = join85(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
110367
+ if (!existsSync59(pluginRoot))
110036
110368
  return null;
110037
110369
  const versions2 = await readdir14(pluginRoot, { withFileTypes: true });
110038
110370
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
110039
- return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
110371
+ return candidates.length === 0 ? null : join85(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
110040
110372
  }
110041
110373
  async function readCodexConfigSummary(configPath) {
110042
- if (!existsSync57(configPath)) {
110374
+ if (!existsSync59(configPath)) {
110043
110375
  return {
110044
110376
  exists: false,
110045
110377
  marketplaceConfigured: false,
@@ -110064,14 +110396,14 @@ async function readCodexConfigSummary(configPath) {
110064
110396
  async function readLinkedBins(binDir) {
110065
110397
  const linked = [];
110066
110398
  for (const name of CODEX_BIN_NAMES) {
110067
- if (await pathExists2(join82(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
110399
+ if (await pathExists2(join85(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
110068
110400
  linked.push(name);
110069
110401
  }
110070
110402
  return linked;
110071
110403
  }
110072
110404
  async function readLinkedAgents(codexHome) {
110073
- const agentsDir = join82(codexHome, "agents");
110074
- if (!existsSync57(agentsDir))
110405
+ const agentsDir = join85(codexHome, "agents");
110406
+ if (!existsSync59(agentsDir))
110075
110407
  return [];
110076
110408
  const entries = await readdir14(agentsDir, { withFileTypes: true });
110077
110409
  return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename11(entry.name, ".toml")).sort();
@@ -110117,16 +110449,16 @@ function formatCompanionPluginStatus(config4) {
110117
110449
  return "none";
110118
110450
  }
110119
110451
  function readCompanionLifecycleHookStateEvents(content) {
110120
- const events = new Set;
110452
+ const events2 = new Set;
110121
110453
  for (const section of splitTomlSections(content)) {
110122
110454
  if (section.header === null)
110123
110455
  continue;
110124
110456
  const key = parseHookStateHeaderKey(section.header);
110125
110457
  const event = key === null ? null : companionLifecycleEventFromHookStateKey(key);
110126
110458
  if (event !== null)
110127
- events.add(event);
110459
+ events2.add(event);
110128
110460
  }
110129
- return [...events].sort(compareCompanionLifecycleEvents);
110461
+ return [...events2].sort(compareCompanionLifecycleEvents);
110130
110462
  }
110131
110463
  function companionLifecycleEventFromHookStateKey(key) {
110132
110464
  if (!key.startsWith(`${COMPANION_PLUGIN_KEY}:`))
@@ -110140,8 +110472,8 @@ function compareCompanionLifecycleEvents(left, right) {
110140
110472
  function companionLifecycleEventOrder(event) {
110141
110473
  return event === "session_start" ? 0 : event === "stop" ? 1 : 2;
110142
110474
  }
110143
- function formatCompanionLifecycleEvents(events) {
110144
- return events.map(formatCompanionLifecycleEvent).join(", ");
110475
+ function formatCompanionLifecycleEvents(events2) {
110476
+ return events2.map(formatCompanionLifecycleEvent).join(", ");
110145
110477
  }
110146
110478
  function formatCompanionLifecycleEvent(event) {
110147
110479
  switch (event) {
@@ -110185,8 +110517,8 @@ async function pathExists2(path14) {
110185
110517
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
110186
110518
  init_src2();
110187
110519
  import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "fs/promises";
110188
- import { homedir as homedir21 } from "os";
110189
- import { dirname as dirname31, isAbsolute as isAbsolute12, join as join83, relative as relative9, resolve as resolve23, sep as sep9 } from "path";
110520
+ import { homedir as homedir23 } from "os";
110521
+ import { dirname as dirname33, isAbsolute as isAbsolute12, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
110190
110522
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
110191
110523
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
110192
110524
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -110196,7 +110528,7 @@ async function checkCodexComponents(deps = {}) {
110196
110528
  const env3 = deps.env ?? process.env;
110197
110529
  const platform = deps.platform ?? process.platform;
110198
110530
  const arch = deps.arch ?? process.arch;
110199
- const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join83(homedir21(), ".codex"));
110531
+ const codexHome = resolve25(deps.codexHome ?? env3["CODEX_HOME"] ?? join86(homedir23(), ".codex"));
110200
110532
  const summary = await gatherCodexSummary({ ...deps, codexHome });
110201
110533
  if (summary.pluginRoot === null) {
110202
110534
  return {
@@ -110221,7 +110553,7 @@ async function checkCodexComponents(deps = {}) {
110221
110553
  });
110222
110554
  }
110223
110555
  const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
110224
- const runtimeSgPath = join83(runtimeSgDir, sgBinaryName(platform));
110556
+ const runtimeSgPath = join86(runtimeSgDir, sgBinaryName(platform));
110225
110557
  const sg = findSgBinarySync({
110226
110558
  arch,
110227
110559
  env: env3,
@@ -110260,8 +110592,8 @@ async function auditBundleTargets(pluginRoot) {
110260
110592
  const manifest2 = await readJson2(manifestPath);
110261
110593
  if (manifest2 === null || !isRecord12(manifest2["mcpServers"]))
110262
110594
  continue;
110263
- const manifestRoot = dirname31(manifestPath);
110264
- const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
110595
+ const manifestRoot = dirname33(manifestPath);
110596
+ const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
110265
110597
  for (const server2 of Object.values(manifest2["mcpServers"])) {
110266
110598
  if (!isRecord12(server2) || !Array.isArray(server2["args"]))
110267
110599
  continue;
@@ -110281,7 +110613,7 @@ async function auditBundleTargets(pluginRoot) {
110281
110613
  continue;
110282
110614
  const commands2 = [];
110283
110615
  collectHookCommands(manifest2, commands2);
110284
- const hookPluginRoot = dirname31(dirname31(hookManifestPath));
110616
+ const hookPluginRoot = dirname33(dirname33(hookManifestPath));
110285
110617
  for (const command of commands2) {
110286
110618
  for (const relativePath of extractPluginRootPaths(command)) {
110287
110619
  referencedCount += 1;
@@ -110303,8 +110635,8 @@ function recordBrokenTarget(broken, classified, origin) {
110303
110635
  broken.push(entry);
110304
110636
  }
110305
110637
  async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
110306
- const targetPath = resolve23(baseRoot, relativePath);
110307
- const bundleRootPath = resolve23(bundleRoot);
110638
+ const targetPath = resolve25(baseRoot, relativePath);
110639
+ const bundleRootPath = resolve25(bundleRoot);
110308
110640
  const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
110309
110641
  if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
110310
110642
  if (allowEscape)
@@ -110320,7 +110652,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
110320
110652
  }
110321
110653
  async function findHookManifestPaths(root) {
110322
110654
  const paths3 = await findManifestPaths(root, "hooks.json");
110323
- return paths3.filter((path14) => dirname31(path14).endsWith(`${sep9}hooks`));
110655
+ return paths3.filter((path14) => dirname33(path14).endsWith(`${sep9}hooks`));
110324
110656
  }
110325
110657
  async function findManifestPaths(root, manifestName) {
110326
110658
  let entries;
@@ -110333,7 +110665,7 @@ async function findManifestPaths(root, manifestName) {
110333
110665
  for (const entry of entries) {
110334
110666
  if (entry.name === "node_modules" || entry.name === ".git")
110335
110667
  continue;
110336
- const entryPath = join83(root, entry.name);
110668
+ const entryPath = join86(root, entry.name);
110337
110669
  if (entry.isDirectory()) {
110338
110670
  paths3.push(...await findManifestPaths(entryPath, manifestName));
110339
110671
  continue;
@@ -110377,18 +110709,18 @@ function isPluginRuntimePathArg(arg) {
110377
110709
  return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
110378
110710
  }
110379
110711
  function runtimeSgDirectory(codexHome, platform, arch) {
110380
- return join83(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
110712
+ return join86(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
110381
110713
  }
110382
110714
  function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
110383
110715
  const override = env3[SG_PATH_ENV_KEY]?.trim();
110384
110716
  if (override !== undefined && override.length > 0 && sgPath === override)
110385
110717
  return `env override ${SG_PATH_ENV_KEY}`;
110386
- if (sgPath === join83(runtimeSgDir, sgBinaryName(platform)))
110718
+ if (sgPath === join86(runtimeSgDir, sgBinaryName(platform)))
110387
110719
  return "runtime dir";
110388
110720
  return "PATH";
110389
110721
  }
110390
110722
  async function readBootstrapStateSummary(codexHome) {
110391
- const statePath = join83(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
110723
+ const statePath = join86(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
110392
110724
  const raw = await readJson2(statePath);
110393
110725
  if (raw === null)
110394
110726
  return null;
@@ -110464,24 +110796,24 @@ function isRecord12(value) {
110464
110796
  }
110465
110797
 
110466
110798
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
110467
- import { existsSync as existsSync58 } from "fs";
110799
+ import { existsSync as existsSync60 } from "fs";
110468
110800
  import { readFile as readFile29 } from "fs/promises";
110469
- import { homedir as homedir22 } from "os";
110470
- import { join as join84, resolve as resolve24 } from "path";
110801
+ import { homedir as homedir24 } from "os";
110802
+ import { join as join87, resolve as resolve26 } from "path";
110471
110803
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
110472
110804
  var CHECK_NAME = "codex-runtime-wrapper";
110473
110805
  var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
110474
110806
  async function checkCodexRuntimeWrapper(deps = {}) {
110475
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir22(), ".codex"));
110807
+ const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join87(homedir24(), ".codex"));
110476
110808
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
110477
110809
  const platform = deps.platform ?? process.platform;
110478
- const wrapperPath = join84(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
110479
- const legacyWrapperPath = join84(binDir, platform === "win32" ? "omo.cmd" : "omo");
110810
+ const wrapperPath = join87(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
110811
+ const legacyWrapperPath = join87(binDir, platform === "win32" ? "omo.cmd" : "omo");
110480
110812
  const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
110481
110813
  const issues = [];
110482
110814
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
110483
110815
  const targetPath = parseRuntimeTargetPath(wrapper);
110484
- if (targetPath !== null && !existsSync58(targetPath)) {
110816
+ if (targetPath !== null && !existsSync60(targetPath)) {
110485
110817
  issues.push({
110486
110818
  title: "omo-agent-toolkit runtime wrapper target is missing",
110487
110819
  description: `Generated omo-agent-toolkit runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
@@ -110995,24 +111327,24 @@ Doctor failed unexpectedly: ${message}`];
110995
111327
  // packages/mcp-client-core/src/mcp-oauth/storage.ts
110996
111328
  import { createHash as createHash6 } from "crypto";
110997
111329
  import {
110998
- chmodSync as chmodSync4,
110999
- existsSync as existsSync61,
111000
- mkdirSync as mkdirSync14,
111330
+ chmodSync as chmodSync5,
111331
+ existsSync as existsSync63,
111332
+ mkdirSync as mkdirSync15,
111001
111333
  readdirSync as readdirSync11,
111002
- readFileSync as readFileSync38,
111334
+ readFileSync as readFileSync39,
111003
111335
  renameSync as renameSync7,
111004
111336
  unlinkSync as unlinkSync9,
111005
- writeFileSync as writeFileSync11
111337
+ writeFileSync as writeFileSync12
111006
111338
  } from "fs";
111007
- import { basename as basename12, dirname as dirname32, join as join87 } from "path";
111339
+ import { basename as basename12, dirname as dirname34, join as join90 } from "path";
111008
111340
 
111009
111341
  // packages/mcp-client-core/src/config-dir.ts
111010
- import { existsSync as existsSync59, realpathSync as realpathSync8 } from "fs";
111011
- import { homedir as homedir23 } from "os";
111012
- import { join as join85, resolve as resolve25 } from "path";
111342
+ import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
111343
+ import { homedir as homedir25 } from "os";
111344
+ import { join as join88, resolve as resolve27 } from "path";
111013
111345
  function resolveConfigPath2(pathValue) {
111014
- const resolvedPath = resolve25(pathValue);
111015
- if (!existsSync59(resolvedPath))
111346
+ const resolvedPath = resolve27(pathValue);
111347
+ if (!existsSync61(resolvedPath))
111016
111348
  return resolvedPath;
111017
111349
  try {
111018
111350
  return realpathSync8(resolvedPath);
@@ -111027,13 +111359,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
111027
111359
  if (customConfigDir) {
111028
111360
  return resolveConfigPath2(customConfigDir);
111029
111361
  }
111030
- const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join85(homedir23(), ".config");
111031
- return resolveConfigPath2(join85(xdgConfigDir, "opencode"));
111362
+ const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join88(homedir25(), ".config");
111363
+ return resolveConfigPath2(join88(xdgConfigDir, "opencode"));
111032
111364
  }
111033
111365
 
111034
111366
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
111035
- import { chmodSync as chmodSync3, existsSync as existsSync60, readFileSync as readFileSync37, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
111036
- import { join as join86 } from "path";
111367
+ import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync38, renameSync as renameSync6, writeFileSync as writeFileSync11 } from "fs";
111368
+ import { join as join89 } from "path";
111037
111369
  var INDEX_FILE_NAME = "index.json";
111038
111370
  function isTokenIndex(value) {
111039
111371
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -111041,14 +111373,14 @@ function isTokenIndex(value) {
111041
111373
  return Object.values(value).every((entry) => typeof entry === "string");
111042
111374
  }
111043
111375
  function getIndexPath(storageDir) {
111044
- return join86(storageDir, INDEX_FILE_NAME);
111376
+ return join89(storageDir, INDEX_FILE_NAME);
111045
111377
  }
111046
111378
  function readTokenIndex(storageDir) {
111047
111379
  const indexPath = getIndexPath(storageDir);
111048
- if (!existsSync60(indexPath))
111380
+ if (!existsSync62(indexPath))
111049
111381
  return {};
111050
111382
  try {
111051
- const parsed = JSON.parse(readFileSync37(indexPath, "utf-8"));
111383
+ const parsed = JSON.parse(readFileSync38(indexPath, "utf-8"));
111052
111384
  return isTokenIndex(parsed) ? parsed : {};
111053
111385
  } catch (readError) {
111054
111386
  if (!(readError instanceof Error))
@@ -111060,8 +111392,8 @@ function writeTokenIndex(storageDir, index) {
111060
111392
  try {
111061
111393
  const indexPath = getIndexPath(storageDir);
111062
111394
  const tempPath = `${indexPath}.tmp.${Date.now()}`;
111063
- writeFileSync10(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
111064
- chmodSync3(tempPath, 384);
111395
+ writeFileSync11(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
111396
+ chmodSync4(tempPath, 384);
111065
111397
  renameSync6(tempPath, indexPath);
111066
111398
  return true;
111067
111399
  } catch (writeError) {
@@ -111085,16 +111417,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
111085
111417
  var STORAGE_DIR_NAME = "mcp-oauth";
111086
111418
  var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
111087
111419
  function getMcpOauthStorageDir() {
111088
- return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
111420
+ return join90(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
111089
111421
  }
111090
111422
  function getMcpOauthServerHash(serverHost, resource) {
111091
111423
  return createHash6("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
111092
111424
  }
111093
111425
  function getMcpOauthStoragePath(serverHost, resource) {
111094
- return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
111426
+ return join90(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
111095
111427
  }
111096
111428
  function getLegacyStoragePath() {
111097
- return join87(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
111429
+ return join90(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
111098
111430
  }
111099
111431
  function normalizeHost2(serverHost) {
111100
111432
  let host = serverHost.trim();
@@ -111155,10 +111487,10 @@ function isOAuthTokenData(value) {
111155
111487
  return clientSecret === undefined || typeof clientSecret === "string";
111156
111488
  }
111157
111489
  function readTokenFile(filePath) {
111158
- if (!existsSync61(filePath))
111490
+ if (!existsSync63(filePath))
111159
111491
  return null;
111160
111492
  try {
111161
- const parsed = JSON.parse(readFileSync38(filePath, "utf-8"));
111493
+ const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
111162
111494
  return isOAuthTokenData(parsed) ? parsed : null;
111163
111495
  } catch (readError) {
111164
111496
  if (!(readError instanceof Error))
@@ -111168,10 +111500,10 @@ function readTokenFile(filePath) {
111168
111500
  }
111169
111501
  function readLegacyStore() {
111170
111502
  const filePath = getLegacyStoragePath();
111171
- if (!existsSync61(filePath))
111503
+ if (!existsSync63(filePath))
111172
111504
  return null;
111173
111505
  try {
111174
- const parsed = JSON.parse(readFileSync38(filePath, "utf-8"));
111506
+ const parsed = JSON.parse(readFileSync39(filePath, "utf-8"));
111175
111507
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
111176
111508
  return null;
111177
111509
  const result = {};
@@ -111188,13 +111520,13 @@ function readLegacyStore() {
111188
111520
  }
111189
111521
  function writeTokenFile(filePath, token) {
111190
111522
  try {
111191
- const dir = dirname32(filePath);
111192
- if (!existsSync61(dir)) {
111193
- mkdirSync14(dir, { recursive: true });
111523
+ const dir = dirname34(filePath);
111524
+ if (!existsSync63(dir)) {
111525
+ mkdirSync15(dir, { recursive: true });
111194
111526
  }
111195
111527
  const tempPath = `${filePath}.tmp.${Date.now()}`;
111196
- writeFileSync11(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
111197
- chmodSync4(tempPath, 384);
111528
+ writeFileSync12(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
111529
+ chmodSync5(tempPath, 384);
111198
111530
  renameSync7(tempPath, filePath);
111199
111531
  return true;
111200
111532
  } catch (writeError) {
@@ -111213,7 +111545,7 @@ function saveToken(serverHost, resource, token) {
111213
111545
  }
111214
111546
  function deleteToken(serverHost, resource) {
111215
111547
  const filePath = getMcpOauthStoragePath(serverHost, resource);
111216
- if (!existsSync61(filePath))
111548
+ if (!existsSync63(filePath))
111217
111549
  return deleteLegacyToken(serverHost, resource);
111218
111550
  try {
111219
111551
  unlinkSync9(filePath);
@@ -111235,7 +111567,7 @@ function deleteLegacyToken(serverHost, resource) {
111235
111567
  if (Object.keys(store2).length === 0) {
111236
111568
  try {
111237
111569
  const filePath = getLegacyStoragePath();
111238
- if (existsSync61(filePath))
111570
+ if (existsSync63(filePath))
111239
111571
  unlinkSync9(filePath);
111240
111572
  return true;
111241
111573
  } catch (deleteError) {
@@ -111249,8 +111581,8 @@ function deleteLegacyToken(serverHost, resource) {
111249
111581
  function writeLegacyStore(store2) {
111250
111582
  try {
111251
111583
  const filePath = getLegacyStoragePath();
111252
- writeFileSync11(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
111253
- chmodSync4(filePath, 384);
111584
+ writeFileSync12(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
111585
+ chmodSync5(filePath, 384);
111254
111586
  return true;
111255
111587
  } catch (writeError) {
111256
111588
  if (!(writeError instanceof Error))
@@ -111273,7 +111605,7 @@ function listTokensByHost(serverHost) {
111273
111605
  for (const [hash2, indexedKey] of Object.entries(index)) {
111274
111606
  if (!indexedKey.startsWith(prefix))
111275
111607
  continue;
111276
- const indexedToken = readTokenFile(join87(getMcpOauthStorageDir(), `${hash2}.json`));
111608
+ const indexedToken = readTokenFile(join90(getMcpOauthStorageDir(), `${hash2}.json`));
111277
111609
  if (indexedToken)
111278
111610
  result[indexedKey] = indexedToken;
111279
111611
  }
@@ -111282,13 +111614,13 @@ function listTokensByHost(serverHost) {
111282
111614
  function listAllTokens() {
111283
111615
  const result = { ...readLegacyStore() ?? {} };
111284
111616
  const dir = getMcpOauthStorageDir();
111285
- if (!existsSync61(dir))
111617
+ if (!existsSync63(dir))
111286
111618
  return result;
111287
111619
  const index = readTokenIndex(dir);
111288
111620
  for (const entry of readdirSync11(dir, { withFileTypes: true })) {
111289
111621
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
111290
111622
  continue;
111291
- const token = readTokenFile(join87(dir, entry.name));
111623
+ const token = readTokenFile(join90(dir, entry.name));
111292
111624
  const hash2 = basename12(entry.name, ".json");
111293
111625
  if (token)
111294
111626
  result[index[hash2] ?? hash2] = token;
@@ -111488,7 +111820,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
111488
111820
  }
111489
111821
  var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
111490
111822
  function startCallbackServer(port) {
111491
- return new Promise((resolve26, reject) => {
111823
+ return new Promise((resolve28, reject) => {
111492
111824
  let timeoutId;
111493
111825
  const server2 = createServer2((request, response) => {
111494
111826
  clearTimeout(timeoutId);
@@ -111514,7 +111846,7 @@ function startCallbackServer(port) {
111514
111846
  response.writeHead(200, { "content-type": "text/html" });
111515
111847
  response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
111516
111848
  server2.close();
111517
- resolve26({ code, state: state2 });
111849
+ resolve28({ code, state: state2 });
111518
111850
  });
111519
111851
  timeoutId = setTimeout(() => {
111520
111852
  server2.close();
@@ -111854,7 +112186,7 @@ function createMcpOAuthCommand() {
111854
112186
  }
111855
112187
 
111856
112188
  // packages/omo-opencode/src/cli/boulder/boulder.ts
111857
- import { existsSync as existsSync62 } from "fs";
112189
+ import { existsSync as existsSync64 } from "fs";
111858
112190
 
111859
112191
  // packages/omo-opencode/src/cli/boulder/formatter.ts
111860
112192
  var import_picocolors22 = __toESM(require_picocolors(), 1);
@@ -111991,10 +112323,10 @@ async function boulder(options) {
111991
112323
  const boulderFilePath = getBoulderFilePath(directory);
111992
112324
  const state2 = readBoulderState(directory);
111993
112325
  if (!state2) {
111994
- const message = existsSync62(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
112326
+ const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
111995
112327
  process.stderr.write(`${message}
111996
112328
  `);
111997
- return existsSync62(boulderFilePath) ? 2 : 1;
112329
+ return existsSync64(boulderFilePath) ? 2 : 1;
111998
112330
  }
111999
112331
  const works = getBoulderWorks(state2);
112000
112332
  const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
@@ -112012,12 +112344,12 @@ async function boulder(options) {
112012
112344
  }
112013
112345
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
112014
112346
  import { spawn as spawn5 } from "child_process";
112015
- import { existsSync as existsSync63, readFileSync as readFileSync39, realpathSync as realpathSync9 } from "fs";
112016
- import { homedir as homedir24 } from "os";
112347
+ import { existsSync as existsSync65, readFileSync as readFileSync40, realpathSync as realpathSync9 } from "fs";
112348
+ import { homedir as homedir26 } from "os";
112017
112349
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
112018
112350
  function resolveCodexUlwLoopCommand(input = {}) {
112019
112351
  const env3 = input.env ?? process.env;
112020
- const homeDir = input.homeDir ?? homedir24();
112352
+ const homeDir = input.homeDir ?? homedir26();
112021
112353
  const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
112022
112354
  if (localComponentBin !== null)
112023
112355
  return { executable: localComponentBin, argsPrefix: [] };
@@ -112040,29 +112372,29 @@ async function codexUlwLoop(args) {
112040
112372
  console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
112041
112373
  return 1;
112042
112374
  }
112043
- const { promise: promise2, resolve: resolve26 } = Promise.withResolvers();
112375
+ const { promise: promise2, resolve: resolve28 } = Promise.withResolvers();
112044
112376
  const child = spawn5(command.executable, [...command.argsPrefix, ...args], {
112045
112377
  stdio: "inherit",
112046
112378
  env: { ...process.env, [ULW_LOOP_DELEGATION_SENTINEL]: "1" }
112047
112379
  });
112048
112380
  child.on("error", (error51) => {
112049
112381
  console.error(error51.message);
112050
- resolve26(1);
112382
+ resolve28(1);
112051
112383
  });
112052
- child.on("close", (code) => resolve26(code ?? 1));
112384
+ child.on("close", (code) => resolve28(code ?? 1));
112053
112385
  return promise2;
112054
112386
  }
112055
112387
  function resolveLocalUlwLoopBin(env3, homeDir) {
112056
112388
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
112057
- return candidates.find((candidate2) => existsSync63(candidate2)) ?? null;
112389
+ return candidates.find((candidate2) => existsSync65(candidate2)) ?? null;
112058
112390
  }
112059
112391
  function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
112060
112392
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
112061
- return candidates.find((candidate2) => existsSync63(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
112393
+ return candidates.find((candidate2) => existsSync65(candidate2) && !isCurrentExecutable(candidate2, currentExecutablePaths) && !isGeneratedRuntimeWrapper(candidate2)) ?? null;
112062
112394
  }
112063
112395
  function isGeneratedRuntimeWrapper(candidate2) {
112064
112396
  try {
112065
- return readFileSync39(candidate2, "utf8").includes(RUNTIME_WRAPPER_MARKER);
112397
+ return readFileSync40(candidate2, "utf8").includes(RUNTIME_WRAPPER_MARKER);
112066
112398
  } catch (error51) {
112067
112399
  if (error51 instanceof Error)
112068
112400
  return false;