oh-my-opencode 4.15.1 → 4.16.0

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 (142) hide show
  1. package/dist/cli/doctor/checks/tui-plugin-config.d.ts +4 -4
  2. package/dist/cli/index.js +673 -678
  3. package/dist/cli/install-senpi/index.d.ts +1 -0
  4. package/dist/cli/run/poll-for-completion.d.ts +4 -0
  5. package/dist/cli/run/session-resolver.d.ts +1 -0
  6. package/dist/cli/senpi-platform-flag.d.ts +4 -0
  7. package/dist/cli/types.d.ts +2 -1
  8. package/dist/cli-node/index.js +673 -678
  9. package/dist/features/background-agent/manager.d.ts +16 -0
  10. package/dist/hooks/anthropic-context-window-limit-recovery/aggressive-truncation-strategy.d.ts +1 -0
  11. package/dist/index.js +1334 -1146
  12. package/dist/skills/debugging/references/methodology/06-fix.md +6 -0
  13. package/dist/skills/frontend/ATTRIBUTION.md +10 -1
  14. package/dist/skills/frontend/SKILL.md +8 -3
  15. package/dist/skills/frontend/references/design/README.md +1 -1
  16. package/dist/skills/frontend/references/design/_INDEX.md +1 -1
  17. package/dist/skills/frontend/references/design/lazyweb.md +77 -0
  18. package/dist/skills/frontend/references/design/stitch-design-example.md +121 -0
  19. package/dist/skills/programming/SKILL.md +10 -1
  20. package/dist/skills/programming/references/logging.md +91 -0
  21. package/dist/skills/ulw-plan/SKILL.md +5 -5
  22. package/dist/skills/ulw-plan/references/full-workflow.md +7 -7
  23. package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
  24. package/dist/skills/ulw-research/ATTRIBUTION.md +2 -2
  25. package/dist/skills/ulw-research/SKILL.md +28 -7
  26. package/dist/tools/skill/description-formatter.d.ts +1 -0
  27. package/dist/tools/skill/description-formatter.test-support.d.ts +9 -0
  28. package/dist/tools/skill/zauc-mocks-skill-tools/test-support.d.ts +25 -0
  29. package/dist/tui.js +121 -419
  30. package/package.json +32 -15
  31. package/packages/git-bash-mcp/dist/cli.js +2 -2
  32. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  33. package/packages/omo-codex/plugin/components/bootstrap/AGENTS.md +55 -0
  34. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +19 -16
  35. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  36. package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +51 -0
  37. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +936 -248
  38. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +233 -135
  39. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  40. package/packages/omo-codex/plugin/components/codegraph/src/cache-gc.ts +29 -0
  41. package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +13 -0
  42. package/packages/omo-codex/plugin/components/codegraph/src/hook-sweep.ts +25 -0
  43. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +3 -1
  44. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +30 -1
  45. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +16 -2
  46. package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +80 -0
  47. package/packages/omo-codex/plugin/components/codegraph/test/cache-gc.test.ts +34 -0
  48. package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +107 -0
  49. package/packages/omo-codex/plugin/components/codegraph/test/hook-registration.test.ts +26 -0
  50. package/packages/omo-codex/plugin/components/codegraph/test/hook-sweep.test.ts +29 -0
  51. package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +8 -21
  52. package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +108 -0
  53. package/packages/omo-codex/plugin/components/codegraph/test/serve-built-wrapper.test.ts +76 -0
  54. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +17 -111
  55. package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +1 -1
  56. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +45 -67
  57. package/packages/omo-codex/plugin/components/codegraph/test/sweep-cli.test.ts +56 -0
  58. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  59. package/packages/omo-codex/plugin/components/git-bash/AGENTS.md +31 -0
  60. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  61. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/AGENTS.md +45 -0
  62. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  63. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  64. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +37 -102
  65. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  66. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  67. package/packages/omo-codex/plugin/components/teammode/AGENTS.md +46 -0
  68. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  69. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +6 -0
  70. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +6 -0
  71. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  72. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -2
  73. package/packages/omo-codex/plugin/components/ultrawork/CHANGELOG.md +2 -0
  74. package/packages/omo-codex/plugin/components/ultrawork/README.md +3 -3
  75. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +51 -2
  76. package/packages/omo-codex/plugin/components/ultrawork/package.json +2 -1
  77. package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +14 -1
  78. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +380 -0
  79. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +5 -2
  80. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +4 -4
  81. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +2 -2
  82. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +5 -3
  83. package/packages/omo-codex/plugin/components/ultrawork/src/skill-pointer.ts +56 -0
  84. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +4 -4
  85. package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +12 -0
  86. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +1 -0
  87. package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +82 -0
  88. package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +1 -0
  89. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +56 -5
  90. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +1 -0
  91. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +5 -1
  92. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.d.ts +2 -1
  93. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.js +5 -3
  94. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-skill-pointer.d.ts +7 -0
  95. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-skill-pointer.js +46 -0
  96. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  97. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +5 -1
  98. package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-directive.ts +9 -3
  99. package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-skill-pointer.ts +55 -0
  100. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +49 -0
  101. package/packages/omo-codex/plugin/package-lock.json +13 -13
  102. package/packages/omo-codex/plugin/package.json +1 -1
  103. package/packages/omo-codex/plugin/scripts/build-components.mjs +63 -17
  104. package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +10 -3
  105. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +1 -0
  106. package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +18 -0
  107. package/packages/omo-codex/plugin/skills/debugging/references/methodology/06-fix.md +6 -0
  108. package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +10 -1
  109. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +8 -3
  110. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +1 -1
  111. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -1
  112. package/packages/omo-codex/plugin/skills/frontend/references/design/lazyweb.md +77 -0
  113. package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-design-example.md +121 -0
  114. package/packages/omo-codex/plugin/skills/programming/SKILL.md +10 -1
  115. package/packages/omo-codex/plugin/skills/programming/references/logging.md +91 -0
  116. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +380 -0
  117. package/packages/omo-codex/plugin/skills/ultrawork/agents/openai.yaml +2 -0
  118. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +5 -2
  119. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +4 -4
  120. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +2 -2
  121. package/packages/omo-codex/plugin/skills/ulw-research/ATTRIBUTION.md +2 -2
  122. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +28 -7
  123. package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +1 -1
  124. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -0
  125. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +56 -0
  126. package/packages/omo-codex/plugin/test/ulw-research-epistemic-contract.test.mjs +98 -0
  127. package/packages/omo-codex/plugin/test/ulw-research-skill-contract.test.mjs +6 -6
  128. package/packages/omo-codex/scripts/install-dist/install-local.mjs +259 -3954
  129. package/packages/shared-skills/skills/debugging/references/methodology/06-fix.md +6 -0
  130. package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +10 -1
  131. package/packages/shared-skills/skills/frontend/SKILL.md +8 -3
  132. package/packages/shared-skills/skills/frontend/references/design/README.md +1 -1
  133. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -1
  134. package/packages/shared-skills/skills/frontend/references/design/lazyweb.md +77 -0
  135. package/packages/shared-skills/skills/frontend/references/design/stitch-design-example.md +121 -0
  136. package/packages/shared-skills/skills/programming/SKILL.md +10 -1
  137. package/packages/shared-skills/skills/programming/references/logging.md +91 -0
  138. package/packages/shared-skills/skills/ulw-plan/SKILL.md +5 -5
  139. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +7 -7
  140. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
  141. package/packages/shared-skills/skills/ulw-research/ATTRIBUTION.md +2 -2
  142. package/packages/shared-skills/skills/ulw-research/SKILL.md +28 -7
package/dist/cli/index.js CHANGED
@@ -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: "4.15.1",
2148
+ version: "4.16.0",
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",
@@ -2159,6 +2159,7 @@ var init_package = __esm(() => {
2159
2159
  "packages/lsp-core",
2160
2160
  "packages/utils",
2161
2161
  "packages/model-core",
2162
+ "packages/omo-config-core",
2162
2163
  "packages/prompts-core",
2163
2164
  "packages/comment-checker-core",
2164
2165
  "packages/hashline-core",
@@ -2172,6 +2173,10 @@ var init_package = __esm(() => {
2172
2173
  "packages/agents-md-core",
2173
2174
  "packages/shared-skills",
2174
2175
  "packages/omo-codex",
2176
+ "packages/omo-senpi",
2177
+ "packages/senpi-task",
2178
+ "packages/pi-goal",
2179
+ "packages/pi-webfetch",
2175
2180
  "packages/omo-opencode"
2176
2181
  ],
2177
2182
  bin: {
@@ -2228,6 +2233,7 @@ var init_package = __esm(() => {
2228
2233
  "packages/omo-codex/plugin/.codex-plugin",
2229
2234
  "!packages/omo-codex/plugin/node_modules",
2230
2235
  "!packages/omo-codex/plugin/**/node_modules",
2236
+ "!packages/omo-codex/plugin/components/workflow-selector",
2231
2237
  "packages/omo-codex/scripts",
2232
2238
  "!packages/omo-codex/scripts/install"
2233
2239
  ],
@@ -2241,10 +2247,11 @@ var init_package = __esm(() => {
2241
2247
  "./schema.json": "./dist/oh-my-opencode.schema.json"
2242
2248
  },
2243
2249
  scripts: {
2244
- build: "bun run build:git-bash-mcp && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build:codex-plugin && bun build packages/omo-opencode/src/index.ts --outdir dist --target bun --format esm --external zod && bun build packages/omo-opencode/src/tui.ts --outdir dist --target bun --format esm --external @opentui/core --external @opentui/keymap --external @opentui/solid && bun run build:shared-skills-assets && bun run build:node-require-shim && tsc --emitDeclarationOnly && bun build packages/omo-opencode/src/cli/index.ts --outdir dist/cli --target bun --format esm && bun run build:cli-node && bun run build:codex-install && bun run build:schema",
2250
+ build: "bun run script/build.ts",
2245
2251
  "build:cli-node": "bun run script/build-cli-node.ts",
2246
2252
  "build:codex-install": "bun run script/build-codex-install.ts",
2247
2253
  "build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
2254
+ "build:senpi-plugin": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check",
2248
2255
  "build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
2249
2256
  "build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
2250
2257
  "build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
@@ -2261,10 +2268,11 @@ var init_package = __esm(() => {
2261
2268
  prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
2262
2269
  "test:model-capabilities": "bun test packages/model-core/src/model-capability-aliases.test.ts packages/model-core/src/model-capability-guardrails.test.ts packages/model-core/src/model-capabilities.test.ts packages/omo-opencode/src/cli/doctor/checks/model-resolution.test.ts --bail",
2263
2270
  typecheck: "tsgo --noEmit && bun run typecheck:script && bun run typecheck:packages",
2264
- "typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json",
2271
+ "typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && tsgo --noEmit -p packages/senpi-task/tsconfig.json && tsgo --noEmit -p packages/pi-goal/tsconfig.json && tsgo --noEmit -p packages/pi-webfetch/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json",
2265
2272
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
2266
2273
  test: "bun test",
2267
2274
  "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 && 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",
2275
+ "test:senpi": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check && bun test packages/omo-senpi",
2268
2276
  "test:windows-codex": "bun run test:codex",
2269
2277
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
2270
2278
  },
@@ -2323,7 +2331,12 @@ var init_package = __esm(() => {
2323
2331
  "@oh-my-opencode/team-core": "workspace:*",
2324
2332
  "@oh-my-opencode/openclaw-core": "workspace:*",
2325
2333
  "@oh-my-opencode/model-core": "workspace:*",
2334
+ "@oh-my-opencode/omo-config-core": "workspace:*",
2326
2335
  "@oh-my-opencode/omo-codex": "workspace:*",
2336
+ "@oh-my-opencode/omo-senpi": "workspace:*",
2337
+ "@oh-my-opencode/senpi-task": "workspace:*",
2338
+ "@oh-my-opencode/pi-goal": "workspace:*",
2339
+ "@oh-my-opencode/pi-webfetch": "workspace:*",
2327
2340
  "@oh-my-opencode/prompts-core": "workspace:*",
2328
2341
  "@oh-my-opencode/rules-engine": "workspace:*",
2329
2342
  "@oh-my-opencode/shared-skills": "workspace:*",
@@ -2336,20 +2349,24 @@ var init_package = __esm(() => {
2336
2349
  typescript: "^6.0.3"
2337
2350
  },
2338
2351
  optionalDependencies: {
2339
- "oh-my-opencode-darwin-arm64": "4.15.1",
2340
- "oh-my-opencode-darwin-x64": "4.15.1",
2341
- "oh-my-opencode-darwin-x64-baseline": "4.15.1",
2342
- "oh-my-opencode-linux-arm64": "4.15.1",
2343
- "oh-my-opencode-linux-arm64-musl": "4.15.1",
2344
- "oh-my-opencode-linux-x64": "4.15.1",
2345
- "oh-my-opencode-linux-x64-baseline": "4.15.1",
2346
- "oh-my-opencode-linux-x64-musl": "4.15.1",
2347
- "oh-my-opencode-linux-x64-musl-baseline": "4.15.1",
2348
- "oh-my-opencode-windows-arm64": "4.15.1",
2349
- "oh-my-opencode-windows-x64": "4.15.1",
2350
- "oh-my-opencode-windows-x64-baseline": "4.15.1"
2352
+ "oh-my-opencode-darwin-arm64": "4.16.0",
2353
+ "oh-my-opencode-darwin-x64": "4.16.0",
2354
+ "oh-my-opencode-darwin-x64-baseline": "4.16.0",
2355
+ "oh-my-opencode-linux-arm64": "4.16.0",
2356
+ "oh-my-opencode-linux-arm64-musl": "4.16.0",
2357
+ "oh-my-opencode-linux-x64": "4.16.0",
2358
+ "oh-my-opencode-linux-x64-baseline": "4.16.0",
2359
+ "oh-my-opencode-linux-x64-musl": "4.16.0",
2360
+ "oh-my-opencode-linux-x64-musl-baseline": "4.16.0",
2361
+ "oh-my-opencode-windows-arm64": "4.16.0",
2362
+ "oh-my-opencode-windows-x64": "4.16.0",
2363
+ "oh-my-opencode-windows-x64-baseline": "4.16.0"
2351
2364
  },
2352
2365
  overrides: {
2366
+ "@earendil-works/pi-agent-core": "0.80.3",
2367
+ "@earendil-works/pi-ai": "0.80.3",
2368
+ "@earendil-works/pi-coding-agent": "0.80.3",
2369
+ "@earendil-works/pi-tui": "0.80.3",
2353
2370
  hono: "^4.12.18",
2354
2371
  "@hono/node-server": "^1.19.13",
2355
2372
  "express-rate-limit": "^8.5.1",
@@ -2529,14 +2546,10 @@ var init_config_section_parser = __esm(() => {
2529
2546
  });
2530
2547
 
2531
2548
  // packages/utils/src/env-expansion.ts
2532
- var init_env_expansion = __esm(() => {
2533
- init_deep_merge();
2534
- });
2549
+ var init_env_expansion = () => {};
2535
2550
 
2536
2551
  // packages/utils/src/snake-case.ts
2537
- var init_snake_case = __esm(() => {
2538
- init_deep_merge();
2539
- });
2552
+ var init_snake_case = () => {};
2540
2553
 
2541
2554
  // packages/utils/src/record-type-guard.ts
2542
2555
  function isRecord(value) {
@@ -5634,6 +5647,7 @@ var init_port_utils = () => {};
5634
5647
 
5635
5648
  // packages/utils/src/tool-name.ts
5636
5649
  var init_tool_name = () => {};
5650
+
5637
5651
  // node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
5638
5652
  function createScanner(text, ignoreTrivia = false) {
5639
5653
  const len = text.length;
@@ -7115,27 +7129,13 @@ function log(message, data) {
7115
7129
  var sharedSubunitLogger = () => {};
7116
7130
 
7117
7131
  // packages/utils/src/omo-config.ts
7118
- var HARNESS_IDS;
7119
- var init_omo_config = __esm(() => {
7120
- HARNESS_IDS = ["codex", "opencode", "omo"];
7121
- });
7122
-
7123
- // packages/utils/src/omo-config/env-overrides.ts
7124
- var init_env_overrides = () => {};
7132
+ var init_omo_config = () => {};
7125
7133
 
7126
7134
  // packages/utils/src/omo-config/resolve.ts
7127
7135
  var init_resolve = () => {};
7128
7136
 
7129
7137
  // packages/utils/src/omo-config/loader.ts
7130
- var HARNESS_BLOCK_KEYS;
7131
- var init_loader = __esm(() => {
7132
- init_deep_merge();
7133
- init_jsonc_parser();
7134
- init_omo_config();
7135
- init_env_overrides();
7136
- init_resolve();
7137
- HARNESS_BLOCK_KEYS = HARNESS_IDS.map((harness) => `[${harness}]`);
7138
- });
7138
+ var init_loader = () => {};
7139
7139
 
7140
7140
  // packages/utils/src/archive-entry-validator.ts
7141
7141
  var init_archive_entry_validator = () => {};
@@ -7160,9 +7160,7 @@ function sgBinaryName(platform = process.platform) {
7160
7160
  var init_sg_manifest = () => {};
7161
7161
 
7162
7162
  // packages/utils/src/ast-grep/sg-provisioner.ts
7163
- var init_sg_provisioner = __esm(() => {
7164
- init_sg_manifest();
7165
- });
7163
+ var init_sg_provisioner = () => {};
7166
7164
 
7167
7165
  // packages/utils/src/ast-grep/types.ts
7168
7166
  var SG_PATH_ENV_KEY = "OMO_AST_GREP_SG_PATH";
@@ -7421,6 +7419,7 @@ var init_env = __esm(() => {
7421
7419
  "CODEGRAPH_ALLOW_UNSAFE_NODE",
7422
7420
  "CODEGRAPH_BIN",
7423
7421
  "CODEGRAPH_FAKE_LOG",
7422
+ "CODEGRAPH_NO_DAEMON",
7424
7423
  "CODEGRAPH_NODE_BIN",
7425
7424
  "OMO_CODEGRAPH_BIN",
7426
7425
  "OMO_CODEGRAPH_PROJECT_CWD",
@@ -7432,9 +7431,7 @@ var init_env = __esm(() => {
7432
7431
  var init_workspace = () => {};
7433
7432
 
7434
7433
  // packages/utils/src/codegraph/guidance.ts
7435
- var init_guidance = __esm(() => {
7436
- init_workspace();
7437
- });
7434
+ var init_guidance = () => {};
7438
7435
 
7439
7436
  // packages/utils/src/codegraph/node-support.ts
7440
7437
  function evaluateCodegraphNodeSupport(options = {}) {
@@ -7457,18 +7454,17 @@ function parseNodeMajor(version) {
7457
7454
  }
7458
7455
  var CODEGRAPH_MIN_NODE_MAJOR = 20, CODEGRAPH_BLOCKED_NODE_MAJOR = 25, CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE", CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
7459
7456
 
7460
- // packages/utils/src/codegraph/manifest.ts
7461
- var init_manifest = () => {};
7462
-
7463
7457
  // packages/utils/src/codegraph/provision.ts
7464
7458
  import { execFile } from "child_process";
7465
7459
  import { promisify } from "util";
7466
7460
  var execFileAsync;
7467
7461
  var init_provision = __esm(() => {
7468
- init_manifest();
7469
7462
  execFileAsync = promisify(execFile);
7470
7463
  });
7471
7464
 
7465
+ // packages/utils/src/codegraph/process-sweep.ts
7466
+ var init_process_sweep = () => {};
7467
+
7472
7468
  // packages/utils/src/codegraph/resolve.ts
7473
7469
  import { existsSync as existsSync7 } from "fs";
7474
7470
  import { spawnSync } from "child_process";
@@ -7566,56 +7562,16 @@ var init_codegraph = __esm(() => {
7566
7562
  init_env();
7567
7563
  init_guidance();
7568
7564
  init_provision();
7565
+ init_process_sweep();
7569
7566
  init_resolve2();
7570
7567
  init_workspace();
7571
7568
  });
7572
7569
 
7573
- // packages/utils/src/command-executor/home-directory.ts
7574
- var init_home_directory = () => {};
7575
-
7576
- // packages/utils/src/command-executor/shell-path.ts
7577
- var init_shell_path = () => {};
7578
-
7579
- // packages/utils/src/command-executor/execute-hook-command.ts
7580
- var init_execute_hook_command = __esm(() => {
7581
- init_home_directory();
7582
- init_shell_path();
7583
- });
7584
-
7585
- // packages/utils/src/command-executor/execute-command.ts
7586
- import { exec } from "child_process";
7587
- import { promisify as promisify2 } from "util";
7588
- var execAsync;
7589
- var init_execute_command = __esm(() => {
7590
- execAsync = promisify2(exec);
7591
- });
7592
-
7593
- // packages/utils/src/command-executor/embedded-commands.ts
7594
- var init_embedded_commands = () => {};
7595
-
7596
- // packages/utils/src/command-executor/resolve-commands-in-text.ts
7597
- var init_resolve_commands_in_text = __esm(() => {
7598
- init_execute_command();
7599
- init_embedded_commands();
7600
- });
7601
-
7602
7570
  // packages/utils/src/command-executor.ts
7603
- var init_command_executor = __esm(() => {
7604
- init_execute_hook_command();
7605
- init_execute_command();
7606
- init_resolve_commands_in_text();
7607
- });
7608
- // packages/utils/src/git-worktree/parse-status-porcelain.ts
7609
- var init_parse_status_porcelain = () => {};
7610
- // packages/utils/src/git-worktree/collect-git-diff-stats.ts
7611
- var init_collect_git_diff_stats = __esm(() => {
7612
- init_parse_status_porcelain();
7613
- });
7571
+ var init_command_executor = () => {};
7572
+
7614
7573
  // packages/utils/src/git-worktree/index.ts
7615
- var init_git_worktree = __esm(() => {
7616
- init_parse_status_porcelain();
7617
- init_collect_git_diff_stats();
7618
- });
7574
+ var init_git_worktree = () => {};
7619
7575
 
7620
7576
  // packages/utils/src/internal-initiator-marker.ts
7621
7577
  function hasInternalInitiatorMarker(text) {
@@ -8036,12 +7992,9 @@ var init_config_migration = __esm(() => {
8036
7992
 
8037
7993
  // packages/utils/src/migration.ts
8038
7994
  var init_migration = __esm(() => {
8039
- init_agent_names();
8040
- init_hook_names();
8041
- init_model_versions();
8042
- init_agent_category();
8043
7995
  init_config_migration();
8044
7996
  });
7997
+
8045
7998
  // packages/utils/src/prompt-async-gate/route-resolver.ts
8046
7999
  function identityRoute(client) {
8047
8000
  return { client, route: "in-process", reason: "identity" };
@@ -9103,7 +9056,6 @@ var init_prompt_async_gate = __esm(() => {
9103
9056
  init_route_resolver();
9104
9057
  init_session_idle_settle();
9105
9058
  init_queue();
9106
- init_recent_dispatches();
9107
9059
  init_reservations();
9108
9060
  init_session_idle_dispatch();
9109
9061
  init_semantic_dedupe();
@@ -9136,39 +9088,8 @@ function isAmbiguousPostDispatchPromptFailure(result) {
9136
9088
  return result.dispatchAttempted === true && isAmbiguousPromptDispatchFailure(result.error);
9137
9089
  }
9138
9090
 
9139
- // packages/utils/src/zip-entry-listing/python-zip-entry-listing.ts
9140
- var init_python_zip_entry_listing = __esm(() => {
9141
- init_runtime();
9142
- });
9143
-
9144
- // packages/utils/src/zip-entry-listing/powershell-zip-entry-listing.ts
9145
- var init_powershell_zip_entry_listing = __esm(() => {
9146
- init_runtime();
9147
- });
9148
-
9149
- // packages/utils/src/zip-entry-listing/tar-zip-entry-listing.ts
9150
- var init_tar_zip_entry_listing = __esm(() => {
9151
- init_runtime();
9152
- });
9153
-
9154
- // packages/utils/src/zip-entry-listing/read-zip-symlink-target.ts
9155
- var init_read_zip_symlink_target = __esm(() => {
9156
- init_runtime();
9157
- });
9158
-
9159
- // packages/utils/src/zip-entry-listing/zipinfo-zip-entry-listing.ts
9160
- var init_zipinfo_zip_entry_listing = __esm(() => {
9161
- init_runtime();
9162
- init_read_zip_symlink_target();
9163
- });
9164
-
9165
9091
  // packages/utils/src/zip-entry-listing.ts
9166
- var init_zip_entry_listing = __esm(() => {
9167
- init_python_zip_entry_listing();
9168
- init_powershell_zip_entry_listing();
9169
- init_tar_zip_entry_listing();
9170
- init_zipinfo_zip_entry_listing();
9171
- });
9092
+ var init_zip_entry_listing = () => {};
9172
9093
 
9173
9094
  // packages/utils/src/index.ts
9174
9095
  var init_src = __esm(() => {
@@ -9816,10 +9737,7 @@ var init_model_capability_heuristics = __esm(() => {
9816
9737
  });
9817
9738
 
9818
9739
  // packages/model-core/src/model-capability-guardrails.ts
9819
- var init_model_capability_guardrails = __esm(() => {
9820
- init_model_capability_aliases();
9821
- init_model_requirements();
9822
- });
9740
+ var init_model_capability_guardrails = () => {};
9823
9741
 
9824
9742
  // packages/model-core/src/model-settings-compatibility.ts
9825
9743
  function downgradeWithinLadder(value, allowed, ladder) {
@@ -9954,6 +9872,7 @@ var init_model_settings_compatibility = __esm(() => {
9954
9872
  VARIANT_LADDER = ["low", "medium", "high", "xhigh", "max"];
9955
9873
  REASONING_LADDER = ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
9956
9874
  });
9875
+
9957
9876
  // packages/model-core/src/provider-model-id-transform.ts
9958
9877
  function inferSubProvider(model) {
9959
9878
  if (model.startsWith("claude-"))
@@ -10013,11 +9932,6 @@ var init_provider_model_id_transform = __esm(() => {
10013
9932
  GEMINI_3_FLASH_PREVIEW = /gemini-3-flash(?!-)/g;
10014
9933
  });
10015
9934
 
10016
- // packages/model-core/src/model-resolution-pipeline.ts
10017
- var init_model_resolution_pipeline = __esm(() => {
10018
- init_provider_model_id_transform();
10019
- });
10020
-
10021
9935
  // packages/model-core/src/known-variants.ts
10022
9936
  var KNOWN_VARIANTS;
10023
9937
  var init_known_variants = __esm(() => {
@@ -10034,9 +9948,6 @@ var init_known_variants = __esm(() => {
10034
9948
  ]);
10035
9949
  });
10036
9950
 
10037
- // packages/model-core/src/connected-providers-cache.ts
10038
- var init_connected_providers_cache = () => {};
10039
-
10040
9951
  // packages/model-core/src/model-resolver.ts
10041
9952
  function normalizeFallbackModels(models) {
10042
9953
  if (!models)
@@ -10045,11 +9956,8 @@ function normalizeFallbackModels(models) {
10045
9956
  return [models];
10046
9957
  return models;
10047
9958
  }
10048
- var init_model_resolver = __esm(() => {
10049
- init_model_resolution_pipeline();
10050
- init_known_variants();
10051
- init_connected_providers_cache();
10052
- });
9959
+ var init_model_resolver = () => {};
9960
+
10053
9961
  // packages/model-core/src/model-string-parser.ts
10054
9962
  var KNOWN_VARIANTS2;
10055
9963
  var init_model_string_parser = __esm(() => {
@@ -10065,16 +9973,13 @@ var init_model_string_parser = __esm(() => {
10065
9973
  "thinking"
10066
9974
  ]);
10067
9975
  });
9976
+
10068
9977
  // packages/model-core/src/fallback-chain-from-models.ts
10069
- var init_fallback_chain_from_models = __esm(() => {
10070
- init_model_resolver();
10071
- init_known_variants();
10072
- });
9978
+ var init_fallback_chain_from_models = () => {};
10073
9979
 
10074
9980
  // packages/model-core/src/model-error-classifier.ts
10075
9981
  var RETRYABLE_ERROR_NAMES, STOP_ERROR_NAMES, NON_RETRYABLE_ERROR_NAMES;
10076
9982
  var init_model_error_classifier = __esm(() => {
10077
- init_connected_providers_cache();
10078
9983
  RETRYABLE_ERROR_NAMES = new Set([
10079
9984
  "providermodelnotfounderror",
10080
9985
  "ratelimiterror",
@@ -10105,21 +10010,13 @@ var init_runtime_fallback_auto_retry_signal = () => {};
10105
10010
  var init_runtime_fallback_error_shape = () => {};
10106
10011
 
10107
10012
  // packages/model-core/src/runtime-fallback-error-classifier.ts
10108
- var init_runtime_fallback_error_classifier = __esm(() => {
10109
- init_runtime_fallback_auto_retry_signal();
10110
- init_runtime_fallback_error_shape();
10111
- init_runtime_fallback_error_shape();
10112
- });
10013
+ var init_runtime_fallback_error_classifier = () => {};
10113
10014
 
10114
10015
  // packages/model-core/src/provider-exhaustion-fallback-policy.ts
10115
- var init_provider_exhaustion_fallback_policy = __esm(() => {
10116
- init_runtime_fallback_error_classifier();
10117
- });
10016
+ var init_provider_exhaustion_fallback_policy = () => {};
10118
10017
 
10119
10018
  // packages/model-core/src/runtime-fallback-model.ts
10120
- var init_runtime_fallback_model = __esm(() => {
10121
- init_model_string_parser();
10122
- });
10019
+ var init_runtime_fallback_model = () => {};
10123
10020
 
10124
10021
  // packages/model-core/src/model-capabilities/supplemental-entries.ts
10125
10022
  var SUPPLEMENTAL_MODEL_CAPABILITIES;
@@ -10526,11 +10423,11 @@ async function fetchModelCapabilitiesSnapshot(args = {}) {
10526
10423
  };
10527
10424
  }
10528
10425
  var MODELS_DEV_SOURCE_URL = "https://models.dev/api.json";
10426
+
10529
10427
  // packages/model-core/src/index.ts
10530
10428
  var init_src2 = __esm(() => {
10531
10429
  init_model_resolver();
10532
10430
  init_provider_model_id_transform();
10533
- init_model_resolution_pipeline();
10534
10431
  init_model_requirements();
10535
10432
  init_model_family_detectors();
10536
10433
  init_model_capability_aliases();
@@ -10551,19 +10448,13 @@ var init_src2 = __esm(() => {
10551
10448
  });
10552
10449
 
10553
10450
  // packages/omo-opencode/src/shared/model-sanitizer.ts
10554
- var init_model_sanitizer = __esm(() => {
10555
- init_src2();
10556
- });
10451
+ var init_model_sanitizer = () => {};
10557
10452
 
10558
10453
  // packages/omo-opencode/src/shared/snake-case.ts
10559
- var init_snake_case2 = __esm(() => {
10560
- init_src();
10561
- });
10454
+ var init_snake_case2 = () => {};
10562
10455
 
10563
10456
  // packages/omo-opencode/src/shared/tool-name.ts
10564
- var init_tool_name2 = __esm(() => {
10565
- init_src();
10566
- });
10457
+ var init_tool_name2 = () => {};
10567
10458
 
10568
10459
  // packages/omo-opencode/src/shared/pattern-matcher.ts
10569
10460
  var regexCache;
@@ -10571,9 +10462,7 @@ var init_pattern_matcher = __esm(() => {
10571
10462
  regexCache = new Map;
10572
10463
  });
10573
10464
  // packages/omo-opencode/src/shared/deep-merge.ts
10574
- var init_deep_merge2 = __esm(() => {
10575
- init_src();
10576
- });
10465
+ var init_deep_merge2 = () => {};
10577
10466
 
10578
10467
  // packages/omo-opencode/src/shared/file-utils.ts
10579
10468
  var init_file_utils2 = __esm(() => {
@@ -10581,9 +10470,7 @@ var init_file_utils2 = __esm(() => {
10581
10470
  });
10582
10471
 
10583
10472
  // packages/omo-opencode/src/shared/context-limit-resolver.ts
10584
- var init_context_limit_resolver2 = __esm(() => {
10585
- init_src2();
10586
- });
10473
+ var init_context_limit_resolver2 = () => {};
10587
10474
 
10588
10475
  // packages/omo-opencode/src/shared/normalize-sdk-response.ts
10589
10476
  function normalizeSDKResponse(response, fallback, options) {
@@ -10974,9 +10861,7 @@ function isGpt5_5Model(model) {
10974
10861
  const modelName = extractModelName(model).toLowerCase();
10975
10862
  return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
10976
10863
  }
10977
- var init_types = __esm(() => {
10978
- init_src2();
10979
- });
10864
+ var init_types = () => {};
10980
10865
 
10981
10866
  // packages/omo-opencode/src/tools/delegate-task/openai-categories.ts
10982
10867
  function resolveDeepCategoryPromptAppend(model) {
@@ -11480,9 +11365,7 @@ var init_zip_extractor = __esm(() => {
11480
11365
  });
11481
11366
 
11482
11367
  // packages/omo-opencode/src/shared/bun-file-shim.ts
11483
- var init_bun_file_shim = __esm(() => {
11484
- init_runtime();
11485
- });
11368
+ var init_bun_file_shim = () => {};
11486
11369
 
11487
11370
  // packages/omo-opencode/src/shared/binary-downloader.ts
11488
11371
  import { chmodSync, existsSync as existsSync12, mkdirSync as mkdirSync4, unlinkSync as unlinkSync3 } from "fs";
@@ -11644,9 +11527,7 @@ function detectShellType() {
11644
11527
  }
11645
11528
  return process.platform === "win32" ? "cmd" : "unix";
11646
11529
  }
11647
- var init_shell_env = __esm(() => {
11648
- init_src();
11649
- });
11530
+ var init_shell_env = () => {};
11650
11531
 
11651
11532
  // packages/omo-opencode/src/shared/system-directive.ts
11652
11533
  var init_system_directive = () => {};
@@ -11737,8 +11618,8 @@ var init_json_file_cache_store = __esm(() => {
11737
11618
  });
11738
11619
 
11739
11620
  // packages/omo-opencode/src/shared/connected-providers-cache.ts
11740
- var exports_connected_providers_cache2 = {};
11741
- __export(exports_connected_providers_cache2, {
11621
+ var exports_connected_providers_cache = {};
11622
+ __export(exports_connected_providers_cache, {
11742
11623
  writeProviderModelsCache: () => writeProviderModelsCache,
11743
11624
  updateConnectedProvidersCache: () => updateConnectedProvidersCache,
11744
11625
  readProviderModelsCache: () => readProviderModelsCache,
@@ -11913,7 +11794,7 @@ function findProviderModelMetadata(providerID, modelID, cache = defaultConnected
11913
11794
  return;
11914
11795
  }
11915
11796
  var providerModelsCacheWrittenInCurrentProcess = false, CONNECTED_PROVIDERS_CACHE_FILE = "connected-providers.json", PROVIDER_MODELS_CACHE_FILE = "provider-models.json", defaultConnectedProvidersCacheStore, readConnectedProvidersCache, hasConnectedProvidersCache, readProviderModelsCache, hasProviderModelsCache, writeProviderModelsCache, updateConnectedProvidersCache, _resetMemCacheForTesting;
11916
- var init_connected_providers_cache2 = __esm(() => {
11797
+ var init_connected_providers_cache = __esm(() => {
11917
11798
  init_src();
11918
11799
  init_logger2();
11919
11800
  init_data_path();
@@ -11933,18 +11814,15 @@ var init_connected_providers_cache2 = __esm(() => {
11933
11814
  // packages/omo-opencode/src/shared/model-resolver.ts
11934
11815
  var init_model_resolver2 = __esm(() => {
11935
11816
  init_src2();
11936
- init_connected_providers_cache2();
11817
+ init_connected_providers_cache();
11937
11818
  });
11938
11819
 
11939
11820
  // packages/omo-opencode/src/shared/model-normalization.ts
11940
- var init_model_normalization = __esm(() => {
11941
- init_src2();
11942
- });
11821
+ var init_model_normalization = () => {};
11943
11822
 
11944
11823
  // packages/omo-opencode/src/shared/model-resolution-pipeline.ts
11945
- var init_model_resolution_pipeline2 = __esm(() => {
11946
- init_src2();
11947
- init_connected_providers_cache2();
11824
+ var init_model_resolution_pipeline = __esm(() => {
11825
+ init_connected_providers_cache();
11948
11826
  });
11949
11827
 
11950
11828
  // packages/omo-opencode/src/shared/model-availability.ts
@@ -11960,7 +11838,7 @@ function isModelCacheAvailable() {
11960
11838
  var init_model_availability = __esm(() => {
11961
11839
  init_logger2();
11962
11840
  init_data_path();
11963
- init_connected_providers_cache2();
11841
+ init_connected_providers_cache();
11964
11842
  });
11965
11843
 
11966
11844
  // packages/omo-opencode/src/generated/model-capabilities.generated.json
@@ -62060,12 +61938,12 @@ function getModelCapabilities2(input) {
62060
61938
  return getModelCapabilities({
62061
61939
  ...input,
62062
61940
  bundledSnapshot: input.bundledSnapshot ?? getBundledModelCapabilitiesSnapshotForRuntime(),
62063
- providerCache: input.providerCache ?? exports_connected_providers_cache2
61941
+ providerCache: input.providerCache ?? exports_connected_providers_cache
62064
61942
  });
62065
61943
  }
62066
61944
  var init_model_capabilities2 = __esm(() => {
62067
61945
  init_src2();
62068
- init_connected_providers_cache2();
61946
+ init_connected_providers_cache();
62069
61947
  init_model_capabilities_generated();
62070
61948
  });
62071
61949
 
@@ -62119,13 +61997,11 @@ var init_model_capabilities_cache = __esm(() => {
62119
61997
  });
62120
61998
 
62121
61999
  // packages/omo-opencode/src/shared/model-settings-compatibility.ts
62122
- var init_model_settings_compatibility2 = __esm(() => {
62123
- init_src2();
62124
- });
62000
+ var init_model_settings_compatibility2 = () => {};
62125
62001
 
62126
62002
  // packages/omo-opencode/src/shared/fallback-model-availability.ts
62127
62003
  var init_fallback_model_availability = __esm(() => {
62128
- init_connected_providers_cache2();
62004
+ init_connected_providers_cache();
62129
62005
  init_logger2();
62130
62006
  init_model_availability();
62131
62007
  });
@@ -62333,10 +62209,10 @@ var init_constants3 = __esm(() => {
62333
62209
  SESSION_TIMEOUT_MS = 60 * 60 * 1000;
62334
62210
  SESSION_MISSING_GRACE_MS = 30 * 1000;
62335
62211
  });
62212
+
62336
62213
  // packages/tmux-core/src/runner.ts
62337
- var init_runner = __esm(() => {
62338
- init_runtime();
62339
- });
62214
+ var init_runner = () => {};
62215
+
62340
62216
  // packages/tmux-core/src/tmux-utils/server-health.ts
62341
62217
  var SERVER_RUNNING_KEY;
62342
62218
  var init_server_health = __esm(() => {
@@ -62344,63 +62220,37 @@ var init_server_health = __esm(() => {
62344
62220
  });
62345
62221
 
62346
62222
  // packages/tmux-core/src/tmux-utils/pane-dimensions.ts
62347
- var init_pane_dimensions = __esm(() => {
62348
- init_runner();
62349
- });
62223
+ var init_pane_dimensions = () => {};
62350
62224
 
62351
62225
  // packages/tmux-core/src/tmux-utils/pane-command.ts
62352
- var init_pane_command = __esm(() => {
62353
- init_src();
62354
- });
62226
+ var init_pane_command = () => {};
62355
62227
 
62356
62228
  // packages/tmux-core/src/tmux-utils/pane-spawn.ts
62357
- var init_pane_spawn = __esm(() => {
62358
- init_server_health();
62359
- init_pane_command();
62360
- });
62229
+ var init_pane_spawn = () => {};
62230
+
62361
62231
  // packages/tmux-core/src/tmux-utils/pane-replace.ts
62362
- var init_pane_replace = __esm(() => {
62363
- init_pane_command();
62364
- });
62232
+ var init_pane_replace = () => {};
62365
62233
 
62366
62234
  // packages/tmux-core/src/tmux-utils/pane-activate.ts
62367
- var init_pane_activate = __esm(() => {
62368
- init_runner();
62369
- init_pane_command();
62370
- });
62235
+ var init_pane_activate = () => {};
62371
62236
 
62372
62237
  // packages/tmux-core/src/tmux-utils/window-spawn.ts
62373
- var init_window_spawn = __esm(() => {
62374
- init_server_health();
62375
- init_pane_command();
62376
- });
62238
+ var init_window_spawn = () => {};
62377
62239
 
62378
62240
  // packages/tmux-core/src/tmux-utils/session-spawn.ts
62379
- var init_session_spawn = __esm(() => {
62380
- init_server_health();
62381
- init_pane_command();
62382
- });
62241
+ var init_session_spawn = () => {};
62383
62242
 
62384
62243
  // packages/tmux-core/src/tmux-utils/session-kill.ts
62385
- var init_session_kill = __esm(() => {
62386
- init_runner();
62387
- });
62244
+ var init_session_kill = () => {};
62388
62245
 
62389
62246
  // packages/tmux-core/src/tmux-utils/stale-session-sweep.ts
62390
- var init_stale_session_sweep = __esm(() => {
62391
- init_runner();
62392
- init_session_kill();
62393
- });
62247
+ var init_stale_session_sweep = () => {};
62394
62248
 
62395
62249
  // packages/tmux-core/src/tmux-utils/layout.ts
62396
- var init_layout = __esm(() => {
62397
- init_runner();
62398
- });
62250
+ var init_layout = () => {};
62399
62251
 
62400
62252
  // packages/tmux-core/src/tmux-utils/spawn-process.ts
62401
- var init_spawn_process = __esm(() => {
62402
- init_runtime();
62403
- });
62253
+ var init_spawn_process = () => {};
62404
62254
 
62405
62255
  // packages/tmux-core/src/tmux-utils.ts
62406
62256
  var init_tmux_utils = __esm(() => {
@@ -62427,34 +62277,22 @@ var init_src3 = __esm(() => {
62427
62277
  });
62428
62278
 
62429
62279
  // packages/omo-opencode/src/shared/tmux/constants.ts
62430
- var init_constants4 = __esm(() => {
62431
- init_src3();
62432
- });
62280
+ var init_constants4 = () => {};
62433
62281
 
62434
62282
  // packages/omo-opencode/src/shared/tmux/cmux-detect.ts
62435
- var init_cmux_detect = __esm(() => {
62436
- init_src3();
62437
- });
62283
+ var init_cmux_detect = () => {};
62438
62284
 
62439
62285
  // packages/omo-opencode/src/shared/tmux/runner.ts
62440
- var init_runner2 = __esm(() => {
62441
- init_src3();
62442
- });
62286
+ var init_runner2 = () => {};
62443
62287
 
62444
62288
  // packages/omo-opencode/src/shared/tmux/tmux-utils/environment.ts
62445
- var init_environment = __esm(() => {
62446
- init_src3();
62447
- });
62289
+ var init_environment = () => {};
62448
62290
 
62449
62291
  // packages/omo-opencode/src/shared/tmux/tmux-utils/server-health.ts
62450
- var init_server_health2 = __esm(() => {
62451
- init_src3();
62452
- });
62292
+ var init_server_health2 = () => {};
62453
62293
 
62454
62294
  // packages/omo-opencode/src/shared/tmux/tmux-utils/pane-dimensions.ts
62455
- var init_pane_dimensions2 = __esm(() => {
62456
- init_src3();
62457
- });
62295
+ var init_pane_dimensions2 = () => {};
62458
62296
 
62459
62297
  // packages/omo-opencode/src/shared/bun-which-shim.ts
62460
62298
  var init_bun_which_shim = __esm(() => {
@@ -62479,61 +62317,46 @@ var init_adapter_deps = __esm(() => {
62479
62317
 
62480
62318
  // packages/omo-opencode/src/shared/tmux/tmux-utils/pane-spawn.ts
62481
62319
  var init_pane_spawn2 = __esm(() => {
62482
- init_src3();
62483
62320
  init_adapter_deps();
62484
62321
  });
62485
62322
 
62486
62323
  // packages/omo-opencode/src/shared/tmux/tmux-utils/pane-close.ts
62487
- var init_pane_close = __esm(() => {
62488
- init_src3();
62489
- });
62324
+ var init_pane_close = () => {};
62490
62325
 
62491
62326
  // packages/omo-opencode/src/shared/tmux/tmux-utils/pane-replace.ts
62492
62327
  var init_pane_replace2 = __esm(() => {
62493
- init_src3();
62494
62328
  init_adapter_deps();
62495
62329
  });
62496
62330
 
62497
62331
  // packages/omo-opencode/src/shared/tmux/tmux-utils/pane-activate.ts
62498
62332
  var init_pane_activate2 = __esm(() => {
62499
- init_src3();
62500
62333
  init_adapter_deps();
62501
62334
  });
62502
62335
 
62503
62336
  // packages/omo-opencode/src/shared/tmux/tmux-utils/window-spawn.ts
62504
62337
  var init_window_spawn2 = __esm(() => {
62505
- init_src3();
62506
62338
  init_adapter_deps();
62507
62339
  });
62508
62340
 
62509
62341
  // packages/omo-opencode/src/shared/tmux/tmux-utils/session-spawn.ts
62510
62342
  var init_session_spawn2 = __esm(() => {
62511
- init_src3();
62512
62343
  init_adapter_deps();
62513
62344
  });
62514
62345
 
62515
62346
  // packages/omo-opencode/src/shared/tmux/tmux-utils/session-kill.ts
62516
- var init_session_kill2 = __esm(() => {
62517
- init_src3();
62518
- });
62347
+ var init_session_kill2 = () => {};
62519
62348
 
62520
62349
  // packages/omo-opencode/src/shared/tmux/tmux-utils/stale-session-sweep.ts
62521
- var init_stale_session_sweep2 = __esm(() => {
62522
- init_src3();
62523
- });
62350
+ var init_stale_session_sweep2 = () => {};
62524
62351
 
62525
62352
  // packages/omo-opencode/src/shared/tmux/tmux-utils/stale-attach-pane-sweep.ts
62526
62353
  var init_stale_attach_pane_sweep = () => {};
62527
62354
 
62528
62355
  // packages/omo-opencode/src/shared/tmux/tmux-utils/pane-command.ts
62529
- var init_pane_command2 = __esm(() => {
62530
- init_src3();
62531
- });
62356
+ var init_pane_command2 = () => {};
62532
62357
 
62533
62358
  // packages/omo-opencode/src/shared/tmux/tmux-utils/layout.ts
62534
- var init_layout2 = __esm(() => {
62535
- init_src3();
62536
- });
62359
+ var init_layout2 = () => {};
62537
62360
 
62538
62361
  // packages/omo-opencode/src/shared/tmux/tmux-utils.ts
62539
62362
  var init_tmux_utils2 = __esm(() => {
@@ -64905,7 +64728,6 @@ var init_prompt_failure_classifier = () => {};
64905
64728
 
64906
64729
  // packages/omo-opencode/src/shared/model-suggestion-retry.ts
64907
64730
  var init_model_suggestion_retry = __esm(() => {
64908
- init_src2();
64909
64731
  init_logger2();
64910
64732
  init_prompt_async_gate2();
64911
64733
  init_prompt_failure_classifier();
@@ -64913,7 +64735,6 @@ var init_model_suggestion_retry = __esm(() => {
64913
64735
 
64914
64736
  // packages/omo-opencode/src/shared/opencode-provider-auth.ts
64915
64737
  var init_opencode_provider_auth = __esm(() => {
64916
- init_src();
64917
64738
  init_data_path();
64918
64739
  init_logger2();
64919
64740
  });
@@ -65044,9 +64865,7 @@ var init_logger3 = __esm(() => {
65044
64865
  });
65045
64866
 
65046
64867
  // packages/claude-code-compat-core/src/shared/contains-path.ts
65047
- var init_contains_path3 = __esm(() => {
65048
- init_src();
65049
- });
64868
+ var init_contains_path3 = () => {};
65050
64869
 
65051
64870
  // packages/claude-code-compat-core/src/features/claude-code-plugin-loader/scope-filter.ts
65052
64871
  var init_scope_filter = __esm(() => {
@@ -65108,19 +64927,13 @@ var init_discovery = __esm(() => {
65108
64927
  });
65109
64928
 
65110
64929
  // packages/claude-code-compat-core/src/shared/frontmatter.ts
65111
- var init_frontmatter3 = __esm(() => {
65112
- init_src();
65113
- });
64930
+ var init_frontmatter3 = () => {};
65114
64931
 
65115
64932
  // packages/claude-code-compat-core/src/shared/file-utils.ts
65116
- var init_file_utils3 = __esm(() => {
65117
- init_src();
65118
- });
64933
+ var init_file_utils3 = () => {};
65119
64934
 
65120
64935
  // packages/claude-code-compat-core/src/shared/model-sanitizer.ts
65121
- var init_model_sanitizer2 = __esm(() => {
65122
- init_src2();
65123
- });
64936
+ var init_model_sanitizer2 = () => {};
65124
64937
  // packages/claude-code-compat-core/src/features/claude-code-plugin-loader/command-loader.ts
65125
64938
  var init_command_loader = __esm(() => {
65126
64939
  init_frontmatter3();
@@ -65141,14 +64954,10 @@ var init_skill_loader = __esm(() => {
65141
64954
  init_logger3();
65142
64955
  });
65143
64956
  // packages/claude-code-compat-core/src/shared/model-format-normalizer.ts
65144
- var init_model_format_normalizer = __esm(() => {
65145
- init_src2();
65146
- });
64957
+ var init_model_format_normalizer = () => {};
65147
64958
 
65148
64959
  // packages/claude-code-compat-core/src/shared/model-normalization.ts
65149
- var init_model_normalization2 = __esm(() => {
65150
- init_src2();
65151
- });
64960
+ var init_model_normalization2 = () => {};
65152
64961
 
65153
64962
  // packages/claude-code-compat-core/src/features/claude-code-agent-loader/claude-model-mapper.ts
65154
64963
  var ANTHROPIC_PREFIX = "anthropic/", CLAUDE_CODE_ALIAS_MAP;
@@ -65178,7 +64987,6 @@ var init_configure_allowed_env_vars = __esm(() => {
65178
64987
 
65179
64988
  // packages/claude-code-compat-core/src/features/claude-code-mcp-loader/env-expander.ts
65180
64989
  var init_env_expander = __esm(() => {
65181
- init_src();
65182
64990
  init_logger3();
65183
64991
  init_configure_allowed_env_vars();
65184
64992
  });
@@ -65194,9 +65002,7 @@ var init_transformer = __esm(() => {
65194
65002
  });
65195
65003
 
65196
65004
  // packages/claude-code-compat-core/src/shared/bun-file-shim.ts
65197
- var init_bun_file_shim2 = __esm(() => {
65198
- init_runtime();
65199
- });
65005
+ var init_bun_file_shim2 = () => {};
65200
65006
 
65201
65007
  // packages/claude-code-compat-core/src/features/claude-code-plugin-loader/mcp-server-loader.ts
65202
65008
  var init_mcp_server_loader = __esm(() => {
@@ -65293,9 +65099,7 @@ var init_legacy_workspace_migration = __esm(() => {
65293
65099
  init_logger2();
65294
65100
  });
65295
65101
  // packages/omo-opencode/src/shared/model-string-parser.ts
65296
- var init_model_string_parser2 = __esm(() => {
65297
- init_src2();
65298
- });
65102
+ var init_model_string_parser2 = () => {};
65299
65103
 
65300
65104
  // packages/omo-opencode/src/shared/excluded-dirs.ts
65301
65105
  var EXCLUDED_DIR_NAMES, EXCLUDED_DIRS;
@@ -65320,15 +65124,13 @@ var init_excluded_dirs = __esm(() => {
65320
65124
  });
65321
65125
 
65322
65126
  // packages/omo-opencode/src/shared/replace-tool-args.ts
65323
- var init_replace_tool_args = __esm(() => {
65324
- init_src();
65325
- });
65127
+ var init_replace_tool_args = () => {};
65326
65128
 
65327
65129
  // packages/omo-opencode/src/shared/index.ts
65328
65130
  var init_shared = __esm(() => {
65329
65131
  init_model_normalization();
65330
65132
  init_model_resolver2();
65331
- init_model_resolution_pipeline2();
65133
+ init_model_resolution_pipeline();
65332
65134
  init_session_category_registry();
65333
65135
  init_model_string_parser2();
65334
65136
  init_excluded_dirs();
@@ -65369,7 +65171,7 @@ var init_shared = __esm(() => {
65369
65171
  init_model_capabilities_cache();
65370
65172
  init_model_settings_compatibility2();
65371
65173
  init_fallback_model_availability();
65372
- init_connected_providers_cache2();
65174
+ init_connected_providers_cache();
65373
65175
  init_context_limit_resolver2();
65374
65176
  init_session_utils();
65375
65177
  init_event_session_id();
@@ -72616,11 +72418,7 @@ var init_posthog_client = __esm(() => {
72616
72418
  });
72617
72419
 
72618
72420
  // packages/telemetry-core/src/record-daily-active.ts
72619
- var init_record_daily_active = __esm(() => {
72620
- init_activity_state();
72621
- init_posthog_client();
72622
- init_machine_id();
72623
- });
72421
+ var init_record_daily_active = () => {};
72624
72422
 
72625
72423
  // packages/telemetry-core/src/index.ts
72626
72424
  var init_src4 = __esm(() => {
@@ -72637,7 +72435,7 @@ var package_default2;
72637
72435
  var init_package2 = __esm(() => {
72638
72436
  package_default2 = {
72639
72437
  name: "@oh-my-opencode/omo-codex",
72640
- version: "4.15.1",
72438
+ version: "4.16.0",
72641
72439
  type: "module",
72642
72440
  private: true,
72643
72441
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -72984,7 +72782,7 @@ function stripJsonComments(json2) {
72984
72782
 
72985
72783
  // packages/omo-opencode/src/hooks/auto-update-checker/checker/local-dev-path.ts
72986
72784
  import * as fs6 from "fs";
72987
- import { fileURLToPath as fileURLToPath2 } from "url";
72785
+ import { fileURLToPath as fileURLToPath3 } from "url";
72988
72786
  function isLocalDevMode(directory) {
72989
72787
  return getLocalDevPath(directory) !== null;
72990
72788
  }
@@ -73002,7 +72800,7 @@ function getLocalDevPath(directory) {
73002
72800
  if (!ACCEPTED_PACKAGE_NAMES2.some((name) => entry.includes(name)))
73003
72801
  continue;
73004
72802
  try {
73005
- return fileURLToPath2(entry);
72803
+ return fileURLToPath3(entry);
73006
72804
  } catch (error51) {
73007
72805
  if (!(error51 instanceof Error)) {
73008
72806
  throw error51;
@@ -73127,7 +72925,7 @@ var init_plugin_entry = __esm(() => {
73127
72925
  // packages/omo-opencode/src/hooks/auto-update-checker/checker/cached-version.ts
73128
72926
  import * as fs10 from "fs";
73129
72927
  import * as path11 from "path";
73130
- import { fileURLToPath as fileURLToPath3 } from "url";
72928
+ import { fileURLToPath as fileURLToPath4 } from "url";
73131
72929
  function readPackageVersion(packageJsonPath) {
73132
72930
  const content = fs10.readFileSync(packageJsonPath, "utf-8");
73133
72931
  const pkg = JSON.parse(content);
@@ -73137,7 +72935,7 @@ function getCachedVersion(options = {}) {
73137
72935
  const packageJsonCandidates = options.packageJsonCandidates ?? INSTALLED_PACKAGE_JSON_CANDIDATES;
73138
72936
  const findPackageJson = options.findPackageJson ?? findPackageJsonUp;
73139
72937
  try {
73140
- const currentDir = options.currentDir === undefined ? path11.dirname(fileURLToPath3(import.meta.url)) : options.currentDir;
72938
+ const currentDir = options.currentDir === undefined ? path11.dirname(fileURLToPath4(import.meta.url)) : options.currentDir;
73141
72939
  if (currentDir) {
73142
72940
  const pkgPath = findPackageJson(currentDir);
73143
72941
  if (pkgPath) {
@@ -73606,20 +73404,20 @@ var init_update_toasts = __esm(() => {
73606
73404
  });
73607
73405
 
73608
73406
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
73609
- import { existsSync as existsSync48 } from "fs";
73610
- import { dirname as dirname26, join as join68 } from "path";
73611
- import { fileURLToPath as fileURLToPath4 } from "url";
73407
+ import { existsSync as existsSync49 } from "fs";
73408
+ import { dirname as dirname27, join as join69 } from "path";
73409
+ import { fileURLToPath as fileURLToPath5 } from "url";
73612
73410
  function defaultGetModuleHostingWorkspace() {
73613
73411
  try {
73614
- const currentDir = dirname26(fileURLToPath4(import.meta.url));
73412
+ const currentDir = dirname27(fileURLToPath5(import.meta.url));
73615
73413
  const pkgJsonPath = findPackageJsonUp(currentDir);
73616
73414
  if (!pkgJsonPath)
73617
73415
  return null;
73618
- const pkgDir = dirname26(pkgJsonPath);
73619
- const nodeModulesDir = dirname26(pkgDir);
73416
+ const pkgDir = dirname27(pkgJsonPath);
73417
+ const nodeModulesDir = dirname27(pkgDir);
73620
73418
  if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
73621
73419
  return null;
73622
- return dirname26(nodeModulesDir);
73420
+ return dirname27(nodeModulesDir);
73623
73421
  } catch (error51) {
73624
73422
  if (error51 instanceof Error) {
73625
73423
  return null;
@@ -73760,8 +73558,8 @@ var init_background_update_check = __esm(() => {
73760
73558
  init_package_json_locator();
73761
73559
  init_update_toasts();
73762
73560
  defaultDeps4 = {
73763
- existsSync: existsSync48,
73764
- join: join68,
73561
+ existsSync: existsSync49,
73562
+ join: join69,
73765
73563
  runBunInstallWithDetails,
73766
73564
  log: log2,
73767
73565
  getOpenCodeCacheDir,
@@ -73851,7 +73649,7 @@ async function updateAndShowConnectedProvidersCacheStatus(ctx) {
73851
73649
  }
73852
73650
  var CACHE_UPDATE_TIMEOUT_MS = 1e4;
73853
73651
  var init_connected_providers_status = __esm(() => {
73854
- init_connected_providers_cache2();
73652
+ init_connected_providers_cache();
73855
73653
  init_model_availability();
73856
73654
  init_logger2();
73857
73655
  });
@@ -73924,7 +73722,7 @@ async function showSpinnerToast(ctx, version3, message) {
73924
73722
  duration: frameInterval + 50
73925
73723
  }
73926
73724
  }).catch(ignoreToastError);
73927
- await new Promise((resolve19) => setTimeout(resolve19, frameInterval));
73725
+ await new Promise((resolve20) => setTimeout(resolve20, frameInterval));
73928
73726
  }
73929
73727
  }
73930
73728
  var SISYPHUS_SPINNER;
@@ -74110,6 +73908,9 @@ function formatConfigSummary(config) {
74110
73908
  if (config.hasCodex) {
74111
73909
  lines.push(` ${SYMBOLS.info} Codex autonomous mode: ${config.codexAutonomous ? "enabled" : "disabled"}`);
74112
73910
  }
73911
+ if (config.hasSenpi) {
73912
+ lines.push(` ${SYMBOLS.info} Senpi adapter: enabled`);
73913
+ }
74113
73914
  if (!config.hasOpenCode)
74114
73915
  return lines.join(`
74115
73916
  `);
@@ -74265,6 +74066,7 @@ function argsToConfig(args) {
74265
74066
  const platform = resolvePlatform(args);
74266
74067
  const hasOpenCode = platform === "opencode" || platform === "both";
74267
74068
  const hasCodex = platform === "codex" || platform === "both";
74069
+ const hasSenpi = platform === "senpi";
74268
74070
  return {
74269
74071
  platform,
74270
74072
  hasOpenCode,
@@ -74274,6 +74076,7 @@ function argsToConfig(args) {
74274
74076
  hasGemini: hasOpenCode && args.gemini === "yes",
74275
74077
  hasCopilot: hasOpenCode && args.copilot === "yes",
74276
74078
  hasCodex,
74079
+ hasSenpi,
74277
74080
  hasOpencodeZen: hasOpenCode && args.opencodeZen === "yes",
74278
74081
  hasZaiCodingPlan: hasOpenCode && args.zaiCodingPlan === "yes",
74279
74082
  hasKimiForCoding: hasOpenCode && args.kimiForCoding === "yes",
@@ -76546,9 +76349,14 @@ function readBooleanSetting(sectionText, key) {
76546
76349
  // packages/omo-codex/src/install/codex-config-toml.ts
76547
76350
  async function updateCodexConfig(input) {
76548
76351
  await mkdir5(dirname15(input.configPath), { recursive: true });
76549
- let config = "";
76550
- if (await exists(input.configPath))
76352
+ let config;
76353
+ try {
76551
76354
  config = await readFile11(input.configPath, "utf8");
76355
+ } catch (error) {
76356
+ if (!isMissingFileError(error))
76357
+ throw error;
76358
+ config = "";
76359
+ }
76552
76360
  const pluginSet = new Set(input.pluginNames);
76553
76361
  for (const legacyMarketplaceName of legacyMarketplaceNames(input.marketplaceName)) {
76554
76362
  config = removeMarketplaceBlock(config, legacyMarketplaceName);
@@ -76582,15 +76390,8 @@ async function updateCodexConfig(input) {
76582
76390
  await writeFileAtomic(input.configPath, `${config.trimEnd()}
76583
76391
  `);
76584
76392
  }
76585
- async function exists(path7) {
76586
- try {
76587
- await readFile11(path7, "utf8");
76588
- return true;
76589
- } catch (error) {
76590
- if (error instanceof Error)
76591
- return false;
76592
- return false;
76593
- }
76393
+ function isMissingFileError(error) {
76394
+ return error instanceof Error && "code" in error && error.code === "ENOENT";
76594
76395
  }
76595
76396
 
76596
76397
  // packages/omo-codex/src/install/codex-hook-trust.ts
@@ -76611,7 +76412,7 @@ var EVENT_LABELS = new Map([
76611
76412
  ]);
76612
76413
  async function trustedHookStatesForPlugin(input) {
76613
76414
  const manifestPath = join39(input.pluginRoot, ".codex-plugin", "plugin.json");
76614
- if (!await exists2(manifestPath))
76415
+ if (!await exists(manifestPath))
76615
76416
  return [];
76616
76417
  const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
76617
76418
  if (!isPlainRecord3(manifest))
@@ -76619,7 +76420,7 @@ async function trustedHookStatesForPlugin(input) {
76619
76420
  const states = [];
76620
76421
  for (const hookPath of hookManifestPaths2(manifest.hooks)) {
76621
76422
  const hooksPath = join39(input.pluginRoot, hookPath);
76622
- if (!await exists2(hooksPath))
76423
+ if (!await exists(hooksPath))
76623
76424
  continue;
76624
76425
  const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
76625
76426
  if (!isPlainRecord3(parsed) || !isPlainRecord3(parsed.hooks))
@@ -76702,7 +76503,7 @@ function canonicalJson(value) {
76702
76503
  function stripDotSlash2(value) {
76703
76504
  return value.startsWith("./") ? value.slice(2) : value;
76704
76505
  }
76705
- async function exists2(path7) {
76506
+ async function exists(path7) {
76706
76507
  try {
76707
76508
  await readFile12(path7, "utf8");
76708
76509
  return true;
@@ -76762,11 +76563,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
76762
76563
  ];
76763
76564
  async function purgeRetiredManagedAgentFiles(input) {
76764
76565
  const agentsDir = join40(input.codexHome, "agents");
76765
- if (!await exists3(agentsDir))
76566
+ if (!await exists2(agentsDir))
76766
76567
  return;
76767
76568
  for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
76768
76569
  const agentPath = join40(agentsDir, retiredAgent.fileName);
76769
- if (!await exists3(agentPath))
76570
+ if (!await exists2(agentPath))
76770
76571
  continue;
76771
76572
  const agentStat = await lstat7(agentPath);
76772
76573
  if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
@@ -76789,7 +76590,7 @@ async function readTextIfExists(path7) {
76789
76590
  throw error;
76790
76591
  }
76791
76592
  }
76792
- async function exists3(path7) {
76593
+ async function exists2(path7) {
76793
76594
  try {
76794
76595
  await lstat7(path7);
76795
76596
  return true;
@@ -76809,7 +76610,7 @@ function nodeErrorCode(error) {
76809
76610
  var MANIFEST_FILE = ".installed-agents.json";
76810
76611
  async function capturePreservedAgentReasoning(input) {
76811
76612
  const agentsDir = join41(input.codexHome, "agents");
76812
- if (!await exists4(agentsDir))
76613
+ if (!await exists3(agentsDir))
76813
76614
  return new Map;
76814
76615
  const preserved = new Map;
76815
76616
  const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
@@ -76827,7 +76628,7 @@ async function capturePreservedAgentReasoning(input) {
76827
76628
  }
76828
76629
  async function capturePreservedAgentServiceTier(input) {
76829
76630
  const agentsDir = join41(input.codexHome, "agents");
76830
- if (!await exists4(agentsDir))
76631
+ if (!await exists3(agentsDir))
76831
76632
  return new Map;
76832
76633
  const preserved = new Map;
76833
76634
  const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
@@ -76885,7 +76686,7 @@ async function restorePreservedServiceTier(input) {
76885
76686
  }
76886
76687
  async function discoverBundledAgents(pluginRoot) {
76887
76688
  const componentsRoot = join41(pluginRoot, "components");
76888
- if (!await exists4(componentsRoot))
76689
+ if (!await exists3(componentsRoot))
76889
76690
  return [];
76890
76691
  const componentEntries = await readdir6(componentsRoot, { withFileTypes: true });
76891
76692
  const agents = [];
@@ -76893,7 +76694,7 @@ async function discoverBundledAgents(pluginRoot) {
76893
76694
  if (!entry.isDirectory())
76894
76695
  continue;
76895
76696
  const agentsRoot = join41(componentsRoot, entry.name, "agents");
76896
- if (!await exists4(agentsRoot))
76697
+ if (!await exists3(agentsRoot))
76897
76698
  continue;
76898
76699
  const agentEntries = await readdir6(agentsRoot, { withFileTypes: true });
76899
76700
  for (const file2 of agentEntries) {
@@ -76910,7 +76711,7 @@ async function replaceWithCopy(linkPath, target) {
76910
76711
  await copyFile(target, linkPath);
76911
76712
  }
76912
76713
  async function prepareReplacement(linkPath) {
76913
- if (!await exists4(linkPath))
76714
+ if (!await exists3(linkPath))
76914
76715
  return;
76915
76716
  const entryStat = await lstat8(linkPath);
76916
76717
  if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
@@ -77029,7 +76830,7 @@ function parseJsonString(value) {
77029
76830
  return null;
77030
76831
  }
77031
76832
  }
77032
- async function exists4(path7) {
76833
+ async function exists3(path7) {
77033
76834
  try {
77034
76835
  await lstat8(path7);
77035
76836
  return true;
@@ -77471,7 +77272,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
77471
77272
  configPathsFromCwd.push(configPath);
77472
77273
  }
77473
77274
  }
77474
- if (await exists5(join45(current, ".git"))) {
77275
+ if (await exists4(join45(current, ".git"))) {
77475
77276
  return configPathsFromCwd.length === 0 ? null : {
77476
77277
  projectRoot: current,
77477
77278
  configPaths: [...configPathsFromCwd].reverse(),
@@ -77552,7 +77353,7 @@ async function maybeLstat(path7) {
77552
77353
  throw error;
77553
77354
  }
77554
77355
  }
77555
- async function exists5(path7) {
77356
+ async function exists4(path7) {
77556
77357
  return await maybeLstat(path7) !== null;
77557
77358
  }
77558
77359
  function nodeErrorCode3(error) {
@@ -77956,19 +77757,19 @@ async function detectCodexInstallation(input = {}) {
77956
77757
  const platform = input.platform ?? process.platform;
77957
77758
  const env3 = input.env ?? process.env;
77958
77759
  const homeDir = input.homeDir ?? homedir7();
77959
- const exists6 = input.exists ?? existsSync31;
77760
+ const exists5 = input.exists ?? existsSync31;
77960
77761
  const which2 = input.which ?? bunWhich;
77961
77762
  const checkedPaths = [CODEX_PATH_CHECK_LABEL];
77962
77763
  const cliPath = nonEmptyValue2(which2("codex"));
77963
77764
  if (cliPath !== undefined)
77964
77765
  return { found: true, source: "cli", path: cliPath };
77965
77766
  if (platform === "darwin") {
77966
- return detectMacCodexInstallation({ homeDir, exists: exists6, checkedPaths });
77767
+ return detectMacCodexInstallation({ homeDir, exists: exists5, checkedPaths });
77967
77768
  }
77968
77769
  if (platform === "win32") {
77969
77770
  return detectWindowsCodexInstallation({
77970
77771
  env: env3,
77971
- exists: exists6,
77772
+ exists: exists5,
77972
77773
  checkedPaths,
77973
77774
  runCommand: input.runCommand ?? defaultRunCommand2
77974
77775
  });
@@ -78301,7 +78102,7 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
78301
78102
  const childPath = join54(directory, entry.name);
78302
78103
  if (isManagedBootstrapOwnerName(entry.name)) {
78303
78104
  const bootstrapDir = join54(childPath, "bootstrap");
78304
- if (await exists6(bootstrapDir))
78105
+ if (await exists5(bootstrapDir))
78305
78106
  results.push(bootstrapDir);
78306
78107
  continue;
78307
78108
  }
@@ -78349,7 +78150,7 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78349
78150
  join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
78350
78151
  ];
78351
78152
  const versionRoot = join54(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78352
- if (await exists6(versionRoot)) {
78153
+ if (await exists5(versionRoot)) {
78353
78154
  const entries = await readdir9(versionRoot, { withFileTypes: true });
78354
78155
  for (const entry of entries) {
78355
78156
  if (entry.isDirectory())
@@ -78368,13 +78169,13 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78368
78169
  return [...paths].sort();
78369
78170
  }
78370
78171
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
78371
- if (!await exists6(configPath))
78172
+ if (!await exists5(configPath))
78372
78173
  return [];
78373
78174
  const config = await readFile20(configPath, "utf8");
78374
78175
  return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join54(codexHome, "agents", `${agentName}.toml`));
78375
78176
  }
78376
78177
  async function readInstalledAgentManifest(manifestPath) {
78377
- if (!await exists6(manifestPath))
78178
+ if (!await exists5(manifestPath))
78378
78179
  return [];
78379
78180
  const parsed = JSON.parse(await readFile20(manifestPath, "utf8"));
78380
78181
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
@@ -78413,7 +78214,7 @@ function isSafeManagedAgentPath(agentsDir, path7) {
78413
78214
  return false;
78414
78215
  return MANAGED_CODEX_AGENT_NAMES2.some((agentName) => fileName === `${agentName}.toml`);
78415
78216
  }
78416
- async function exists6(path7) {
78217
+ async function exists5(path7) {
78417
78218
  return await maybeLstat2(path7) !== null;
78418
78219
  }
78419
78220
  async function maybeLstat2(path7) {
@@ -78432,8 +78233,158 @@ function nodeErrorCode5(error) {
78432
78233
  }
78433
78234
  // packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
78434
78235
  var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
78435
- // packages/omo-opencode/src/cli/star-request.ts
78236
+ // packages/omo-senpi/src/install/install-senpi.ts
78436
78237
  import { execFile as execFile3 } from "child_process";
78238
+ import { constants as constants7, existsSync as existsSync32 } from "fs";
78239
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile21, rename as rename5, writeFile as writeFile11 } from "fs/promises";
78240
+ import { homedir as homedir9 } from "os";
78241
+ import { dirname as dirname20, join as join55, resolve as resolve18 } from "path";
78242
+ import { fileURLToPath } from "url";
78243
+ import { promisify as promisify2 } from "util";
78244
+ var execFileAsync2 = promisify2(execFile3);
78245
+ var REQUIRED_PLUGIN_ARTIFACTS = [
78246
+ join55("extensions", "omo.js"),
78247
+ join55("skills", "ultrawork", "SKILL.md"),
78248
+ join55("skills", "ulw-loop", "SKILL.md")
78249
+ ];
78250
+ async function runSenpiInstaller(options = {}) {
78251
+ const context = resolveInstallContext(options);
78252
+ await ensurePluginArtifacts(context);
78253
+ const settings = await readSettings(context.settingsPath);
78254
+ const before = JSON.stringify(settings);
78255
+ const packages = dedupePackages(readPackages(settings));
78256
+ if (!packages.includes(context.pluginPath))
78257
+ packages.push(context.pluginPath);
78258
+ settings.packages = packages;
78259
+ const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
78260
+ return {
78261
+ ok: true,
78262
+ action: "install",
78263
+ agentDir: context.agentDir,
78264
+ settingsPath: context.settingsPath,
78265
+ pluginPath: context.pluginPath,
78266
+ changed: JSON.stringify(settings) !== before,
78267
+ backupPath
78268
+ };
78269
+ }
78270
+ function resolveInstallContext(options) {
78271
+ const env3 = options.env ?? process.env;
78272
+ const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
78273
+ const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join55(homedir9(), ".senpi", "agent"));
78274
+ const pluginPath = resolve18(options.pluginPath ?? join55(repoRoot, "packages", "omo-senpi", "plugin"));
78275
+ return {
78276
+ env: env3,
78277
+ repoRoot,
78278
+ agentDir,
78279
+ settingsPath: join55(agentDir, "settings.json"),
78280
+ pluginPath,
78281
+ runCommand: options.runCommand ?? defaultRunCommand3
78282
+ };
78283
+ }
78284
+ async function ensurePluginArtifacts(context) {
78285
+ const missing = await hasMissingPluginArtifact(context.pluginPath);
78286
+ if (!missing)
78287
+ return;
78288
+ await context.runCommand("node", [join55(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78289
+ await context.runCommand("node", [join55(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
78290
+ }
78291
+ async function hasMissingPluginArtifact(pluginPath) {
78292
+ for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
78293
+ if (!await fileExists(join55(pluginPath, artifact)))
78294
+ return true;
78295
+ }
78296
+ return false;
78297
+ }
78298
+ async function defaultRunCommand3(command, args, options) {
78299
+ const result = await execFileAsync2(command, [...args], { cwd: options.cwd });
78300
+ if (result.stderr.trim().length > 0)
78301
+ process.stderr.write(result.stderr);
78302
+ if (result.stdout.trim().length > 0)
78303
+ process.stdout.write(result.stdout);
78304
+ }
78305
+ async function readSettings(settingsPath) {
78306
+ let raw;
78307
+ try {
78308
+ raw = await readFile21(settingsPath, "utf8");
78309
+ } catch (error) {
78310
+ if (isErrno(error, "ENOENT"))
78311
+ return {};
78312
+ throw error;
78313
+ }
78314
+ const parsed = JSON.parse(raw);
78315
+ if (!isPlainObject3(parsed))
78316
+ throw new Error(`${settingsPath} must contain a JSON object`);
78317
+ return parsed;
78318
+ }
78319
+ function readPackages(settings) {
78320
+ const packages = settings.packages;
78321
+ if (packages === undefined)
78322
+ return [];
78323
+ if (!Array.isArray(packages) || !packages.every((entry) => typeof entry === "string")) {
78324
+ throw new Error("Senpi settings packages must be an array of strings");
78325
+ }
78326
+ return packages;
78327
+ }
78328
+ function dedupePackages(packages) {
78329
+ return [...new Set(packages)];
78330
+ }
78331
+ async function writeSettingsAtomically(settingsPath, settings) {
78332
+ await mkdir9(dirname20(settingsPath), { recursive: true });
78333
+ const backupPath = await nextBackupPath(settingsPath);
78334
+ if (await fileExists(settingsPath)) {
78335
+ await copyFile3(settingsPath, backupPath);
78336
+ } else {
78337
+ await writeFile11(backupPath, `{}
78338
+ `, "utf8");
78339
+ }
78340
+ const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
78341
+ await writeFile11(tempPath, `${JSON.stringify(settings, null, 2)}
78342
+ `, "utf8");
78343
+ await rename5(tempPath, settingsPath);
78344
+ return backupPath;
78345
+ }
78346
+ async function nextBackupPath(settingsPath) {
78347
+ for (let index = 0;index < 1000; index += 1) {
78348
+ const suffix = index === 0 ? "" : `-${index}`;
78349
+ const candidate = `${settingsPath}.${timestampForBackup()}${suffix}.backup`;
78350
+ if (!await fileExists(candidate))
78351
+ return candidate;
78352
+ }
78353
+ throw new Error(`Unable to allocate backup path for ${settingsPath}`);
78354
+ }
78355
+ function timestampForBackup() {
78356
+ return new Date().toISOString().replace(/[-:.]/g, "");
78357
+ }
78358
+ function findRepoRoot2(importerDir) {
78359
+ let current = importerDir;
78360
+ for (let depth = 0;depth <= 7; depth += 1) {
78361
+ if (fileExistsSync(join55(current, "packages", "omo-senpi", "plugin", "package.json")))
78362
+ return current;
78363
+ current = resolve18(current, "..");
78364
+ }
78365
+ throw new Error("Unable to locate packages/omo-senpi/plugin/package.json from installer module");
78366
+ }
78367
+ function isPlainObject3(value) {
78368
+ return typeof value === "object" && value !== null && !Array.isArray(value);
78369
+ }
78370
+ async function fileExists(path7) {
78371
+ try {
78372
+ await access(path7, constants7.F_OK);
78373
+ return true;
78374
+ } catch (error) {
78375
+ if (isErrno(error, "ENOENT"))
78376
+ return false;
78377
+ throw error;
78378
+ }
78379
+ }
78380
+ function fileExistsSync(path7) {
78381
+ return existsSync32(path7);
78382
+ }
78383
+ function isErrno(error, code) {
78384
+ return error instanceof Error && "code" in error && error.code === code;
78385
+ }
78386
+ // packages/omo-opencode/src/cli/star-request.ts
78387
+ import { execFile as execFile4 } from "child_process";
78437
78388
  import { promisify as promisify3 } from "util";
78438
78389
  var STAR_REPOSITORIES = [
78439
78390
  "code-yeongyu/oh-my-openagent",
@@ -78442,11 +78393,12 @@ var STAR_REPOSITORIES = [
78442
78393
  var PLATFORM_REPOSITORIES = {
78443
78394
  opencode: ["code-yeongyu/oh-my-openagent"],
78444
78395
  codex: STAR_REPOSITORIES,
78445
- both: STAR_REPOSITORIES
78396
+ both: STAR_REPOSITORIES,
78397
+ senpi: STAR_REPOSITORIES
78446
78398
  };
78447
- var execFileAsync2 = promisify3(execFile3);
78399
+ var execFileAsync3 = promisify3(execFile4);
78448
78400
  async function runGitHubStarCommand(repository) {
78449
- await execFileAsync2("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
78401
+ await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
78450
78402
  }
78451
78403
  async function starGitHubRepositories(platform = "both", runCommand = runGitHubStarCommand) {
78452
78404
  const results = [];
@@ -78465,23 +78417,23 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
78465
78417
  init_provider_availability();
78466
78418
 
78467
78419
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
78468
- import { existsSync as existsSync33, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "fs";
78469
- import { join as join56 } from "path";
78420
+ import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "fs";
78421
+ import { join as join57 } from "path";
78470
78422
 
78471
78423
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
78472
78424
  init_shared();
78473
- import { existsSync as existsSync32, readFileSync as readFileSync15 } from "fs";
78474
- import { join as join55 } from "path";
78425
+ import { existsSync as existsSync33, readFileSync as readFileSync15 } from "fs";
78426
+ import { join as join56 } from "path";
78475
78427
  var TUI_SUBPATH = "tui";
78476
78428
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
78477
78429
  function fileEntryPackageJsonPath(entry) {
78478
78430
  let path7 = entry.slice("file:".length);
78479
78431
  if (path7.startsWith("//"))
78480
78432
  path7 = path7.slice(2);
78481
- return join55(path7, "package.json");
78433
+ return join56(path7, "package.json");
78482
78434
  }
78483
78435
  function packageJsonExportsTui(pkgJsonPath) {
78484
- if (!existsSync32(pkgJsonPath))
78436
+ if (!existsSync33(pkgJsonPath))
78485
78437
  return null;
78486
78438
  try {
78487
78439
  const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
@@ -78501,9 +78453,9 @@ function packageJsonExportsTui(pkgJsonPath) {
78501
78453
  }
78502
78454
  }
78503
78455
  function packageNameFromServerEntry(entry) {
78504
- if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`))
78456
+ if (typeof entry === "string" && (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)))
78505
78457
  return PLUGIN_NAME;
78506
- if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`))
78458
+ if (typeof entry === "string" && (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)))
78507
78459
  return LEGACY_PLUGIN_NAME;
78508
78460
  return null;
78509
78461
  }
@@ -78511,19 +78463,19 @@ function isPackagePluginEntry(entry) {
78511
78463
  return packageNameFromServerEntry(entry) !== null;
78512
78464
  }
78513
78465
  function packageExportsTuiForServerEntry(entry) {
78514
- if (entry.startsWith("file:"))
78466
+ if (typeof entry === "string" && entry.startsWith("file:"))
78515
78467
  return packageJsonExportsTui(fileEntryPackageJsonPath(entry));
78516
78468
  const packageName = packageNameFromServerEntry(entry);
78517
78469
  if (packageName === null)
78518
78470
  return null;
78519
- return packageJsonExportsTui(join55(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
78471
+ return packageJsonExportsTui(join56(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
78520
78472
  }
78521
78473
  function isOurFilePluginEntry(entry) {
78522
- if (!entry.startsWith("file:"))
78474
+ if (typeof entry !== "string" || !entry.startsWith("file:"))
78523
78475
  return false;
78524
78476
  try {
78525
78477
  const pkgJsonPath = fileEntryPackageJsonPath(entry);
78526
- if (!existsSync32(pkgJsonPath))
78478
+ if (!existsSync33(pkgJsonPath))
78527
78479
  return false;
78528
78480
  const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
78529
78481
  return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
@@ -78536,37 +78488,29 @@ function isOurFilePluginEntry(entry) {
78536
78488
  }
78537
78489
  }
78538
78490
  function isServerPluginEntry(entry) {
78539
- if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`))
78491
+ if (typeof entry === "string" && (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)))
78540
78492
  return true;
78541
- if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`))
78493
+ if (typeof entry === "string" && (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)))
78542
78494
  return true;
78543
- if (entry.startsWith("file:") && isOurFilePluginEntry(entry))
78495
+ if (typeof entry === "string" && entry.startsWith("file:") && isOurFilePluginEntry(entry))
78544
78496
  return true;
78545
78497
  return false;
78546
78498
  }
78547
78499
  function isTuiPluginEntry(entry) {
78548
- if (isPackagePluginEntry(entry))
78549
- return true;
78550
- if (entry.startsWith("file:") && isOurFilePluginEntry(entry))
78551
- return true;
78552
- return false;
78500
+ return typeof entry === "string" && (isPackagePluginEntry(entry) || entry.startsWith("file:") && isOurFilePluginEntry(entry));
78553
78501
  }
78554
78502
  function isNamedTuiPluginEntry(entry) {
78555
78503
  const canonicalPrefix = `${PLUGIN_NAME}/${TUI_SUBPATH}`;
78556
78504
  const legacyPrefix = `${LEGACY_PLUGIN_NAME}/${TUI_SUBPATH}`;
78557
- if (entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`))
78558
- return true;
78559
- if (entry === legacyPrefix || entry.startsWith(`${legacyPrefix}@`))
78560
- return true;
78561
- return false;
78505
+ return typeof entry === "string" && (entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`) || entry === legacyPrefix || entry.startsWith(`${legacyPrefix}@`));
78562
78506
  }
78563
78507
  function isCanonicalNamedTuiPluginEntry(entry) {
78564
78508
  const canonicalPrefix = `${PLUGIN_NAME}/${TUI_SUBPATH}`;
78565
- return entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`);
78509
+ return typeof entry === "string" && (entry === canonicalPrefix || entry.startsWith(`${canonicalPrefix}@`));
78566
78510
  }
78567
78511
  function detectServerPluginRegistration() {
78568
78512
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
78569
- const configPath = existsSync32(paths.configJsonc) ? paths.configJsonc : existsSync32(paths.configJson) ? paths.configJson : null;
78513
+ const configPath = existsSync33(paths.configJsonc) ? paths.configJsonc : existsSync33(paths.configJson) ? paths.configJson : null;
78570
78514
  if (!configPath) {
78571
78515
  return { registered: false, configPath: null, entry: null, packageExportsTui: null };
78572
78516
  }
@@ -78589,8 +78533,8 @@ function detectServerPluginRegistration() {
78589
78533
  }
78590
78534
  }
78591
78535
  function detectTuiPluginRegistration() {
78592
- const tuiJsonPath = join55(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
78593
- if (!existsSync32(tuiJsonPath)) {
78536
+ const tuiJsonPath = join56(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
78537
+ if (!existsSync33(tuiJsonPath)) {
78594
78538
  return {
78595
78539
  registered: false,
78596
78540
  configPath: tuiJsonPath,
@@ -78745,11 +78689,11 @@ function readConfig(path7) {
78745
78689
  return null;
78746
78690
  }
78747
78691
  function readServerConfig(configDir) {
78748
- const jsoncPath = join56(configDir, "opencode.jsonc");
78749
- if (existsSync33(jsoncPath))
78692
+ const jsoncPath = join57(configDir, "opencode.jsonc");
78693
+ if (existsSync34(jsoncPath))
78750
78694
  return readConfig(jsoncPath);
78751
- const jsonPath = join56(configDir, "opencode.json");
78752
- if (existsSync33(jsonPath))
78695
+ const jsonPath = join57(configDir, "opencode.json");
78696
+ if (existsSync34(jsonPath))
78753
78697
  return readConfig(jsonPath);
78754
78698
  return null;
78755
78699
  }
@@ -78769,7 +78713,7 @@ function desiredTuiEntry(serverEntry) {
78769
78713
  return null;
78770
78714
  }
78771
78715
  function readTuiConfig(tuiJsonPath) {
78772
- if (!existsSync33(tuiJsonPath)) {
78716
+ if (!existsSync34(tuiJsonPath)) {
78773
78717
  return { config: {}, malformed: false };
78774
78718
  }
78775
78719
  const config = readConfig(tuiJsonPath);
@@ -78790,7 +78734,7 @@ function ensureTuiPluginEntry(opts = {}) {
78790
78734
  if (!desiredEntry) {
78791
78735
  return { changed: false, reason: "no-server-entry" };
78792
78736
  }
78793
- const tuiJsonPath = join56(configDir, "tui.json");
78737
+ const tuiJsonPath = join57(configDir, "tui.json");
78794
78738
  const { config, malformed } = readTuiConfig(tuiJsonPath);
78795
78739
  if (malformed) {
78796
78740
  return { changed: false, reason: "malformed" };
@@ -78805,13 +78749,13 @@ function ensureTuiPluginEntry(opts = {}) {
78805
78749
  }
78806
78750
 
78807
78751
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
78808
- import { homedir as homedir9 } from "os";
78809
- import { join as join57 } from "path";
78752
+ import { homedir as homedir10 } from "os";
78753
+ import { join as join58 } from "path";
78810
78754
 
78811
78755
  // packages/shared-skills/index.mjs
78812
- import { fileURLToPath } from "url";
78756
+ import { fileURLToPath as fileURLToPath2 } from "url";
78813
78757
  function sharedSkillsRootPath() {
78814
- return fileURLToPath(new URL("./skills/", import.meta.url));
78758
+ return fileURLToPath2(new URL("./skills/", import.meta.url));
78815
78759
  }
78816
78760
 
78817
78761
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
@@ -78825,9 +78769,9 @@ function describeResult2(result) {
78825
78769
  }
78826
78770
  async function installAstGrepForOpenCode(options = {}) {
78827
78771
  const platform = options.platform ?? process.platform;
78828
- const baseDir = join57(options.homeDir ?? homedir9(), ".omo");
78772
+ const baseDir = join58(options.homeDir ?? homedir10(), ".omo");
78829
78773
  const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
78830
- const skillDir = join57(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
78774
+ const skillDir = join58(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
78831
78775
  const installer = options.installer ?? runAstGrepSkillInstall;
78832
78776
  try {
78833
78777
  const result = await installer({ platform, skillDir, targetDir });
@@ -78948,6 +78892,18 @@ async function runCliInstaller(args, version2) {
78948
78892
  }
78949
78893
  console.log();
78950
78894
  }
78895
+ if (config.hasSenpi) {
78896
+ printInfo("Installing Senpi harness adapter...");
78897
+ try {
78898
+ const senpiResult = await runSenpiInstaller();
78899
+ printSuccess(`Senpi adapter installed ${SYMBOLS.arrow} ${import_picocolors3.default.dim(senpiResult.settingsPath)}`);
78900
+ } catch (error) {
78901
+ const message = error instanceof Error ? error.message : String(error);
78902
+ printError(`Senpi install failed: ${message}`);
78903
+ return 1;
78904
+ }
78905
+ console.log();
78906
+ }
78951
78907
  printInfo("Anonymous telemetry is enabled by default. Disable it with OMO_SEND_ANONYMOUS_TELEMETRY=0 or OMO_DISABLE_POSTHOG=1.");
78952
78908
  printInfo("Docs: docs/legal/privacy-policy.md and docs/legal/terms-of-service.md");
78953
78909
  console.log();
@@ -79229,7 +79185,7 @@ var stringVisibleTrimSpacesRight = (string) => {
79229
79185
  }
79230
79186
  return words.slice(0, last).join(" ") + words.slice(last).join("");
79231
79187
  };
79232
- var exec2 = (string, columns, options = {}) => {
79188
+ var exec = (string, columns, options = {}) => {
79233
79189
  if (options.trim !== false && string.trim() === "") {
79234
79190
  return "";
79235
79191
  }
@@ -79339,7 +79295,7 @@ var exec2 = (string, columns, options = {}) => {
79339
79295
  };
79340
79296
  var CRLF_OR_LF = /\r?\n/;
79341
79297
  function wrapAnsi(string, columns, options) {
79342
- return String(string).normalize().split(CRLF_OR_LF).map((line) => exec2(line, columns, options)).join(`
79298
+ return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
79343
79299
  `);
79344
79300
  }
79345
79301
 
@@ -80313,6 +80269,21 @@ var import_picocolors4 = __toESM(require_picocolors(), 1);
80313
80269
 
80314
80270
  // packages/omo-opencode/src/cli/tui-install-prompts.ts
80315
80271
  init_model_fallback();
80272
+
80273
+ // packages/omo-opencode/src/cli/senpi-platform-flag.ts
80274
+ var SENPI_PLATFORM_ENV_FLAG = "OMO_ENABLE_SENPI_PLATFORM";
80275
+ function isSenpiPlatformEnabled(env3 = process.env) {
80276
+ const value = env3[SENPI_PLATFORM_ENV_FLAG]?.trim().toLowerCase();
80277
+ return value === "1" || value === "true";
80278
+ }
80279
+ function availableInstallPlatforms(env3 = process.env) {
80280
+ const platforms = ["opencode", "codex", "both"];
80281
+ if (isSenpiPlatformEnabled(env3))
80282
+ platforms.push("senpi");
80283
+ return platforms;
80284
+ }
80285
+
80286
+ // packages/omo-opencode/src/cli/tui-install-prompts.ts
80316
80287
  async function selectOrCancel(params) {
80317
80288
  if (!process.stdin.isTTY || !process.stdout.isTTY)
80318
80289
  return null;
@@ -80333,6 +80304,9 @@ async function promptInstallPlatform(initialValue = "opencode") {
80333
80304
  { value: "codex", label: "Codex", hint: "Install Codex harness adapter only" },
80334
80305
  { value: "both", label: "Both", hint: "Install OpenCode plugin and Codex adapter" }
80335
80306
  ];
80307
+ if (isSenpiPlatformEnabled()) {
80308
+ options.push({ value: "senpi", label: "Senpi", hint: "Install Senpi harness adapter only" });
80309
+ }
80336
80310
  return selectOrCancel({
80337
80311
  message: "Which platform do you want to install?",
80338
80312
  options,
@@ -80342,6 +80316,7 @@ async function promptInstallPlatform(initialValue = "opencode") {
80342
80316
  async function promptInstallConfig(detected, platform, codexAutonomousOverride) {
80343
80317
  const hasOpenCode = platform === "opencode" || platform === "both";
80344
80318
  const hasCodex = platform === "codex" || platform === "both";
80319
+ const hasSenpi = platform === "senpi";
80345
80320
  const codexAutonomous = await resolveCodexAutonomous(hasCodex, codexAutonomousOverride);
80346
80321
  if (codexAutonomous === null)
80347
80322
  return null;
@@ -80355,6 +80330,7 @@ async function promptInstallConfig(detected, platform, codexAutonomousOverride)
80355
80330
  hasGemini: false,
80356
80331
  hasCopilot: false,
80357
80332
  hasCodex,
80333
+ hasSenpi,
80358
80334
  hasOpencodeZen: false,
80359
80335
  hasZaiCodingPlan: false,
80360
80336
  hasKimiForCoding: false,
@@ -80497,6 +80473,7 @@ async function promptInstallConfig(detected, platform, codexAutonomousOverride)
80497
80473
  hasGemini: gemini === "yes",
80498
80474
  hasCopilot: copilot === "yes",
80499
80475
  hasCodex,
80476
+ hasSenpi,
80500
80477
  hasOpencodeZen: opencodeZen === "yes",
80501
80478
  hasZaiCodingPlan: zaiCodingPlan === "yes",
80502
80479
  hasKimiForCoding: kimiForCoding === "yes",
@@ -80626,6 +80603,19 @@ async function runTuiInstaller(args, version2) {
80626
80603
  R2.warn(`Codex install failed (OpenCode install remains successful): ${message}`);
80627
80604
  }
80628
80605
  }
80606
+ if (config.hasSenpi) {
80607
+ spinner.start("Installing Senpi harness adapter");
80608
+ try {
80609
+ const senpiResult = await runSenpiInstaller();
80610
+ spinner.stop(`Senpi adapter installed to ${import_picocolors4.default.cyan(senpiResult.settingsPath)}`);
80611
+ } catch (error) {
80612
+ const message = error instanceof Error ? error.message : String(error);
80613
+ spinner.stop(`Senpi install failed ${import_picocolors4.default.yellow("[!]")}`);
80614
+ R2.error(`Senpi install failed: ${message}`);
80615
+ fe(import_picocolors4.default.red("Installation failed."));
80616
+ return 1;
80617
+ }
80618
+ }
80629
80619
  R2.success(import_picocolors4.default.bold(isUpdate ? "Configuration updated!" : "Installation complete!"));
80630
80620
  if (config.hasOpenCode) {
80631
80621
  R2.message(`Run ${import_picocolors4.default.cyan("opencode")} to start!`);
@@ -80673,7 +80663,7 @@ async function runTuiInstaller(args, version2) {
80673
80663
 
80674
80664
  // packages/omo-opencode/src/cli/install.ts
80675
80665
  var VERSION = package_default.version;
80676
- async function install2(args) {
80666
+ async function install3(args) {
80677
80667
  return args.tui ? runTuiInstaller(args, VERSION) : runCliInstaller(args, VERSION);
80678
80668
  }
80679
80669
  // packages/omo-opencode/src/cli/cleanup.ts
@@ -81476,7 +81466,7 @@ async function processEvents(ctx, stream, state) {
81476
81466
  }
81477
81467
  // packages/omo-opencode/src/plugin-config/layered-config-loader.ts
81478
81468
  import * as fs5 from "fs";
81479
- import { homedir as homedir10 } from "os";
81469
+ import { homedir as homedir11 } from "os";
81480
81470
  import * as path7 from "path";
81481
81471
 
81482
81472
  // node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
@@ -82110,7 +82100,7 @@ __export(exports_util, {
82110
82100
  jsonStringifyReplacer: () => jsonStringifyReplacer,
82111
82101
  joinValues: () => joinValues,
82112
82102
  issue: () => issue,
82113
- isPlainObject: () => isPlainObject3,
82103
+ isPlainObject: () => isPlainObject4,
82114
82104
  isObject: () => isObject2,
82115
82105
  hexToUint8Array: () => hexToUint8Array,
82116
82106
  getSizableOrigin: () => getSizableOrigin,
@@ -82292,7 +82282,7 @@ var allowsEval = /* @__PURE__ */ cached(() => {
82292
82282
  return false;
82293
82283
  }
82294
82284
  });
82295
- function isPlainObject3(o) {
82285
+ function isPlainObject4(o) {
82296
82286
  if (isObject2(o) === false)
82297
82287
  return false;
82298
82288
  const ctor = o.constructor;
@@ -82309,7 +82299,7 @@ function isPlainObject3(o) {
82309
82299
  return true;
82310
82300
  }
82311
82301
  function shallowClone(o) {
82312
- if (isPlainObject3(o))
82302
+ if (isPlainObject4(o))
82313
82303
  return { ...o };
82314
82304
  if (Array.isArray(o))
82315
82305
  return [...o];
@@ -82513,7 +82503,7 @@ function omit(schema, mask) {
82513
82503
  return clone(schema, def);
82514
82504
  }
82515
82505
  function extend(schema, shape) {
82516
- if (!isPlainObject3(shape)) {
82506
+ if (!isPlainObject4(shape)) {
82517
82507
  throw new Error("Invalid input to extend: expected a plain object");
82518
82508
  }
82519
82509
  const checks = schema._zod.def.checks;
@@ -82536,7 +82526,7 @@ function extend(schema, shape) {
82536
82526
  return clone(schema, def);
82537
82527
  }
82538
82528
  function safeExtend(schema, shape) {
82539
- if (!isPlainObject3(shape)) {
82529
+ if (!isPlainObject4(shape)) {
82540
82530
  throw new Error("Invalid input to safeExtend: expected a plain object");
82541
82531
  }
82542
82532
  const def = mergeDefs(schema._zod.def, {
@@ -84879,7 +84869,7 @@ function mergeValues(a, b2) {
84879
84869
  if (a instanceof Date && b2 instanceof Date && +a === +b2) {
84880
84870
  return { valid: true, data: a };
84881
84871
  }
84882
- if (isPlainObject3(a) && isPlainObject3(b2)) {
84872
+ if (isPlainObject4(a) && isPlainObject4(b2)) {
84883
84873
  const bKeys = Object.keys(b2);
84884
84874
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
84885
84875
  const newObj = { ...a, ...b2 };
@@ -85065,7 +85055,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
85065
85055
  $ZodType.init(inst, def);
85066
85056
  inst._zod.parse = (payload, ctx) => {
85067
85057
  const input = payload.value;
85068
- if (!isPlainObject3(input)) {
85058
+ if (!isPlainObject4(input)) {
85069
85059
  payload.issues.push({
85070
85060
  expected: "record",
85071
85061
  code: "invalid_type",
@@ -96217,18 +96207,18 @@ var RuntimeFallbackConfigSchema = exports_external.object({
96217
96207
  });
96218
96208
 
96219
96209
  // packages/team-core/src/config.ts
96220
- var TeamModeConfigSchema = exports_external.object({
96221
- enabled: exports_external.boolean().default(false),
96222
- tmux_visualization: exports_external.boolean().default(false),
96223
- max_parallel_members: exports_external.number().int().min(1).max(8).default(4),
96224
- max_members: exports_external.number().int().min(1).max(8).default(8),
96225
- max_messages_per_run: exports_external.number().int().min(1).default(1e4),
96226
- max_wall_clock_minutes: exports_external.number().int().min(1).default(120),
96227
- max_member_turns: exports_external.number().int().min(1).default(500),
96228
- base_dir: exports_external.string().optional(),
96229
- message_payload_max_bytes: exports_external.number().int().min(1024).default(32768),
96230
- recipient_unread_max_bytes: exports_external.number().int().min(1024).default(262144),
96231
- mailbox_poll_interval_ms: exports_external.number().int().min(500).default(3000)
96210
+ var TeamModeConfigSchema = object({
96211
+ enabled: boolean2().default(false),
96212
+ tmux_visualization: boolean2().default(false),
96213
+ max_parallel_members: number2().int().min(1).max(8).default(4),
96214
+ max_members: number2().int().min(1).max(8).default(8),
96215
+ max_messages_per_run: number2().int().min(1).default(1e4),
96216
+ max_wall_clock_minutes: number2().int().min(1).default(120),
96217
+ max_member_turns: number2().int().min(1).default(500),
96218
+ base_dir: string2().optional(),
96219
+ message_payload_max_bytes: number2().int().min(1024).default(32768),
96220
+ recipient_unread_max_bytes: number2().int().min(1024).default(262144),
96221
+ mailbox_poll_interval_ms: number2().int().min(500).default(3000)
96232
96222
  });
96233
96223
  // packages/omo-opencode/src/config/schema/skills.ts
96234
96224
  var SkillSourceSchema = exports_external.union([
@@ -96635,7 +96625,7 @@ function loadConfigFromPath(configPath, _ctx) {
96635
96625
 
96636
96626
  // packages/omo-opencode/src/plugin-config/layered-config-loader.ts
96637
96627
  function resolveHomeDirectory() {
96638
- return process.env.HOME ?? process.env.USERPROFILE ?? homedir10();
96628
+ return process.env.HOME ?? process.env.USERPROFILE ?? homedir11();
96639
96629
  }
96640
96630
  function resolveConfigPathAfterLegacyMigration(detectedPath) {
96641
96631
  if (!path7.basename(detectedPath).startsWith(LEGACY_CONFIG_BASENAME)) {
@@ -96776,7 +96766,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
96776
96766
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
96777
96767
  init_bun_which_shim();
96778
96768
  init_spawn_with_windows_hide();
96779
- import { delimiter as delimiter2, dirname as dirname21, posix as posix4, win32 as win324 } from "path";
96769
+ import { delimiter as delimiter2, dirname as dirname22, posix as posix4, win32 as win324 } from "path";
96780
96770
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
96781
96771
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
96782
96772
  function getCommandCandidates(platform) {
@@ -96834,7 +96824,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
96834
96824
  return null;
96835
96825
  }
96836
96826
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
96837
- const preferredDir = dirname21(binaryPath);
96827
+ const preferredDir = dirname22(binaryPath);
96838
96828
  const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
96839
96829
  return [preferredDir, ...existing].join(delimiter2);
96840
96830
  }
@@ -96976,6 +96966,7 @@ var SESSION_CREATE_MAX_RETRIES = 3;
96976
96966
  var SESSION_CREATE_RETRY_DELAY_MS = 1000;
96977
96967
  async function resolveSession(options) {
96978
96968
  const { client: client3, sessionId, directory } = options;
96969
+ const retryDelayMs = options.retryDelayMs ?? SESSION_CREATE_RETRY_DELAY_MS;
96979
96970
  if (sessionId) {
96980
96971
  const res = await client3.session.get({
96981
96972
  path: { id: sessionId },
@@ -97000,9 +96991,9 @@ async function resolveSession(options) {
97000
96991
  console.error(import_picocolors12.default.yellow(`Session create attempt ${attempt}/${SESSION_CREATE_MAX_RETRIES} failed:`));
97001
96992
  console.error(import_picocolors12.default.dim(` Error: ${serializeError2(res.error)}`));
97002
96993
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
97003
- const delay2 = SESSION_CREATE_RETRY_DELAY_MS * attempt;
96994
+ const delay2 = retryDelayMs * attempt;
97004
96995
  console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
97005
- await new Promise((resolve18) => setTimeout(resolve18, delay2));
96996
+ await new Promise((resolve19) => setTimeout(resolve19, delay2));
97006
96997
  }
97007
96998
  continue;
97008
96999
  }
@@ -97011,9 +97002,9 @@ async function resolveSession(options) {
97011
97002
  }
97012
97003
  console.error(import_picocolors12.default.yellow(`Session create attempt ${attempt}/${SESSION_CREATE_MAX_RETRIES}: No session ID returned`));
97013
97004
  if (attempt < SESSION_CREATE_MAX_RETRIES) {
97014
- const delay2 = SESSION_CREATE_RETRY_DELAY_MS * attempt;
97005
+ const delay2 = retryDelayMs * attempt;
97015
97006
  console.log(import_picocolors12.default.dim(` Retrying in ${delay2}ms...`));
97016
- await new Promise((resolve18) => setTimeout(resolve18, delay2));
97007
+ await new Promise((resolve19) => setTimeout(resolve19, delay2));
97017
97008
  }
97018
97009
  }
97019
97010
  throw new Error("Failed to create session after all retries");
@@ -97226,7 +97217,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
97226
97217
  var NOTEPAD_DIR = "notepads";
97227
97218
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
97228
97219
  // packages/boulder-state/src/top-level-task.ts
97229
- import { existsSync as existsSync36, readFileSync as readFileSync18 } from "fs";
97220
+ import { existsSync as existsSync37, readFileSync as readFileSync18 } from "fs";
97230
97221
  var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
97231
97222
  var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
97232
97223
  var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
@@ -97249,7 +97240,7 @@ function buildTaskRef(section, taskLabel) {
97249
97240
  };
97250
97241
  }
97251
97242
  function readCurrentTopLevelTask(planPath) {
97252
- if (!existsSync36(planPath)) {
97243
+ if (!existsSync37(planPath)) {
97253
97244
  return null;
97254
97245
  }
97255
97246
  try {
@@ -97278,13 +97269,13 @@ function readCurrentTopLevelTask(planPath) {
97278
97269
  }
97279
97270
  }
97280
97271
  // packages/boulder-state/src/storage/path.ts
97281
- import { existsSync as existsSync37 } from "fs";
97282
- import { isAbsolute as isAbsolute11, join as join59, relative as relative8, resolve as resolve18 } from "path";
97272
+ import { existsSync as existsSync38 } from "fs";
97273
+ import { isAbsolute as isAbsolute11, join as join60, relative as relative8, resolve as resolve19 } from "path";
97283
97274
  function getBoulderFilePath(directory) {
97284
- return join59(directory, BOULDER_DIR, BOULDER_FILE);
97275
+ return join60(directory, BOULDER_DIR, BOULDER_FILE);
97285
97276
  }
97286
97277
  function resolveTrackedPath(baseDirectory, trackedPath) {
97287
- return isAbsolute11(trackedPath) ? resolve18(trackedPath) : resolve18(baseDirectory, trackedPath);
97278
+ return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
97288
97279
  }
97289
97280
  function resolveBoulderPlanPath(directory, state) {
97290
97281
  const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
@@ -97292,20 +97283,20 @@ function resolveBoulderPlanPath(directory, state) {
97292
97283
  if (!worktreePath) {
97293
97284
  return absolutePlanPath;
97294
97285
  }
97295
- const absoluteDirectory = resolve18(directory);
97286
+ const absoluteDirectory = resolve19(directory);
97296
97287
  const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
97297
97288
  if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
97298
97289
  return absolutePlanPath;
97299
97290
  }
97300
97291
  const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
97301
- const worktreePlanPath = resolve18(absoluteWorktreePath, relativePlanPath);
97302
- return existsSync37(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
97292
+ const worktreePlanPath = resolve19(absoluteWorktreePath, relativePlanPath);
97293
+ return existsSync38(worktreePlanPath) ? worktreePlanPath : absolutePlanPath;
97303
97294
  }
97304
97295
  function resolveBoulderPlanPathForWork(directory, work) {
97305
97296
  return resolveBoulderPlanPath(directory, work);
97306
97297
  }
97307
97298
  // packages/boulder-state/src/storage/plan-progress.ts
97308
- import { existsSync as existsSync38, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
97299
+ import { existsSync as existsSync39, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
97309
97300
  var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
97310
97301
  var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
97311
97302
  var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
@@ -97314,7 +97305,7 @@ var CHECKED_CHECKBOX_PATTERN = /^(\s*)[-*]\s*\[[xX]\]\s*(.+)$/;
97314
97305
  var TODO_TASK_PATTERN2 = /^\d+\.\s+/;
97315
97306
  var FINAL_WAVE_TASK_PATTERN2 = /^F\d+\.\s+/i;
97316
97307
  function getPlanProgress(planPath) {
97317
- if (!existsSync38(planPath)) {
97308
+ if (!existsSync39(planPath)) {
97318
97309
  return { total: 0, completed: 0, isComplete: false };
97319
97310
  }
97320
97311
  try {
@@ -97434,10 +97425,10 @@ function selectMirrorWork(state) {
97434
97425
  return sorted[0] ?? null;
97435
97426
  }
97436
97427
  // packages/boulder-state/src/storage/read-state.ts
97437
- import { existsSync as existsSync39, readFileSync as readFileSync20 } from "fs";
97428
+ import { existsSync as existsSync40, readFileSync as readFileSync20 } from "fs";
97438
97429
  function readBoulderState(directory) {
97439
97430
  const filePath = getBoulderFilePath(directory);
97440
- if (!existsSync39(filePath)) {
97431
+ if (!existsSync40(filePath)) {
97441
97432
  return null;
97442
97433
  }
97443
97434
  try {
@@ -97502,21 +97493,19 @@ function getBoulderWorks(state) {
97502
97493
  }
97503
97494
  return [buildWorkFromMirror(state)];
97504
97495
  }
97505
- // packages/omo-opencode/src/features/boulder-state/format-duration.ts
97506
- init_src();
97507
97496
  // packages/omo-opencode/src/features/claude-code-session-state/index.ts
97508
97497
  init_state();
97509
97498
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
97510
97499
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
97511
97500
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
97512
- import { existsSync as existsSync40, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
97513
- import { join as join60 } from "path";
97501
+ import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
97502
+ import { join as join61 } from "path";
97514
97503
  function getMarkerPath(directory, sessionID) {
97515
- return join60(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
97504
+ return join61(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
97516
97505
  }
97517
97506
  function readContinuationMarker(directory, sessionID) {
97518
97507
  const markerPath = getMarkerPath(directory, sessionID);
97519
- if (!existsSync40(markerPath))
97508
+ if (!existsSync41(markerPath))
97520
97509
  return null;
97521
97510
  try {
97522
97511
  const raw = readFileSync21(markerPath, "utf-8");
@@ -97585,7 +97574,7 @@ async function isSessionInBoulderLineage(input) {
97585
97574
  init_shared();
97586
97575
  init_compaction_marker();
97587
97576
  import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "fs";
97588
- import { join as join61 } from "path";
97577
+ import { join as join62 } from "path";
97589
97578
  var defaultSessionLastAgentDeps = {
97590
97579
  getMessageDir,
97591
97580
  isSqliteBackend,
@@ -97645,7 +97634,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
97645
97634
  try {
97646
97635
  const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
97647
97636
  try {
97648
- const content = readFileSync22(join61(messageDir, fileName), "utf-8");
97637
+ const content = readFileSync22(join62(messageDir, fileName), "utf-8");
97649
97638
  const parsed = JSON.parse(content);
97650
97639
  return {
97651
97640
  fileName,
@@ -97688,8 +97677,8 @@ init_agent_display_names();
97688
97677
 
97689
97678
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
97690
97679
  init_frontmatter2();
97691
- import { existsSync as existsSync41, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "fs";
97692
- import { dirname as dirname22, join as join62 } from "path";
97680
+ import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "fs";
97681
+ import { dirname as dirname23, join as join63 } from "path";
97693
97682
 
97694
97683
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
97695
97684
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -97698,11 +97687,11 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
97698
97687
 
97699
97688
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
97700
97689
  function getStateFilePath(directory, customPath) {
97701
- return customPath ? join62(directory, customPath) : join62(directory, DEFAULT_STATE_FILE);
97690
+ return customPath ? join63(directory, customPath) : join63(directory, DEFAULT_STATE_FILE);
97702
97691
  }
97703
97692
  function readState(directory, customPath) {
97704
97693
  const filePath = getStateFilePath(directory, customPath);
97705
- if (!existsSync41(filePath)) {
97694
+ if (!existsSync42(filePath)) {
97706
97695
  return null;
97707
97696
  }
97708
97697
  try {
@@ -97931,13 +97920,15 @@ async function pollForCompletion(ctx, eventState, abortController, options = {})
97931
97920
  const eventWatchdogMs = options.eventWatchdogMs ?? DEFAULT_EVENT_WATCHDOG_MS;
97932
97921
  const secondaryMeaningfulWorkTimeoutMs = options.secondaryMeaningfulWorkTimeoutMs ?? DEFAULT_SECONDARY_MEANINGFUL_WORK_TIMEOUT_MS;
97933
97922
  const requireMeaningfulWork = options.requireMeaningfulWork ?? false;
97923
+ const now = options.now ?? Date.now;
97924
+ const sleep = options.sleep ?? ((ms) => new Promise((resolve20) => setTimeout(resolve20, ms)));
97934
97925
  let consecutiveCompleteChecks = 0;
97935
97926
  let errorCycleCount = 0;
97936
97927
  let firstWorkTimestamp = null;
97937
97928
  let secondaryTimeoutChecked = false;
97938
- const pollStartTimestamp = Date.now();
97929
+ const pollStartTimestamp = now();
97939
97930
  while (!abortController.signal.aborted) {
97940
- await new Promise((resolve19) => setTimeout(resolve19, pollIntervalMs));
97931
+ await sleep(pollIntervalMs);
97941
97932
  if (abortController.signal.aborted) {
97942
97933
  return 130;
97943
97934
  }
@@ -97963,7 +97954,7 @@ Session ended with error: ${eventState.lastError}`));
97963
97954
  }
97964
97955
  let mainSessionStatus = null;
97965
97956
  if (eventState.lastEventTimestamp !== null) {
97966
- const timeSinceLastEvent = Date.now() - eventState.lastEventTimestamp;
97957
+ const timeSinceLastEvent = now() - eventState.lastEventTimestamp;
97967
97958
  if (timeSinceLastEvent > eventWatchdogMs) {
97968
97959
  console.log(import_picocolors15.default.yellow(`
97969
97960
  No events for ${Math.round(timeSinceLastEvent / 1000)}s, verifying session status...`));
@@ -97973,7 +97964,7 @@ Session ended with error: ${eventState.lastError}`));
97973
97964
  } else if (mainSessionStatus === "busy" || mainSessionStatus === "retry") {
97974
97965
  eventState.mainSessionIdle = false;
97975
97966
  }
97976
- eventState.lastEventTimestamp = Date.now();
97967
+ eventState.lastEventTimestamp = now();
97977
97968
  }
97978
97969
  }
97979
97970
  if (mainSessionStatus === null) {
@@ -97993,12 +97984,12 @@ Session ended with error: ${eventState.lastError}`));
97993
97984
  continue;
97994
97985
  }
97995
97986
  if (!eventState.hasReceivedMeaningfulWork) {
97996
- if (Date.now() - pollStartTimestamp < minStabilizationMs) {
97987
+ if (now() - pollStartTimestamp < minStabilizationMs) {
97997
97988
  consecutiveCompleteChecks = 0;
97998
97989
  continue;
97999
97990
  }
98000
97991
  if (requireMeaningfulWork) {
98001
- if (Date.now() - pollStartTimestamp <= secondaryMeaningfulWorkTimeoutMs) {
97992
+ if (now() - pollStartTimestamp <= secondaryMeaningfulWorkTimeoutMs) {
98002
97993
  consecutiveCompleteChecks = 0;
98003
97994
  continue;
98004
97995
  }
@@ -98012,7 +98003,7 @@ Session ended with error: ${eventState.lastError}`));
98012
98003
  Session never produced assistant output, tool activity, or reasoning after the prompt started.`));
98013
98004
  return 1;
98014
98005
  }
98015
- if (Date.now() - pollStartTimestamp > secondaryMeaningfulWorkTimeoutMs && !secondaryTimeoutChecked) {
98006
+ if (now() - pollStartTimestamp > secondaryMeaningfulWorkTimeoutMs && !secondaryTimeoutChecked) {
98016
98007
  secondaryTimeoutChecked = true;
98017
98008
  const hasActiveWork = await hasActiveSessionWork(ctx);
98018
98009
  if (hasActiveWork) {
@@ -98023,9 +98014,9 @@ Session never produced assistant output, tool activity, or reasoning after the p
98023
98014
  }
98024
98015
  } else {
98025
98016
  if (firstWorkTimestamp === null) {
98026
- firstWorkTimestamp = Date.now();
98017
+ firstWorkTimestamp = now();
98027
98018
  }
98028
- if (Date.now() - firstWorkTimestamp < minStabilizationMs) {
98019
+ if (now() - firstWorkTimestamp < minStabilizationMs) {
98029
98020
  consecutiveCompleteChecks = 0;
98030
98021
  continue;
98031
98022
  }
@@ -98095,7 +98086,7 @@ function createAbortError() {
98095
98086
  return error51;
98096
98087
  }
98097
98088
  function sleep(delayMs) {
98098
- return new Promise((resolve19) => setTimeout(resolve19, delayMs));
98089
+ return new Promise((resolve20) => setTimeout(resolve20, delayMs));
98099
98090
  }
98100
98091
  function hasPromptStartEvidence(eventState) {
98101
98092
  return eventState.mainSessionStarted || eventState.hasReceivedMeaningfulWork || eventState.messageCount > 0 || eventState.currentTool !== null;
@@ -98470,7 +98461,7 @@ var EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS = 2000;
98470
98461
  async function waitForEventProcessorShutdown(eventProcessor, timeoutMs = EVENT_PROCESSOR_SHUTDOWN_TIMEOUT_MS) {
98471
98462
  const completed = await Promise.race([
98472
98463
  eventProcessor.then(() => true),
98473
- new Promise((resolve19) => setTimeout(() => resolve19(false), timeoutMs))
98464
+ new Promise((resolve20) => setTimeout(() => resolve20(false), timeoutMs))
98474
98465
  ]);
98475
98466
  }
98476
98467
  async function run(options) {
@@ -98773,14 +98764,14 @@ async function getLocalVersion(options = {}) {
98773
98764
  }
98774
98765
  }
98775
98766
  // packages/omo-opencode/src/cli/doctor/checks/system.ts
98776
- import { existsSync as existsSync52, readFileSync as readFileSync33 } from "fs";
98767
+ import { existsSync as existsSync53, readFileSync as readFileSync33 } from "fs";
98777
98768
 
98778
98769
  // packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
98779
98770
  init_extract_semver();
98780
98771
  init_bun_which_shim();
98781
- import { existsSync as existsSync49, accessSync as accessSync4, constants as constants9 } from "fs";
98782
- import { homedir as homedir13 } from "os";
98783
- import { join as join69 } from "path";
98772
+ import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "fs";
98773
+ import { homedir as homedir14 } from "os";
98774
+ import { join as join70 } from "path";
98784
98775
 
98785
98776
  // packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
98786
98777
  init_spawn_with_windows_hide();
@@ -98819,8 +98810,8 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
98819
98810
  const stdoutPromise = readSpawnStream(proc.stdout);
98820
98811
  const stderrPromise = readSpawnStream(proc.stderr);
98821
98812
  let timer;
98822
- const timeoutPromise = new Promise((resolve19) => {
98823
- timer = setTimeout(() => resolve19("timeout"), timeoutMs);
98813
+ const timeoutPromise = new Promise((resolve20) => {
98814
+ timer = setTimeout(() => resolve20("timeout"), timeoutMs);
98824
98815
  });
98825
98816
  const processPromise = (async () => {
98826
98817
  await proc.exited;
@@ -98857,7 +98848,7 @@ async function spawnWithTimeout(command, options, timeoutMs = DEFAULT_SPAWN_TIME
98857
98848
  var WINDOWS_EXECUTABLE_EXTS = [".exe", ".cmd", ".bat", ".ps1"];
98858
98849
  function isExecutable2(path14) {
98859
98850
  try {
98860
- accessSync4(path14, constants9.X_OK);
98851
+ accessSync4(path14, constants10.X_OK);
98861
98852
  return true;
98862
98853
  } catch (error51) {
98863
98854
  if (error51 instanceof Error) {
@@ -98867,22 +98858,22 @@ function isExecutable2(path14) {
98867
98858
  }
98868
98859
  }
98869
98860
  function getDesktopAppPaths(platform) {
98870
- const home = homedir13();
98861
+ const home = homedir14();
98871
98862
  switch (platform) {
98872
98863
  case "darwin":
98873
98864
  return [
98874
98865
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
98875
- join69(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
98866
+ join70(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
98876
98867
  ];
98877
98868
  case "win32": {
98878
98869
  const programFiles = process.env.ProgramFiles;
98879
98870
  const localAppData = process.env.LOCALAPPDATA;
98880
98871
  const paths = [];
98881
98872
  if (programFiles) {
98882
- paths.push(join69(programFiles, "OpenCode", "OpenCode.exe"));
98873
+ paths.push(join70(programFiles, "OpenCode", "OpenCode.exe"));
98883
98874
  }
98884
98875
  if (localAppData) {
98885
- paths.push(join69(localAppData, "OpenCode", "OpenCode.exe"));
98876
+ paths.push(join70(localAppData, "OpenCode", "OpenCode.exe"));
98886
98877
  }
98887
98878
  return paths;
98888
98879
  }
@@ -98890,8 +98881,8 @@ function getDesktopAppPaths(platform) {
98890
98881
  return [
98891
98882
  "/usr/bin/opencode",
98892
98883
  "/usr/lib/opencode/opencode",
98893
- join69(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
98894
- join69(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
98884
+ join70(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
98885
+ join70(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
98895
98886
  ];
98896
98887
  default:
98897
98888
  return [];
@@ -98903,7 +98894,7 @@ function buildVersionCommand(binaryPath, platform) {
98903
98894
  }
98904
98895
  return [binaryPath, "--version"];
98905
98896
  }
98906
- function findDesktopBinary(platform = process.platform, checkExists = existsSync49) {
98897
+ function findDesktopBinary(platform = process.platform, checkExists = existsSync50) {
98907
98898
  for (const desktopPath of getDesktopAppPaths(platform)) {
98908
98899
  if (checkExists(desktopPath)) {
98909
98900
  return { binary: "opencode", path: desktopPath };
@@ -98911,7 +98902,7 @@ function findDesktopBinary(platform = process.platform, checkExists = existsSync
98911
98902
  }
98912
98903
  return null;
98913
98904
  }
98914
- async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync49) {
98905
+ async function findOpenCodeBinary(platform = process.platform, checkExists = existsSync50) {
98915
98906
  for (const binary of OPENCODE_BINARIES2) {
98916
98907
  const path14 = bunWhich(binary);
98917
98908
  if (path14 && checkExists(path14)) {
@@ -98923,7 +98914,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
98923
98914
  const candidates = getCommandCandidates2(platform);
98924
98915
  for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
98925
98916
  for (const command of candidates) {
98926
- const fullPath = join69(entry, command);
98917
+ const fullPath = join70(entry, command);
98927
98918
  if (checkExists(fullPath) && isExecutable2(fullPath)) {
98928
98919
  return { binary: command, path: fullPath };
98929
98920
  }
@@ -98969,12 +98960,12 @@ function compareVersions3(current, minimum) {
98969
98960
 
98970
98961
  // packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
98971
98962
  init_shared();
98972
- import { existsSync as existsSync50, readFileSync as readFileSync31 } from "fs";
98963
+ import { existsSync as existsSync51, readFileSync as readFileSync31 } from "fs";
98973
98964
  function detectConfigPath() {
98974
98965
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
98975
- if (existsSync50(paths.configJsonc))
98966
+ if (existsSync51(paths.configJsonc))
98976
98967
  return paths.configJsonc;
98977
- if (existsSync50(paths.configJson))
98968
+ if (existsSync51(paths.configJson))
98978
98969
  return paths.configJson;
98979
98970
  return null;
98980
98971
  }
@@ -99062,36 +99053,36 @@ init_file_utils2();
99062
99053
  init_checker();
99063
99054
  init_auto_update_checker();
99064
99055
  init_package_json_locator();
99065
- import { existsSync as existsSync51, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "fs";
99056
+ import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "fs";
99066
99057
  import { createRequire as createRequire2 } from "module";
99067
- import { homedir as homedir14 } from "os";
99068
- import { join as join70 } from "path";
99069
- import { fileURLToPath as fileURLToPath5 } from "url";
99058
+ import { homedir as homedir15 } from "os";
99059
+ import { join as join71 } from "path";
99060
+ import { fileURLToPath as fileURLToPath6 } from "url";
99070
99061
  init_shared();
99071
99062
  function getPlatformDefaultCacheDir(platform = process.platform) {
99072
99063
  if (platform === "darwin")
99073
- return join70(homedir14(), "Library", "Caches");
99064
+ return join71(homedir15(), "Library", "Caches");
99074
99065
  if (platform === "win32")
99075
- return process.env.LOCALAPPDATA ?? join70(homedir14(), "AppData", "Local");
99076
- return join70(homedir14(), ".cache");
99066
+ return process.env.LOCALAPPDATA ?? join71(homedir15(), "AppData", "Local");
99067
+ return join71(homedir15(), ".cache");
99077
99068
  }
99078
99069
  function resolveOpenCodeCacheDir() {
99079
99070
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
99080
99071
  if (xdgCacheHome)
99081
- return join70(xdgCacheHome, "opencode");
99072
+ return join71(xdgCacheHome, "opencode");
99082
99073
  const fromShared = getOpenCodeCacheDir();
99083
- const platformDefault = join70(getPlatformDefaultCacheDir(), "opencode");
99084
- if (existsSync51(fromShared) || !existsSync51(platformDefault))
99074
+ const platformDefault = join71(getPlatformDefaultCacheDir(), "opencode");
99075
+ if (existsSync52(fromShared) || !existsSync52(platformDefault))
99085
99076
  return fromShared;
99086
99077
  return platformDefault;
99087
99078
  }
99088
99079
  function resolveExistingDir(dirPath) {
99089
- if (!existsSync51(dirPath))
99080
+ if (!existsSync52(dirPath))
99090
99081
  return dirPath;
99091
99082
  return resolveSymlink(dirPath);
99092
99083
  }
99093
99084
  function readPackageJson(filePath) {
99094
- if (!existsSync51(filePath))
99085
+ if (!existsSync52(filePath))
99095
99086
  return null;
99096
99087
  try {
99097
99088
  const content = readFileSync32(filePath, "utf-8");
@@ -99112,26 +99103,26 @@ function normalizeVersion(value) {
99112
99103
  function createPackageCandidates(rootDir) {
99113
99104
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
99114
99105
  packageName,
99115
- installedPackagePath: join70(rootDir, "node_modules", packageName, "package.json")
99106
+ installedPackagePath: join71(rootDir, "node_modules", packageName, "package.json")
99116
99107
  }));
99117
99108
  }
99118
99109
  function createTaggedInstallCandidates(rootDir) {
99119
- const packagesDir = join70(rootDir, "packages");
99120
- if (!existsSync51(packagesDir))
99110
+ const packagesDir = join71(rootDir, "packages");
99111
+ if (!existsSync52(packagesDir))
99121
99112
  return [];
99122
99113
  const candidates = [];
99123
99114
  for (const entryName of readdirSync8(packagesDir).sort()) {
99124
99115
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
99125
99116
  if (packageName === undefined)
99126
99117
  continue;
99127
- const installDir = join70(packagesDir, entryName);
99118
+ const installDir = join71(packagesDir, entryName);
99128
99119
  candidates.push({
99129
99120
  cacheDir: installDir,
99130
- cachePackagePath: join70(installDir, "package.json"),
99121
+ cachePackagePath: join71(installDir, "package.json"),
99131
99122
  packageCandidates: [
99132
99123
  {
99133
99124
  packageName,
99134
- installedPackagePath: join70(installDir, "node_modules", packageName, "package.json")
99125
+ installedPackagePath: join71(installDir, "node_modules", packageName, "package.json")
99135
99126
  }
99136
99127
  ]
99137
99128
  });
@@ -99139,7 +99130,7 @@ function createTaggedInstallCandidates(rootDir) {
99139
99130
  return candidates;
99140
99131
  }
99141
99132
  function selectInstalledPackage(candidate) {
99142
- return candidate.packageCandidates.find((packageCandidate) => existsSync51(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
99133
+ return candidate.packageCandidates.find((packageCandidate) => existsSync52(packageCandidate.installedPackagePath)) ?? candidate.packageCandidates[0];
99143
99134
  }
99144
99135
  function getExpectedVersion(cachePackage, packageName) {
99145
99136
  return normalizeVersion(cachePackage?.dependencies?.[packageName]) ?? normalizeVersion(cachePackage?.dependencies?.[PACKAGE_NAME]);
@@ -99150,14 +99141,14 @@ function resolveInstalledPackageJsonPath() {
99150
99141
  for (const packageName of ACCEPTED_PACKAGE_NAMES) {
99151
99142
  try {
99152
99143
  const packageJsonPath = require2.resolve(`${packageName}/package.json`);
99153
- if (existsSync51(packageJsonPath)) {
99144
+ if (existsSync52(packageJsonPath)) {
99154
99145
  return { packageName, packageJsonPath };
99155
99146
  }
99156
99147
  } catch {
99157
99148
  continue;
99158
99149
  }
99159
99150
  }
99160
- const ownPackageJsonPath = findPackageJsonUp(fileURLToPath5(import.meta.url));
99151
+ const ownPackageJsonPath = findPackageJsonUp(fileURLToPath6(import.meta.url));
99161
99152
  if (ownPackageJsonPath) {
99162
99153
  return { packageName: PACKAGE_NAME, packageJsonPath: ownPackageJsonPath };
99163
99154
  }
@@ -99176,22 +99167,22 @@ function getLoadedPluginVersion() {
99176
99167
  const candidates = [
99177
99168
  {
99178
99169
  cacheDir: configDir,
99179
- cachePackagePath: join70(configDir, "package.json"),
99170
+ cachePackagePath: join71(configDir, "package.json"),
99180
99171
  packageCandidates: createPackageCandidates(configDir)
99181
99172
  },
99182
99173
  ...createTaggedInstallCandidates(configDir),
99183
99174
  {
99184
99175
  cacheDir,
99185
- cachePackagePath: join70(cacheDir, "package.json"),
99176
+ cachePackagePath: join71(cacheDir, "package.json"),
99186
99177
  packageCandidates: createPackageCandidates(cacheDir)
99187
99178
  },
99188
99179
  ...createTaggedInstallCandidates(cacheDir)
99189
99180
  ];
99190
- const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync51(packageCandidate.installedPackagePath))) ?? candidates[0];
99181
+ const selectedCandidate = candidates.find((candidate) => candidate.packageCandidates.some((packageCandidate) => existsSync52(packageCandidate.installedPackagePath))) ?? candidates[0];
99191
99182
  const { cacheDir: selectedDir, cachePackagePath } = selectedCandidate;
99192
99183
  const selectedPackage = selectInstalledPackage(selectedCandidate);
99193
99184
  const candidateInstalledPath = selectedPackage.installedPackagePath;
99194
- const candidateExists = existsSync51(candidateInstalledPath);
99185
+ const candidateExists = existsSync52(candidateInstalledPath);
99195
99186
  const resolvedFallback = candidateExists ? null : resolveInstalledPackageJsonPath();
99196
99187
  const installedPackagePath = resolvedFallback?.packageJsonPath ?? candidateInstalledPath;
99197
99188
  const resolvedPackageName = resolvedFallback?.packageName ?? selectedPackage.packageName;
@@ -99227,7 +99218,7 @@ var defaultDeps6 = {
99227
99218
  getLoadedPluginVersion,
99228
99219
  getLatestPluginVersion,
99229
99220
  getSuggestedInstallTag,
99230
- configExists: existsSync52,
99221
+ configExists: existsSync53,
99231
99222
  readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
99232
99223
  parseConfigContent: (content) => parseJsonc(content)
99233
99224
  };
@@ -99374,12 +99365,12 @@ async function checkSystem(deps = defaultDeps6) {
99374
99365
  // packages/omo-opencode/src/config/validate.ts
99375
99366
  init_src();
99376
99367
  import { readFileSync as readFileSync34 } from "fs";
99377
- import { homedir as homedir15 } from "os";
99378
- import { dirname as dirname27, relative as relative9 } from "path";
99368
+ import { homedir as homedir16 } from "os";
99369
+ import { dirname as dirname28, relative as relative9 } from "path";
99379
99370
  init_shared();
99380
99371
  init_plugin_identity();
99381
99372
  function resolveHomeDirectory2() {
99382
- return process.env.HOME ?? process.env.USERPROFILE ?? homedir15();
99373
+ return process.env.HOME ?? process.env.USERPROFILE ?? homedir16();
99383
99374
  }
99384
99375
  function discoverConfigInDirectory(configDir) {
99385
99376
  const detected = detectPluginConfigFile(configDir, {
@@ -99399,7 +99390,7 @@ function discoverProjectLayersNearestFirst(directory) {
99399
99390
  const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
99400
99391
  return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
99401
99392
  path: configPath,
99402
- configDir: dirname27(configPath)
99393
+ configDir: dirname28(configPath)
99403
99394
  }));
99404
99395
  }
99405
99396
  function shortPath(configPath) {
@@ -99423,7 +99414,7 @@ function parseLayerConfig(configPath) {
99423
99414
  if (!isPlainRecord(rawConfig)) {
99424
99415
  return {
99425
99416
  path: configPath,
99426
- configDir: dirname27(configPath),
99417
+ configDir: dirname28(configPath),
99427
99418
  config: null,
99428
99419
  messages: [`${shortPath(configPath)}: <root>: Expected object`]
99429
99420
  };
@@ -99431,7 +99422,7 @@ function parseLayerConfig(configPath) {
99431
99422
  const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
99432
99423
  return {
99433
99424
  path: configPath,
99434
- configDir: dirname27(configPath),
99425
+ configDir: dirname28(configPath),
99435
99426
  config: result.success ? result.data : parseConfigPartially(rawConfig),
99436
99427
  messages: schemaMessages(configPath, rawConfig)
99437
99428
  };
@@ -99441,7 +99432,7 @@ function parseLayerConfig(configPath) {
99441
99432
  }
99442
99433
  return {
99443
99434
  path: configPath,
99444
- configDir: dirname27(configPath),
99435
+ configDir: dirname28(configPath),
99445
99436
  config: null,
99446
99437
  messages: [`${shortPath(configPath)}: ${error51.message}`]
99447
99438
  };
@@ -99487,23 +99478,23 @@ function validatePluginConfig(directory) {
99487
99478
 
99488
99479
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
99489
99480
  init_shared();
99490
- import { existsSync as existsSync53, readFileSync as readFileSync35 } from "fs";
99491
- import { homedir as homedir16 } from "os";
99492
- import { join as join71 } from "path";
99481
+ import { existsSync as existsSync54, readFileSync as readFileSync35 } from "fs";
99482
+ import { homedir as homedir17 } from "os";
99483
+ import { join as join72 } from "path";
99493
99484
  function getUserConfigDir2() {
99494
99485
  const xdgConfig = process.env.XDG_CONFIG_HOME;
99495
99486
  if (xdgConfig)
99496
- return join71(xdgConfig, "opencode");
99497
- return join71(homedir16(), ".config", "opencode");
99487
+ return join72(xdgConfig, "opencode");
99488
+ return join72(homedir17(), ".config", "opencode");
99498
99489
  }
99499
99490
  function loadCustomProviderNames() {
99500
99491
  const configDir = getUserConfigDir2();
99501
99492
  const candidatePaths = [
99502
- join71(configDir, "opencode.json"),
99503
- join71(configDir, "opencode.jsonc")
99493
+ join72(configDir, "opencode.json"),
99494
+ join72(configDir, "opencode.jsonc")
99504
99495
  ];
99505
99496
  for (const configPath of candidatePaths) {
99506
- if (!existsSync53(configPath))
99497
+ if (!existsSync54(configPath))
99507
99498
  continue;
99508
99499
  try {
99509
99500
  const content = readFileSync35(configPath, "utf-8");
@@ -99521,9 +99512,9 @@ function loadCustomProviderNames() {
99521
99512
  return [];
99522
99513
  }
99523
99514
  function loadAvailableModelsFromCache() {
99524
- const cacheFile = join71(getOpenCodeCacheDir(), "models.json");
99515
+ const cacheFile = join72(getOpenCodeCacheDir(), "models.json");
99525
99516
  const customProviders = loadCustomProviderNames();
99526
- if (!existsSync53(cacheFile)) {
99517
+ if (!existsSync54(cacheFile)) {
99527
99518
  if (customProviders.length > 0) {
99528
99519
  return { providers: customProviders, modelCount: 0, cacheExists: true };
99529
99520
  }
@@ -99558,8 +99549,8 @@ init_model_capabilities2();
99558
99549
  init_shared();
99559
99550
  init_plugin_identity();
99560
99551
  import { readFileSync as readFileSync36 } from "fs";
99561
- import { join as join72 } from "path";
99562
- var PROJECT_CONFIG_DIR = join72(process.cwd(), ".opencode");
99552
+ import { join as join73 } from "path";
99553
+ var PROJECT_CONFIG_DIR = join73(process.cwd(), ".opencode");
99563
99554
  function loadOmoConfig() {
99564
99555
  const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
99565
99556
  basenames: [CONFIG_BASENAME],
@@ -99597,7 +99588,7 @@ function loadOmoConfig() {
99597
99588
 
99598
99589
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
99599
99590
  init_shared();
99600
- import { join as join73 } from "path";
99591
+ import { join as join74 } from "path";
99601
99592
 
99602
99593
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
99603
99594
  function formatModelWithVariant(model, variant) {
@@ -99639,7 +99630,7 @@ function formatCapabilityResolutionLabel(mode) {
99639
99630
  }
99640
99631
  function buildModelResolutionDetails(options) {
99641
99632
  const details = [];
99642
- const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
99633
+ const cacheFile = join74(getOpenCodeCacheDir(), "models.json");
99643
99634
  details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
99644
99635
  details.push("");
99645
99636
  if (options.available.cacheExists) {
@@ -99915,28 +99906,28 @@ async function checkConfig() {
99915
99906
 
99916
99907
  // packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
99917
99908
  init_src();
99918
- import { existsSync as existsSync54 } from "fs";
99909
+ import { existsSync as existsSync55 } from "fs";
99919
99910
  import { createRequire as createRequire3 } from "module";
99920
- import { homedir as homedir18 } from "os";
99921
- import { dirname as dirname28, join as join75 } from "path";
99911
+ import { homedir as homedir19 } from "os";
99912
+ import { dirname as dirname29, join as join76 } from "path";
99922
99913
 
99923
99914
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
99924
- import { join as join74 } from "path";
99925
- import { homedir as homedir17, tmpdir as tmpdir3 } from "os";
99915
+ import { join as join75 } from "path";
99916
+ import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
99926
99917
  init_binary_downloader();
99927
99918
  init_logger2();
99928
99919
  init_plugin_identity();
99929
99920
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
99930
- var DEBUG_FILE = join74(tmpdir3(), "comment-checker-debug.log");
99921
+ var DEBUG_FILE = join75(tmpdir3(), "comment-checker-debug.log");
99931
99922
  function getCacheDir2() {
99932
99923
  if (process.platform === "win32") {
99933
99924
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
99934
- const base2 = localAppData || join74(homedir17(), "AppData", "Local");
99935
- return join74(base2, CACHE_DIR_NAME, "bin");
99925
+ const base2 = localAppData || join75(homedir18(), "AppData", "Local");
99926
+ return join75(base2, CACHE_DIR_NAME, "bin");
99936
99927
  }
99937
99928
  const xdgCache = process.env.XDG_CACHE_HOME;
99938
- const base = xdgCache || join74(homedir17(), ".cache");
99939
- return join74(base, CACHE_DIR_NAME, "bin");
99929
+ const base = xdgCache || join75(homedir18(), ".cache");
99930
+ return join75(base, CACHE_DIR_NAME, "bin");
99940
99931
  }
99941
99932
  function getBinaryName() {
99942
99933
  return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -99986,7 +99977,7 @@ async function getBinaryVersion(binary) {
99986
99977
  }
99987
99978
  }
99988
99979
  async function checkAstGrepCli() {
99989
- const runtimeDir = astGrepRuntimeDir(join75(homedir18(), ".omo"));
99980
+ const runtimeDir = astGrepRuntimeDir(join76(homedir19(), ".omo"));
99990
99981
  const sgPath = findSgBinarySync({ runtimeDir });
99991
99982
  if (sgPath === null) {
99992
99983
  return {
@@ -100015,12 +100006,12 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
100015
100006
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
100016
100007
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
100017
100008
  try {
100018
- const packageDir = baseDirOverride ?? dirname28(resolvePackageJsonPath());
100019
- const vendorPath = join75(packageDir, "vendor", platformKey, binaryName);
100020
- if (existsSync54(vendorPath))
100009
+ const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
100010
+ const vendorPath = join76(packageDir, "vendor", platformKey, binaryName);
100011
+ if (existsSync55(vendorPath))
100021
100012
  return vendorPath;
100022
- const binPath = join75(packageDir, "bin", binaryName);
100023
- if (existsSync54(binPath))
100013
+ const binPath = join76(packageDir, "bin", binaryName);
100014
+ if (existsSync55(binPath))
100024
100015
  return binPath;
100025
100016
  } catch (error51) {
100026
100017
  if (!(error51 instanceof Error) && !isModuleResolutionFailure(error51))
@@ -100165,12 +100156,12 @@ async function getGhCliInfo(dependencies = {}) {
100165
100156
 
100166
100157
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
100167
100158
  import { readFileSync as readFileSync37 } from "fs";
100168
- import { join as join76 } from "path";
100159
+ import { join as join77 } from "path";
100169
100160
 
100170
100161
  // packages/omo-opencode/src/mcp/lsp.ts
100171
- import { existsSync as existsSync55 } from "fs";
100172
- import { delimiter as delimiter3, dirname as dirname29, resolve as resolve20 } from "path";
100173
- import { fileURLToPath as fileURLToPath6 } from "url";
100162
+ import { existsSync as existsSync56 } from "fs";
100163
+ import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "path";
100164
+ import { fileURLToPath as fileURLToPath7 } from "url";
100174
100165
 
100175
100166
  // packages/omo-opencode/src/mcp/cli-suffix.ts
100176
100167
  function normalizeCliPath(path14) {
@@ -100216,7 +100207,7 @@ function resolveRuntimeExecutable(commandName, options = {}) {
100216
100207
  }
100217
100208
 
100218
100209
  // packages/omo-opencode/src/mcp/shared/ancestor-cli-resolver.ts
100219
- import { resolve as resolve19 } from "path";
100210
+ import { resolve as resolve20 } from "path";
100220
100211
  function resolveJavaScriptRuntime(resolveExecutable) {
100221
100212
  const node = resolveExecutable("node");
100222
100213
  return node.available ? node : resolveExecutable("bun");
@@ -100224,9 +100215,9 @@ function resolveJavaScriptRuntime(resolveExecutable) {
100224
100215
  function createAncestorCliCandidates(options) {
100225
100216
  const candidates = [];
100226
100217
  const seenPaths = new Set;
100227
- let currentDirectory = resolve19(options.startDirectory);
100218
+ let currentDirectory = resolve20(options.startDirectory);
100228
100219
  while (true) {
100229
- const distCliPath = resolve19(currentDirectory, options.packageRel, options.distCliRel);
100220
+ const distCliPath = resolve20(currentDirectory, options.packageRel, options.distCliRel);
100230
100221
  if (!seenPaths.has(distCliPath)) {
100231
100222
  const runtime5 = resolveJavaScriptRuntime(options.resolveExecutable);
100232
100223
  seenPaths.add(distCliPath);
@@ -100238,7 +100229,7 @@ function createAncestorCliCandidates(options) {
100238
100229
  runtimeAvailable: runtime5.available
100239
100230
  });
100240
100231
  }
100241
- const sourceCliPath = resolve19(currentDirectory, options.packageRel, options.sourceCliRel);
100232
+ const sourceCliPath = resolve20(currentDirectory, options.packageRel, options.sourceCliRel);
100242
100233
  if (!seenPaths.has(sourceCliPath)) {
100243
100234
  const runtime5 = options.resolveExecutable("bun");
100244
100235
  const sourceCandidateAvailable = options.isSourceCandidateAvailable?.({
@@ -100255,7 +100246,7 @@ function createAncestorCliCandidates(options) {
100255
100246
  runtimeAvailable: runtime5.available
100256
100247
  });
100257
100248
  }
100258
- const parentDirectory = resolve19(currentDirectory, "..");
100249
+ const parentDirectory = resolve20(currentDirectory, "..");
100259
100250
  if (parentDirectory === currentDirectory)
100260
100251
  return candidates;
100261
100252
  currentDirectory = parentDirectory;
@@ -100291,7 +100282,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
100291
100282
  ].join(";");
100292
100283
  function getModuleDirectory(moduleUrl) {
100293
100284
  try {
100294
- return dirname29(fileURLToPath6(moduleUrl));
100285
+ return dirname30(fileURLToPath7(moduleUrl));
100295
100286
  } catch (error51) {
100296
100287
  if (!(error51 instanceof Error))
100297
100288
  throw error51;
@@ -100299,23 +100290,23 @@ function getModuleDirectory(moduleUrl) {
100299
100290
  }
100300
100291
  }
100301
100292
  function findBootstrapRoot(candidates, pathExists) {
100302
- return candidates.find((candidate) => pathExists(resolve20(candidate.root, "package.json")))?.root ?? process.cwd();
100293
+ return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
100303
100294
  }
100304
100295
  function createBootstrapCandidate(root, pathExists, resolveExecutable) {
100305
100296
  const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
100306
100297
  const bun = resolveExecutable("bun");
100307
100298
  const npm = resolveExecutable("npm");
100308
- const packageManifestPath = resolve20(root, PACKAGE_REL, "package.json");
100299
+ const packageManifestPath = resolve21(root, PACKAGE_REL, "package.json");
100309
100300
  return {
100310
100301
  command: [runtime5.command, "-e", LSP_BOOTSTRAP_SCRIPT, root, npm.command, bun.command],
100311
100302
  root,
100312
- path: resolve20(root, PACKAGE_REL, DIST_CLI_REL),
100303
+ path: resolve21(root, PACKAGE_REL, DIST_CLI_REL),
100313
100304
  exists: runtime5.available && npm.available && pathExists(packageManifestPath),
100314
100305
  runtimeAvailable: runtime5.available
100315
100306
  };
100316
100307
  }
100317
100308
  function resolveLspCommand(options = {}) {
100318
- const pathExists = options.exists ?? existsSync55;
100309
+ const pathExists = options.exists ?? existsSync56;
100319
100310
  const resolveExecutable = options.resolveExecutable ?? resolveRuntimeExecutable;
100320
100311
  const moduleDirectory = getModuleDirectory(options.moduleUrl ?? import.meta.url);
100321
100312
  const candidates = moduleDirectory ? createAncestorCliCandidates({
@@ -100325,7 +100316,7 @@ function resolveLspCommand(options = {}) {
100325
100316
  sourceCliRel: SOURCE_CLI_REL,
100326
100317
  pathExists,
100327
100318
  resolveExecutable,
100328
- isSourceCandidateAvailable: ({ root }) => pathExists(resolve20(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
100319
+ isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
100329
100320
  }) : [];
100330
100321
  const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
100331
100322
  if (distCandidate) {
@@ -100372,7 +100363,7 @@ function readOmoConfig(configDirectory) {
100372
100363
  }
100373
100364
  function isLspMcpDisabled(options) {
100374
100365
  const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
100375
- const projectConfigDirectory = join76(options.cwd ?? process.cwd(), ".opencode");
100366
+ const projectConfigDirectory = join77(options.cwd ?? process.cwd(), ".opencode");
100376
100367
  const userConfig = readOmoConfig(userConfigDirectory);
100377
100368
  const projectConfig = readOmoConfig(projectConfigDirectory);
100378
100369
  const disabledMcps = new Set([
@@ -100391,21 +100382,21 @@ function getInstalledLspServers(options = {}) {
100391
100382
 
100392
100383
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
100393
100384
  init_shared();
100394
- import { existsSync as existsSync56, readFileSync as readFileSync38 } from "fs";
100395
- import { homedir as homedir19 } from "os";
100396
- import { join as join77 } from "path";
100385
+ import { existsSync as existsSync57, readFileSync as readFileSync38 } from "fs";
100386
+ import { homedir as homedir20 } from "os";
100387
+ import { join as join78 } from "path";
100397
100388
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
100398
100389
  function getMcpConfigPaths() {
100399
100390
  return [
100400
- join77(homedir19(), ".claude", ".mcp.json"),
100401
- join77(process.cwd(), ".mcp.json"),
100402
- join77(process.cwd(), ".claude", ".mcp.json")
100391
+ join78(homedir20(), ".claude", ".mcp.json"),
100392
+ join78(process.cwd(), ".mcp.json"),
100393
+ join78(process.cwd(), ".claude", ".mcp.json")
100403
100394
  ];
100404
100395
  }
100405
100396
  function loadUserMcpConfig() {
100406
100397
  const servers = {};
100407
100398
  for (const configPath of getMcpConfigPaths()) {
100408
- if (!existsSync56(configPath))
100399
+ if (!existsSync57(configPath))
100409
100400
  continue;
100410
100401
  try {
100411
100402
  const content = readFileSync38(configPath, "utf-8");
@@ -100543,12 +100534,12 @@ async function checkTools() {
100543
100534
 
100544
100535
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
100545
100536
  init_src4();
100546
- import { existsSync as existsSync57, readFileSync as readFileSync39 } from "fs";
100537
+ import { existsSync as existsSync58, readFileSync as readFileSync39 } from "fs";
100547
100538
  function isTelemetryState(value) {
100548
100539
  return value !== null && typeof value === "object" && !Array.isArray(value);
100549
100540
  }
100550
100541
  function readLastActiveDay(stateFilePath) {
100551
- if (!existsSync57(stateFilePath)) {
100542
+ if (!existsSync58(stateFilePath)) {
100552
100543
  return "never";
100553
100544
  }
100554
100545
  let parsed;
@@ -100611,17 +100602,17 @@ async function probeBinary(cmd, args, spawnImpl) {
100611
100602
  }
100612
100603
 
100613
100604
  // packages/team-core/src/team-registry/paths.ts
100614
- import { homedir as homedir20 } from "os";
100605
+ import { homedir as homedir21 } from "os";
100615
100606
  import path14 from "path";
100616
100607
  function resolveBaseDir(config3) {
100617
- return expandHomeDirectory(config3.base_dir ?? path14.join(homedir20(), ".omo"));
100608
+ return expandHomeDirectory(config3.base_dir ?? path14.join(homedir21(), ".omo"));
100618
100609
  }
100619
100610
  function expandHomeDirectory(directoryPath) {
100620
100611
  if (directoryPath === "~") {
100621
- return homedir20();
100612
+ return homedir21();
100622
100613
  }
100623
100614
  if (directoryPath.startsWith("~/") || directoryPath.startsWith("~\\")) {
100624
- return path14.join(homedir20(), directoryPath.slice(2));
100615
+ return path14.join(homedir21(), directoryPath.slice(2));
100625
100616
  }
100626
100617
  return directoryPath;
100627
100618
  }
@@ -100698,10 +100689,10 @@ async function pathExists(dir) {
100698
100689
 
100699
100690
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
100700
100691
  init_src();
100701
- import { existsSync as existsSync58 } from "fs";
100702
- import { lstat as lstat12, readdir as readdir10, readFile as readFile21 } from "fs/promises";
100703
- import { homedir as homedir21 } from "os";
100704
- import { basename as basename13, join as join78, resolve as resolve21 } from "path";
100692
+ import { existsSync as existsSync59 } from "fs";
100693
+ import { lstat as lstat12, readdir as readdir10, readFile as readFile22 } from "fs/promises";
100694
+ import { homedir as homedir22 } from "os";
100695
+ import { basename as basename13, join as join79, resolve as resolve22 } from "path";
100705
100696
  // packages/omo-opencode/package.json
100706
100697
  var package_default3 = {
100707
100698
  name: "@oh-my-opencode/omo-opencode",
@@ -100759,13 +100750,13 @@ var CODEX_BIN_NAMES = [
100759
100750
  "omo-git-bash-hook"
100760
100751
  ];
100761
100752
  async function gatherCodexSummary(deps = {}) {
100762
- const codexHome = resolve21(deps.codexHome ?? process.env.CODEX_HOME ?? join78(homedir21(), ".codex"));
100753
+ const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join79(homedir22(), ".codex"));
100763
100754
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
100764
100755
  const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
100765
100756
  const pluginRoot = await resolveInstalledPluginRoot(codexHome);
100766
- const manifest = pluginRoot === null ? null : await readJson(join78(pluginRoot, ".codex-plugin", "plugin.json"));
100767
- const installSnapshot = pluginRoot === null ? null : await readJson(join78(pluginRoot, "lazycodex-install.json"));
100768
- const configPath = join78(codexHome, "config.toml");
100757
+ const manifest = pluginRoot === null ? null : await readJson(join79(pluginRoot, ".codex-plugin", "plugin.json"));
100758
+ const installSnapshot = pluginRoot === null ? null : await readJson(join79(pluginRoot, "lazycodex-install.json"));
100759
+ const configPath = join79(codexHome, "config.toml");
100769
100760
  const pluginVersion = stringField(manifest, "version");
100770
100761
  return {
100771
100762
  codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -100822,7 +100813,7 @@ function buildCodexIssues(summary) {
100822
100813
  if (summary.pluginRoot === null) {
100823
100814
  issues.push({
100824
100815
  title: "OMO Codex plugin is not installed",
100825
- description: `Expected cached plugin at ${join78("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
100816
+ description: `Expected cached plugin at ${join79("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
100826
100817
  fix: "Run: npx lazycodex-ai install",
100827
100818
  severity: "error",
100828
100819
  affects: ["plugin loading"]
@@ -100887,15 +100878,15 @@ function buildCodexIssues(summary) {
100887
100878
  return issues;
100888
100879
  }
100889
100880
  async function resolveInstalledPluginRoot(codexHome) {
100890
- const pluginRoot = join78(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
100891
- if (!existsSync58(pluginRoot))
100881
+ const pluginRoot = join79(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
100882
+ if (!existsSync59(pluginRoot))
100892
100883
  return null;
100893
100884
  const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
100894
100885
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
100895
- return candidates.length === 0 ? null : join78(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
100886
+ return candidates.length === 0 ? null : join79(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
100896
100887
  }
100897
100888
  async function readCodexConfigSummary(configPath) {
100898
- if (!existsSync58(configPath)) {
100889
+ if (!existsSync59(configPath)) {
100899
100890
  return {
100900
100891
  exists: false,
100901
100892
  marketplaceConfigured: false,
@@ -100906,7 +100897,7 @@ async function readCodexConfigSummary(configPath) {
100906
100897
  companionLifecycleHookStateEvents: []
100907
100898
  };
100908
100899
  }
100909
- const content = await readFile21(configPath, "utf8");
100900
+ const content = await readFile22(configPath, "utf8");
100910
100901
  return {
100911
100902
  exists: true,
100912
100903
  marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
@@ -100920,21 +100911,21 @@ async function readCodexConfigSummary(configPath) {
100920
100911
  async function readLinkedBins(binDir) {
100921
100912
  const linked = [];
100922
100913
  for (const name of CODEX_BIN_NAMES) {
100923
- if (await pathExists2(join78(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
100914
+ if (await pathExists2(join79(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
100924
100915
  linked.push(name);
100925
100916
  }
100926
100917
  return linked;
100927
100918
  }
100928
100919
  async function readLinkedAgents(codexHome) {
100929
- const agentsDir = join78(codexHome, "agents");
100930
- if (!existsSync58(agentsDir))
100920
+ const agentsDir = join79(codexHome, "agents");
100921
+ if (!existsSync59(agentsDir))
100931
100922
  return [];
100932
100923
  const entries = await readdir10(agentsDir, { withFileTypes: true });
100933
100924
  return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
100934
100925
  }
100935
100926
  async function readJson(path16) {
100936
100927
  try {
100937
- const parsed = JSON.parse(await readFile21(path16, "utf8"));
100928
+ const parsed = JSON.parse(await readFile22(path16, "utf8"));
100938
100929
  return isPlainRecord(parsed) ? parsed : null;
100939
100930
  } catch (error51) {
100940
100931
  if (error51 instanceof Error)
@@ -101040,9 +101031,9 @@ async function pathExists2(path16) {
101040
101031
 
101041
101032
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
101042
101033
  init_src();
101043
- import { readdir as readdir11, readFile as readFile22, stat as stat6 } from "fs/promises";
101044
- import { homedir as homedir22 } from "os";
101045
- import { dirname as dirname30, isAbsolute as isAbsolute12, join as join79, relative as relative10, resolve as resolve22, sep as sep9 } from "path";
101034
+ import { readdir as readdir11, readFile as readFile23, stat as stat6 } from "fs/promises";
101035
+ import { homedir as homedir23 } from "os";
101036
+ import { dirname as dirname31, isAbsolute as isAbsolute12, join as join80, relative as relative10, resolve as resolve23, sep as sep9 } from "path";
101046
101037
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
101047
101038
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
101048
101039
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -101052,7 +101043,7 @@ async function checkCodexComponents(deps = {}) {
101052
101043
  const env3 = deps.env ?? process.env;
101053
101044
  const platform = deps.platform ?? process.platform;
101054
101045
  const arch = deps.arch ?? process.arch;
101055
- const codexHome = resolve22(deps.codexHome ?? env3["CODEX_HOME"] ?? join79(homedir22(), ".codex"));
101046
+ const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join80(homedir23(), ".codex"));
101056
101047
  const summary = await gatherCodexSummary({ ...deps, codexHome });
101057
101048
  if (summary.pluginRoot === null) {
101058
101049
  return {
@@ -101077,7 +101068,7 @@ async function checkCodexComponents(deps = {}) {
101077
101068
  });
101078
101069
  }
101079
101070
  const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
101080
- const runtimeSgPath = join79(runtimeSgDir, sgBinaryName(platform));
101071
+ const runtimeSgPath = join80(runtimeSgDir, sgBinaryName(platform));
101081
101072
  const sg = findSgBinarySync({
101082
101073
  arch,
101083
101074
  env: env3,
@@ -101116,8 +101107,8 @@ async function auditBundleTargets(pluginRoot) {
101116
101107
  const manifest = await readJson2(manifestPath);
101117
101108
  if (manifest === null || !isRecord5(manifest["mcpServers"]))
101118
101109
  continue;
101119
- const manifestRoot = dirname30(manifestPath);
101120
- const isRootManifest = resolve22(manifestRoot) === resolve22(pluginRoot);
101110
+ const manifestRoot = dirname31(manifestPath);
101111
+ const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
101121
101112
  for (const server2 of Object.values(manifest["mcpServers"])) {
101122
101113
  if (!isRecord5(server2) || !Array.isArray(server2["args"]))
101123
101114
  continue;
@@ -101137,7 +101128,7 @@ async function auditBundleTargets(pluginRoot) {
101137
101128
  continue;
101138
101129
  const commands2 = [];
101139
101130
  collectHookCommands(manifest, commands2);
101140
- const hookPluginRoot = dirname30(dirname30(hookManifestPath));
101131
+ const hookPluginRoot = dirname31(dirname31(hookManifestPath));
101141
101132
  for (const command of commands2) {
101142
101133
  for (const relativePath of extractPluginRootPaths(command)) {
101143
101134
  referencedCount += 1;
@@ -101159,8 +101150,8 @@ function recordBrokenTarget(broken, classified, origin) {
101159
101150
  broken.push(entry);
101160
101151
  }
101161
101152
  async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEscape) {
101162
- const targetPath = resolve22(baseRoot, relativePath);
101163
- const bundleRootPath = resolve22(bundleRoot);
101153
+ const targetPath = resolve23(baseRoot, relativePath);
101154
+ const bundleRootPath = resolve23(bundleRoot);
101164
101155
  const bundleRootPrefix = bundleRootPath.endsWith(sep9) ? bundleRootPath : `${bundleRootPath}${sep9}`;
101165
101156
  if (targetPath !== bundleRootPath && !targetPath.startsWith(bundleRootPrefix)) {
101166
101157
  if (allowEscape)
@@ -101176,7 +101167,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
101176
101167
  }
101177
101168
  async function findHookManifestPaths(root) {
101178
101169
  const paths2 = await findManifestPaths(root, "hooks.json");
101179
- return paths2.filter((path16) => dirname30(path16).endsWith(`${sep9}hooks`));
101170
+ return paths2.filter((path16) => dirname31(path16).endsWith(`${sep9}hooks`));
101180
101171
  }
101181
101172
  async function findManifestPaths(root, manifestName) {
101182
101173
  let entries;
@@ -101189,7 +101180,7 @@ async function findManifestPaths(root, manifestName) {
101189
101180
  for (const entry of entries) {
101190
101181
  if (entry.name === "node_modules" || entry.name === ".git")
101191
101182
  continue;
101192
- const entryPath = join79(root, entry.name);
101183
+ const entryPath = join80(root, entry.name);
101193
101184
  if (entry.isDirectory()) {
101194
101185
  paths2.push(...await findManifestPaths(entryPath, manifestName));
101195
101186
  continue;
@@ -101233,18 +101224,18 @@ function isPluginRuntimePathArg(arg) {
101233
101224
  return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
101234
101225
  }
101235
101226
  function runtimeSgDirectory(codexHome, platform, arch) {
101236
- return join79(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
101227
+ return join80(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
101237
101228
  }
101238
101229
  function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
101239
101230
  const override = env3[SG_PATH_ENV_KEY]?.trim();
101240
101231
  if (override !== undefined && override.length > 0 && sgPath === override)
101241
101232
  return `env override ${SG_PATH_ENV_KEY}`;
101242
- if (sgPath === join79(runtimeSgDir, sgBinaryName(platform)))
101233
+ if (sgPath === join80(runtimeSgDir, sgBinaryName(platform)))
101243
101234
  return "runtime dir";
101244
101235
  return "PATH";
101245
101236
  }
101246
101237
  async function readBootstrapStateSummary(codexHome) {
101247
- const statePath = join79(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
101238
+ const statePath = join80(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
101248
101239
  const raw = await readJson2(statePath);
101249
101240
  if (raw === null)
101250
101241
  return null;
@@ -101293,7 +101284,7 @@ function degradedDetailLines(entries) {
101293
101284
  }
101294
101285
  async function readJson2(path16) {
101295
101286
  try {
101296
- const parsed = JSON.parse(await readFile22(path16, "utf8"));
101287
+ const parsed = JSON.parse(await readFile23(path16, "utf8"));
101297
101288
  return isRecord5(parsed) ? parsed : null;
101298
101289
  } catch (error51) {
101299
101290
  if (error51 instanceof Error)
@@ -101320,23 +101311,23 @@ function isRecord5(value) {
101320
101311
  }
101321
101312
 
101322
101313
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
101323
- import { existsSync as existsSync59 } from "fs";
101324
- import { readFile as readFile23 } from "fs/promises";
101325
- import { homedir as homedir23 } from "os";
101326
- import { join as join80, resolve as resolve23 } from "path";
101314
+ import { existsSync as existsSync60 } from "fs";
101315
+ import { readFile as readFile24 } from "fs/promises";
101316
+ import { homedir as homedir24 } from "os";
101317
+ import { join as join81, resolve as resolve24 } from "path";
101327
101318
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
101328
101319
  var CHECK_NAME = "codex-runtime-wrapper";
101329
101320
  var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
101330
101321
  async function checkCodexRuntimeWrapper(deps = {}) {
101331
- const codexHome = resolve23(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir23(), ".codex"));
101322
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join81(homedir24(), ".codex"));
101332
101323
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
101333
101324
  const platform = deps.platform ?? process.platform;
101334
- const wrapperPath = join80(binDir, platform === "win32" ? "omo.cmd" : "omo");
101325
+ const wrapperPath = join81(binDir, platform === "win32" ? "omo.cmd" : "omo");
101335
101326
  const wrapper = await readRuntimeWrapper(wrapperPath);
101336
101327
  const issues = [];
101337
101328
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
101338
101329
  const targetPath = parseRuntimeTargetPath(wrapper);
101339
- if (targetPath !== null && !existsSync59(targetPath)) {
101330
+ if (targetPath !== null && !existsSync60(targetPath)) {
101340
101331
  issues.push({
101341
101332
  title: "omo runtime wrapper target is missing",
101342
101333
  description: `Generated omo runtime wrapper at ${wrapperPath} points to missing target ${targetPath}.`,
@@ -101356,7 +101347,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
101356
101347
  }
101357
101348
  async function readRuntimeWrapper(path16) {
101358
101349
  try {
101359
- return await readFile23(path16, "utf8");
101350
+ return await readFile24(path16, "utf8");
101360
101351
  } catch (error51) {
101361
101352
  if (error51 instanceof Error)
101362
101353
  return null;
@@ -101835,7 +101826,7 @@ Doctor failed unexpectedly: ${message}`];
101835
101826
  import { createHash as createHash4 } from "crypto";
101836
101827
  import {
101837
101828
  chmodSync as chmodSync4,
101838
- existsSync as existsSync62,
101829
+ existsSync as existsSync63,
101839
101830
  mkdirSync as mkdirSync14,
101840
101831
  readdirSync as readdirSync9,
101841
101832
  readFileSync as readFileSync42,
@@ -101843,15 +101834,15 @@ import {
101843
101834
  unlinkSync as unlinkSync8,
101844
101835
  writeFileSync as writeFileSync11
101845
101836
  } from "fs";
101846
- import { basename as basename14, dirname as dirname31, join as join83 } from "path";
101837
+ import { basename as basename14, dirname as dirname32, join as join84 } from "path";
101847
101838
 
101848
101839
  // packages/mcp-client-core/src/config-dir.ts
101849
- import { existsSync as existsSync60, realpathSync as realpathSync8 } from "fs";
101850
- import { homedir as homedir24 } from "os";
101851
- import { join as join81, resolve as resolve24 } from "path";
101840
+ import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
101841
+ import { homedir as homedir25 } from "os";
101842
+ import { join as join82, resolve as resolve25 } from "path";
101852
101843
  function resolveConfigPath2(pathValue) {
101853
- const resolvedPath = resolve24(pathValue);
101854
- if (!existsSync60(resolvedPath))
101844
+ const resolvedPath = resolve25(pathValue);
101845
+ if (!existsSync61(resolvedPath))
101855
101846
  return resolvedPath;
101856
101847
  try {
101857
101848
  return realpathSync8(resolvedPath);
@@ -101866,13 +101857,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
101866
101857
  if (customConfigDir) {
101867
101858
  return resolveConfigPath2(customConfigDir);
101868
101859
  }
101869
- const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join81(homedir24(), ".config");
101870
- return resolveConfigPath2(join81(xdgConfigDir, "opencode"));
101860
+ const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join82(homedir25(), ".config");
101861
+ return resolveConfigPath2(join82(xdgConfigDir, "opencode"));
101871
101862
  }
101872
101863
 
101873
101864
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
101874
- import { chmodSync as chmodSync3, existsSync as existsSync61, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
101875
- import { join as join82 } from "path";
101865
+ import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "fs";
101866
+ import { join as join83 } from "path";
101876
101867
  var INDEX_FILE_NAME = "index.json";
101877
101868
  function isTokenIndex(value) {
101878
101869
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -101880,11 +101871,11 @@ function isTokenIndex(value) {
101880
101871
  return Object.values(value).every((entry) => typeof entry === "string");
101881
101872
  }
101882
101873
  function getIndexPath(storageDir) {
101883
- return join82(storageDir, INDEX_FILE_NAME);
101874
+ return join83(storageDir, INDEX_FILE_NAME);
101884
101875
  }
101885
101876
  function readTokenIndex(storageDir) {
101886
101877
  const indexPath = getIndexPath(storageDir);
101887
- if (!existsSync61(indexPath))
101878
+ if (!existsSync62(indexPath))
101888
101879
  return {};
101889
101880
  try {
101890
101881
  const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
@@ -101924,16 +101915,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
101924
101915
  var STORAGE_DIR_NAME = "mcp-oauth";
101925
101916
  var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
101926
101917
  function getMcpOauthStorageDir() {
101927
- return join83(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
101918
+ return join84(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
101928
101919
  }
101929
101920
  function getMcpOauthServerHash(serverHost, resource) {
101930
101921
  return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
101931
101922
  }
101932
101923
  function getMcpOauthStoragePath(serverHost, resource) {
101933
- return join83(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
101924
+ return join84(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
101934
101925
  }
101935
101926
  function getLegacyStoragePath() {
101936
- return join83(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
101927
+ return join84(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
101937
101928
  }
101938
101929
  function normalizeHost2(serverHost) {
101939
101930
  let host = serverHost.trim();
@@ -101994,7 +101985,7 @@ function isOAuthTokenData(value) {
101994
101985
  return clientSecret === undefined || typeof clientSecret === "string";
101995
101986
  }
101996
101987
  function readTokenFile(filePath) {
101997
- if (!existsSync62(filePath))
101988
+ if (!existsSync63(filePath))
101998
101989
  return null;
101999
101990
  try {
102000
101991
  const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
@@ -102007,7 +101998,7 @@ function readTokenFile(filePath) {
102007
101998
  }
102008
101999
  function readLegacyStore() {
102009
102000
  const filePath = getLegacyStoragePath();
102010
- if (!existsSync62(filePath))
102001
+ if (!existsSync63(filePath))
102011
102002
  return null;
102012
102003
  try {
102013
102004
  const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
@@ -102027,8 +102018,8 @@ function readLegacyStore() {
102027
102018
  }
102028
102019
  function writeTokenFile(filePath, token) {
102029
102020
  try {
102030
- const dir = dirname31(filePath);
102031
- if (!existsSync62(dir)) {
102021
+ const dir = dirname32(filePath);
102022
+ if (!existsSync63(dir)) {
102032
102023
  mkdirSync14(dir, { recursive: true });
102033
102024
  }
102034
102025
  const tempPath = `${filePath}.tmp.${Date.now()}`;
@@ -102052,7 +102043,7 @@ function saveToken(serverHost, resource, token) {
102052
102043
  }
102053
102044
  function deleteToken(serverHost, resource) {
102054
102045
  const filePath = getMcpOauthStoragePath(serverHost, resource);
102055
- if (!existsSync62(filePath))
102046
+ if (!existsSync63(filePath))
102056
102047
  return deleteLegacyToken(serverHost, resource);
102057
102048
  try {
102058
102049
  unlinkSync8(filePath);
@@ -102074,7 +102065,7 @@ function deleteLegacyToken(serverHost, resource) {
102074
102065
  if (Object.keys(store2).length === 0) {
102075
102066
  try {
102076
102067
  const filePath = getLegacyStoragePath();
102077
- if (existsSync62(filePath))
102068
+ if (existsSync63(filePath))
102078
102069
  unlinkSync8(filePath);
102079
102070
  return true;
102080
102071
  } catch (deleteError) {
@@ -102112,7 +102103,7 @@ function listTokensByHost(serverHost) {
102112
102103
  for (const [hash2, indexedKey] of Object.entries(index)) {
102113
102104
  if (!indexedKey.startsWith(prefix))
102114
102105
  continue;
102115
- const indexedToken = readTokenFile(join83(getMcpOauthStorageDir(), `${hash2}.json`));
102106
+ const indexedToken = readTokenFile(join84(getMcpOauthStorageDir(), `${hash2}.json`));
102116
102107
  if (indexedToken)
102117
102108
  result[indexedKey] = indexedToken;
102118
102109
  }
@@ -102121,13 +102112,13 @@ function listTokensByHost(serverHost) {
102121
102112
  function listAllTokens() {
102122
102113
  const result = { ...readLegacyStore() ?? {} };
102123
102114
  const dir = getMcpOauthStorageDir();
102124
- if (!existsSync62(dir))
102115
+ if (!existsSync63(dir))
102125
102116
  return result;
102126
102117
  const index = readTokenIndex(dir);
102127
102118
  for (const entry of readdirSync9(dir, { withFileTypes: true })) {
102128
102119
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
102129
102120
  continue;
102130
- const token = readTokenFile(join83(dir, entry.name));
102121
+ const token = readTokenFile(join84(dir, entry.name));
102131
102122
  const hash2 = basename14(entry.name, ".json");
102132
102123
  if (token)
102133
102124
  result[index[hash2] ?? hash2] = token;
@@ -102327,7 +102318,7 @@ function buildAuthorizationUrl(authorizationEndpoint, options) {
102327
102318
  }
102328
102319
  var CALLBACK_TIMEOUT_MS = 5 * 60 * 1000;
102329
102320
  function startCallbackServer(port) {
102330
- return new Promise((resolve25, reject) => {
102321
+ return new Promise((resolve26, reject) => {
102331
102322
  let timeoutId;
102332
102323
  const server2 = createServer2((request, response) => {
102333
102324
  clearTimeout(timeoutId);
@@ -102353,7 +102344,7 @@ function startCallbackServer(port) {
102353
102344
  response.writeHead(200, { "content-type": "text/html" });
102354
102345
  response.end("<html><body><h1>Authorization successful. You can close this tab.</h1></body></html>");
102355
102346
  server2.close();
102356
- resolve25({ code, state: state2 });
102347
+ resolve26({ code, state: state2 });
102357
102348
  });
102358
102349
  timeoutId = setTimeout(() => {
102359
102350
  server2.close();
@@ -102693,7 +102684,7 @@ function createMcpOAuthCommand() {
102693
102684
  }
102694
102685
 
102695
102686
  // packages/omo-opencode/src/cli/boulder/boulder.ts
102696
- import { existsSync as existsSync63 } from "fs";
102687
+ import { existsSync as existsSync64 } from "fs";
102697
102688
 
102698
102689
  // packages/omo-opencode/src/cli/boulder/formatter.ts
102699
102690
  var import_picocolors22 = __toESM(require_picocolors(), 1);
@@ -102757,7 +102748,7 @@ function formatReadErrorMessage(isJson) {
102757
102748
  }
102758
102749
 
102759
102750
  // packages/omo-opencode/src/cli/boulder/boulder.ts
102760
- function formatDurationHuman2(durationMs) {
102751
+ function formatDurationHuman(durationMs) {
102761
102752
  if (durationMs < 1000) {
102762
102753
  return `${durationMs}ms`;
102763
102754
  }
@@ -102796,11 +102787,11 @@ function buildCliWork(directory, work) {
102796
102787
  const taskSession = currentTask ? work.task_sessions?.[currentTask.key] : undefined;
102797
102788
  let currentTaskElapsedHuman;
102798
102789
  if (taskSession?.elapsed_ms !== undefined) {
102799
- currentTaskElapsedHuman = formatDurationHuman2(taskSession.elapsed_ms);
102790
+ currentTaskElapsedHuman = formatDurationHuman(taskSession.elapsed_ms);
102800
102791
  } else if (taskSession?.started_at) {
102801
102792
  const startedAtMs = Date.parse(taskSession.started_at);
102802
102793
  if (!Number.isNaN(startedAtMs)) {
102803
- currentTaskElapsedHuman = formatDurationHuman2(Math.max(0, Date.now() - startedAtMs));
102794
+ currentTaskElapsedHuman = formatDurationHuman(Math.max(0, Date.now() - startedAtMs));
102804
102795
  }
102805
102796
  }
102806
102797
  return {
@@ -102812,7 +102803,7 @@ function buildCliWork(directory, work) {
102812
102803
  started_at: work.started_at,
102813
102804
  ended_at: work.ended_at,
102814
102805
  elapsed_ms: elapsedMs,
102815
- elapsed_human: elapsedMs !== undefined ? formatDurationHuman2(elapsedMs) : undefined,
102806
+ elapsed_human: elapsedMs !== undefined ? formatDurationHuman(elapsedMs) : undefined,
102816
102807
  total_tasks: progress.total,
102817
102808
  completed_tasks: progress.completed,
102818
102809
  remaining_tasks: Math.max(0, progress.total - progress.completed),
@@ -102830,10 +102821,10 @@ async function boulder(options) {
102830
102821
  const boulderFilePath = getBoulderFilePath(directory);
102831
102822
  const state2 = readBoulderState(directory);
102832
102823
  if (!state2) {
102833
- const message = existsSync63(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
102824
+ const message = existsSync64(boulderFilePath) ? formatReadErrorMessage(options.json) : formatNoBoulderMessage(options.json);
102834
102825
  process.stderr.write(`${message}
102835
102826
  `);
102836
- return existsSync63(boulderFilePath) ? 2 : 1;
102827
+ return existsSync64(boulderFilePath) ? 2 : 1;
102837
102828
  }
102838
102829
  const works = getBoulderWorks(state2);
102839
102830
  const filteredWorks = options.workId ? works.filter((work) => work.work_id === options.workId) : works;
@@ -102851,11 +102842,11 @@ async function boulder(options) {
102851
102842
  }
102852
102843
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
102853
102844
  import { spawn as spawn5 } from "child_process";
102854
- import { existsSync as existsSync64, realpathSync as realpathSync9 } from "fs";
102855
- import { homedir as homedir25 } from "os";
102845
+ import { existsSync as existsSync65, realpathSync as realpathSync9 } from "fs";
102846
+ import { homedir as homedir26 } from "os";
102856
102847
  function resolveCodexUlwLoopCommand(input = {}) {
102857
102848
  const env3 = input.env ?? process.env;
102858
- const homeDir = input.homeDir ?? homedir25();
102849
+ const homeDir = input.homeDir ?? homedir26();
102859
102850
  const localComponentBin = resolveLocalUlwLoopBin(env3, homeDir);
102860
102851
  if (localComponentBin !== null)
102861
102852
  return { executable: localComponentBin, argsPrefix: [] };
@@ -102876,22 +102867,22 @@ async function codexUlwLoop(args) {
102876
102867
  console.error("Codex ulw-loop is not installed. Run: npx lazycodex-ai@latest install --no-tui");
102877
102868
  return 1;
102878
102869
  }
102879
- return new Promise((resolve25) => {
102870
+ return new Promise((resolve26) => {
102880
102871
  const child = spawn5(command.executable, [...command.argsPrefix, ...args], { stdio: "inherit" });
102881
102872
  child.on("error", (error51) => {
102882
102873
  console.error(error51.message);
102883
- resolve25(1);
102874
+ resolve26(1);
102884
102875
  });
102885
- child.on("close", (code) => resolve25(code ?? 1));
102876
+ child.on("close", (code) => resolve26(code ?? 1));
102886
102877
  });
102887
102878
  }
102888
102879
  function resolveLocalUlwLoopBin(env3, homeDir) {
102889
102880
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo-ulw-loop", env: env3, homeDir });
102890
- return candidates.find((candidate) => existsSync64(candidate)) ?? null;
102881
+ return candidates.find((candidate) => existsSync65(candidate)) ?? null;
102891
102882
  }
102892
102883
  function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
102893
102884
  const candidates = resolveCodexComponentBinCandidates({ executableName: "omo", env: env3, homeDir });
102894
- return candidates.find((candidate) => existsSync64(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths)) ?? null;
102885
+ return candidates.find((candidate) => existsSync65(candidate) && !isCurrentExecutable(candidate, currentExecutablePaths)) ?? null;
102895
102886
  }
102896
102887
  function isCurrentExecutable(candidate, currentExecutablePaths) {
102897
102888
  const candidateRealPath = realpathOrSelf(candidate);
@@ -102975,13 +102966,17 @@ var VERSION3 = package_default.version;
102975
102966
  var program2 = new Command;
102976
102967
  function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION_NAME) {
102977
102968
  const defaultPlatform = invocationName === "lazycodex" || invocationName === "lazycodex-ai" ? "codex" : undefined;
102969
+ const platform = options.platform ?? defaultPlatform;
102970
+ if (platform === "senpi" && !isSenpiPlatformEnabled()) {
102971
+ throw new Error(`The senpi install platform is not available in this release. Set ${SENPI_PLATFORM_ENV_FLAG}=1 to enable it from a source checkout.`);
102972
+ }
102978
102973
  return {
102979
102974
  tui: options.tui !== false,
102980
102975
  claude: options.claude,
102981
102976
  openai: options.openai,
102982
102977
  gemini: options.gemini,
102983
102978
  copilot: options.copilot,
102984
- platform: options.platform ?? defaultPlatform,
102979
+ platform,
102985
102980
  opencodeZen: options.opencodeZen,
102986
102981
  zaiCodingPlan: options.zaiCodingPlan,
102987
102982
  kimiForCoding: options.kimiForCoding,
@@ -102994,8 +102989,8 @@ function resolveInstallArgs(options, invocationName = process.env.OMO_INVOCATION
102994
102989
  skipAuth: options.skipAuth ?? false
102995
102990
  };
102996
102991
  }
102997
- program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION3, "-v, --version", "Show version number").helpOption("-h, --help", "Display help for command").addOption(new Option("--platform <platform>", "Install target platform: opencode, codex, both").choices(["opencode", "codex", "both"]).hideHelp()).enablePositionalOptions();
102998
- program2.command("install").alias("setup").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").addOption(new Option("--platform <platform>", "Install target platform: opencode, codex, both").choices(["opencode", "codex", "both"])).option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--bailian-coding-plan <value>", "Bailian Coding Plan subscription: no, yes (default: no)").option("--minimax-cn-coding-plan <value>", "MiniMax Coding Plan (minimaxi.com) subscription: no, yes (default: no)").option("--minimax-coding-plan <value>", "MiniMax Coding Plan (minimax.io) subscription: no, yes (default: no)").option("--vercel-ai-gateway <value>", "Vercel AI Gateway: no, yes (default: no)").option("--codex-autonomous", "Configure Codex with approval never, full filesystem access, and network enabled").option("--no-codex-autonomous", "Leave existing Codex permission settings unchanged").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
102992
+ program2.name("oh-my-opencode").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION3, "-v, --version", "Show version number").helpOption("-h, --help", "Display help for command").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms()).hideHelp()).enablePositionalOptions();
102993
+ program2.command("install").alias("setup").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").addOption(new Option("--platform <platform>", `Install target platform: ${availableInstallPlatforms().join(", ")}`).choices(availableInstallPlatforms())).option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)").option("--bailian-coding-plan <value>", "Bailian Coding Plan subscription: no, yes (default: no)").option("--minimax-cn-coding-plan <value>", "MiniMax Coding Plan (minimaxi.com) subscription: no, yes (default: no)").option("--minimax-coding-plan <value>", "MiniMax Coding Plan (minimax.io) subscription: no, yes (default: no)").option("--vercel-ai-gateway <value>", "Vercel AI Gateway: no, yes (default: no)").option("--codex-autonomous", "Configure Codex with approval never, full filesystem access, and network enabled").option("--no-codex-autonomous", "Leave existing Codex permission settings unchanged").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
102999
102994
  Examples:
103000
102995
  $ bunx oh-my-opencode install
103001
102996
  $ npx lazycodex-ai install --no-tui
@@ -103018,7 +103013,7 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi > Baili
103018
103013
  `).action(async (options) => {
103019
103014
  const rootOptions = program2.opts();
103020
103015
  const args = resolveInstallArgs({ ...options, platform: options.platform ?? rootOptions.platform });
103021
- const exitCode = await install2(args);
103016
+ const exitCode = await install3(args);
103022
103017
  process.exit(exitCode);
103023
103018
  });
103024
103019
  configureCleanupCommand(program2);