oh-my-opencode 4.16.2 → 4.16.3

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 (133) hide show
  1. package/.agents/skills/pre-publish-review/SKILL.md +3 -0
  2. package/README.md +2 -2
  3. package/dist/agents/hephaestus/agent.d.ts +1 -1
  4. package/dist/agents/hephaestus/gpt-5-6.d.ts +2 -0
  5. package/dist/agents/momus-gpt-5-6.d.ts +1 -0
  6. package/dist/agents/types.d.ts +2 -0
  7. package/dist/cli/index.js +800 -536
  8. package/dist/cli-node/index.js +800 -536
  9. package/dist/features/background-agent/error-classifier.d.ts +5 -0
  10. package/dist/features/builtin-commands/templates/refactor-sections/intro-and-analysis.d.ts +1 -1
  11. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
  12. package/dist/index.js +416 -37
  13. package/dist/shared/live-server-route.d.ts +1 -1
  14. package/dist/skills/review-work/SKILL.md +1 -1
  15. package/dist/skills/ulw-plan/references/full-workflow.md +1 -1
  16. package/dist/skills/ulw-research/SKILL.md +2 -2
  17. package/dist/skills/visual-qa/SKILL.md +1 -1
  18. package/dist/tui.js +125 -13
  19. package/package.json +13 -13
  20. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  21. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +398 -246
  22. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  23. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  24. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  25. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  26. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  27. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  28. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  29. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  30. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  31. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  32. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  33. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +93 -0
  34. package/packages/omo-codex/plugin/components/rules/dist/cli.js +43 -24
  35. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  36. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  37. package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +2 -1
  38. package/packages/omo-codex/plugin/components/rules/src/dynamic-target-fingerprints.ts +15 -6
  39. package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +7 -2
  40. package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +2 -2
  41. package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +32 -0
  42. package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +106 -0
  43. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  44. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  45. package/packages/omo-codex/plugin/components/teammode/AGENTS.md +12 -9
  46. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  47. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  48. package/packages/omo-codex/plugin/components/teammode/skills/teammode/SKILL.md +136 -76
  49. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-guide.mjs +94 -23
  50. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-state.mjs +94 -14
  51. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-transport.mjs +55 -0
  52. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team.mjs +72 -18
  53. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +23 -0
  54. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  55. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  56. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +24 -41
  57. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +1 -1
  58. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
  59. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-executor.toml +2 -2
  60. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
  61. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
  62. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +21 -49
  63. package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +17 -29
  64. package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +20 -50
  65. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +18 -39
  66. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  67. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  68. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +1 -1
  69. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  70. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  71. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -1
  72. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  73. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  74. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  78. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  92. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  93. package/packages/omo-codex/plugin/package-lock.json +13 -13
  94. package/packages/omo-codex/plugin/package.json +1 -1
  95. package/packages/omo-codex/plugin/scripts/auto-update.mjs +9 -2
  96. package/packages/omo-codex/plugin/scripts/entry-guard.mjs +26 -0
  97. package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +3 -1
  98. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +39 -4
  99. package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +24 -4
  100. package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +3 -3
  101. package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +2 -2
  102. package/packages/omo-codex/plugin/scripts/sync-hook-status-messages.mjs +2 -2
  103. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +6 -4
  104. package/packages/omo-codex/plugin/scripts/sync-version.mjs +4 -2
  105. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +1 -1
  106. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +1 -1
  107. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +1 -1
  108. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +1 -1
  109. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +1 -1
  110. package/packages/omo-codex/plugin/skills/teammode/SKILL.md +136 -76
  111. package/packages/omo-codex/plugin/skills/teammode/scripts/team-guide.mjs +94 -23
  112. package/packages/omo-codex/plugin/skills/teammode/scripts/team-state.mjs +94 -14
  113. package/packages/omo-codex/plugin/skills/teammode/scripts/team-transport.mjs +55 -0
  114. package/packages/omo-codex/plugin/skills/teammode/scripts/team.mjs +72 -18
  115. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -1
  116. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +1 -1
  117. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +2 -2
  118. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +2 -2
  119. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +47 -1
  120. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +4 -2
  121. package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +33 -0
  122. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +146 -9
  123. package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +71 -0
  124. package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +32 -0
  125. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +9 -2
  126. package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +345 -0
  127. package/packages/omo-codex/scripts/install-dist/install-local.mjs +436 -284
  128. package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +111 -1
  129. package/packages/shared-skills/skills/review-work/SKILL.md +1 -1
  130. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +1 -1
  131. package/packages/shared-skills/skills/ulw-research/SKILL.md +2 -2
  132. package/packages/shared-skills/skills/visual-qa/SKILL.md +1 -1
  133. /package/packages/omo-codex/plugin/components/rules/bundled-rules/{hephaestus.md → hephaestus/gpt-5.5.md} +0 -0
@@ -2146,7 +2146,7 @@ var package_default;
2146
2146
  var init_package = __esm(() => {
2147
2147
  package_default = {
2148
2148
  name: "oh-my-opencode",
2149
- version: "4.16.2",
2149
+ version: "4.16.3",
2150
2150
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2151
2151
  main: "./dist/index.js",
2152
2152
  types: "dist/index.d.ts",
@@ -2356,18 +2356,18 @@ var init_package = __esm(() => {
2356
2356
  typescript: "^6.0.3"
2357
2357
  },
2358
2358
  optionalDependencies: {
2359
- "oh-my-opencode-darwin-arm64": "4.16.2",
2360
- "oh-my-opencode-darwin-x64": "4.16.2",
2361
- "oh-my-opencode-darwin-x64-baseline": "4.16.2",
2362
- "oh-my-opencode-linux-arm64": "4.16.2",
2363
- "oh-my-opencode-linux-arm64-musl": "4.16.2",
2364
- "oh-my-opencode-linux-x64": "4.16.2",
2365
- "oh-my-opencode-linux-x64-baseline": "4.16.2",
2366
- "oh-my-opencode-linux-x64-musl": "4.16.2",
2367
- "oh-my-opencode-linux-x64-musl-baseline": "4.16.2",
2368
- "oh-my-opencode-windows-arm64": "4.16.2",
2369
- "oh-my-opencode-windows-x64": "4.16.2",
2370
- "oh-my-opencode-windows-x64-baseline": "4.16.2"
2359
+ "oh-my-opencode-darwin-arm64": "4.16.3",
2360
+ "oh-my-opencode-darwin-x64": "4.16.3",
2361
+ "oh-my-opencode-darwin-x64-baseline": "4.16.3",
2362
+ "oh-my-opencode-linux-arm64": "4.16.3",
2363
+ "oh-my-opencode-linux-arm64-musl": "4.16.3",
2364
+ "oh-my-opencode-linux-x64": "4.16.3",
2365
+ "oh-my-opencode-linux-x64-baseline": "4.16.3",
2366
+ "oh-my-opencode-linux-x64-musl": "4.16.3",
2367
+ "oh-my-opencode-linux-x64-musl-baseline": "4.16.3",
2368
+ "oh-my-opencode-windows-arm64": "4.16.3",
2369
+ "oh-my-opencode-windows-x64": "4.16.3",
2370
+ "oh-my-opencode-windows-x64-baseline": "4.16.3"
2371
2371
  },
2372
2372
  overrides: {
2373
2373
  "@earendil-works/pi-agent-core": "0.80.3",
@@ -9220,6 +9220,11 @@ var init_agent_model_requirements = __esm(() => {
9220
9220
  },
9221
9221
  hephaestus: {
9222
9222
  fallbackChain: [
9223
+ {
9224
+ providers: ["openai", "vercel"],
9225
+ model: "gpt-5.6-sol",
9226
+ variant: "medium"
9227
+ },
9223
9228
  {
9224
9229
  providers: ["openai", "github-copilot", "opencode", "vercel"],
9225
9230
  model: "gpt-5.5",
@@ -9246,7 +9251,7 @@ var init_agent_model_requirements = __esm(() => {
9246
9251
  model: "claude-opus-4-7",
9247
9252
  variant: "max"
9248
9253
  },
9249
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
9254
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
9250
9255
  ]
9251
9256
  },
9252
9257
  librarian: {
@@ -9293,7 +9298,7 @@ var init_agent_model_requirements = __esm(() => {
9293
9298
  model: "gpt-5.5",
9294
9299
  variant: "high"
9295
9300
  },
9296
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
9301
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
9297
9302
  {
9298
9303
  providers: ["google", "github-copilot", "opencode", "vercel"],
9299
9304
  model: "gemini-3.1-pro"
@@ -9316,12 +9321,17 @@ var init_agent_model_requirements = __esm(() => {
9316
9321
  model: "gpt-5.5",
9317
9322
  variant: "high"
9318
9323
  },
9319
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
9324
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
9320
9325
  { providers: ["kimi-for-coding"], model: "k2p5" }
9321
9326
  ]
9322
9327
  },
9323
9328
  momus: {
9324
9329
  fallbackChain: [
9330
+ {
9331
+ providers: ["openai", "vercel"],
9332
+ model: "gpt-5.6-sol",
9333
+ variant: "xhigh"
9334
+ },
9325
9335
  {
9326
9336
  providers: ["openai", "github-copilot", "opencode", "vercel"],
9327
9337
  model: "gpt-5.5",
@@ -9337,7 +9347,7 @@ var init_agent_model_requirements = __esm(() => {
9337
9347
  model: "gemini-3.1-pro",
9338
9348
  variant: "high"
9339
9349
  },
9340
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
9350
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
9341
9351
  ]
9342
9352
  },
9343
9353
  atlas: {
@@ -9389,12 +9399,17 @@ var init_category_model_requirements = __esm(() => {
9389
9399
  model: "claude-opus-4-7",
9390
9400
  variant: "max"
9391
9401
  },
9392
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
9402
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
9393
9403
  { providers: ["kimi-for-coding"], model: "k2p5" }
9394
9404
  ]
9395
9405
  },
9396
9406
  ultrabrain: {
9397
9407
  fallbackChain: [
9408
+ {
9409
+ providers: ["openai", "vercel"],
9410
+ model: "gpt-5.6-sol",
9411
+ variant: "xhigh"
9412
+ },
9398
9413
  {
9399
9414
  providers: ["openai", "opencode", "vercel"],
9400
9415
  model: "gpt-5.5",
@@ -9410,11 +9425,16 @@ var init_category_model_requirements = __esm(() => {
9410
9425
  model: "claude-opus-4-7",
9411
9426
  variant: "max"
9412
9427
  },
9413
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
9428
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
9414
9429
  ]
9415
9430
  },
9416
9431
  deep: {
9417
9432
  fallbackChain: [
9433
+ {
9434
+ providers: ["openai", "vercel"],
9435
+ model: "gpt-5.6-sol",
9436
+ variant: "high"
9437
+ },
9418
9438
  {
9419
9439
  providers: ["openai", "github-copilot", "opencode", "vercel"],
9420
9440
  model: "gpt-5.5",
@@ -9431,7 +9451,7 @@ var init_category_model_requirements = __esm(() => {
9431
9451
  variant: "high"
9432
9452
  },
9433
9453
  { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
9434
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
9454
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
9435
9455
  ]
9436
9456
  },
9437
9457
  artistry: {
@@ -9448,7 +9468,7 @@ var init_category_model_requirements = __esm(() => {
9448
9468
  },
9449
9469
  { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5" },
9450
9470
  { providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
9451
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" }
9471
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" }
9452
9472
  ]
9453
9473
  },
9454
9474
  quick: {
@@ -9506,7 +9526,7 @@ var init_category_model_requirements = __esm(() => {
9506
9526
  },
9507
9527
  { providers: ["zai-coding-plan", "opencode", "bailian-coding-plan", "vercel"], model: "glm-5" },
9508
9528
  { providers: ["kimi-for-coding"], model: "k2p5" },
9509
- { providers: ["opencode-go", "vercel"], model: "glm-5.1" },
9529
+ { providers: ["opencode-go", "vercel"], model: "glm-5.2" },
9510
9530
  { providers: ["opencode", "bailian-coding-plan", "vercel"], model: "kimi-k2.5" },
9511
9531
  {
9512
9532
  providers: [
@@ -10044,6 +10064,22 @@ var init_supplemental_entries = __esm(() => {
10044
10064
  output: 262144
10045
10065
  }
10046
10066
  },
10067
+ "gpt-5.6-sol": {
10068
+ id: "gpt-5.6-sol",
10069
+ family: "gpt",
10070
+ reasoning: true,
10071
+ temperature: false,
10072
+ toolCall: true,
10073
+ modalities: {
10074
+ input: ["text", "image", "pdf"],
10075
+ output: ["text"]
10076
+ },
10077
+ limit: {
10078
+ context: 1050000,
10079
+ input: 922000,
10080
+ output: 128000
10081
+ }
10082
+ },
10047
10083
  "gpt-5.5": {
10048
10084
  id: "gpt-5.5",
10049
10085
  family: "gpt",
@@ -10868,11 +10904,15 @@ function isGpt5_5Model(model) {
10868
10904
  const modelName = extractModelName(model).toLowerCase();
10869
10905
  return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
10870
10906
  }
10907
+ function isGpt5_6Model(model) {
10908
+ const modelName = extractModelName(model).toLowerCase();
10909
+ return modelName.includes("gpt-5.6") || modelName.includes("gpt-5-6");
10910
+ }
10871
10911
  var init_types = () => {};
10872
10912
 
10873
10913
  // packages/omo-opencode/src/tools/delegate-task/openai-categories.ts
10874
10914
  function resolveDeepCategoryPromptAppend(model) {
10875
- if (model && isGpt5_5Model(model)) {
10915
+ if (model && (isGpt5_5Model(model) || isGpt5_6Model(model))) {
10876
10916
  return DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5;
10877
10917
  }
10878
10918
  return DEEP_CATEGORY_PROMPT_APPEND;
@@ -10991,13 +11031,13 @@ var init_openai_categories = __esm(() => {
10991
11031
  OPENAI_CATEGORIES = [
10992
11032
  {
10993
11033
  name: "ultrabrain",
10994
- config: { model: "openai/gpt-5.5", variant: "xhigh" },
11034
+ config: { model: "openai/gpt-5.6-sol", variant: "xhigh" },
10995
11035
  description: "Use ONLY for genuinely hard, logic-heavy tasks. Give clear goals only, not step-by-step instructions.",
10996
11036
  promptAppend: ULTRABRAIN_CATEGORY_PROMPT_APPEND
10997
11037
  },
10998
11038
  {
10999
11039
  name: "deep",
11000
- config: { model: "openai/gpt-5.5", variant: "medium" },
11040
+ config: { model: "openai/gpt-5.6-sol", variant: "high" },
11001
11041
  description: "Goal-oriented autonomous problem-solving on hairy problems requiring deep research. ONE goal + ONE deliverable per call — multiple goals must fan out as parallel `deep` calls, never bundled into one.",
11002
11042
  promptAppend: DEEP_CATEGORY_PROMPT_APPEND,
11003
11043
  resolvePromptAppend: resolveDeepCategoryPromptAppend
@@ -64594,6 +64634,66 @@ async function probe(registration) {
64594
64634
  return false;
64595
64635
  }
64596
64636
  }
64637
+ async function probeSessionAffinity(registration, sessionID) {
64638
+ if (!registration.serverUrl) {
64639
+ return;
64640
+ }
64641
+ const probeUrl = new URL(`/session/${sessionID}`, registration.serverUrl);
64642
+ const authHeader = getServerBasicAuthHeader();
64643
+ const headers = authHeader ? { Authorization: authHeader } : {};
64644
+ try {
64645
+ const controller = new AbortController;
64646
+ const timeoutId = setTimeout(() => controller.abort(), PROBE_ABORT_MS);
64647
+ let response;
64648
+ try {
64649
+ response = await getFetch()(probeUrl, { headers, signal: controller.signal });
64650
+ } finally {
64651
+ clearTimeout(timeoutId);
64652
+ }
64653
+ if (response.ok) {
64654
+ setSessionAffinity(registration, sessionID, true);
64655
+ return true;
64656
+ }
64657
+ if (response.status === 404) {
64658
+ setSessionAffinity(registration, sessionID, false);
64659
+ log2("[live-server-route] live listener does not own session; falling back to in-process client", { sessionID });
64660
+ return false;
64661
+ }
64662
+ return;
64663
+ } catch {
64664
+ return;
64665
+ }
64666
+ }
64667
+ function setSessionAffinity(registration, sessionID, owned) {
64668
+ const now = Date.now();
64669
+ for (const [key, entry] of registration.sessionAffinity) {
64670
+ if (now - entry.timestamp >= AFFINITY_TTL_MS) {
64671
+ registration.sessionAffinity.delete(key);
64672
+ }
64673
+ }
64674
+ registration.sessionAffinity.set(sessionID, { owned, timestamp: now });
64675
+ }
64676
+ function getFreshSessionAffinity(registration, sessionID) {
64677
+ const entry = registration.sessionAffinity.get(sessionID);
64678
+ if (!entry || Date.now() - entry.timestamp >= AFFINITY_TTL_MS) {
64679
+ return;
64680
+ }
64681
+ return entry.owned;
64682
+ }
64683
+ async function resolveSessionAffinity(registration, sessionID) {
64684
+ const cached = getFreshSessionAffinity(registration, sessionID);
64685
+ if (cached !== undefined) {
64686
+ return cached;
64687
+ }
64688
+ let inFlight = registration.inFlightAffinity.get(sessionID);
64689
+ if (!inFlight) {
64690
+ inFlight = probeSessionAffinity(registration, sessionID).finally(() => {
64691
+ registration.inFlightAffinity.delete(sessionID);
64692
+ });
64693
+ registration.inFlightAffinity.set(sessionID, inFlight);
64694
+ }
64695
+ return inFlight;
64696
+ }
64597
64697
  function getFreshProbeAvailability(registration) {
64598
64698
  const available = registration.available;
64599
64699
  if (available === undefined || Date.now() - registration.probeTimestamp >= PROBE_TTL_MS) {
@@ -64646,6 +64746,13 @@ function tryResolveDispatchClientSync2(client3, sessionID) {
64646
64746
  if (!freshAvailability) {
64647
64747
  return { client: client3, route: "in-process", reason: "unavailable" };
64648
64748
  }
64749
+ const cachedAffinity = getFreshSessionAffinity(registration, sessionID);
64750
+ if (cachedAffinity === undefined) {
64751
+ return;
64752
+ }
64753
+ if (!cachedAffinity) {
64754
+ return { client: client3, route: "in-process", reason: "affinity" };
64755
+ }
64649
64756
  const resolvedLiveClient = getOrBuildLiveClient(registration);
64650
64757
  if (!resolvedLiveClient) {
64651
64758
  return { client: client3, route: "in-process", reason: "unavailable" };
@@ -64665,6 +64772,10 @@ async function resolveDispatchClient2(client3, sessionID) {
64665
64772
  if (!isAvailable) {
64666
64773
  return { client: client3, route: "in-process", reason: "unavailable" };
64667
64774
  }
64775
+ const affinity = await resolveSessionAffinity(registration, sessionID);
64776
+ if (affinity === false) {
64777
+ return { client: client3, route: "in-process", reason: "affinity" };
64778
+ }
64668
64779
  const resolvedLiveClient = getOrBuildLiveClient(registration);
64669
64780
  if (!resolvedLiveClient) {
64670
64781
  return { client: client3, route: "in-process", reason: "unavailable" };
@@ -64702,10 +64813,11 @@ function markLiveRouteUnavailable2(reason) {
64702
64813
  for (const registration of registrations.values()) {
64703
64814
  registration.available = false;
64704
64815
  registration.probeTimestamp = Date.now();
64816
+ registration.sessionAffinity.clear();
64705
64817
  }
64706
64818
  log2(`[live-server-route] marked unavailable: ${reason}`);
64707
64819
  }
64708
- var PROBE_TTL_MS = 60000, PROBE_ABORT_MS = 1500, registrations, liveParentWakeRoutingDisabled = false, fetchImplementationForTesting;
64820
+ var PROBE_TTL_MS = 60000, PROBE_ABORT_MS = 1500, AFFINITY_TTL_MS = 60000, registrations, liveParentWakeRoutingDisabled = false, fetchImplementationForTesting;
64709
64821
  var init_live_server_route = __esm(() => {
64710
64822
  init_dist();
64711
64823
  init_state();
@@ -66689,21 +66801,21 @@ var init_config_manager = __esm(() => {
66689
66801
  });
66690
66802
 
66691
66803
  // packages/telemetry-core/src/activity-state.ts
66692
- import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync13 } from "node:fs";
66693
- import { basename as basename10, join as join51 } from "node:path";
66804
+ import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "node:fs";
66805
+ import { basename as basename10, join as join53 } from "node:path";
66694
66806
  function resolveTelemetryStateDir(product, options = {}) {
66695
66807
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
66696
66808
  env: options.env,
66697
66809
  osProvider: options.osProvider
66698
66810
  });
66699
- const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join51(options.env.XDG_DATA_HOME, product.cacheDirName);
66811
+ const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
66700
66812
  if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
66701
66813
  return dataDir;
66702
66814
  }
66703
- return join51(dataDir, product.cacheDirName);
66815
+ return join53(dataDir, product.cacheDirName);
66704
66816
  }
66705
66817
  function getTelemetryActivityStateFilePath(stateDir) {
66706
- return join51(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
66818
+ return join53(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
66707
66819
  }
66708
66820
  function getDailyActiveCaptureState(input) {
66709
66821
  const state = readPostHogActivityState(input.stateDir, input.diagnostics);
@@ -66732,7 +66844,7 @@ function readPostHogActivityState(stateDir, diagnostics) {
66732
66844
  return {};
66733
66845
  }
66734
66846
  try {
66735
- const stateContent = readFileSync13(stateFilePath, "utf-8");
66847
+ const stateContent = readFileSync14(stateFilePath, "utf-8");
66736
66848
  const stateJson = JSON.parse(stateContent);
66737
66849
  if (!isPostHogActivityState(stateJson)) {
66738
66850
  return {};
@@ -66773,10 +66885,10 @@ var init_activity_state = __esm(() => {
66773
66885
  var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
66774
66886
 
66775
66887
  // packages/telemetry-core/src/diagnostics.ts
66776
- import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync14 } from "node:fs";
66777
- import { join as join52 } from "node:path";
66888
+ import { appendFileSync as appendFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync15 } from "node:fs";
66889
+ import { join as join54 } from "node:path";
66778
66890
  function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
66779
- return join52(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
66891
+ return join54(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
66780
66892
  }
66781
66893
  function writeTelemetryDiagnostic(input, options) {
66782
66894
  const now = options.now ?? new Date;
@@ -66799,7 +66911,7 @@ function cleanupTelemetryDiagnostics(options) {
66799
66911
  }
66800
66912
  try {
66801
66913
  const cutoffMs = (options.now ?? new Date).getTime() - DIAGNOSTICS_RETENTION_MS;
66802
- const retainedLines = trimToMaxBytes(readFileSync14(diagnosticsFilePath, "utf-8").split(`
66914
+ const retainedLines = trimToMaxBytes(readFileSync15(diagnosticsFilePath, "utf-8").split(`
66803
66915
  `).filter((line) => shouldRetainLine(line, cutoffMs)));
66804
66916
  writeFileAtomically(diagnosticsFilePath, retainedLines.length === 0 ? "" : `${retainedLines.join(`
66805
66917
  `)}
@@ -66851,7 +66963,7 @@ function shouldRetainLine(line, cutoffMs) {
66851
66963
  function parseDiagnosticLine(line) {
66852
66964
  try {
66853
66965
  const parsed = JSON.parse(line);
66854
- if (!isRecord4(parsed)) {
66966
+ if (!isRecord5(parsed)) {
66855
66967
  return null;
66856
66968
  }
66857
66969
  return parsed;
@@ -66862,7 +66974,7 @@ function parseDiagnosticLine(line) {
66862
66974
  throw error;
66863
66975
  }
66864
66976
  }
66865
- function isRecord4(value) {
66977
+ function isRecord5(value) {
66866
66978
  return value !== null && typeof value === "object" && !Array.isArray(value);
66867
66979
  }
66868
66980
  function trimToMaxBytes(lines) {
@@ -66942,7 +67054,7 @@ function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetr
66942
67054
  var init_machine_id = () => {};
66943
67055
 
66944
67056
  // node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
66945
- import { dirname as dirname17, posix as posix2, sep as sep7 } from "path";
67057
+ import { dirname as dirname18, posix as posix2, sep as sep7 } from "path";
66946
67058
  function createModulerModifier() {
66947
67059
  const getModuleFromFileName = createGetModuleFromFilename();
66948
67060
  return async (frames) => {
@@ -66951,7 +67063,7 @@ function createModulerModifier() {
66951
67063
  return frames;
66952
67064
  };
66953
67065
  }
66954
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
67066
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
66955
67067
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
66956
67068
  return (filename) => {
66957
67069
  if (!filename)
@@ -69972,7 +70084,7 @@ var init_context_lines_node = __esm(() => {
69972
70084
  });
69973
70085
 
69974
70086
  // node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/relative-path.node.mjs
69975
- import { isAbsolute as isAbsolute8, relative as relative5, sep as sep8 } from "path";
70087
+ import { isAbsolute as isAbsolute9, relative as relative5, sep as sep8 } from "path";
69976
70088
  function createRelativePathModifier(basePath = process.cwd()) {
69977
70089
  const isWindows = sep8 === "\\";
69978
70090
  const toUnix = (p) => isWindows ? p.replace(/\\/g, "/") : p;
@@ -69980,7 +70092,7 @@ function createRelativePathModifier(basePath = process.cwd()) {
69980
70092
  return async (frames) => {
69981
70093
  for (const frame of frames)
69982
70094
  if (!(!frame.filename || frame.filename.startsWith("node:") || frame.filename.startsWith("data:"))) {
69983
- if (isAbsolute8(frame.filename))
70095
+ if (isAbsolute9(frame.filename))
69984
70096
  frame.filename = toUnix(relative5(normalizedBase, toUnix(frame.filename)));
69985
70097
  }
69986
70098
  return frames;
@@ -72497,7 +72609,7 @@ var package_default2;
72497
72609
  var init_package2 = __esm(() => {
72498
72610
  package_default2 = {
72499
72611
  name: "@oh-my-opencode/omo-codex",
72500
- version: "4.16.1",
72612
+ version: "4.16.2",
72501
72613
  type: "module",
72502
72614
  private: true,
72503
72615
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -73467,19 +73579,19 @@ var init_update_toasts = __esm(() => {
73467
73579
 
73468
73580
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
73469
73581
  import { existsSync as existsSync49 } from "node:fs";
73470
- import { dirname as dirname27, join as join70 } from "node:path";
73582
+ import { dirname as dirname28, join as join72 } from "node:path";
73471
73583
  import { fileURLToPath as fileURLToPath5 } from "node:url";
73472
73584
  function defaultGetModuleHostingWorkspace() {
73473
73585
  try {
73474
- const currentDir = dirname27(fileURLToPath5(import.meta.url));
73586
+ const currentDir = dirname28(fileURLToPath5(import.meta.url));
73475
73587
  const pkgJsonPath = findPackageJsonUp(currentDir);
73476
73588
  if (!pkgJsonPath)
73477
73589
  return null;
73478
- const pkgDir = dirname27(pkgJsonPath);
73479
- const nodeModulesDir = dirname27(pkgDir);
73590
+ const pkgDir = dirname28(pkgJsonPath);
73591
+ const nodeModulesDir = dirname28(pkgDir);
73480
73592
  if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
73481
73593
  return null;
73482
- return dirname27(nodeModulesDir);
73594
+ return dirname28(nodeModulesDir);
73483
73595
  } catch (error51) {
73484
73596
  if (error51 instanceof Error) {
73485
73597
  return null;
@@ -73621,7 +73733,7 @@ var init_background_update_check = __esm(() => {
73621
73733
  init_update_toasts();
73622
73734
  defaultDeps4 = {
73623
73735
  existsSync: existsSync49,
73624
- join: join70,
73736
+ join: join72,
73625
73737
  runBunInstallWithDetails,
73626
73738
  log: log2,
73627
73739
  getOpenCodeCacheDir,
@@ -74230,7 +74342,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
74230
74342
  }
74231
74343
 
74232
74344
  // packages/omo-codex/src/install/install-codex.ts
74233
- import { join as join53, resolve as resolve15 } from "node:path";
74345
+ import { join as join55, resolve as resolve15 } from "node:path";
74234
74346
  import { existsSync as existsSync30 } from "node:fs";
74235
74347
  import { homedir as homedir6 } from "node:os";
74236
74348
 
@@ -75520,7 +75632,7 @@ async function shouldBuildSourcePackages(repoRoot) {
75520
75632
 
75521
75633
  // packages/omo-codex/src/install/codex-config-toml.ts
75522
75634
  import { mkdir as mkdir5, readFile as readFile11 } from "node:fs/promises";
75523
- import { dirname as dirname15 } from "node:path";
75635
+ import { dirname as dirname16 } from "node:path";
75524
75636
 
75525
75637
  // packages/omo-codex/src/install/toml-section-editor.ts
75526
75638
  function findTomlSection(config, header) {
@@ -76357,30 +76469,87 @@ function isRootSetting2(line, key) {
76357
76469
  }
76358
76470
 
76359
76471
  // packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
76472
+ import { readFileSync as readFileSync13 } from "node:fs";
76473
+ import { dirname as dirname15, isAbsolute as isAbsolute8, join as join39 } from "node:path";
76360
76474
  var CODEX_AGENTS_HEADER = "agents";
76361
76475
  var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
76362
76476
  var CODEX_SUBAGENT_THREAD_LIMIT = 1000;
76363
- function ensureCodexMultiAgentV2Config(config) {
76477
+ function ensureCodexMultiAgentV2Config(config, options = {}) {
76364
76478
  const featureFlag = removeFeatureFlagSetting(config, "multi_agent_v2");
76365
- const agentsConfig = ensureAgentsMaxThreads(featureFlag.config);
76366
- const section = findTomlSection(agentsConfig, CODEX_MULTI_AGENT_V2_HEADER);
76479
+ const v2Preferred = options.multiAgentVersion === "v2";
76480
+ const modelKnown = options.multiAgentVersion != null || readRootModel(featureFlag.config) !== null;
76481
+ const agentsConfig = v2Preferred ? removeAgentsMaxThreads(featureFlag.config) : modelKnown ? ensureAgentsMaxThreads(featureFlag.config) : raiseExistingAgentsMaxThreads(featureFlag.config);
76367
76482
  const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
76483
+ const preserveDisable = featureFlag.value === false && !v2Preferred;
76484
+ const featureConfig = preserveDisable ? setMultiAgentV2Disable(agentsConfig) : v2Preferred ? removeMultiAgentV2Disable(agentsConfig) : agentsConfig;
76485
+ const section = findTomlSection(featureConfig, CODEX_MULTI_AGENT_V2_HEADER);
76368
76486
  if (!section) {
76369
- const enabledSetting = featureFlag.value === false ? `enabled = false
76487
+ const enabledSetting = preserveDisable ? `enabled = false
76370
76488
  ` : "";
76371
- return appendBlock(agentsConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
76489
+ return appendBlock(featureConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
76372
76490
  ${enabledSetting}max_concurrent_threads_per_session = ${maxThreadsValue}
76373
76491
  `);
76374
76492
  }
76375
- const withPreservedDisable = featureFlag.value === false ? replaceOrInsertSetting(agentsConfig, section, "enabled", "false") : agentsConfig;
76376
- const updatedSection = featureFlag.value === false ? findTomlSection(withPreservedDisable, CODEX_MULTI_AGENT_V2_HEADER) : section;
76377
- if (!updatedSection) {
76378
- return appendBlock(withPreservedDisable, `[${CODEX_MULTI_AGENT_V2_HEADER}]
76379
- enabled = false
76380
- max_concurrent_threads_per_session = ${maxThreadsValue}
76381
- `);
76493
+ return replaceOrInsertSetting(featureConfig, section, "max_concurrent_threads_per_session", maxThreadsValue);
76494
+ }
76495
+ function resolveCodexMultiAgentVersion(config, configPath) {
76496
+ const model = readRootModel(config);
76497
+ if (model === null)
76498
+ return null;
76499
+ const catalogPath = resolveCatalogPath(readRootModelCatalogPath(config), configPath);
76500
+ const catalogVersion = readCatalogMultiAgentVersion(model, catalogPath);
76501
+ if (catalogVersion !== null)
76502
+ return catalogVersion;
76503
+ return /^gpt-5\.6\b/i.test(model) ? "v2" : null;
76504
+ }
76505
+ function resolveCatalogPath(configuredPath, configPath) {
76506
+ if (configuredPath === null)
76507
+ return join39(dirname15(configPath), "models_cache.json");
76508
+ return isAbsolute8(configuredPath) ? configuredPath : join39(dirname15(configPath), configuredPath);
76509
+ }
76510
+ function readCatalogMultiAgentVersion(model, cachePath) {
76511
+ let raw;
76512
+ try {
76513
+ raw = readFileSync13(cachePath, "utf8");
76514
+ } catch {
76515
+ return null;
76382
76516
  }
76383
- return replaceOrInsertSetting(withPreservedDisable, updatedSection, "max_concurrent_threads_per_session", maxThreadsValue);
76517
+ let cache;
76518
+ try {
76519
+ cache = JSON.parse(raw);
76520
+ } catch {
76521
+ return null;
76522
+ }
76523
+ if (!isRecord4(cache) || !Array.isArray(cache.models))
76524
+ return null;
76525
+ for (const entry of cache.models) {
76526
+ if (!isRecord4(entry))
76527
+ continue;
76528
+ if (entry.slug !== model && entry.id !== model)
76529
+ continue;
76530
+ const version = entry.multi_agent_version;
76531
+ if (version === "v1" || version === "v2")
76532
+ return version;
76533
+ return null;
76534
+ }
76535
+ return null;
76536
+ }
76537
+ function readRootModel(config) {
76538
+ const double = config.match(/^\s*model\s*=\s*"([^"]+)"/m);
76539
+ if (double !== null)
76540
+ return double[1] ?? null;
76541
+ const single = config.match(/^\s*model\s*=\s*'([^']+)'/m);
76542
+ return single?.[1] ?? null;
76543
+ }
76544
+ function readRootModelCatalogPath(config) {
76545
+ const double = config.match(/^\s*model_catalog_json\s*=\s*"([^"]+)"/m);
76546
+ if (double !== null)
76547
+ return double[1] ?? null;
76548
+ const single = config.match(/^\s*model_catalog_json\s*=\s*'([^']+)'/m);
76549
+ return single?.[1] ?? null;
76550
+ }
76551
+ function isRecord4(value) {
76552
+ return typeof value === "object" && value !== null && !Array.isArray(value);
76384
76553
  }
76385
76554
  function removeFeatureFlagSetting(config, featureName) {
76386
76555
  const section = findTomlSection(config, "features");
@@ -76401,6 +76570,36 @@ max_threads = ${maxThreadsValue}
76401
76570
  }
76402
76571
  return replaceOrInsertSetting(config, section, "max_threads", maxThreadsValue);
76403
76572
  }
76573
+ function removeAgentsMaxThreads(config) {
76574
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
76575
+ if (!section)
76576
+ return config;
76577
+ if (!/^\s*max_threads\s*=/m.test(section.text))
76578
+ return config;
76579
+ return removeSetting(config, section, "max_threads");
76580
+ }
76581
+ function removeMultiAgentV2Disable(config) {
76582
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
76583
+ if (!section)
76584
+ return config;
76585
+ if (!/^\s*enabled\s*=\s*false(?:\s*#.*)?$/m.test(section.text))
76586
+ return config;
76587
+ return removeSetting(config, section, "enabled");
76588
+ }
76589
+ function setMultiAgentV2Disable(config) {
76590
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
76591
+ if (!section)
76592
+ return config;
76593
+ return replaceOrInsertSetting(config, section, "enabled", "false");
76594
+ }
76595
+ function raiseExistingAgentsMaxThreads(config) {
76596
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
76597
+ if (!section)
76598
+ return config;
76599
+ if (!/^\s*max_threads\s*=/m.test(section.text))
76600
+ return config;
76601
+ return replaceOrInsertSetting(config, section, "max_threads", CODEX_SUBAGENT_THREAD_LIMIT.toString());
76602
+ }
76404
76603
  function readBooleanSetting(sectionText, key) {
76405
76604
  const match = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=\\s*(true|false)\\s*(?:#.*)?$`, "m").exec(sectionText);
76406
76605
  if (!match)
@@ -76410,7 +76609,7 @@ function readBooleanSetting(sectionText, key) {
76410
76609
 
76411
76610
  // packages/omo-codex/src/install/codex-config-toml.ts
76412
76611
  async function updateCodexConfig(input) {
76413
- await mkdir5(dirname15(input.configPath), { recursive: true });
76612
+ await mkdir5(dirname16(input.configPath), { recursive: true });
76414
76613
  let config;
76415
76614
  try {
76416
76615
  config = await readFile11(input.configPath, "utf8");
@@ -76433,7 +76632,9 @@ async function updateCodexConfig(input) {
76433
76632
  config = ensureFeatureEnabled(config, "multi_agent");
76434
76633
  config = removeUnsupportedCodexMultiAgentModeConfig(config);
76435
76634
  config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(input.repoRoot));
76436
- config = ensureCodexMultiAgentV2Config(config);
76635
+ config = ensureCodexMultiAgentV2Config(config, {
76636
+ multiAgentVersion: resolveCodexMultiAgentVersion(config, input.configPath)
76637
+ });
76437
76638
  if (input.autonomousPermissions === true)
76438
76639
  config = ensureAutonomousPermissions(config);
76439
76640
  if (!(input.preserveMarketplaceSource === true && hasMarketplaceBlock(config, input.marketplaceName))) {
@@ -76459,7 +76660,7 @@ function isMissingFileError(error) {
76459
76660
  // packages/omo-codex/src/install/codex-hook-trust.ts
76460
76661
  import { createHash as createHash2 } from "node:crypto";
76461
76662
  import { readFile as readFile12 } from "node:fs/promises";
76462
- import { join as join39 } from "node:path";
76663
+ import { join as join40 } from "node:path";
76463
76664
  var EVENT_LABELS = new Map([
76464
76665
  ["PreToolUse", "pre_tool_use"],
76465
76666
  ["PermissionRequest", "permission_request"],
@@ -76473,7 +76674,7 @@ var EVENT_LABELS = new Map([
76473
76674
  ["Stop", "stop"]
76474
76675
  ]);
76475
76676
  async function trustedHookStatesForPlugin(input) {
76476
- const manifestPath = join39(input.pluginRoot, ".codex-plugin", "plugin.json");
76677
+ const manifestPath = join40(input.pluginRoot, ".codex-plugin", "plugin.json");
76477
76678
  if (!await exists(manifestPath))
76478
76679
  return [];
76479
76680
  const manifest = JSON.parse(await readFile12(manifestPath, "utf8"));
@@ -76481,7 +76682,7 @@ async function trustedHookStatesForPlugin(input) {
76481
76682
  return [];
76482
76683
  const states = [];
76483
76684
  for (const hookPath of hookManifestPaths2(manifest.hooks)) {
76484
- const hooksPath = join39(input.pluginRoot, hookPath);
76685
+ const hooksPath = join40(input.pluginRoot, hookPath);
76485
76686
  if (!await exists(hooksPath))
76486
76687
  continue;
76487
76688
  const parsed = JSON.parse(await readFile12(hooksPath, "utf8"));
@@ -76607,207 +76808,125 @@ function toCodexResolution(resolution) {
76607
76808
  }
76608
76809
 
76609
76810
  // packages/omo-codex/src/install/link-cached-plugin-agents.ts
76610
- import { copyFile, lstat as lstat8, mkdir as mkdir6, readFile as readFile14, readdir as readdir6, rm as rm8, writeFile as writeFile6 } from "node:fs/promises";
76611
- import { basename as basename9, join as join41 } from "node:path";
76811
+ import { copyFile, lstat as lstat9, mkdir as mkdir6, readdir as readdir7, rm as rm8, writeFile as writeFile7 } from "node:fs/promises";
76812
+ import { basename as basename9, join as join43 } from "node:path";
76612
76813
 
76613
- // packages/omo-codex/src/install/retired-managed-agent-purge.ts
76614
- import { lstat as lstat7, readFile as readFile13, rm as rm7 } from "node:fs/promises";
76615
- import { join as join40 } from "node:path";
76616
- var RETIRED_MANAGED_AGENT_FILES = [
76617
- {
76618
- fileName: "codex-ultrawork-reviewer.toml",
76619
- requiredMarkers: [
76620
- 'name = "codex-ultrawork-reviewer"',
76621
- 'description = "Strict ultrawork verification reviewer.',
76622
- 'developer_instructions = """You are the ultrawork verification reviewer.'
76623
- ]
76624
- }
76625
- ];
76626
- async function purgeRetiredManagedAgentFiles(input) {
76627
- const agentsDir = join40(input.codexHome, "agents");
76628
- if (!await exists2(agentsDir))
76629
- return;
76630
- for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
76631
- const agentPath = join40(agentsDir, retiredAgent.fileName);
76632
- if (!await exists2(agentPath))
76633
- continue;
76634
- const agentStat = await lstat7(agentPath);
76635
- if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
76636
- continue;
76637
- const content = await readTextIfExists(agentPath);
76638
- if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
76639
- continue;
76640
- await rm7(agentPath, { force: true });
76641
- }
76642
- }
76643
- function hasRequiredMarkers(content, markers) {
76644
- return markers.every((marker) => content.includes(marker));
76645
- }
76646
- async function readTextIfExists(path7) {
76647
- try {
76648
- return await readFile13(path7, "utf8");
76649
- } catch (error) {
76650
- if (nodeErrorCode(error) === "ENOENT")
76651
- return null;
76652
- throw error;
76653
- }
76654
- }
76655
- async function exists2(path7) {
76656
- try {
76657
- await lstat7(path7);
76658
- return true;
76659
- } catch (error) {
76660
- if (nodeErrorCode(error) !== "ENOENT")
76661
- throw error;
76662
- return false;
76814
+ // packages/omo-codex/src/install/preserved-agent-settings.ts
76815
+ import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile6 } from "node:fs/promises";
76816
+ import { join as join41 } from "node:path";
76817
+
76818
+ // packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
76819
+ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
76820
+ [
76821
+ "explorer",
76822
+ {
76823
+ previous: { model: "gpt-5.4-mini", effort: "low" },
76824
+ current: { model: "gpt-5.6-terra", effort: "medium" }
76825
+ }
76826
+ ],
76827
+ [
76828
+ "librarian",
76829
+ {
76830
+ previous: { model: "gpt-5.4-mini", effort: "low" },
76831
+ current: { model: "gpt-5.6-terra", effort: "medium" }
76832
+ }
76833
+ ],
76834
+ [
76835
+ "momus",
76836
+ {
76837
+ previous: { model: "gpt-5.5", effort: "xhigh" },
76838
+ current: { model: "gpt-5.6-sol", effort: "ultra" }
76839
+ }
76840
+ ]
76841
+ ]);
76842
+ function resolveManagedAgentReasoning(input) {
76843
+ const upgrade = MANAGED_REASONING_DEFAULT_UPGRADES.get(input.agentName);
76844
+ if (upgrade !== undefined && input.preserved.model === upgrade.previous.model && input.preserved.effort === upgrade.previous.effort && input.bundledModel === upgrade.current.model && input.bundledEffort === upgrade.current.effort) {
76845
+ return upgrade.current.effort;
76663
76846
  }
76664
- }
76665
- function nodeErrorCode(error) {
76666
- if (!(error instanceof Error) || !("code" in error))
76667
- return null;
76668
- return typeof error.code === "string" ? error.code : null;
76847
+ return input.preserved.effort;
76669
76848
  }
76670
76849
 
76671
- // packages/omo-codex/src/install/link-cached-plugin-agents.ts
76672
- var MANIFEST_FILE = ".installed-agents.json";
76850
+ // packages/omo-codex/src/install/preserved-agent-settings.ts
76673
76851
  async function capturePreservedAgentReasoning(input) {
76674
76852
  const agentsDir = join41(input.codexHome, "agents");
76675
- if (!await exists3(agentsDir))
76853
+ if (!await exists2(agentsDir))
76676
76854
  return new Map;
76677
76855
  const preserved = new Map;
76678
76856
  const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
76679
76857
  for (const entry of agentEntries) {
76680
76858
  if (!entry.name.endsWith(".toml"))
76681
76859
  continue;
76682
- const content = await readTextIfExists2(join41(agentsDir, entry.name));
76860
+ const content = await readTextIfExists(join41(agentsDir, entry.name));
76683
76861
  if (content === null)
76684
76862
  continue;
76685
76863
  const effort = extractReasoningEffort(content);
76686
- if (effort !== null)
76687
- preserved.set(agentNameFromToml(entry.name), effort);
76864
+ if (effort !== null) {
76865
+ preserved.set(agentNameFromToml(entry.name), {
76866
+ model: extractModel(content),
76867
+ effort
76868
+ });
76869
+ }
76688
76870
  }
76689
76871
  return preserved;
76690
76872
  }
76691
76873
  async function capturePreservedAgentServiceTier(input) {
76692
76874
  const agentsDir = join41(input.codexHome, "agents");
76693
- if (!await exists3(agentsDir))
76875
+ if (!await exists2(agentsDir))
76694
76876
  return new Map;
76695
76877
  const preserved = new Map;
76696
76878
  const agentEntries = await readdir6(agentsDir, { withFileTypes: true });
76697
76879
  for (const entry of agentEntries) {
76698
76880
  if (!entry.name.endsWith(".toml"))
76699
76881
  continue;
76700
- const content = await readTextIfExists2(join41(agentsDir, entry.name));
76882
+ const content = await readTextIfExists(join41(agentsDir, entry.name));
76701
76883
  if (content === null)
76702
76884
  continue;
76703
76885
  preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
76704
76886
  }
76705
76887
  return preserved;
76706
76888
  }
76707
- async function linkCachedPluginAgents(input) {
76708
- const bundledAgents = await discoverBundledAgents(input.pluginRoot);
76709
- await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
76710
- if (bundledAgents.length === 0) {
76711
- await writeManifest(input.pluginRoot, []);
76712
- return [];
76713
- }
76714
- const agentsDir = join41(input.codexHome, "agents");
76715
- await mkdir6(agentsDir, { recursive: true });
76716
- const linked = [];
76717
- for (const agentPath of bundledAgents) {
76718
- const agentFileName = basename9(agentPath);
76719
- const agentName = agentNameFromToml(agentFileName);
76720
- const linkPath = join41(agentsDir, agentFileName);
76721
- await replaceWithCopy(linkPath, agentPath);
76722
- await restorePreservedReasoning({
76723
- agentName,
76724
- linkPath,
76725
- target: agentPath,
76726
- value: input.preservedReasoning?.get(agentName)
76727
- });
76728
- await restorePreservedServiceTier({
76729
- linkPath,
76730
- preserved: input.preservedServiceTier?.has(agentName) ?? false,
76731
- value: input.preservedServiceTier?.get(agentName) ?? null
76732
- });
76733
- linked.push({ name: agentFileName, path: linkPath, target: agentPath });
76734
- }
76735
- await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
76736
- return linked;
76737
- }
76738
- async function restorePreservedServiceTier(input) {
76739
- if (!input.preserved)
76889
+ async function restorePreservedReasoning(input) {
76890
+ if (input.value === undefined)
76740
76891
  return;
76741
- const content = await readFile14(input.linkPath, "utf8");
76742
- if (extractServiceTier(content) === input.value)
76892
+ const content = await readFile13(input.target, "utf8");
76893
+ const bundledEffort = extractReasoningEffort(content);
76894
+ const effort = resolveManagedAgentReasoning({
76895
+ agentName: input.agentName,
76896
+ bundledModel: extractModel(content),
76897
+ bundledEffort,
76898
+ preserved: input.value
76899
+ });
76900
+ if (bundledEffort === effort)
76743
76901
  return;
76744
- const replacement = replaceServiceTier(content, input.value);
76902
+ const replacement = replaceTopLevelStringSetting(content, "model_reasoning_effort", effort, { insertIfMissing: false });
76745
76903
  if (!replacement.replaced)
76746
76904
  return;
76747
76905
  await writeFile6(input.linkPath, replacement.content);
76748
76906
  }
76749
- async function discoverBundledAgents(pluginRoot) {
76750
- const componentsRoot = join41(pluginRoot, "components");
76751
- if (!await exists3(componentsRoot))
76752
- return [];
76753
- const componentEntries = await readdir6(componentsRoot, { withFileTypes: true });
76754
- const agents = [];
76755
- for (const entry of componentEntries) {
76756
- if (!entry.isDirectory())
76757
- continue;
76758
- const agentsRoot = join41(componentsRoot, entry.name, "agents");
76759
- if (!await exists3(agentsRoot))
76760
- continue;
76761
- const agentEntries = await readdir6(agentsRoot, { withFileTypes: true });
76762
- for (const file2 of agentEntries) {
76763
- if (!file2.isFile() || !file2.name.endsWith(".toml"))
76764
- continue;
76765
- agents.push(join41(agentsRoot, file2.name));
76766
- }
76767
- }
76768
- agents.sort();
76769
- return agents;
76770
- }
76771
- async function replaceWithCopy(linkPath, target) {
76772
- await prepareReplacement(linkPath);
76773
- await copyFile(target, linkPath);
76774
- }
76775
- async function prepareReplacement(linkPath) {
76776
- if (!await exists3(linkPath))
76777
- return;
76778
- const entryStat = await lstat8(linkPath);
76779
- if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
76780
- throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
76781
- }
76782
- await rm8(linkPath, { force: true });
76783
- }
76784
- async function writeManifest(pluginRoot, agentPaths) {
76785
- const manifestPath = join41(pluginRoot, MANIFEST_FILE);
76786
- const payload = { agents: [...agentPaths].sort() };
76787
- await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
76788
- `);
76789
- }
76790
- async function restorePreservedReasoning(input) {
76791
- if (input.value === undefined)
76907
+ async function restorePreservedServiceTier(input) {
76908
+ if (!input.preserved)
76792
76909
  return;
76793
- const content = await readFile14(input.target, "utf8");
76794
- const bundledEffort = extractReasoningEffort(content);
76795
- if (bundledEffort === input.value)
76910
+ const content = await readFile13(input.linkPath, "utf8");
76911
+ if (extractServiceTier(content) === input.value)
76796
76912
  return;
76797
- const replacement = replaceReasoningEffort(content, input.value);
76913
+ const replacement = replaceTopLevelStringSetting(content, "service_tier", input.value, { insertIfMissing: true });
76798
76914
  if (!replacement.replaced)
76799
76915
  return;
76800
76916
  await writeFile6(input.linkPath, replacement.content);
76801
76917
  }
76802
- async function readTextIfExists2(path7) {
76918
+ async function readTextIfExists(path7) {
76803
76919
  try {
76804
- return await readFile14(path7, "utf8");
76920
+ return await readFile13(path7, "utf8");
76805
76921
  } catch (error) {
76806
- if (nodeErrorCode2(error) === "ENOENT")
76922
+ if (nodeErrorCode(error) === "ENOENT")
76807
76923
  return null;
76808
76924
  throw error;
76809
76925
  }
76810
76926
  }
76927
+ function extractModel(content) {
76928
+ return extractTopLevelStringSetting(content, "model");
76929
+ }
76811
76930
  function extractReasoningEffort(content) {
76812
76931
  return extractTopLevelStringSetting(content, "model_reasoning_effort");
76813
76932
  }
@@ -76827,12 +76946,6 @@ function extractTopLevelStringSetting(content, key) {
76827
76946
  }
76828
76947
  return null;
76829
76948
  }
76830
- function replaceReasoningEffort(content, value) {
76831
- return replaceTopLevelStringSetting(content, "model_reasoning_effort", value, { insertIfMissing: false });
76832
- }
76833
- function replaceServiceTier(content, value) {
76834
- return replaceTopLevelStringSetting(content, "service_tier", value, { insertIfMissing: true });
76835
- }
76836
76949
  function replaceTopLevelStringSetting(content, key, value, options) {
76837
76950
  const lines = content.split(/\n/);
76838
76951
  for (let index = 0;index < lines.length; index += 1) {
@@ -76892,6 +77005,64 @@ function parseJsonString(value) {
76892
77005
  return null;
76893
77006
  }
76894
77007
  }
77008
+ async function exists2(path7) {
77009
+ try {
77010
+ await lstat7(path7);
77011
+ return true;
77012
+ } catch (error) {
77013
+ if (nodeErrorCode(error) !== "ENOENT")
77014
+ throw error;
77015
+ return false;
77016
+ }
77017
+ }
77018
+ function nodeErrorCode(error) {
77019
+ if (!(error instanceof Error) || !("code" in error))
77020
+ return null;
77021
+ return typeof error.code === "string" ? error.code : null;
77022
+ }
77023
+
77024
+ // packages/omo-codex/src/install/retired-managed-agent-purge.ts
77025
+ import { lstat as lstat8, readFile as readFile14, rm as rm7 } from "node:fs/promises";
77026
+ import { join as join42 } from "node:path";
77027
+ var RETIRED_MANAGED_AGENT_FILES = [
77028
+ {
77029
+ fileName: "codex-ultrawork-reviewer.toml",
77030
+ requiredMarkers: [
77031
+ 'name = "codex-ultrawork-reviewer"',
77032
+ 'description = "Strict ultrawork verification reviewer.',
77033
+ 'developer_instructions = """You are the ultrawork verification reviewer.'
77034
+ ]
77035
+ }
77036
+ ];
77037
+ async function purgeRetiredManagedAgentFiles(input) {
77038
+ const agentsDir = join42(input.codexHome, "agents");
77039
+ if (!await exists3(agentsDir))
77040
+ return;
77041
+ for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
77042
+ const agentPath = join42(agentsDir, retiredAgent.fileName);
77043
+ if (!await exists3(agentPath))
77044
+ continue;
77045
+ const agentStat = await lstat8(agentPath);
77046
+ if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
77047
+ continue;
77048
+ const content = await readTextIfExists2(agentPath);
77049
+ if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
77050
+ continue;
77051
+ await rm7(agentPath, { force: true });
77052
+ }
77053
+ }
77054
+ function hasRequiredMarkers(content, markers) {
77055
+ return markers.every((marker) => content.includes(marker));
77056
+ }
77057
+ async function readTextIfExists2(path7) {
77058
+ try {
77059
+ return await readFile14(path7, "utf8");
77060
+ } catch (error) {
77061
+ if (nodeErrorCode2(error) === "ENOENT")
77062
+ return null;
77063
+ throw error;
77064
+ }
77065
+ }
76895
77066
  async function exists3(path7) {
76896
77067
  try {
76897
77068
  await lstat8(path7);
@@ -76908,12 +77079,105 @@ function nodeErrorCode2(error) {
76908
77079
  return typeof error.code === "string" ? error.code : null;
76909
77080
  }
76910
77081
 
77082
+ // packages/omo-codex/src/install/link-cached-plugin-agents.ts
77083
+ var MANIFEST_FILE = ".installed-agents.json";
77084
+ async function linkCachedPluginAgents(input) {
77085
+ const bundledAgents = await discoverBundledAgents(input.pluginRoot);
77086
+ await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
77087
+ if (bundledAgents.length === 0) {
77088
+ await writeManifest(input.pluginRoot, []);
77089
+ return [];
77090
+ }
77091
+ const agentsDir = join43(input.codexHome, "agents");
77092
+ await mkdir6(agentsDir, { recursive: true });
77093
+ const linked = [];
77094
+ for (const agentPath of bundledAgents) {
77095
+ const agentFileName = basename9(agentPath);
77096
+ const agentName = agentNameFromToml2(agentFileName);
77097
+ const linkPath = join43(agentsDir, agentFileName);
77098
+ await replaceWithCopy(linkPath, agentPath);
77099
+ await restorePreservedReasoning({
77100
+ agentName,
77101
+ linkPath,
77102
+ target: agentPath,
77103
+ value: input.preservedReasoning?.get(agentName)
77104
+ });
77105
+ await restorePreservedServiceTier({
77106
+ linkPath,
77107
+ preserved: input.preservedServiceTier?.has(agentName) ?? false,
77108
+ value: input.preservedServiceTier?.get(agentName) ?? null
77109
+ });
77110
+ linked.push({ name: agentFileName, path: linkPath, target: agentPath });
77111
+ }
77112
+ await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
77113
+ return linked;
77114
+ }
77115
+ async function discoverBundledAgents(pluginRoot) {
77116
+ const componentsRoot = join43(pluginRoot, "components");
77117
+ if (!await exists4(componentsRoot))
77118
+ return [];
77119
+ const componentEntries = await readdir7(componentsRoot, { withFileTypes: true });
77120
+ const agents = [];
77121
+ for (const entry of componentEntries) {
77122
+ if (!entry.isDirectory())
77123
+ continue;
77124
+ const agentsRoot = join43(componentsRoot, entry.name, "agents");
77125
+ if (!await exists4(agentsRoot))
77126
+ continue;
77127
+ const agentEntries = await readdir7(agentsRoot, { withFileTypes: true });
77128
+ for (const file2 of agentEntries) {
77129
+ if (!file2.isFile() || !file2.name.endsWith(".toml"))
77130
+ continue;
77131
+ agents.push(join43(agentsRoot, file2.name));
77132
+ }
77133
+ }
77134
+ agents.sort();
77135
+ return agents;
77136
+ }
77137
+ async function replaceWithCopy(linkPath, target) {
77138
+ await prepareReplacement(linkPath);
77139
+ await copyFile(target, linkPath);
77140
+ }
77141
+ async function prepareReplacement(linkPath) {
77142
+ if (!await exists4(linkPath))
77143
+ return;
77144
+ const entryStat = await lstat9(linkPath);
77145
+ if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
77146
+ throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
77147
+ }
77148
+ await rm8(linkPath, { force: true });
77149
+ }
77150
+ async function writeManifest(pluginRoot, agentPaths) {
77151
+ const manifestPath = join43(pluginRoot, MANIFEST_FILE);
77152
+ const payload = { agents: [...agentPaths].sort() };
77153
+ await writeFile7(manifestPath, `${JSON.stringify(payload, null, "\t")}
77154
+ `);
77155
+ }
77156
+ function agentNameFromToml2(fileName) {
77157
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
77158
+ }
77159
+ async function exists4(path7) {
77160
+ try {
77161
+ await lstat9(path7);
77162
+ return true;
77163
+ } catch (error) {
77164
+ if (nodeErrorCode3(error) !== "ENOENT")
77165
+ throw error;
77166
+ return false;
77167
+ }
77168
+ }
77169
+ function nodeErrorCode3(error) {
77170
+ if (!(error instanceof Error) || !("code" in error))
77171
+ return null;
77172
+ return typeof error.code === "string" ? error.code : null;
77173
+ }
77174
+
76911
77175
  // packages/omo-codex/src/install/codex-marketplace.ts
76912
77176
  import { readFile as readFile15 } from "node:fs/promises";
76913
- import { join as join42 } from "node:path";
77177
+ import { join as join44 } from "node:path";
76914
77178
  var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
76915
77179
  async function readMarketplace(repoRoot, options) {
76916
- const marketplacePath = options?.marketplacePath ?? join42(repoRoot, DEFAULT_MARKETPLACE_PATH);
77180
+ const marketplacePath = options?.marketplacePath ?? join44(repoRoot, DEFAULT_MARKETPLACE_PATH);
76917
77181
  const raw = await readFile15(marketplacePath, "utf8");
76918
77182
  const parsed = JSON.parse(raw);
76919
77183
  if (!isPlainRecord3(parsed))
@@ -76932,10 +77196,10 @@ async function readMarketplace(repoRoot, options) {
76932
77196
  function resolvePluginSource(repoRoot, plugin, options) {
76933
77197
  const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
76934
77198
  const relativePath = sourcePath.slice(2);
76935
- return join42(repoRoot, ...relativePath.split(/[\\/]/));
77199
+ return join44(repoRoot, ...relativePath.split(/[\\/]/));
76936
77200
  }
76937
77201
  async function readPluginManifest(pluginRoot) {
76938
- const raw = await readFile15(join42(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
77202
+ const raw = await readFile15(join44(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
76939
77203
  const parsed = JSON.parse(raw);
76940
77204
  if (!isPlainRecord3(parsed))
76941
77205
  throw new Error(`${pluginRoot} plugin.json must be an object`);
@@ -77016,8 +77280,8 @@ function validateLocalSourcePath(path7) {
77016
77280
  }
77017
77281
 
77018
77282
  // packages/omo-codex/src/install/codex-marketplace-snapshot.ts
77019
- import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm9, writeFile as writeFile7 } from "node:fs/promises";
77020
- import { join as join43, sep as sep6 } from "node:path";
77283
+ import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm9, writeFile as writeFile8 } from "node:fs/promises";
77284
+ import { join as join45, sep as sep6 } from "node:path";
77021
77285
  var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
77022
77286
  async function writeInstalledMarketplaceSnapshot(input) {
77023
77287
  const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
@@ -77030,21 +77294,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
77030
77294
  return snapshotPlugins;
77031
77295
  }
77032
77296
  function installedMarketplaceRoot(codexHome, marketplaceName) {
77033
- return join43(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
77297
+ return join45(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
77034
77298
  }
77035
77299
  async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
77036
- const manifestDir = join43(marketplaceRoot, ".agents", "plugins");
77300
+ const manifestDir = join45(marketplaceRoot, ".agents", "plugins");
77037
77301
  await mkdir7(manifestDir, { recursive: true });
77038
- const tempPath = join43(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
77039
- await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
77302
+ const tempPath = join45(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
77303
+ await writeFile8(tempPath, `${JSON.stringify(marketplace, null, "\t")}
77040
77304
  `);
77041
- await rename4(tempPath, join43(manifestDir, "marketplace.json"));
77305
+ await rename4(tempPath, join45(manifestDir, "marketplace.json"));
77042
77306
  }
77043
77307
  async function writeSnapshotPlugin(marketplaceRoot, plugin) {
77044
- const pluginsDir = join43(marketplaceRoot, "plugins");
77308
+ const pluginsDir = join45(marketplaceRoot, "plugins");
77045
77309
  await mkdir7(pluginsDir, { recursive: true });
77046
- const targetPath = join43(pluginsDir, plugin.name);
77047
- const tempPath = join43(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
77310
+ const targetPath = join45(pluginsDir, plugin.name);
77311
+ const tempPath = join45(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
77048
77312
  await rm9(tempPath, { recursive: true, force: true });
77049
77313
  await cp3(plugin.sourcePath, tempPath, {
77050
77314
  recursive: true,
@@ -77065,11 +77329,11 @@ function shouldCopyMarketplaceSourcePath(path7, root) {
77065
77329
  }
77066
77330
 
77067
77331
  // packages/omo-codex/src/install/lazycodex-version-stamp.ts
77068
- import { readdir as readdir7, readFile as readFile16, writeFile as writeFile8 } from "node:fs/promises";
77069
- import { join as join44 } from "node:path";
77332
+ import { readdir as readdir8, readFile as readFile16, writeFile as writeFile9 } from "node:fs/promises";
77333
+ import { join as join46 } from "node:path";
77070
77334
  async function readDistributionManifest(repoRoot) {
77071
77335
  try {
77072
- const parsed = JSON.parse(await readFile16(join44(repoRoot, "package.json"), "utf8"));
77336
+ const parsed = JSON.parse(await readFile16(join46(repoRoot, "package.json"), "utf8"));
77073
77337
  if (!isPlainRecord3(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
77074
77338
  return;
77075
77339
  return {
@@ -77089,19 +77353,19 @@ function resolveLazyCodexPluginVersion(input) {
77089
77353
  return input.manifestVersion ?? "local";
77090
77354
  }
77091
77355
  async function stampLazyCodexPluginVersion(input) {
77092
- const manifestPath = join44(input.pluginRoot, ".codex-plugin", "plugin.json");
77356
+ const manifestPath = join46(input.pluginRoot, ".codex-plugin", "plugin.json");
77093
77357
  const hookPaths = await readPluginHookPaths(manifestPath);
77094
77358
  await stampJsonVersion(manifestPath, input.version);
77095
- await stampJsonVersion(join44(input.pluginRoot, "package.json"), input.version);
77359
+ await stampJsonVersion(join46(input.pluginRoot, "package.json"), input.version);
77096
77360
  for (const hookPath of hookPaths) {
77097
- await stampHookStatusMessages(join44(input.pluginRoot, hookPath), input.version);
77361
+ await stampHookStatusMessages(join46(input.pluginRoot, hookPath), input.version);
77098
77362
  }
77099
77363
  await stampComponentVersions(input);
77100
77364
  }
77101
77365
  async function writeLazyCodexInstallSnapshot(input) {
77102
77366
  if (input.distributionManifest === undefined)
77103
77367
  return;
77104
- await writeFile8(join44(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
77368
+ await writeFile9(join46(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
77105
77369
  packageName: input.distributionManifest.name,
77106
77370
  version: input.distributionManifest.version
77107
77371
  }, null, "\t")}
@@ -77113,7 +77377,7 @@ async function stampJsonVersion(path7, version) {
77113
77377
  if (!isPlainRecord3(parsed))
77114
77378
  return;
77115
77379
  parsed.version = version;
77116
- await writeFile8(path7, `${JSON.stringify(parsed, null, "\t")}
77380
+ await writeFile9(path7, `${JSON.stringify(parsed, null, "\t")}
77117
77381
  `);
77118
77382
  } catch (error) {
77119
77383
  if (error instanceof Error)
@@ -77147,7 +77411,7 @@ async function stampHookStatusMessages(path7, version) {
77147
77411
  if (!isPlainRecord3(parsed))
77148
77412
  return;
77149
77413
  stampHookGroups(parsed.hooks, version);
77150
- await writeFile8(path7, `${JSON.stringify(parsed, null, "\t")}
77414
+ await writeFile9(path7, `${JSON.stringify(parsed, null, "\t")}
77151
77415
  `);
77152
77416
  } catch (error) {
77153
77417
  if (error instanceof Error)
@@ -77158,16 +77422,16 @@ async function stampHookStatusMessages(path7, version) {
77158
77422
  async function stampComponentVersions(input) {
77159
77423
  let entries;
77160
77424
  try {
77161
- entries = await readdir7(join44(input.pluginRoot, "components"));
77425
+ entries = await readdir8(join46(input.pluginRoot, "components"));
77162
77426
  } catch (error) {
77163
77427
  if (error instanceof Error)
77164
77428
  return;
77165
77429
  throw error;
77166
77430
  }
77167
77431
  for (const entry of entries) {
77168
- const componentRoot = join44(input.pluginRoot, "components", entry);
77169
- await stampJsonVersion(join44(componentRoot, "package.json"), input.version);
77170
- await stampHookStatusMessages(join44(componentRoot, "hooks", "hooks.json"), input.version);
77432
+ const componentRoot = join46(input.pluginRoot, "components", entry);
77433
+ await stampJsonVersion(join46(componentRoot, "package.json"), input.version);
77434
+ await stampHookStatusMessages(join46(componentRoot, "hooks", "hooks.json"), input.version);
77171
77435
  }
77172
77436
  }
77173
77437
  function stampHookGroups(hooks, version) {
@@ -77224,8 +77488,8 @@ var defaultRunCommand = async (command, args, options) => {
77224
77488
  };
77225
77489
 
77226
77490
  // packages/omo-codex/src/install/codex-project-local-cleanup.ts
77227
- import { copyFile as copyFile2, lstat as lstat9, readFile as readFile17, writeFile as writeFile9 } from "node:fs/promises";
77228
- import { dirname as dirname16, join as join45, resolve as resolve13 } from "node:path";
77491
+ import { copyFile as copyFile2, lstat as lstat10, readFile as readFile17, writeFile as writeFile10 } from "node:fs/promises";
77492
+ import { dirname as dirname17, join as join47, resolve as resolve13 } from "node:path";
77229
77493
  var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
77230
77494
  var PROJECT_LOCAL_ARTIFACT_PATHS = [
77231
77495
  ".codex/hooks.json",
@@ -77257,7 +77521,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
77257
77521
  }
77258
77522
  const backupPath = `${configPath}.backup-${formatBackupTimestamp(input.now?.() ?? new Date)}`;
77259
77523
  await copyFile2(configPath, backupPath);
77260
- await writeFile9(configPath, `${repair.config.trimEnd()}
77524
+ await writeFile10(configPath, `${repair.config.trimEnd()}
77261
77525
  `);
77262
77526
  configs.push({
77263
77527
  projectRoot: project.projectRoot,
@@ -77328,37 +77592,37 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
77328
77592
  if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
77329
77593
  throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
77330
77594
  }
77331
- const codexHomeConfigPath = codexHome === undefined ? null : join45(resolve13(codexHome), "config.toml");
77595
+ const codexHomeConfigPath = codexHome === undefined ? null : join47(resolve13(codexHome), "config.toml");
77332
77596
  let current = resolve13(startDirectory);
77333
77597
  const configPathsFromCwd = [];
77334
77598
  while (true) {
77335
- const configPath = join45(current, ".codex", "config.toml");
77599
+ const configPath = join47(current, ".codex", "config.toml");
77336
77600
  if (await isRegularProjectLocalConfig(current, configPath)) {
77337
77601
  if (codexHomeConfigPath === null || resolve13(configPath) !== codexHomeConfigPath) {
77338
77602
  configPathsFromCwd.push(configPath);
77339
77603
  }
77340
77604
  }
77341
- if (await exists4(join45(current, ".git"))) {
77605
+ if (await exists5(join47(current, ".git"))) {
77342
77606
  return configPathsFromCwd.length === 0 ? null : {
77343
77607
  projectRoot: current,
77344
77608
  configPaths: [...configPathsFromCwd].reverse(),
77345
77609
  artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
77346
77610
  };
77347
77611
  }
77348
- const parent = dirname16(current);
77612
+ const parent = dirname17(current);
77349
77613
  if (parent === current) {
77350
77614
  const nearestConfigPath = configPathsFromCwd[0];
77351
77615
  return nearestConfigPath === undefined ? null : {
77352
- projectRoot: dirname16(dirname16(nearestConfigPath)),
77616
+ projectRoot: dirname17(dirname17(nearestConfigPath)),
77353
77617
  configPaths: [nearestConfigPath],
77354
- artifactRoots: [dirname16(dirname16(nearestConfigPath))]
77618
+ artifactRoots: [dirname17(dirname17(nearestConfigPath))]
77355
77619
  };
77356
77620
  }
77357
77621
  current = parent;
77358
77622
  }
77359
77623
  }
77360
77624
  async function isRegularProjectLocalConfig(directory, configPath) {
77361
- const codexDirStat = await maybeLstat(join45(directory, ".codex"));
77625
+ const codexDirStat = await maybeLstat(join47(directory, ".codex"));
77362
77626
  if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
77363
77627
  return false;
77364
77628
  const configStat = await maybeLstat(configPath);
@@ -77367,7 +77631,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
77367
77631
  function artifactRootsForConfigPaths(configPaths) {
77368
77632
  const roots = [];
77369
77633
  for (const configPath of configPaths) {
77370
- const root = dirname16(dirname16(configPath));
77634
+ const root = dirname17(dirname17(configPath));
77371
77635
  if (!roots.includes(root))
77372
77636
  roots.push(root);
77373
77637
  }
@@ -77378,7 +77642,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
77378
77642
  const seenPaths = new Set;
77379
77643
  for (const projectRoot of projectRoots) {
77380
77644
  for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
77381
- const artifactPath = join45(projectRoot, relativePath);
77645
+ const artifactPath = join47(projectRoot, relativePath);
77382
77646
  if (seenPaths.has(artifactPath))
77383
77647
  continue;
77384
77648
  const entryStat = await maybeLstat(artifactPath);
@@ -77412,17 +77676,17 @@ function formatBackupTimestamp(date) {
77412
77676
  }
77413
77677
  async function maybeLstat(path7) {
77414
77678
  try {
77415
- return await lstat9(path7);
77679
+ return await lstat10(path7);
77416
77680
  } catch (error) {
77417
- if (nodeErrorCode3(error) === "ENOENT")
77681
+ if (nodeErrorCode4(error) === "ENOENT")
77418
77682
  return null;
77419
77683
  throw error;
77420
77684
  }
77421
77685
  }
77422
- async function exists4(path7) {
77686
+ async function exists5(path7) {
77423
77687
  return await maybeLstat(path7) !== null;
77424
77688
  }
77425
- function nodeErrorCode3(error) {
77689
+ function nodeErrorCode4(error) {
77426
77690
  if (!(error instanceof Error) || !("code" in error))
77427
77691
  return null;
77428
77692
  return typeof error.code === "string" ? error.code : null;
@@ -77453,24 +77717,24 @@ function formatUnknownError(error) {
77453
77717
  }
77454
77718
 
77455
77719
  // packages/omo-codex/src/install/lsp-daemon-reaper.ts
77456
- import { readFile as readFile18, readdir as readdir8, rm as rm10 } from "node:fs/promises";
77720
+ import { readFile as readFile18, readdir as readdir9, rm as rm10 } from "node:fs/promises";
77457
77721
  import { connect } from "node:net";
77458
- import { join as join46 } from "node:path";
77722
+ import { join as join48 } from "node:path";
77459
77723
  async function reapLspDaemons(codexHome, deps = {}) {
77460
77724
  const killProcess = deps.killProcess ?? sendSigterm;
77461
77725
  const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
77462
- const daemonRoot = join46(codexHome, "codex-lsp", "daemon");
77726
+ const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
77463
77727
  const reaped = [];
77464
77728
  let entries;
77465
77729
  try {
77466
- entries = await readdir8(daemonRoot);
77730
+ entries = await readdir9(daemonRoot);
77467
77731
  } catch {
77468
77732
  return reaped;
77469
77733
  }
77470
77734
  for (const entry of entries) {
77471
- const versionDir = join46(daemonRoot, entry);
77472
- const pid = await readPidFile(join46(versionDir, "daemon.pid"));
77473
- const socketPath = await readEndpointFile(join46(versionDir, "daemon.endpoint"));
77735
+ const versionDir = join48(daemonRoot, entry);
77736
+ const pid = await readPidFile(join48(versionDir, "daemon.pid"));
77737
+ const socketPath = await readEndpointFile(join48(versionDir, "daemon.endpoint"));
77474
77738
  if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
77475
77739
  reaped.push(pid);
77476
77740
  }
@@ -77524,7 +77788,7 @@ function sendSigterm(pid) {
77524
77788
 
77525
77789
  // packages/omo-codex/src/install/codex-installer-bin-dir.ts
77526
77790
  import { homedir as homedir5 } from "node:os";
77527
- import { join as join47, resolve as resolve14 } from "node:path";
77791
+ import { join as join49, resolve as resolve14 } from "node:path";
77528
77792
  function resolveCodexInstallerBinDir(input) {
77529
77793
  const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
77530
77794
  if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
@@ -77533,13 +77797,13 @@ function resolveCodexInstallerBinDir(input) {
77533
77797
  const defaultCodexHome = resolve14(homeDir, ".codex");
77534
77798
  const resolvedCodexHome = resolve14(input.codexHome);
77535
77799
  if (resolvedCodexHome !== defaultCodexHome)
77536
- return join47(resolvedCodexHome, "bin");
77800
+ return join49(resolvedCodexHome, "bin");
77537
77801
  return resolve14(homeDir, ".local", "bin");
77538
77802
  }
77539
77803
 
77540
77804
  // packages/omo-codex/src/install/codex-git-bash-hooks.ts
77541
- import { readFile as readFile19, writeFile as writeFile10 } from "node:fs/promises";
77542
- import { join as join48 } from "node:path";
77805
+ import { readFile as readFile19, writeFile as writeFile11 } from "node:fs/promises";
77806
+ import { join as join50 } from "node:path";
77543
77807
  var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
77544
77808
  "./hooks/pre-tool-use-recommending-git-bash-mcp.json",
77545
77809
  "./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
@@ -77547,22 +77811,22 @@ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
77547
77811
  async function removeGitBashHooksOffWindows(input) {
77548
77812
  if (input.platform === "win32")
77549
77813
  return;
77550
- const manifestPath = join48(input.pluginRoot, ".codex-plugin", "plugin.json");
77814
+ const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
77551
77815
  const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
77552
77816
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
77553
77817
  return;
77554
77818
  const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
77555
77819
  if (hooks.length === parsed.hooks.length)
77556
77820
  return;
77557
- await writeFile10(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
77821
+ await writeFile11(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
77558
77822
  `);
77559
77823
  }
77560
77824
 
77561
77825
  // packages/omo-codex/src/install/omo-sot-migration.ts
77562
- import { join as join49 } from "node:path";
77826
+ import { join as join51 } from "node:path";
77563
77827
  async function seedAndMigrateOmoSot(input) {
77564
77828
  const commandEnv = { ...input.env };
77565
- const scriptPath = join49(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
77829
+ const scriptPath = join51(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
77566
77830
  try {
77567
77831
  await input.runCommand(process.execPath, [scriptPath, "--seed"], {
77568
77832
  cwd: input.repoRoot,
@@ -77577,7 +77841,7 @@ async function seedAndMigrateOmoSot(input) {
77577
77841
 
77578
77842
  // packages/omo-codex/src/install/install-ast-grep-sg.ts
77579
77843
  init_src();
77580
- import { join as join50 } from "node:path";
77844
+ import { join as join52 } from "node:path";
77581
77845
  function describeResult(result) {
77582
77846
  if (result.kind === "succeeded")
77583
77847
  return null;
@@ -77591,7 +77855,7 @@ async function installAstGrepForCodex(options) {
77591
77855
  return;
77592
77856
  const platform = options.platform ?? process.platform;
77593
77857
  const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
77594
- const skillDir = join50(plugin.path, "skills", "ast-grep");
77858
+ const skillDir = join52(plugin.path, "skills", "ast-grep");
77595
77859
  const installer = options.installer ?? runAstGrepSkillInstall;
77596
77860
  try {
77597
77861
  const result = await installer({ platform, skillDir, targetDir });
@@ -77625,7 +77889,7 @@ async function runCodexInstaller(options = {}) {
77625
77889
  const env3 = options.env ?? process.env;
77626
77890
  const platform = options.platform ?? process.platform;
77627
77891
  const repoRoot = resolve15(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env3 }));
77628
- const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join53(homedir6(), ".codex"));
77892
+ const codexHome = resolve15(options.codexHome ?? env3.CODEX_HOME ?? join55(homedir6(), ".codex"));
77629
77893
  const projectDirectory = resolve15(options.projectDirectory ?? env3.OMO_CODEX_PROJECT ?? process.cwd());
77630
77894
  const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env3 });
77631
77895
  const runCommand = options.runCommand ?? defaultRunCommand;
@@ -77641,9 +77905,9 @@ async function runCodexInstaller(options = {}) {
77641
77905
  if (!gitBashResolution.found) {
77642
77906
  throw new Error(gitBashResolution.installHint);
77643
77907
  }
77644
- const codexPackageRoot = join53(repoRoot, "packages", "omo-codex");
77908
+ const codexPackageRoot = join55(repoRoot, "packages", "omo-codex");
77645
77909
  const marketplace = await readMarketplace(repoRoot, {
77646
- marketplacePath: join53(codexPackageRoot, "marketplace.json")
77910
+ marketplacePath: join55(codexPackageRoot, "marketplace.json")
77647
77911
  });
77648
77912
  const distributionManifest = await readDistributionManifest(repoRoot);
77649
77913
  const installed = [];
@@ -77686,7 +77950,7 @@ async function runCodexInstaller(options = {}) {
77686
77950
  if (runtimeLink !== null)
77687
77951
  log4(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
77688
77952
  else
77689
- log4(`Warning: skipped the omo runtime wrapper because ${join53(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
77953
+ log4(`Warning: skipped the omo runtime wrapper because ${join55(repoRoot, "dist", "cli", "index.js")} is missing; omo ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
77690
77954
  }
77691
77955
  pluginSources.push({ name: entry.name, sourcePath });
77692
77956
  installed.push(plugin);
@@ -77717,7 +77981,7 @@ async function runCodexInstaller(options = {}) {
77717
77981
  });
77718
77982
  for (const link of agentLinks) {
77719
77983
  log4(`Linked agent ${link.name} -> ${link.target}`);
77720
- const agentName = agentNameFromToml2(link.name);
77984
+ const agentName = agentNameFromToml3(link.name);
77721
77985
  agentConfigs.set(agentName, { name: agentName, configFile: `./agents/${link.name}` });
77722
77986
  }
77723
77987
  }
@@ -77740,13 +78004,13 @@ async function runCodexInstaller(options = {}) {
77740
78004
  });
77741
78005
  }
77742
78006
  await reapLspDaemons(codexHome).catch(() => []);
77743
- const marketplaceRoot = join53(codexHome, "plugins", "cache", marketplace.name);
78007
+ const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
77744
78008
  await writeCachedMarketplaceManifest({
77745
78009
  marketplaceName: marketplace.name,
77746
78010
  marketplaceRoot,
77747
78011
  plugins: installed
77748
78012
  });
77749
- const configPath = join53(codexHome, "config.toml");
78013
+ const configPath = join55(codexHome, "config.toml");
77750
78014
  await updateCodexConfig({
77751
78015
  configPath,
77752
78016
  repoRoot: codexPackageRoot,
@@ -77784,7 +78048,7 @@ async function runCodexInstaller(options = {}) {
77784
78048
  projectCleanup
77785
78049
  };
77786
78050
  }
77787
- function agentNameFromToml2(fileName) {
78051
+ function agentNameFromToml3(fileName) {
77788
78052
  return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
77789
78053
  }
77790
78054
  async function agentSourceRootsForInstall(input) {
@@ -77806,7 +78070,7 @@ function findRepoRootFromImporter(importerDir) {
77806
78070
  for (let depth = 0;depth <= 7; depth += 1) {
77807
78071
  if (isRepoRootWithCodexPlugin(current))
77808
78072
  return current;
77809
- for (const wrapperPackageRoot of [join53(current, "node_modules", "oh-my-openagent"), join53(current, "oh-my-openagent")]) {
78073
+ for (const wrapperPackageRoot of [join55(current, "node_modules", "oh-my-openagent"), join55(current, "oh-my-openagent")]) {
77810
78074
  if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
77811
78075
  return wrapperPackageRoot;
77812
78076
  }
@@ -77824,7 +78088,7 @@ function findRepoRoot(input) {
77824
78088
  return findRepoRootFromImporter(input.importerDir);
77825
78089
  }
77826
78090
  function isRepoRootWithCodexPlugin(repoRoot) {
77827
- return existsSync30(join53(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
78091
+ return existsSync30(join55(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
77828
78092
  }
77829
78093
  function codexMarketplaceSource(marketplaceRoot) {
77830
78094
  return { sourceType: "local", source: marketplaceRoot };
@@ -77845,19 +78109,19 @@ async function detectCodexInstallation(input = {}) {
77845
78109
  const platform = input.platform ?? process.platform;
77846
78110
  const env3 = input.env ?? process.env;
77847
78111
  const homeDir = input.homeDir ?? homedir7();
77848
- const exists5 = input.exists ?? existsSync31;
78112
+ const exists6 = input.exists ?? existsSync31;
77849
78113
  const which2 = input.which ?? bunWhich;
77850
78114
  const checkedPaths = [CODEX_PATH_CHECK_LABEL];
77851
78115
  const cliPath = nonEmptyValue2(which2("codex"));
77852
78116
  if (cliPath !== undefined)
77853
78117
  return { found: true, source: "cli", path: cliPath };
77854
78118
  if (platform === "darwin") {
77855
- return detectMacCodexInstallation({ homeDir, exists: exists5, checkedPaths });
78119
+ return detectMacCodexInstallation({ homeDir, exists: exists6, checkedPaths });
77856
78120
  }
77857
78121
  if (platform === "win32") {
77858
78122
  return detectWindowsCodexInstallation({
77859
78123
  env: env3,
77860
- exists: exists5,
78124
+ exists: exists6,
77861
78125
  checkedPaths,
77862
78126
  runCommand: input.runCommand ?? defaultRunCommand2
77863
78127
  });
@@ -77959,13 +78223,13 @@ function defaultRunCommand2(command, args) {
77959
78223
  });
77960
78224
  }
77961
78225
  // packages/omo-codex/src/install/codex-cleanup.ts
77962
- import { lstat as lstat11, readFile as readFile21, readdir as readdir9, rm as rm11, rmdir } from "node:fs/promises";
78226
+ import { lstat as lstat12, readFile as readFile21, readdir as readdir10, rm as rm11, rmdir } from "node:fs/promises";
77963
78227
  import { homedir as homedir8 } from "node:os";
77964
- import { isAbsolute as isAbsolute10, join as join55, relative as relative7, resolve as resolve17 } from "node:path";
78228
+ import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "node:path";
77965
78229
 
77966
78230
  // packages/omo-codex/src/install/codex-cleanup-config.ts
77967
- import { lstat as lstat10, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
77968
- import { dirname as dirname18 } from "node:path";
78231
+ import { lstat as lstat11, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile12 } from "node:fs/promises";
78232
+ import { dirname as dirname19 } from "node:path";
77969
78233
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
77970
78234
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
77971
78235
  var CURRENT_MANAGED_CODEX_AGENT_NAMES2 = [
@@ -77999,9 +78263,9 @@ async function cleanupCodexConfig(configPath, now) {
77999
78263
  if (next === original)
78000
78264
  return { changed: false };
78001
78265
  const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
78002
- await mkdir8(dirname18(configPath), { recursive: true });
78003
- await writeFile11(backupPath, original);
78004
- await writeFile11(configPath, `${next.trimEnd()}
78266
+ await mkdir8(dirname19(configPath), { recursive: true });
78267
+ await writeFile12(backupPath, original);
78268
+ await writeFile12(configPath, `${next.trimEnd()}
78005
78269
  `);
78006
78270
  return { changed: true, backupPath };
78007
78271
  }
@@ -78063,27 +78327,27 @@ function formatBackupTimestamp2(date) {
78063
78327
  }
78064
78328
  async function configExists(path7) {
78065
78329
  try {
78066
- await lstat10(path7);
78330
+ await lstat11(path7);
78067
78331
  return true;
78068
78332
  } catch (error) {
78069
- if (nodeErrorCode4(error) === "ENOENT")
78333
+ if (nodeErrorCode5(error) === "ENOENT")
78070
78334
  return false;
78071
78335
  throw error;
78072
78336
  }
78073
78337
  }
78074
- function nodeErrorCode4(error) {
78338
+ function nodeErrorCode5(error) {
78075
78339
  if (!(error instanceof Error) || !("code" in error))
78076
78340
  return null;
78077
78341
  return typeof error.code === "string" ? error.code : null;
78078
78342
  }
78079
78343
 
78080
78344
  // packages/omo-codex/src/install/codex-cleanup-safety.ts
78081
- import { dirname as dirname19, isAbsolute as isAbsolute9, join as join54, relative as relative6, resolve as resolve16 } from "node:path";
78345
+ import { dirname as dirname20, isAbsolute as isAbsolute10, join as join56, relative as relative6, resolve as resolve16 } from "node:path";
78082
78346
  function validateManagedCleanupTarget(input) {
78083
- if (!isAbsolute9(input.path))
78347
+ if (!isAbsolute10(input.path))
78084
78348
  return skipped(input.path, "outside managed Codex cleanup scope");
78085
78349
  const codexHome = resolve16(input.codexHome);
78086
- if (dirname19(codexHome) === codexHome)
78350
+ if (dirname20(codexHome) === codexHome)
78087
78351
  return skipped(input.path, "Codex home resolves to a filesystem root");
78088
78352
  const target = resolve16(input.path);
78089
78353
  if (!isWithinDirectory(codexHome, target))
@@ -78091,11 +78355,11 @@ function validateManagedCleanupTarget(input) {
78091
78355
  if (target === codexHome)
78092
78356
  return skipped(input.path, "outside managed Codex cleanup scope");
78093
78357
  const exactManagedRoots = new Set([
78094
- resolve16(join54(codexHome, "plugins", "cache", "sisyphuslabs")),
78095
- resolve16(join54(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
78096
- resolve16(join54(codexHome, "runtime", "ast-grep")),
78097
- resolve16(join54(codexHome, "runtime", "node")),
78098
- resolve16(join54(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
78358
+ resolve16(join56(codexHome, "plugins", "cache", "sisyphuslabs")),
78359
+ resolve16(join56(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
78360
+ resolve16(join56(codexHome, "runtime", "ast-grep")),
78361
+ resolve16(join56(codexHome, "runtime", "node")),
78362
+ resolve16(join56(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
78099
78363
  ]);
78100
78364
  if (exactManagedRoots.has(target))
78101
78365
  return null;
@@ -78105,7 +78369,7 @@ function validateManagedCleanupTarget(input) {
78105
78369
  }
78106
78370
  function isWithinDirectory(parent, child) {
78107
78371
  const relativePath = relative6(parent, child);
78108
- return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute9(relativePath);
78372
+ return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute10(relativePath);
78109
78373
  }
78110
78374
  function isManagedBootstrapDriftPath(codexHome, target) {
78111
78375
  const relativePath = relative6(codexHome, target);
@@ -78125,8 +78389,8 @@ function skipped(path7, reason) {
78125
78389
  var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
78126
78390
  async function cleanupCodexLight(input = {}) {
78127
78391
  const env3 = input.env ?? process.env;
78128
- const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join55(homedir8(), ".codex"));
78129
- const configPath = join55(codexHome, "config.toml");
78392
+ const codexHome = resolve17(input.codexHome ?? env3.CODEX_HOME ?? join57(homedir8(), ".codex"));
78393
+ const configPath = join57(codexHome, "config.toml");
78130
78394
  const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
78131
78395
  const configCleanup = await cleanupCodexConfig(configPath, input.now);
78132
78396
  const agentCleanup = await removeManifestListedAgentLinks(codexHome, agentPaths);
@@ -78165,32 +78429,32 @@ async function cleanupCodexLight(input = {}) {
78165
78429
  }
78166
78430
  function managedGlobalStatePaths(codexHome) {
78167
78431
  return [
78168
- join55(codexHome, "plugins", "cache", "sisyphuslabs"),
78169
- join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
78170
- join55(codexHome, "runtime", "ast-grep"),
78171
- join55(codexHome, "runtime", "node"),
78172
- join55(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
78432
+ join57(codexHome, "plugins", "cache", "sisyphuslabs"),
78433
+ join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
78434
+ join57(codexHome, "runtime", "ast-grep"),
78435
+ join57(codexHome, "runtime", "node"),
78436
+ join57(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
78173
78437
  ];
78174
78438
  }
78175
78439
  var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
78176
78440
  async function collectBootstrapDataDirsByGlob(codexHome) {
78177
78441
  const results = [];
78178
- await walkForManagedBootstrapDirs(join55(codexHome, "plugins"), 0, results);
78442
+ await walkForManagedBootstrapDirs(join57(codexHome, "plugins"), 0, results);
78179
78443
  return results;
78180
78444
  }
78181
78445
  async function walkForManagedBootstrapDirs(directory, depth, results) {
78182
78446
  if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
78183
78447
  return;
78184
- const entries = await readdir9(directory, { withFileTypes: true }).catch(() => null);
78448
+ const entries = await readdir10(directory, { withFileTypes: true }).catch(() => null);
78185
78449
  if (entries === null)
78186
78450
  return;
78187
78451
  for (const entry of entries) {
78188
78452
  if (!entry.isDirectory())
78189
78453
  continue;
78190
- const childPath = join55(directory, entry.name);
78454
+ const childPath = join57(directory, entry.name);
78191
78455
  if (isManagedBootstrapOwnerName(entry.name)) {
78192
- const bootstrapDir = join55(childPath, "bootstrap");
78193
- if (await exists5(bootstrapDir))
78456
+ const bootstrapDir = join57(childPath, "bootstrap");
78457
+ if (await exists6(bootstrapDir))
78194
78458
  results.push(bootstrapDir);
78195
78459
  continue;
78196
78460
  }
@@ -78213,7 +78477,7 @@ async function removeManagedPathBestEffort(path7, seams) {
78213
78477
  }
78214
78478
  async function attemptRemove(path7) {
78215
78479
  try {
78216
- if (await lstat11(path7).catch(() => null) === null)
78480
+ if (await lstat12(path7).catch(() => null) === null)
78217
78481
  return false;
78218
78482
  await rm11(path7, { recursive: true, force: true });
78219
78483
  return true;
@@ -78223,7 +78487,7 @@ async function attemptRemove(path7) {
78223
78487
  }
78224
78488
  async function pruneEmptyRuntimeDirBestEffort(codexHome) {
78225
78489
  try {
78226
- await rmdir(join55(codexHome, "runtime"));
78490
+ await rmdir(join57(codexHome, "runtime"));
78227
78491
  } catch (error) {
78228
78492
  if (isExpectedRuntimePruneFailure(error))
78229
78493
  return;
@@ -78231,18 +78495,18 @@ async function pruneEmptyRuntimeDirBestEffort(codexHome) {
78231
78495
  }
78232
78496
  }
78233
78497
  function isExpectedRuntimePruneFailure(error) {
78234
- return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode5(error) ?? "");
78498
+ return ["ENOENT", "ENOTEMPTY", "EEXIST", "EPERM", "EBUSY", "ENOTDIR"].includes(nodeErrorCode6(error) ?? "");
78235
78499
  }
78236
78500
  async function collectInstalledAgentPaths(codexHome, configPath) {
78237
78501
  const manifestPaths = [
78238
- join55(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
78502
+ join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
78239
78503
  ];
78240
- const versionRoot = join55(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78241
- if (await exists5(versionRoot)) {
78242
- const entries = await readdir9(versionRoot, { withFileTypes: true });
78504
+ const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78505
+ if (await exists6(versionRoot)) {
78506
+ const entries = await readdir10(versionRoot, { withFileTypes: true });
78243
78507
  for (const entry of entries) {
78244
78508
  if (entry.isDirectory())
78245
- manifestPaths.push(join55(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
78509
+ manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
78246
78510
  }
78247
78511
  }
78248
78512
  const paths = new Set;
@@ -78257,13 +78521,13 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78257
78521
  return [...paths].sort();
78258
78522
  }
78259
78523
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
78260
- if (!await exists5(configPath))
78524
+ if (!await exists6(configPath))
78261
78525
  return [];
78262
78526
  const config = await readFile21(configPath, "utf8");
78263
- return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join55(codexHome, "agents", `${agentName}.toml`));
78527
+ return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
78264
78528
  }
78265
78529
  async function readInstalledAgentManifest(manifestPath) {
78266
- if (!await exists5(manifestPath))
78530
+ if (!await exists6(manifestPath))
78267
78531
  return [];
78268
78532
  const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
78269
78533
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
@@ -78271,7 +78535,7 @@ async function readInstalledAgentManifest(manifestPath) {
78271
78535
  return parsed.agents.filter((path7) => typeof path7 === "string");
78272
78536
  }
78273
78537
  async function removeManifestListedAgentLinks(codexHome, paths) {
78274
- const agentsDir = join55(codexHome, "agents");
78538
+ const agentsDir = join57(codexHome, "agents");
78275
78539
  const removed = [];
78276
78540
  const skipped2 = [];
78277
78541
  for (const path7 of paths) {
@@ -78292,29 +78556,29 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
78292
78556
  return { removed, skipped: skipped2 };
78293
78557
  }
78294
78558
  function isSafeManagedAgentPath(agentsDir, path7) {
78295
- if (!isAbsolute10(path7))
78559
+ if (!isAbsolute11(path7))
78296
78560
  return false;
78297
78561
  const relativePath = relative7(agentsDir, path7);
78298
- if (relativePath === "" || relativePath.startsWith("..") || isAbsolute10(relativePath))
78562
+ if (relativePath === "" || relativePath.startsWith("..") || isAbsolute11(relativePath))
78299
78563
  return false;
78300
78564
  const fileName = relativePath.split(/[\\/]/).pop();
78301
78565
  if (fileName === undefined)
78302
78566
  return false;
78303
78567
  return MANAGED_CODEX_AGENT_NAMES2.some((agentName) => fileName === `${agentName}.toml`);
78304
78568
  }
78305
- async function exists5(path7) {
78569
+ async function exists6(path7) {
78306
78570
  return await maybeLstat2(path7) !== null;
78307
78571
  }
78308
78572
  async function maybeLstat2(path7) {
78309
78573
  try {
78310
- return await lstat11(path7);
78574
+ return await lstat12(path7);
78311
78575
  } catch (error) {
78312
- if (nodeErrorCode5(error) === "ENOENT")
78576
+ if (nodeErrorCode6(error) === "ENOENT")
78313
78577
  return null;
78314
78578
  throw error;
78315
78579
  }
78316
78580
  }
78317
- function nodeErrorCode5(error) {
78581
+ function nodeErrorCode6(error) {
78318
78582
  if (!(error instanceof Error) || !("code" in error))
78319
78583
  return null;
78320
78584
  return typeof error.code === "string" ? error.code : null;
@@ -78324,16 +78588,16 @@ var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", ".
78324
78588
  // packages/omo-senpi/src/install/install-senpi.ts
78325
78589
  import { execFile as execFile3 } from "node:child_process";
78326
78590
  import { constants as constants7, existsSync as existsSync32 } from "node:fs";
78327
- import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile12 } from "node:fs/promises";
78591
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
78328
78592
  import { homedir as homedir9 } from "node:os";
78329
- import { dirname as dirname20, join as join56, resolve as resolve18 } from "node:path";
78593
+ import { dirname as dirname21, join as join58, resolve as resolve18 } from "node:path";
78330
78594
  import { fileURLToPath } from "node:url";
78331
78595
  import { promisify as promisify2 } from "node:util";
78332
78596
  var execFileAsync2 = promisify2(execFile3);
78333
78597
  var REQUIRED_PLUGIN_ARTIFACTS = [
78334
- join56("extensions", "omo.js"),
78335
- join56("skills", "ultrawork", "SKILL.md"),
78336
- join56("skills", "ulw-loop", "SKILL.md")
78598
+ join58("extensions", "omo.js"),
78599
+ join58("skills", "ultrawork", "SKILL.md"),
78600
+ join58("skills", "ulw-loop", "SKILL.md")
78337
78601
  ];
78338
78602
  async function runSenpiInstaller(options = {}) {
78339
78603
  const context = resolveInstallContext(options);
@@ -78357,14 +78621,14 @@ async function runSenpiInstaller(options = {}) {
78357
78621
  }
78358
78622
  function resolveInstallContext(options) {
78359
78623
  const env3 = options.env ?? process.env;
78360
- const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname20(fileURLToPath(import.meta.url))));
78361
- const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join56(homedir9(), ".senpi", "agent"));
78362
- const pluginPath = resolve18(options.pluginPath ?? join56(repoRoot, "packages", "omo-senpi", "plugin"));
78624
+ const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))));
78625
+ const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
78626
+ const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
78363
78627
  return {
78364
78628
  env: env3,
78365
78629
  repoRoot,
78366
78630
  agentDir,
78367
- settingsPath: join56(agentDir, "settings.json"),
78631
+ settingsPath: join58(agentDir, "settings.json"),
78368
78632
  pluginPath,
78369
78633
  runCommand: options.runCommand ?? defaultRunCommand3
78370
78634
  };
@@ -78373,12 +78637,12 @@ async function ensurePluginArtifacts(context) {
78373
78637
  const missing = await hasMissingPluginArtifact(context.pluginPath);
78374
78638
  if (!missing)
78375
78639
  return;
78376
- await context.runCommand("node", [join56(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78377
- await context.runCommand("node", [join56(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
78640
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78641
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
78378
78642
  }
78379
78643
  async function hasMissingPluginArtifact(pluginPath) {
78380
78644
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
78381
- if (!await fileExists(join56(pluginPath, artifact)))
78645
+ if (!await fileExists(join58(pluginPath, artifact)))
78382
78646
  return true;
78383
78647
  }
78384
78648
  return false;
@@ -78417,16 +78681,16 @@ function dedupePackages(packages) {
78417
78681
  return [...new Set(packages)];
78418
78682
  }
78419
78683
  async function writeSettingsAtomically(settingsPath, settings) {
78420
- await mkdir9(dirname20(settingsPath), { recursive: true });
78684
+ await mkdir9(dirname21(settingsPath), { recursive: true });
78421
78685
  const backupPath = await nextBackupPath(settingsPath);
78422
78686
  if (await fileExists(settingsPath)) {
78423
78687
  await copyFile3(settingsPath, backupPath);
78424
78688
  } else {
78425
- await writeFile12(backupPath, `{}
78689
+ await writeFile13(backupPath, `{}
78426
78690
  `, "utf8");
78427
78691
  }
78428
78692
  const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
78429
- await writeFile12(tempPath, `${JSON.stringify(settings, null, 2)}
78693
+ await writeFile13(tempPath, `${JSON.stringify(settings, null, 2)}
78430
78694
  `, "utf8");
78431
78695
  await rename5(tempPath, settingsPath);
78432
78696
  return backupPath;
@@ -78446,7 +78710,7 @@ function timestampForBackup() {
78446
78710
  function findRepoRoot2(importerDir) {
78447
78711
  let current = importerDir;
78448
78712
  for (let depth = 0;depth <= 7; depth += 1) {
78449
- if (fileExistsSync(join56(current, "packages", "omo-senpi", "plugin", "package.json")))
78713
+ if (fileExistsSync(join58(current, "packages", "omo-senpi", "plugin", "package.json")))
78450
78714
  return current;
78451
78715
  current = resolve18(current, "..");
78452
78716
  }
@@ -78505,26 +78769,26 @@ async function starGitHubRepositories(platform = "both", runCommand = runGitHubS
78505
78769
  init_provider_availability();
78506
78770
 
78507
78771
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
78508
- import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync16 } from "node:fs";
78509
- import { join as join58 } from "node:path";
78772
+ import { existsSync as existsSync34, mkdirSync as mkdirSync10, readFileSync as readFileSync17 } from "node:fs";
78773
+ import { join as join60 } from "node:path";
78510
78774
 
78511
78775
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
78512
78776
  init_shared();
78513
- import { existsSync as existsSync33, readFileSync as readFileSync15 } from "node:fs";
78514
- import { join as join57 } from "node:path";
78777
+ import { existsSync as existsSync33, readFileSync as readFileSync16 } from "node:fs";
78778
+ import { join as join59 } from "node:path";
78515
78779
  var TUI_SUBPATH = "tui";
78516
78780
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
78517
78781
  function fileEntryPackageJsonPath(entry) {
78518
78782
  let path7 = entry.slice("file:".length);
78519
78783
  if (path7.startsWith("//"))
78520
78784
  path7 = path7.slice(2);
78521
- return join57(path7, "package.json");
78785
+ return join59(path7, "package.json");
78522
78786
  }
78523
78787
  function packageJsonExportsTui(pkgJsonPath) {
78524
78788
  if (!existsSync33(pkgJsonPath))
78525
78789
  return null;
78526
78790
  try {
78527
- const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
78791
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
78528
78792
  if (parsed.exports === undefined)
78529
78793
  return null;
78530
78794
  if (typeof parsed.exports === "string")
@@ -78556,7 +78820,7 @@ function packageExportsTuiForServerEntry(entry) {
78556
78820
  const packageName = packageNameFromServerEntry(entry);
78557
78821
  if (packageName === null)
78558
78822
  return null;
78559
- return packageJsonExportsTui(join57(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
78823
+ return packageJsonExportsTui(join59(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
78560
78824
  }
78561
78825
  function isOurFilePluginEntry(entry) {
78562
78826
  if (typeof entry !== "string" || !entry.startsWith("file:"))
@@ -78565,7 +78829,7 @@ function isOurFilePluginEntry(entry) {
78565
78829
  const pkgJsonPath = fileEntryPackageJsonPath(entry);
78566
78830
  if (!existsSync33(pkgJsonPath))
78567
78831
  return false;
78568
- const parsed = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
78832
+ const parsed = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
78569
78833
  return typeof parsed.name === "string" && ACCEPTED_PACKAGE_NAMES.includes(parsed.name);
78570
78834
  } catch (error) {
78571
78835
  log2("[tui-plugin-config] Failed to inspect file plugin package", {
@@ -78603,7 +78867,7 @@ function detectServerPluginRegistration() {
78603
78867
  return { registered: false, configPath: null, entry: null, packageExportsTui: null };
78604
78868
  }
78605
78869
  try {
78606
- const parsed = parseJsonc(readFileSync15(configPath, "utf-8"));
78870
+ const parsed = parseJsonc(readFileSync16(configPath, "utf-8"));
78607
78871
  const plugins = parsed.plugin ?? [];
78608
78872
  const serverEntry = plugins.find(isServerPluginEntry);
78609
78873
  return {
@@ -78621,7 +78885,7 @@ function detectServerPluginRegistration() {
78621
78885
  }
78622
78886
  }
78623
78887
  function detectTuiPluginRegistration() {
78624
- const tuiJsonPath = join57(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
78888
+ const tuiJsonPath = join59(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
78625
78889
  if (!existsSync33(tuiJsonPath)) {
78626
78890
  return {
78627
78891
  registered: false,
@@ -78633,7 +78897,7 @@ function detectTuiPluginRegistration() {
78633
78897
  };
78634
78898
  }
78635
78899
  try {
78636
- const parsed = parseJsonc(readFileSync15(tuiJsonPath, "utf-8"));
78900
+ const parsed = parseJsonc(readFileSync16(tuiJsonPath, "utf-8"));
78637
78901
  const plugins = parsed.plugin ?? [];
78638
78902
  return {
78639
78903
  registered: plugins.some(isTuiPluginEntry),
@@ -78766,7 +79030,7 @@ init_shared();
78766
79030
  init_write_file_atomically2();
78767
79031
  function readConfig(path7) {
78768
79032
  try {
78769
- const parsed = parseJsonc(readFileSync16(path7, "utf-8"));
79033
+ const parsed = parseJsonc(readFileSync17(path7, "utf-8"));
78770
79034
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
78771
79035
  return parsed;
78772
79036
  }
@@ -78777,10 +79041,10 @@ function readConfig(path7) {
78777
79041
  return null;
78778
79042
  }
78779
79043
  function readServerConfig(configDir) {
78780
- const jsoncPath = join58(configDir, "opencode.jsonc");
79044
+ const jsoncPath = join60(configDir, "opencode.jsonc");
78781
79045
  if (existsSync34(jsoncPath))
78782
79046
  return readConfig(jsoncPath);
78783
- const jsonPath = join58(configDir, "opencode.json");
79047
+ const jsonPath = join60(configDir, "opencode.json");
78784
79048
  if (existsSync34(jsonPath))
78785
79049
  return readConfig(jsonPath);
78786
79050
  return null;
@@ -78822,7 +79086,7 @@ function ensureTuiPluginEntry(opts = {}) {
78822
79086
  if (!desiredEntry) {
78823
79087
  return { changed: false, reason: "no-server-entry" };
78824
79088
  }
78825
- const tuiJsonPath = join58(configDir, "tui.json");
79089
+ const tuiJsonPath = join60(configDir, "tui.json");
78826
79090
  const { config, malformed } = readTuiConfig(tuiJsonPath);
78827
79091
  if (malformed) {
78828
79092
  return { changed: false, reason: "malformed" };
@@ -78838,7 +79102,7 @@ function ensureTuiPluginEntry(opts = {}) {
78838
79102
 
78839
79103
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
78840
79104
  import { homedir as homedir10 } from "node:os";
78841
- import { join as join59 } from "node:path";
79105
+ import { join as join61 } from "node:path";
78842
79106
 
78843
79107
  // packages/shared-skills/index.mjs
78844
79108
  import { fileURLToPath as fileURLToPath2 } from "node:url";
@@ -78857,9 +79121,9 @@ function describeResult2(result) {
78857
79121
  }
78858
79122
  async function installAstGrepForOpenCode(options = {}) {
78859
79123
  const platform = options.platform ?? process.platform;
78860
- const baseDir = join59(options.homeDir ?? homedir10(), ".omo");
79124
+ const baseDir = join61(options.homeDir ?? homedir10(), ".omo");
78861
79125
  const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
78862
- const skillDir = join59(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
79126
+ const skillDir = join61(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
78863
79127
  const installer = options.installer ?? runAstGrepSkillInstall;
78864
79128
  try {
78865
79129
  const result = await installer({ platform, skillDir, targetDir });
@@ -96854,7 +97118,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
96854
97118
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
96855
97119
  init_bun_which_shim();
96856
97120
  init_spawn_with_windows_hide();
96857
- import { delimiter as delimiter2, dirname as dirname22, posix as posix4, win32 as win324 } from "node:path";
97121
+ import { delimiter as delimiter2, dirname as dirname23, posix as posix4, win32 as win324 } from "node:path";
96858
97122
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
96859
97123
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
96860
97124
  function getCommandCandidates(platform) {
@@ -96912,7 +97176,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
96912
97176
  return null;
96913
97177
  }
96914
97178
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
96915
- const preferredDir = dirname22(binaryPath);
97179
+ const preferredDir = dirname23(binaryPath);
96916
97180
  const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
96917
97181
  return [preferredDir, ...existing].join(delimiter2);
96918
97182
  }
@@ -97305,7 +97569,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
97305
97569
  var NOTEPAD_DIR = "notepads";
97306
97570
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
97307
97571
  // packages/boulder-state/src/top-level-task.ts
97308
- import { existsSync as existsSync37, readFileSync as readFileSync18 } from "node:fs";
97572
+ import { existsSync as existsSync37, readFileSync as readFileSync19 } from "node:fs";
97309
97573
  var TODO_HEADING_PATTERN = /^##\s+TODOs\b/i;
97310
97574
  var FINAL_VERIFICATION_HEADING_PATTERN = /^##\s+Final Verification Wave\b/i;
97311
97575
  var SECOND_LEVEL_HEADING_PATTERN = /^##\s+/;
@@ -97332,7 +97596,7 @@ function readCurrentTopLevelTask(planPath) {
97332
97596
  return null;
97333
97597
  }
97334
97598
  try {
97335
- const content = readFileSync18(planPath, "utf-8");
97599
+ const content = readFileSync19(planPath, "utf-8");
97336
97600
  const lines = content.split(/\r?\n/);
97337
97601
  let section = "other";
97338
97602
  for (const line of lines) {
@@ -97358,12 +97622,12 @@ function readCurrentTopLevelTask(planPath) {
97358
97622
  }
97359
97623
  // packages/boulder-state/src/storage/path.ts
97360
97624
  import { existsSync as existsSync38 } from "node:fs";
97361
- import { isAbsolute as isAbsolute11, join as join61, relative as relative8, resolve as resolve19 } from "node:path";
97625
+ import { isAbsolute as isAbsolute12, join as join63, relative as relative8, resolve as resolve19 } from "node:path";
97362
97626
  function getBoulderFilePath(directory) {
97363
- return join61(directory, BOULDER_DIR, BOULDER_FILE);
97627
+ return join63(directory, BOULDER_DIR, BOULDER_FILE);
97364
97628
  }
97365
97629
  function resolveTrackedPath(baseDirectory, trackedPath) {
97366
- return isAbsolute11(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
97630
+ return isAbsolute12(trackedPath) ? resolve19(trackedPath) : resolve19(baseDirectory, trackedPath);
97367
97631
  }
97368
97632
  function resolveBoulderPlanPath(directory, state) {
97369
97633
  const absolutePlanPath = resolveTrackedPath(directory, state.active_plan);
@@ -97373,7 +97637,7 @@ function resolveBoulderPlanPath(directory, state) {
97373
97637
  }
97374
97638
  const absoluteDirectory = resolve19(directory);
97375
97639
  const relativePlanPath = relative8(absoluteDirectory, absolutePlanPath);
97376
- if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute11(relativePlanPath)) {
97640
+ if (relativePlanPath.length === 0 || relativePlanPath.startsWith("..") || isAbsolute12(relativePlanPath)) {
97377
97641
  return absolutePlanPath;
97378
97642
  }
97379
97643
  const absoluteWorktreePath = resolveTrackedPath(directory, worktreePath);
@@ -97384,7 +97648,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
97384
97648
  return resolveBoulderPlanPath(directory, work);
97385
97649
  }
97386
97650
  // packages/boulder-state/src/storage/plan-progress.ts
97387
- import { existsSync as existsSync39, readFileSync as readFileSync19, readdirSync as readdirSync5, statSync as statSync5 } from "node:fs";
97651
+ import { existsSync as existsSync39, readFileSync as readFileSync20, readdirSync as readdirSync5, statSync as statSync5 } from "node:fs";
97388
97652
  var TODO_HEADING_PATTERN2 = /^##\s+TODOs\b/i;
97389
97653
  var FINAL_VERIFICATION_HEADING_PATTERN2 = /^##\s+Final Verification Wave\b/i;
97390
97654
  var SECOND_LEVEL_HEADING_PATTERN2 = /^##\s+/;
@@ -97397,7 +97661,7 @@ function getPlanProgress(planPath) {
97397
97661
  return { total: 0, completed: 0, isComplete: false };
97398
97662
  }
97399
97663
  try {
97400
- const content = readFileSync19(planPath, "utf-8");
97664
+ const content = readFileSync20(planPath, "utf-8");
97401
97665
  const lines = content.split(/\r?\n/);
97402
97666
  const hasStructuredSections = lines.some((line) => TODO_HEADING_PATTERN2.test(line) || FINAL_VERIFICATION_HEADING_PATTERN2.test(line));
97403
97667
  if (hasStructuredSections) {
@@ -97513,14 +97777,14 @@ function selectMirrorWork(state) {
97513
97777
  return sorted[0] ?? null;
97514
97778
  }
97515
97779
  // packages/boulder-state/src/storage/read-state.ts
97516
- import { existsSync as existsSync40, readFileSync as readFileSync20 } from "node:fs";
97780
+ import { existsSync as existsSync40, readFileSync as readFileSync21 } from "node:fs";
97517
97781
  function readBoulderState(directory) {
97518
97782
  const filePath = getBoulderFilePath(directory);
97519
97783
  if (!existsSync40(filePath)) {
97520
97784
  return null;
97521
97785
  }
97522
97786
  try {
97523
- const content = readFileSync20(filePath, "utf-8");
97787
+ const content = readFileSync21(filePath, "utf-8");
97524
97788
  const parsed = JSON.parse(content);
97525
97789
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
97526
97790
  return null;
@@ -97586,17 +97850,17 @@ init_state();
97586
97850
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
97587
97851
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
97588
97852
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
97589
- import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync21, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
97590
- import { join as join62 } from "node:path";
97853
+ import { existsSync as existsSync41, mkdirSync as mkdirSync11, readFileSync as readFileSync22, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
97854
+ import { join as join64 } from "node:path";
97591
97855
  function getMarkerPath(directory, sessionID) {
97592
- return join62(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
97856
+ return join64(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
97593
97857
  }
97594
97858
  function readContinuationMarker(directory, sessionID) {
97595
97859
  const markerPath = getMarkerPath(directory, sessionID);
97596
97860
  if (!existsSync41(markerPath))
97597
97861
  return null;
97598
97862
  try {
97599
- const raw = readFileSync21(markerPath, "utf-8");
97863
+ const raw = readFileSync22(markerPath, "utf-8");
97600
97864
  const parsed = JSON.parse(raw);
97601
97865
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
97602
97866
  return null;
@@ -97661,8 +97925,8 @@ async function isSessionInBoulderLineage(input) {
97661
97925
  // packages/omo-opencode/src/hooks/atlas/session-last-agent.ts
97662
97926
  init_shared();
97663
97927
  init_compaction_marker();
97664
- import { readFileSync as readFileSync22, readdirSync as readdirSync6 } from "node:fs";
97665
- import { join as join63 } from "node:path";
97928
+ import { readFileSync as readFileSync23, readdirSync as readdirSync6 } from "node:fs";
97929
+ import { join as join65 } from "node:path";
97666
97930
  var defaultSessionLastAgentDeps = {
97667
97931
  getMessageDir,
97668
97932
  isSqliteBackend,
@@ -97722,7 +97986,7 @@ async function getLastAgentFromSession(sessionID, client3, deps = {}) {
97722
97986
  try {
97723
97987
  const messages = readdirSync6(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
97724
97988
  try {
97725
- const content = readFileSync22(join63(messageDir, fileName), "utf-8");
97989
+ const content = readFileSync23(join65(messageDir, fileName), "utf-8");
97726
97990
  const parsed = JSON.parse(content);
97727
97991
  return {
97728
97992
  fileName,
@@ -97765,8 +98029,8 @@ init_agent_display_names();
97765
98029
 
97766
98030
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
97767
98031
  init_frontmatter2();
97768
- import { existsSync as existsSync42, readFileSync as readFileSync23, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "node:fs";
97769
- import { dirname as dirname23, join as join64 } from "node:path";
98032
+ import { existsSync as existsSync42, readFileSync as readFileSync24, writeFileSync as writeFileSync7, unlinkSync as unlinkSync5, mkdirSync as mkdirSync12 } from "node:fs";
98033
+ import { dirname as dirname24, join as join66 } from "node:path";
97770
98034
 
97771
98035
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
97772
98036
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -97775,7 +98039,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
97775
98039
 
97776
98040
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
97777
98041
  function getStateFilePath(directory, customPath) {
97778
- return customPath ? join64(directory, customPath) : join64(directory, DEFAULT_STATE_FILE);
98042
+ return customPath ? join66(directory, customPath) : join66(directory, DEFAULT_STATE_FILE);
97779
98043
  }
97780
98044
  function readState(directory, customPath) {
97781
98045
  const filePath = getStateFilePath(directory, customPath);
@@ -97783,7 +98047,7 @@ function readState(directory, customPath) {
97783
98047
  return null;
97784
98048
  }
97785
98049
  try {
97786
- const content = readFileSync23(filePath, "utf-8");
98050
+ const content = readFileSync24(filePath, "utf-8");
97787
98051
  const { data, body } = parseFrontmatter(content);
97788
98052
  const active = data.active;
97789
98053
  const iteration = data.iteration;
@@ -98858,14 +99122,14 @@ async function getLocalVersion(options = {}) {
98858
99122
  }
98859
99123
  }
98860
99124
  // packages/omo-opencode/src/cli/doctor/checks/system.ts
98861
- import { existsSync as existsSync53, readFileSync as readFileSync33 } from "node:fs";
99125
+ import { existsSync as existsSync53, readFileSync as readFileSync34 } from "node:fs";
98862
99126
 
98863
99127
  // packages/omo-opencode/src/cli/doctor/checks/system-binary.ts
98864
99128
  init_extract_semver();
98865
99129
  init_bun_which_shim();
98866
99130
  import { existsSync as existsSync50, accessSync as accessSync4, constants as constants10 } from "node:fs";
98867
99131
  import { homedir as homedir14 } from "node:os";
98868
- import { join as join71 } from "node:path";
99132
+ import { join as join73 } from "node:path";
98869
99133
 
98870
99134
  // packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
98871
99135
  init_spawn_with_windows_hide();
@@ -98957,17 +99221,17 @@ function getDesktopAppPaths(platform) {
98957
99221
  case "darwin":
98958
99222
  return [
98959
99223
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
98960
- join71(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
99224
+ join73(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
98961
99225
  ];
98962
99226
  case "win32": {
98963
99227
  const programFiles = process.env.ProgramFiles;
98964
99228
  const localAppData = process.env.LOCALAPPDATA;
98965
99229
  const paths = [];
98966
99230
  if (programFiles) {
98967
- paths.push(join71(programFiles, "OpenCode", "OpenCode.exe"));
99231
+ paths.push(join73(programFiles, "OpenCode", "OpenCode.exe"));
98968
99232
  }
98969
99233
  if (localAppData) {
98970
- paths.push(join71(localAppData, "OpenCode", "OpenCode.exe"));
99234
+ paths.push(join73(localAppData, "OpenCode", "OpenCode.exe"));
98971
99235
  }
98972
99236
  return paths;
98973
99237
  }
@@ -98975,8 +99239,8 @@ function getDesktopAppPaths(platform) {
98975
99239
  return [
98976
99240
  "/usr/bin/opencode",
98977
99241
  "/usr/lib/opencode/opencode",
98978
- join71(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
98979
- join71(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
99242
+ join73(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
99243
+ join73(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
98980
99244
  ];
98981
99245
  default:
98982
99246
  return [];
@@ -99008,7 +99272,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
99008
99272
  const candidates = getCommandCandidates2(platform);
99009
99273
  for (const entry of pathEnv.split(delimiter3).filter(Boolean)) {
99010
99274
  for (const command of candidates) {
99011
- const fullPath = join71(entry, command);
99275
+ const fullPath = join73(entry, command);
99012
99276
  if (checkExists(fullPath) && isExecutable2(fullPath)) {
99013
99277
  return { binary: command, path: fullPath };
99014
99278
  }
@@ -99054,7 +99318,7 @@ function compareVersions3(current, minimum) {
99054
99318
 
99055
99319
  // packages/omo-opencode/src/cli/doctor/checks/system-plugin.ts
99056
99320
  init_shared();
99057
- import { existsSync as existsSync51, readFileSync as readFileSync31 } from "node:fs";
99321
+ import { existsSync as existsSync51, readFileSync as readFileSync32 } from "node:fs";
99058
99322
  function detectConfigPath() {
99059
99323
  const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
99060
99324
  if (existsSync51(paths.configJsonc))
@@ -99105,7 +99369,7 @@ function getPluginInfo() {
99105
99369
  };
99106
99370
  }
99107
99371
  try {
99108
- const content = readFileSync31(configPath, "utf-8");
99372
+ const content = readFileSync32(configPath, "utf-8");
99109
99373
  const parsedConfig = parseJsonc(content);
99110
99374
  const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
99111
99375
  if (!pluginEntry) {
@@ -99147,25 +99411,25 @@ init_file_utils2();
99147
99411
  init_checker();
99148
99412
  init_auto_update_checker();
99149
99413
  init_package_json_locator();
99150
- import { existsSync as existsSync52, readFileSync as readFileSync32, readdirSync as readdirSync8 } from "node:fs";
99414
+ import { existsSync as existsSync52, readFileSync as readFileSync33, readdirSync as readdirSync8 } from "node:fs";
99151
99415
  import { createRequire as createRequire3 } from "node:module";
99152
99416
  import { homedir as homedir15 } from "node:os";
99153
- import { join as join72 } from "node:path";
99417
+ import { join as join74 } from "node:path";
99154
99418
  import { fileURLToPath as fileURLToPath6 } from "node:url";
99155
99419
  init_shared();
99156
99420
  function getPlatformDefaultCacheDir(platform = process.platform) {
99157
99421
  if (platform === "darwin")
99158
- return join72(homedir15(), "Library", "Caches");
99422
+ return join74(homedir15(), "Library", "Caches");
99159
99423
  if (platform === "win32")
99160
- return process.env.LOCALAPPDATA ?? join72(homedir15(), "AppData", "Local");
99161
- return join72(homedir15(), ".cache");
99424
+ return process.env.LOCALAPPDATA ?? join74(homedir15(), "AppData", "Local");
99425
+ return join74(homedir15(), ".cache");
99162
99426
  }
99163
99427
  function resolveOpenCodeCacheDir() {
99164
99428
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
99165
99429
  if (xdgCacheHome)
99166
- return join72(xdgCacheHome, "opencode");
99430
+ return join74(xdgCacheHome, "opencode");
99167
99431
  const fromShared = getOpenCodeCacheDir();
99168
- const platformDefault = join72(getPlatformDefaultCacheDir(), "opencode");
99432
+ const platformDefault = join74(getPlatformDefaultCacheDir(), "opencode");
99169
99433
  if (existsSync52(fromShared) || !existsSync52(platformDefault))
99170
99434
  return fromShared;
99171
99435
  return platformDefault;
@@ -99179,7 +99443,7 @@ function readPackageJson(filePath) {
99179
99443
  if (!existsSync52(filePath))
99180
99444
  return null;
99181
99445
  try {
99182
- const content = readFileSync32(filePath, "utf-8");
99446
+ const content = readFileSync33(filePath, "utf-8");
99183
99447
  return parseJsonc(content);
99184
99448
  } catch (error51) {
99185
99449
  if (!(error51 instanceof Error)) {
@@ -99197,11 +99461,11 @@ function normalizeVersion(value) {
99197
99461
  function createPackageCandidates(rootDir) {
99198
99462
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
99199
99463
  packageName,
99200
- installedPackagePath: join72(rootDir, "node_modules", packageName, "package.json")
99464
+ installedPackagePath: join74(rootDir, "node_modules", packageName, "package.json")
99201
99465
  }));
99202
99466
  }
99203
99467
  function createTaggedInstallCandidates(rootDir) {
99204
- const packagesDir = join72(rootDir, "packages");
99468
+ const packagesDir = join74(rootDir, "packages");
99205
99469
  if (!existsSync52(packagesDir))
99206
99470
  return [];
99207
99471
  const candidates = [];
@@ -99209,14 +99473,14 @@ function createTaggedInstallCandidates(rootDir) {
99209
99473
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
99210
99474
  if (packageName === undefined)
99211
99475
  continue;
99212
- const installDir = join72(packagesDir, entryName);
99476
+ const installDir = join74(packagesDir, entryName);
99213
99477
  candidates.push({
99214
99478
  cacheDir: installDir,
99215
- cachePackagePath: join72(installDir, "package.json"),
99479
+ cachePackagePath: join74(installDir, "package.json"),
99216
99480
  packageCandidates: [
99217
99481
  {
99218
99482
  packageName,
99219
- installedPackagePath: join72(installDir, "node_modules", packageName, "package.json")
99483
+ installedPackagePath: join74(installDir, "node_modules", packageName, "package.json")
99220
99484
  }
99221
99485
  ]
99222
99486
  });
@@ -99261,13 +99525,13 @@ function getLoadedPluginVersion() {
99261
99525
  const candidates = [
99262
99526
  {
99263
99527
  cacheDir: configDir,
99264
- cachePackagePath: join72(configDir, "package.json"),
99528
+ cachePackagePath: join74(configDir, "package.json"),
99265
99529
  packageCandidates: createPackageCandidates(configDir)
99266
99530
  },
99267
99531
  ...createTaggedInstallCandidates(configDir),
99268
99532
  {
99269
99533
  cacheDir,
99270
- cachePackagePath: join72(cacheDir, "package.json"),
99534
+ cachePackagePath: join74(cacheDir, "package.json"),
99271
99535
  packageCandidates: createPackageCandidates(cacheDir)
99272
99536
  },
99273
99537
  ...createTaggedInstallCandidates(cacheDir)
@@ -99313,7 +99577,7 @@ var defaultDeps6 = {
99313
99577
  getLatestPluginVersion,
99314
99578
  getSuggestedInstallTag,
99315
99579
  configExists: existsSync53,
99316
- readConfigFile: (path14) => readFileSync33(path14, "utf-8"),
99580
+ readConfigFile: (path14) => readFileSync34(path14, "utf-8"),
99317
99581
  parseConfigContent: (content) => parseJsonc(content)
99318
99582
  };
99319
99583
  var BUN_POSTINSTALL_HELPER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
@@ -99458,9 +99722,9 @@ async function checkSystem(deps = defaultDeps6) {
99458
99722
 
99459
99723
  // packages/omo-opencode/src/config/validate.ts
99460
99724
  init_src();
99461
- import { readFileSync as readFileSync34 } from "node:fs";
99725
+ import { readFileSync as readFileSync35 } from "node:fs";
99462
99726
  import { homedir as homedir16 } from "node:os";
99463
- import { dirname as dirname28, relative as relative9 } from "node:path";
99727
+ import { dirname as dirname29, relative as relative9 } from "node:path";
99464
99728
  init_shared();
99465
99729
  init_plugin_identity();
99466
99730
  function resolveHomeDirectory2() {
@@ -99484,7 +99748,7 @@ function discoverProjectLayersNearestFirst(directory) {
99484
99748
  const stopDirectory = containsPath(homeDirectory, directory) ? homeDirectory : directory;
99485
99749
  return findProjectOpencodePluginConfigFiles(directory, stopDirectory).map((configPath) => ({
99486
99750
  path: configPath,
99487
- configDir: dirname28(configPath)
99751
+ configDir: dirname29(configPath)
99488
99752
  }));
99489
99753
  }
99490
99754
  function shortPath(configPath) {
@@ -99503,12 +99767,12 @@ function schemaMessages(configPath, rawConfig) {
99503
99767
  }
99504
99768
  function parseLayerConfig(configPath) {
99505
99769
  try {
99506
- const content = readFileSync34(configPath, "utf-8");
99770
+ const content = readFileSync35(configPath, "utf-8");
99507
99771
  const rawConfig = parseJsonc(content);
99508
99772
  if (!isPlainRecord(rawConfig)) {
99509
99773
  return {
99510
99774
  path: configPath,
99511
- configDir: dirname28(configPath),
99775
+ configDir: dirname29(configPath),
99512
99776
  config: null,
99513
99777
  messages: [`${shortPath(configPath)}: <root>: Expected object`]
99514
99778
  };
@@ -99516,7 +99780,7 @@ function parseLayerConfig(configPath) {
99516
99780
  const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
99517
99781
  return {
99518
99782
  path: configPath,
99519
- configDir: dirname28(configPath),
99783
+ configDir: dirname29(configPath),
99520
99784
  config: result.success ? result.data : parseConfigPartially(rawConfig),
99521
99785
  messages: schemaMessages(configPath, rawConfig)
99522
99786
  };
@@ -99526,7 +99790,7 @@ function parseLayerConfig(configPath) {
99526
99790
  }
99527
99791
  return {
99528
99792
  path: configPath,
99529
- configDir: dirname28(configPath),
99793
+ configDir: dirname29(configPath),
99530
99794
  config: null,
99531
99795
  messages: [`${shortPath(configPath)}: ${error51.message}`]
99532
99796
  };
@@ -99572,26 +99836,26 @@ function validatePluginConfig(directory) {
99572
99836
 
99573
99837
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-cache.ts
99574
99838
  init_shared();
99575
- import { existsSync as existsSync54, readFileSync as readFileSync35 } from "node:fs";
99839
+ import { existsSync as existsSync54, readFileSync as readFileSync36 } from "node:fs";
99576
99840
  import { homedir as homedir17 } from "node:os";
99577
- import { join as join73 } from "node:path";
99841
+ import { join as join75 } from "node:path";
99578
99842
  function getUserConfigDir2() {
99579
99843
  const xdgConfig = process.env.XDG_CONFIG_HOME;
99580
99844
  if (xdgConfig)
99581
- return join73(xdgConfig, "opencode");
99582
- return join73(homedir17(), ".config", "opencode");
99845
+ return join75(xdgConfig, "opencode");
99846
+ return join75(homedir17(), ".config", "opencode");
99583
99847
  }
99584
99848
  function loadCustomProviderNames() {
99585
99849
  const configDir = getUserConfigDir2();
99586
99850
  const candidatePaths = [
99587
- join73(configDir, "opencode.json"),
99588
- join73(configDir, "opencode.jsonc")
99851
+ join75(configDir, "opencode.json"),
99852
+ join75(configDir, "opencode.jsonc")
99589
99853
  ];
99590
99854
  for (const configPath of candidatePaths) {
99591
99855
  if (!existsSync54(configPath))
99592
99856
  continue;
99593
99857
  try {
99594
- const content = readFileSync35(configPath, "utf-8");
99858
+ const content = readFileSync36(configPath, "utf-8");
99595
99859
  const data = parseJsonc(content);
99596
99860
  if (data?.provider && typeof data.provider === "object") {
99597
99861
  return Object.keys(data.provider);
@@ -99606,7 +99870,7 @@ function loadCustomProviderNames() {
99606
99870
  return [];
99607
99871
  }
99608
99872
  function loadAvailableModelsFromCache() {
99609
- const cacheFile = join73(getOpenCodeCacheDir(), "models.json");
99873
+ const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
99610
99874
  const customProviders = loadCustomProviderNames();
99611
99875
  if (!existsSync54(cacheFile)) {
99612
99876
  if (customProviders.length > 0) {
@@ -99615,7 +99879,7 @@ function loadAvailableModelsFromCache() {
99615
99879
  return { providers: [], modelCount: 0, cacheExists: false };
99616
99880
  }
99617
99881
  try {
99618
- const content = readFileSync35(cacheFile, "utf-8");
99882
+ const content = readFileSync36(cacheFile, "utf-8");
99619
99883
  const data = parseJsonc(content);
99620
99884
  const cacheProviders = Object.keys(data);
99621
99885
  let modelCount = 0;
@@ -99642,9 +99906,9 @@ init_model_capabilities2();
99642
99906
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-config.ts
99643
99907
  init_shared();
99644
99908
  init_plugin_identity();
99645
- import { readFileSync as readFileSync36 } from "node:fs";
99646
- import { join as join74 } from "node:path";
99647
- var PROJECT_CONFIG_DIR = join74(process.cwd(), ".opencode");
99909
+ import { readFileSync as readFileSync37 } from "node:fs";
99910
+ import { join as join76 } from "node:path";
99911
+ var PROJECT_CONFIG_DIR = join76(process.cwd(), ".opencode");
99648
99912
  function loadOmoConfig() {
99649
99913
  const projectDetected = detectPluginConfigFile(PROJECT_CONFIG_DIR, {
99650
99914
  basenames: [CONFIG_BASENAME],
@@ -99652,7 +99916,7 @@ function loadOmoConfig() {
99652
99916
  });
99653
99917
  if (projectDetected.format !== "none") {
99654
99918
  try {
99655
- const content = readFileSync36(projectDetected.path, "utf-8");
99919
+ const content = readFileSync37(projectDetected.path, "utf-8");
99656
99920
  return parseJsonc(content);
99657
99921
  } catch (error51) {
99658
99922
  if (error51 instanceof Error) {
@@ -99668,7 +99932,7 @@ function loadOmoConfig() {
99668
99932
  });
99669
99933
  if (userDetected.format !== "none") {
99670
99934
  try {
99671
- const content = readFileSync36(userDetected.path, "utf-8");
99935
+ const content = readFileSync37(userDetected.path, "utf-8");
99672
99936
  return parseJsonc(content);
99673
99937
  } catch (error51) {
99674
99938
  if (error51 instanceof Error) {
@@ -99682,7 +99946,7 @@ function loadOmoConfig() {
99682
99946
 
99683
99947
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
99684
99948
  init_shared();
99685
- import { join as join75 } from "node:path";
99949
+ import { join as join77 } from "node:path";
99686
99950
 
99687
99951
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
99688
99952
  function formatModelWithVariant(model, variant) {
@@ -99724,7 +99988,7 @@ function formatCapabilityResolutionLabel(mode) {
99724
99988
  }
99725
99989
  function buildModelResolutionDetails(options) {
99726
99990
  const details = [];
99727
- const cacheFile = join75(getOpenCodeCacheDir(), "models.json");
99991
+ const cacheFile = join77(getOpenCodeCacheDir(), "models.json");
99728
99992
  details.push("═══ Available Models (from cache) ═══");
99729
99993
  details.push("");
99730
99994
  if (options.available.cacheExists) {
@@ -100003,25 +100267,25 @@ init_src();
100003
100267
  import { existsSync as existsSync55 } from "node:fs";
100004
100268
  import { createRequire as createRequire4 } from "node:module";
100005
100269
  import { homedir as homedir19 } from "node:os";
100006
- import { dirname as dirname29, join as join77 } from "node:path";
100270
+ import { dirname as dirname30, join as join79 } from "node:path";
100007
100271
 
100008
100272
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
100009
- import { join as join76 } from "path";
100273
+ import { join as join78 } from "path";
100010
100274
  import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
100011
100275
  init_binary_downloader();
100012
100276
  init_logger2();
100013
100277
  init_plugin_identity();
100014
100278
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
100015
- var DEBUG_FILE = join76(tmpdir3(), "comment-checker-debug.log");
100279
+ var DEBUG_FILE = join78(tmpdir3(), "comment-checker-debug.log");
100016
100280
  function getCacheDir2() {
100017
100281
  if (process.platform === "win32") {
100018
100282
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
100019
- const base2 = localAppData || join76(homedir18(), "AppData", "Local");
100020
- return join76(base2, CACHE_DIR_NAME, "bin");
100283
+ const base2 = localAppData || join78(homedir18(), "AppData", "Local");
100284
+ return join78(base2, CACHE_DIR_NAME, "bin");
100021
100285
  }
100022
100286
  const xdgCache = process.env.XDG_CACHE_HOME;
100023
- const base = xdgCache || join76(homedir18(), ".cache");
100024
- return join76(base, CACHE_DIR_NAME, "bin");
100287
+ const base = xdgCache || join78(homedir18(), ".cache");
100288
+ return join78(base, CACHE_DIR_NAME, "bin");
100025
100289
  }
100026
100290
  function getBinaryName() {
100027
100291
  return process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
@@ -100071,7 +100335,7 @@ async function getBinaryVersion(binary) {
100071
100335
  }
100072
100336
  }
100073
100337
  async function checkAstGrepCli() {
100074
- const runtimeDir = astGrepRuntimeDir(join77(homedir19(), ".omo"));
100338
+ const runtimeDir = astGrepRuntimeDir(join79(homedir19(), ".omo"));
100075
100339
  const sgPath = findSgBinarySync({ runtimeDir });
100076
100340
  if (sgPath === null) {
100077
100341
  return {
@@ -100100,11 +100364,11 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
100100
100364
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
100101
100365
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
100102
100366
  try {
100103
- const packageDir = baseDirOverride ?? dirname29(resolvePackageJsonPath());
100104
- const vendorPath = join77(packageDir, "vendor", platformKey, binaryName);
100367
+ const packageDir = baseDirOverride ?? dirname30(resolvePackageJsonPath());
100368
+ const vendorPath = join79(packageDir, "vendor", platformKey, binaryName);
100105
100369
  if (existsSync55(vendorPath))
100106
100370
  return vendorPath;
100107
- const binPath = join77(packageDir, "bin", binaryName);
100371
+ const binPath = join79(packageDir, "bin", binaryName);
100108
100372
  if (existsSync55(binPath))
100109
100373
  return binPath;
100110
100374
  } catch (error51) {
@@ -100249,12 +100513,12 @@ async function getGhCliInfo(dependencies = {}) {
100249
100513
  }
100250
100514
 
100251
100515
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
100252
- import { readFileSync as readFileSync37 } from "node:fs";
100253
- import { join as join78 } from "node:path";
100516
+ import { readFileSync as readFileSync38 } from "node:fs";
100517
+ import { join as join80 } from "node:path";
100254
100518
 
100255
100519
  // packages/omo-opencode/src/mcp/lsp.ts
100256
100520
  import { existsSync as existsSync56 } from "node:fs";
100257
- import { delimiter as delimiter3, dirname as dirname30, resolve as resolve21 } from "node:path";
100521
+ import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "node:path";
100258
100522
  import { fileURLToPath as fileURLToPath7 } from "node:url";
100259
100523
 
100260
100524
  // packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -100376,7 +100640,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
100376
100640
  ].join(";");
100377
100641
  function getModuleDirectory(moduleUrl) {
100378
100642
  try {
100379
- return dirname30(fileURLToPath7(moduleUrl));
100643
+ return dirname31(fileURLToPath7(moduleUrl));
100380
100644
  } catch (error51) {
100381
100645
  if (!(error51 instanceof Error))
100382
100646
  throw error51;
@@ -100446,7 +100710,7 @@ function readOmoConfig(configDirectory) {
100446
100710
  return null;
100447
100711
  }
100448
100712
  try {
100449
- const content = readFileSync37(detected.path, "utf-8");
100713
+ const content = readFileSync38(detected.path, "utf-8");
100450
100714
  return parseJsonc(content);
100451
100715
  } catch (error51) {
100452
100716
  if (!(error51 instanceof Error)) {
@@ -100457,7 +100721,7 @@ function readOmoConfig(configDirectory) {
100457
100721
  }
100458
100722
  function isLspMcpDisabled(options) {
100459
100723
  const userConfigDirectory = options.configDirectory ?? getOpenCodeConfigDir({ binary: "opencode" });
100460
- const projectConfigDirectory = join78(options.cwd ?? process.cwd(), ".opencode");
100724
+ const projectConfigDirectory = join80(options.cwd ?? process.cwd(), ".opencode");
100461
100725
  const userConfig = readOmoConfig(userConfigDirectory);
100462
100726
  const projectConfig = readOmoConfig(projectConfigDirectory);
100463
100727
  const disabledMcps = new Set([
@@ -100476,15 +100740,15 @@ function getInstalledLspServers(options = {}) {
100476
100740
 
100477
100741
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
100478
100742
  init_shared();
100479
- import { existsSync as existsSync57, readFileSync as readFileSync38 } from "node:fs";
100743
+ import { existsSync as existsSync57, readFileSync as readFileSync39 } from "node:fs";
100480
100744
  import { homedir as homedir20 } from "node:os";
100481
- import { join as join79 } from "node:path";
100745
+ import { join as join81 } from "node:path";
100482
100746
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
100483
100747
  function getMcpConfigPaths() {
100484
100748
  return [
100485
- join79(homedir20(), ".claude", ".mcp.json"),
100486
- join79(process.cwd(), ".mcp.json"),
100487
- join79(process.cwd(), ".claude", ".mcp.json")
100749
+ join81(homedir20(), ".claude", ".mcp.json"),
100750
+ join81(process.cwd(), ".mcp.json"),
100751
+ join81(process.cwd(), ".claude", ".mcp.json")
100488
100752
  ];
100489
100753
  }
100490
100754
  function loadUserMcpConfig() {
@@ -100493,7 +100757,7 @@ function loadUserMcpConfig() {
100493
100757
  if (!existsSync57(configPath))
100494
100758
  continue;
100495
100759
  try {
100496
- const content = readFileSync38(configPath, "utf-8");
100760
+ const content = readFileSync39(configPath, "utf-8");
100497
100761
  const config3 = parseJsonc(content);
100498
100762
  if (config3.mcpServers) {
100499
100763
  Object.assign(servers, config3.mcpServers);
@@ -100628,7 +100892,7 @@ async function checkTools() {
100628
100892
 
100629
100893
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
100630
100894
  init_src4();
100631
- import { existsSync as existsSync58, readFileSync as readFileSync39 } from "node:fs";
100895
+ import { existsSync as existsSync58, readFileSync as readFileSync40 } from "node:fs";
100632
100896
  function isTelemetryState(value) {
100633
100897
  return value !== null && typeof value === "object" && !Array.isArray(value);
100634
100898
  }
@@ -100638,7 +100902,7 @@ function readLastActiveDay(stateFilePath) {
100638
100902
  }
100639
100903
  let parsed;
100640
100904
  try {
100641
- parsed = JSON.parse(readFileSync39(stateFilePath, "utf-8"));
100905
+ parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
100642
100906
  } catch (error51) {
100643
100907
  if (error51 instanceof Error) {
100644
100908
  return "unreadable";
@@ -100713,7 +100977,7 @@ function expandHomeDirectory(directoryPath) {
100713
100977
  // packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
100714
100978
  init_shared();
100715
100979
  init_plugin_identity();
100716
- import { readFileSync as readFileSync40, promises as fs13 } from "node:fs";
100980
+ import { readFileSync as readFileSync41, promises as fs13 } from "node:fs";
100717
100981
  import path15 from "node:path";
100718
100982
  async function checkTeamMode() {
100719
100983
  const config3 = loadTeamModeConfig();
@@ -100750,7 +101014,7 @@ function loadTeamModeConfig() {
100750
101014
  if (!configPath)
100751
101015
  return { team_mode: undefined };
100752
101016
  try {
100753
- return parseJsonc(readFileSync40(configPath, "utf-8"));
101017
+ return parseJsonc(readFileSync41(configPath, "utf-8"));
100754
101018
  } catch (error51) {
100755
101019
  if (error51 instanceof Error) {
100756
101020
  return { team_mode: undefined };
@@ -100784,9 +101048,9 @@ async function pathExists(dir) {
100784
101048
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
100785
101049
  init_src();
100786
101050
  import { existsSync as existsSync59 } from "node:fs";
100787
- import { lstat as lstat12, readdir as readdir10, readFile as readFile23 } from "node:fs/promises";
101051
+ import { lstat as lstat13, readdir as readdir11, readFile as readFile23 } from "node:fs/promises";
100788
101052
  import { homedir as homedir22 } from "node:os";
100789
- import { basename as basename13, join as join80, resolve as resolve22 } from "node:path";
101053
+ import { basename as basename13, join as join82, resolve as resolve22 } from "node:path";
100790
101054
  // packages/omo-opencode/package.json
100791
101055
  var package_default3 = {
100792
101056
  name: "@oh-my-opencode/omo-opencode",
@@ -100844,13 +101108,13 @@ var CODEX_BIN_NAMES = [
100844
101108
  "omo-git-bash-hook"
100845
101109
  ];
100846
101110
  async function gatherCodexSummary(deps = {}) {
100847
- const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join80(homedir22(), ".codex"));
101111
+ const codexHome = resolve22(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir22(), ".codex"));
100848
101112
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
100849
101113
  const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
100850
101114
  const pluginRoot = await resolveInstalledPluginRoot(codexHome);
100851
- const manifest = pluginRoot === null ? null : await readJson(join80(pluginRoot, ".codex-plugin", "plugin.json"));
100852
- const installSnapshot = pluginRoot === null ? null : await readJson(join80(pluginRoot, "lazycodex-install.json"));
100853
- const configPath = join80(codexHome, "config.toml");
101115
+ const manifest = pluginRoot === null ? null : await readJson(join82(pluginRoot, ".codex-plugin", "plugin.json"));
101116
+ const installSnapshot = pluginRoot === null ? null : await readJson(join82(pluginRoot, "lazycodex-install.json"));
101117
+ const configPath = join82(codexHome, "config.toml");
100854
101118
  const pluginVersion = stringField(manifest, "version");
100855
101119
  return {
100856
101120
  codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -100907,7 +101171,7 @@ function buildCodexIssues(summary) {
100907
101171
  if (summary.pluginRoot === null) {
100908
101172
  issues.push({
100909
101173
  title: "OMO Codex plugin is not installed",
100910
- description: `Expected cached plugin at ${join80("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
101174
+ description: `Expected cached plugin at ${join82("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
100911
101175
  fix: "Run: npx lazycodex-ai install",
100912
101176
  severity: "error",
100913
101177
  affects: ["plugin loading"]
@@ -100972,12 +101236,12 @@ function buildCodexIssues(summary) {
100972
101236
  return issues;
100973
101237
  }
100974
101238
  async function resolveInstalledPluginRoot(codexHome) {
100975
- const pluginRoot = join80(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
101239
+ const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
100976
101240
  if (!existsSync59(pluginRoot))
100977
101241
  return null;
100978
- const versions2 = await readdir10(pluginRoot, { withFileTypes: true });
101242
+ const versions2 = await readdir11(pluginRoot, { withFileTypes: true });
100979
101243
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
100980
- return candidates.length === 0 ? null : join80(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
101244
+ return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
100981
101245
  }
100982
101246
  async function readCodexConfigSummary(configPath) {
100983
101247
  if (!existsSync59(configPath)) {
@@ -101005,16 +101269,16 @@ async function readCodexConfigSummary(configPath) {
101005
101269
  async function readLinkedBins(binDir) {
101006
101270
  const linked = [];
101007
101271
  for (const name of CODEX_BIN_NAMES) {
101008
- if (await pathExists2(join80(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
101272
+ if (await pathExists2(join82(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
101009
101273
  linked.push(name);
101010
101274
  }
101011
101275
  return linked;
101012
101276
  }
101013
101277
  async function readLinkedAgents(codexHome) {
101014
- const agentsDir = join80(codexHome, "agents");
101278
+ const agentsDir = join82(codexHome, "agents");
101015
101279
  if (!existsSync59(agentsDir))
101016
101280
  return [];
101017
- const entries = await readdir10(agentsDir, { withFileTypes: true });
101281
+ const entries = await readdir11(agentsDir, { withFileTypes: true });
101018
101282
  return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
101019
101283
  }
101020
101284
  async function readJson(path16) {
@@ -101114,7 +101378,7 @@ function compareVersionsDescending(left, right) {
101114
101378
  }
101115
101379
  async function pathExists2(path16) {
101116
101380
  try {
101117
- await lstat12(path16);
101381
+ await lstat13(path16);
101118
101382
  return true;
101119
101383
  } catch (error51) {
101120
101384
  if (error51 instanceof Error)
@@ -101125,9 +101389,9 @@ async function pathExists2(path16) {
101125
101389
 
101126
101390
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
101127
101391
  init_src();
101128
- import { readdir as readdir11, readFile as readFile24, stat as stat6 } from "node:fs/promises";
101392
+ import { readdir as readdir12, readFile as readFile24, stat as stat6 } from "node:fs/promises";
101129
101393
  import { homedir as homedir23 } from "node:os";
101130
- import { dirname as dirname31, isAbsolute as isAbsolute12, join as join81, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
101394
+ import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
101131
101395
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
101132
101396
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
101133
101397
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -101137,7 +101401,7 @@ async function checkCodexComponents(deps = {}) {
101137
101401
  const env3 = deps.env ?? process.env;
101138
101402
  const platform = deps.platform ?? process.platform;
101139
101403
  const arch = deps.arch ?? process.arch;
101140
- const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join81(homedir23(), ".codex"));
101404
+ const codexHome = resolve23(deps.codexHome ?? env3["CODEX_HOME"] ?? join83(homedir23(), ".codex"));
101141
101405
  const summary = await gatherCodexSummary({ ...deps, codexHome });
101142
101406
  if (summary.pluginRoot === null) {
101143
101407
  return {
@@ -101162,7 +101426,7 @@ async function checkCodexComponents(deps = {}) {
101162
101426
  });
101163
101427
  }
101164
101428
  const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
101165
- const runtimeSgPath = join81(runtimeSgDir, sgBinaryName(platform));
101429
+ const runtimeSgPath = join83(runtimeSgDir, sgBinaryName(platform));
101166
101430
  const sg = findSgBinarySync({
101167
101431
  arch,
101168
101432
  env: env3,
@@ -101199,12 +101463,12 @@ async function auditBundleTargets(pluginRoot) {
101199
101463
  let referencedCount = 0;
101200
101464
  for (const manifestPath of await findManifestPaths(pluginRoot, ".mcp.json")) {
101201
101465
  const manifest = await readJson2(manifestPath);
101202
- if (manifest === null || !isRecord5(manifest["mcpServers"]))
101466
+ if (manifest === null || !isRecord6(manifest["mcpServers"]))
101203
101467
  continue;
101204
- const manifestRoot = dirname31(manifestPath);
101468
+ const manifestRoot = dirname32(manifestPath);
101205
101469
  const isRootManifest = resolve23(manifestRoot) === resolve23(pluginRoot);
101206
101470
  for (const server2 of Object.values(manifest["mcpServers"])) {
101207
- if (!isRecord5(server2) || !Array.isArray(server2["args"]))
101471
+ if (!isRecord6(server2) || !Array.isArray(server2["args"]))
101208
101472
  continue;
101209
101473
  for (const arg of server2["args"]) {
101210
101474
  if (typeof arg !== "string" || !isPluginRuntimePathArg(arg))
@@ -101222,7 +101486,7 @@ async function auditBundleTargets(pluginRoot) {
101222
101486
  continue;
101223
101487
  const commands2 = [];
101224
101488
  collectHookCommands(manifest, commands2);
101225
- const hookPluginRoot = dirname31(dirname31(hookManifestPath));
101489
+ const hookPluginRoot = dirname32(dirname32(hookManifestPath));
101226
101490
  for (const command of commands2) {
101227
101491
  for (const relativePath of extractPluginRootPaths(command)) {
101228
101492
  referencedCount += 1;
@@ -101261,12 +101525,12 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
101261
101525
  }
101262
101526
  async function findHookManifestPaths(root) {
101263
101527
  const paths2 = await findManifestPaths(root, "hooks.json");
101264
- return paths2.filter((path16) => dirname31(path16).endsWith(`${sep9}hooks`));
101528
+ return paths2.filter((path16) => dirname32(path16).endsWith(`${sep9}hooks`));
101265
101529
  }
101266
101530
  async function findManifestPaths(root, manifestName) {
101267
101531
  let entries;
101268
101532
  try {
101269
- entries = await readdir11(root, { withFileTypes: true });
101533
+ entries = await readdir12(root, { withFileTypes: true });
101270
101534
  } catch {
101271
101535
  return [];
101272
101536
  }
@@ -101274,7 +101538,7 @@ async function findManifestPaths(root, manifestName) {
101274
101538
  for (const entry of entries) {
101275
101539
  if (entry.name === "node_modules" || entry.name === ".git")
101276
101540
  continue;
101277
- const entryPath = join81(root, entry.name);
101541
+ const entryPath = join83(root, entry.name);
101278
101542
  if (entry.isDirectory()) {
101279
101543
  paths2.push(...await findManifestPaths(entryPath, manifestName));
101280
101544
  continue;
@@ -101290,7 +101554,7 @@ function collectHookCommands(value, commands2) {
101290
101554
  collectHookCommands(item, commands2);
101291
101555
  return;
101292
101556
  }
101293
- if (!isRecord5(value))
101557
+ if (!isRecord6(value))
101294
101558
  return;
101295
101559
  if (value["type"] === "command") {
101296
101560
  if (typeof value["command"] === "string")
@@ -101315,21 +101579,21 @@ function extractPluginRootPaths(command) {
101315
101579
  }
101316
101580
  function isPluginRuntimePathArg(arg) {
101317
101581
  const normalized = normalizePathSeparators(arg);
101318
- return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute12(arg));
101582
+ return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute13(arg));
101319
101583
  }
101320
101584
  function runtimeSgDirectory(codexHome, platform, arch) {
101321
- return join81(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
101585
+ return join83(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
101322
101586
  }
101323
101587
  function describeSgSource(sgPath, env3, runtimeSgDir, platform) {
101324
101588
  const override = env3[SG_PATH_ENV_KEY]?.trim();
101325
101589
  if (override !== undefined && override.length > 0 && sgPath === override)
101326
101590
  return `env override ${SG_PATH_ENV_KEY}`;
101327
- if (sgPath === join81(runtimeSgDir, sgBinaryName(platform)))
101591
+ if (sgPath === join83(runtimeSgDir, sgBinaryName(platform)))
101328
101592
  return "runtime dir";
101329
101593
  return "PATH";
101330
101594
  }
101331
101595
  async function readBootstrapStateSummary(codexHome) {
101332
- const statePath = join81(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
101596
+ const statePath = join83(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
101333
101597
  const raw = await readJson2(statePath);
101334
101598
  if (raw === null)
101335
101599
  return null;
@@ -101345,7 +101609,7 @@ function parseDegradedEntries(value) {
101345
101609
  return [];
101346
101610
  const entries = [];
101347
101611
  for (const item of value) {
101348
- if (!isRecord5(item))
101612
+ if (!isRecord6(item))
101349
101613
  continue;
101350
101614
  if (typeof item["component"] !== "string" || typeof item["reason"] !== "string")
101351
101615
  continue;
@@ -101379,7 +101643,7 @@ function degradedDetailLines(entries) {
101379
101643
  async function readJson2(path16) {
101380
101644
  try {
101381
101645
  const parsed = JSON.parse(await readFile24(path16, "utf8"));
101382
- return isRecord5(parsed) ? parsed : null;
101646
+ return isRecord6(parsed) ? parsed : null;
101383
101647
  } catch (error51) {
101384
101648
  if (error51 instanceof Error)
101385
101649
  return null;
@@ -101400,7 +101664,7 @@ function normalizeRelative(root, target) {
101400
101664
  function normalizePathSeparators(path16) {
101401
101665
  return path16.split("\\").join("/");
101402
101666
  }
101403
- function isRecord5(value) {
101667
+ function isRecord6(value) {
101404
101668
  return typeof value === "object" && value !== null && !Array.isArray(value);
101405
101669
  }
101406
101670
 
@@ -101408,15 +101672,15 @@ function isRecord5(value) {
101408
101672
  import { existsSync as existsSync60 } from "node:fs";
101409
101673
  import { readFile as readFile25 } from "node:fs/promises";
101410
101674
  import { homedir as homedir24 } from "node:os";
101411
- import { join as join82, resolve as resolve24 } from "node:path";
101675
+ import { join as join84, resolve as resolve24 } from "node:path";
101412
101676
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
101413
101677
  var CHECK_NAME = "codex-runtime-wrapper";
101414
101678
  var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
101415
101679
  async function checkCodexRuntimeWrapper(deps = {}) {
101416
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join82(homedir24(), ".codex"));
101680
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join84(homedir24(), ".codex"));
101417
101681
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
101418
101682
  const platform = deps.platform ?? process.platform;
101419
- const wrapperPath = join82(binDir, platform === "win32" ? "omo.cmd" : "omo");
101683
+ const wrapperPath = join84(binDir, platform === "win32" ? "omo.cmd" : "omo");
101420
101684
  const wrapper = await readRuntimeWrapper(wrapperPath);
101421
101685
  const issues = [];
101422
101686
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
@@ -101923,17 +102187,17 @@ import {
101923
102187
  existsSync as existsSync63,
101924
102188
  mkdirSync as mkdirSync14,
101925
102189
  readdirSync as readdirSync9,
101926
- readFileSync as readFileSync42,
102190
+ readFileSync as readFileSync43,
101927
102191
  renameSync as renameSync7,
101928
102192
  unlinkSync as unlinkSync8,
101929
102193
  writeFileSync as writeFileSync11
101930
102194
  } from "node:fs";
101931
- import { basename as basename14, dirname as dirname32, join as join85 } from "node:path";
102195
+ import { basename as basename14, dirname as dirname33, join as join87 } from "node:path";
101932
102196
 
101933
102197
  // packages/mcp-client-core/src/config-dir.ts
101934
102198
  import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
101935
102199
  import { homedir as homedir25 } from "node:os";
101936
- import { join as join83, resolve as resolve25 } from "node:path";
102200
+ import { join as join85, resolve as resolve25 } from "node:path";
101937
102201
  function resolveConfigPath2(pathValue) {
101938
102202
  const resolvedPath = resolve25(pathValue);
101939
102203
  if (!existsSync61(resolvedPath))
@@ -101951,13 +102215,13 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
101951
102215
  if (customConfigDir) {
101952
102216
  return resolveConfigPath2(customConfigDir);
101953
102217
  }
101954
- const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join83(homedir25(), ".config");
101955
- return resolveConfigPath2(join83(xdgConfigDir, "opencode"));
102218
+ const xdgConfigDir = env3["XDG_CONFIG_HOME"]?.trim() || join85(homedir25(), ".config");
102219
+ return resolveConfigPath2(join85(xdgConfigDir, "opencode"));
101956
102220
  }
101957
102221
 
101958
102222
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
101959
- import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
101960
- import { join as join84 } from "node:path";
102223
+ import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync42, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
102224
+ import { join as join86 } from "node:path";
101961
102225
  var INDEX_FILE_NAME = "index.json";
101962
102226
  function isTokenIndex(value) {
101963
102227
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -101965,14 +102229,14 @@ function isTokenIndex(value) {
101965
102229
  return Object.values(value).every((entry) => typeof entry === "string");
101966
102230
  }
101967
102231
  function getIndexPath(storageDir) {
101968
- return join84(storageDir, INDEX_FILE_NAME);
102232
+ return join86(storageDir, INDEX_FILE_NAME);
101969
102233
  }
101970
102234
  function readTokenIndex(storageDir) {
101971
102235
  const indexPath = getIndexPath(storageDir);
101972
102236
  if (!existsSync62(indexPath))
101973
102237
  return {};
101974
102238
  try {
101975
- const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
102239
+ const parsed = JSON.parse(readFileSync42(indexPath, "utf-8"));
101976
102240
  return isTokenIndex(parsed) ? parsed : {};
101977
102241
  } catch (readError) {
101978
102242
  if (!(readError instanceof Error))
@@ -102009,16 +102273,16 @@ function deleteTokenIndexEntry(storageDir, hash2) {
102009
102273
  var STORAGE_DIR_NAME = "mcp-oauth";
102010
102274
  var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
102011
102275
  function getMcpOauthStorageDir() {
102012
- return join85(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
102276
+ return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
102013
102277
  }
102014
102278
  function getMcpOauthServerHash(serverHost, resource) {
102015
102279
  return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
102016
102280
  }
102017
102281
  function getMcpOauthStoragePath(serverHost, resource) {
102018
- return join85(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
102282
+ return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
102019
102283
  }
102020
102284
  function getLegacyStoragePath() {
102021
- return join85(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
102285
+ return join87(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
102022
102286
  }
102023
102287
  function normalizeHost2(serverHost) {
102024
102288
  let host = serverHost.trim();
@@ -102082,7 +102346,7 @@ function readTokenFile(filePath) {
102082
102346
  if (!existsSync63(filePath))
102083
102347
  return null;
102084
102348
  try {
102085
- const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
102349
+ const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102086
102350
  return isOAuthTokenData(parsed) ? parsed : null;
102087
102351
  } catch (readError) {
102088
102352
  if (!(readError instanceof Error))
@@ -102095,7 +102359,7 @@ function readLegacyStore() {
102095
102359
  if (!existsSync63(filePath))
102096
102360
  return null;
102097
102361
  try {
102098
- const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
102362
+ const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102099
102363
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
102100
102364
  return null;
102101
102365
  const result = {};
@@ -102112,7 +102376,7 @@ function readLegacyStore() {
102112
102376
  }
102113
102377
  function writeTokenFile(filePath, token) {
102114
102378
  try {
102115
- const dir = dirname32(filePath);
102379
+ const dir = dirname33(filePath);
102116
102380
  if (!existsSync63(dir)) {
102117
102381
  mkdirSync14(dir, { recursive: true });
102118
102382
  }
@@ -102197,7 +102461,7 @@ function listTokensByHost(serverHost) {
102197
102461
  for (const [hash2, indexedKey] of Object.entries(index)) {
102198
102462
  if (!indexedKey.startsWith(prefix))
102199
102463
  continue;
102200
- const indexedToken = readTokenFile(join85(getMcpOauthStorageDir(), `${hash2}.json`));
102464
+ const indexedToken = readTokenFile(join87(getMcpOauthStorageDir(), `${hash2}.json`));
102201
102465
  if (indexedToken)
102202
102466
  result[indexedKey] = indexedToken;
102203
102467
  }
@@ -102212,7 +102476,7 @@ function listAllTokens() {
102212
102476
  for (const entry of readdirSync9(dir, { withFileTypes: true })) {
102213
102477
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
102214
102478
  continue;
102215
- const token = readTokenFile(join85(dir, entry.name));
102479
+ const token = readTokenFile(join87(dir, entry.name));
102216
102480
  const hash2 = basename14(entry.name, ".json");
102217
102481
  if (token)
102218
102482
  result[index[hash2] ?? hash2] = token;
@@ -102936,7 +103200,7 @@ async function boulder(options) {
102936
103200
  }
102937
103201
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
102938
103202
  import { spawn as spawn5 } from "node:child_process";
102939
- import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync9 } from "node:fs";
103203
+ import { existsSync as existsSync65, readFileSync as readFileSync44, realpathSync as realpathSync9 } from "node:fs";
102940
103204
  import { homedir as homedir26 } from "node:os";
102941
103205
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
102942
103206
  function resolveCodexUlwLoopCommand(input = {}) {
@@ -102986,7 +103250,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
102986
103250
  }
102987
103251
  function isGeneratedRuntimeWrapper(candidate) {
102988
103252
  try {
102989
- return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
103253
+ return readFileSync44(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
102990
103254
  } catch (error51) {
102991
103255
  if (error51 instanceof Error)
102992
103256
  return false;