lazycodex-ai 5.0.1 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.ja.md +2 -1
  2. package/README.ko.md +2 -1
  3. package/README.md +2 -1
  4. package/README.ru.md +2 -1
  5. package/README.zh-cn.md +2 -1
  6. package/dist/cli/index.js +851 -546
  7. package/dist/cli-node/index.js +851 -546
  8. package/package.json +6 -1
  9. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  10. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +341 -157
  11. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  12. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  13. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +7 -4
  14. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  15. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  16. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  17. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  18. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  19. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  20. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
  21. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  22. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  23. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  24. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  25. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  26. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  27. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  28. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  29. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  30. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  31. package/packages/omo-codex/plugin/components/ulw-execute-continuation/AGENTS.md +1 -1
  32. package/packages/omo-codex/plugin/components/ulw-execute-continuation/dist/cli.js +42 -32
  33. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  34. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  35. package/packages/omo-codex/plugin/components/ulw-execute-continuation/src/plan-checklist.ts +55 -29
  36. package/packages/omo-codex/plugin/components/ulw-execute-continuation/test/boulder-reader.test.ts +51 -0
  37. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  38. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  39. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  40. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  41. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  42. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  43. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  44. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  45. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  46. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  47. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  48. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  49. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  50. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  51. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  52. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  53. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  54. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  55. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  56. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  57. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  58. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  59. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  60. package/packages/omo-codex/plugin/package-lock.json +12 -12
  61. package/packages/omo-codex/plugin/package.json +1 -1
  62. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
  63. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +1 -1
  64. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/aside_scanner.py +3 -0
  65. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +4 -0
  66. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +6 -2
  67. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +7 -1
  68. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +3 -1
  69. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/types.py +3 -1
  70. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/find-agent-sessions.py +4 -0
  71. package/packages/omo-codex/scripts/install-dist/install-local.mjs +10465 -10270
  72. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
  73. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +1 -1
  74. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/aside_scanner.py +3 -0
  75. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +4 -0
  76. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +6 -2
  77. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +7 -1
  78. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +3 -1
  79. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/types.py +3 -1
  80. package/packages/shared-skills/skills/coding-agent-sessions/scripts/find-agent-sessions.py +4 -0
package/dist/cli/index.js CHANGED
@@ -64,7 +64,7 @@ var package_default;
64
64
  var init_package = __esm(() => {
65
65
  package_default = {
66
66
  name: "oh-my-opencode",
67
- version: "5.0.1",
67
+ version: "5.1.1",
68
68
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
69
69
  main: "./dist/index.js",
70
70
  types: "dist/index.d.ts",
@@ -97,6 +97,11 @@ var init_package = __esm(() => {
97
97
  "packages/omo-codex",
98
98
  "packages/omo-senpi",
99
99
  "packages/senpi-task",
100
+ "packages/senpi-desktop-protocol",
101
+ "packages/senpi-desktop-engine",
102
+ "packages/senpi-desktop-prelude",
103
+ "packages/senpi-desktop-service",
104
+ "packages/senpi-desktop-tool",
100
105
  "packages/omo-opencode",
101
106
  "packages/omo-native"
102
107
  ],
@@ -198,7 +203,7 @@ var init_package = __esm(() => {
198
203
  prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
199
204
  "test:model-capabilities": "bun test --timeout 20000 packages/model-core/src/model-capability-aliases.test.ts packages/model-core/src/model-capability-guardrails.test.ts packages/model-core/src/model-capabilities.test.ts packages/omo-opencode/src/cli/doctor/checks/model-resolution.test.ts --bail",
200
205
  typecheck: "tsgo --noEmit && bun run typecheck:script && bun run typecheck:packages",
201
- "typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/isolation-core/tsconfig.json && tsgo --noEmit -p packages/memory-core/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && tsgo --noEmit -p packages/senpi-task/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json && tsgo --noEmit -p packages/omo-native/tsconfig.json",
206
+ "typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/delegate-core/tsconfig.json && tsgo --noEmit -p packages/mcp-stdio-core/tsconfig.json && tsgo --noEmit -p packages/mcp-client-core/tsconfig.json && tsgo --noEmit -p packages/git-bash-mcp/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/lsp-core/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/omo-config-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/tmux-core/tsconfig.json && tsgo --noEmit -p packages/team-core/tsconfig.json && tsgo --noEmit -p packages/openclaw-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/isolation-core/tsconfig.json && tsgo --noEmit -p packages/memory-core/tsconfig.json && tsgo --noEmit -p packages/telemetry-core/tsconfig.json && tsgo --noEmit -p packages/claude-code-compat-core/tsconfig.json && tsgo --noEmit -p packages/skills-loader-core/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/plugin/shared/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && tsgo --noEmit -p packages/senpi-task/tsconfig.json && tsgo --noEmit -p packages/omo-opencode/tsconfig.json && tsgo --noEmit -p packages/omo-native/tsconfig.json && tsgo --noEmit -p packages/senpi-desktop-protocol/tsconfig.json && tsgo --noEmit -p packages/senpi-desktop-engine/tsconfig.json && tsgo --noEmit -p packages/senpi-desktop-prelude/tsconfig.json && tsgo --noEmit -p packages/senpi-desktop-service/tsconfig.json && tsgo --noEmit -p packages/senpi-desktop-tool/tsconfig.json",
202
207
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
203
208
  test: "bun test --timeout 20000",
204
209
  "changelog:section": "bun script/changelog-section.ts",
@@ -207,7 +212,8 @@ var init_package = __esm(() => {
207
212
  "test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test --timeout 20000 packages/omo-senpi && bun test ./.agents/skills/senpi-qa/scripts/resolve-evidence-dir.test.mjs",
208
213
  "test:windows-codex": "bun run test:codex",
209
214
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
210
- "build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build"
215
+ "build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build",
216
+ "test:desktop": "bun script/check-cargo-pinned-deps.mjs && bun run --cwd packages/senpi-desktop-protocol test && bun run --cwd packages/senpi-desktop-engine test && bun run --cwd packages/senpi-desktop-prelude test && bun run --cwd packages/senpi-desktop-service test && bun run --cwd packages/senpi-desktop-tool test"
211
217
  },
212
218
  keywords: [
213
219
  "opencode",
@@ -247,7 +253,7 @@ var init_package = __esm(() => {
247
253
  zod: "^4.6.5"
248
254
  },
249
255
  devDependencies: {
250
- "@code-yeongyu/senpi": "2026.9.27",
256
+ "@code-yeongyu/senpi": "2026.9.29",
251
257
  "@oh-my-opencode/agents-md-core": "workspace:*",
252
258
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
253
259
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -256,11 +262,11 @@ var init_package = __esm(() => {
256
262
  "@oh-my-opencode/delegate-core": "workspace:*",
257
263
  "@oh-my-opencode/git-bash-mcp": "workspace:*",
258
264
  "@oh-my-opencode/hashline-core": "workspace:*",
259
- "@oh-my-opencode/lsp-core": "workspace:*",
260
265
  "@oh-my-opencode/isolation-core": "workspace:*",
261
- "@oh-my-opencode/memory-core": "workspace:*",
266
+ "@oh-my-opencode/lsp-core": "workspace:*",
262
267
  "@oh-my-opencode/mcp-client-core": "workspace:*",
263
268
  "@oh-my-opencode/mcp-stdio-core": "workspace:*",
269
+ "@oh-my-opencode/memory-core": "workspace:*",
264
270
  "@oh-my-opencode/model-core": "workspace:*",
265
271
  "@oh-my-opencode/omo-codex": "workspace:*",
266
272
  "@oh-my-opencode/omo-config-core": "workspace:*",
@@ -269,6 +275,11 @@ var init_package = __esm(() => {
269
275
  "@oh-my-opencode/openclaw-core": "workspace:*",
270
276
  "@oh-my-opencode/prompts-core": "workspace:*",
271
277
  "@oh-my-opencode/rules-engine": "workspace:*",
278
+ "@oh-my-opencode/senpi-desktop-engine": "workspace:*",
279
+ "@oh-my-opencode/senpi-desktop-prelude": "workspace:*",
280
+ "@oh-my-opencode/senpi-desktop-protocol": "workspace:*",
281
+ "@oh-my-opencode/senpi-desktop-service": "workspace:*",
282
+ "@oh-my-opencode/senpi-desktop-tool": "workspace:*",
272
283
  "@oh-my-opencode/senpi-task": "workspace:*",
273
284
  "@oh-my-opencode/shared-skills": "workspace:*",
274
285
  "@oh-my-opencode/skills-loader-core": "workspace:*",
@@ -288,18 +299,18 @@ var init_package = __esm(() => {
288
299
  typescript: "^7.0.2"
289
300
  },
290
301
  optionalDependencies: {
291
- "oh-my-opencode-darwin-arm64": "5.0.1",
292
- "oh-my-opencode-darwin-x64": "5.0.1",
293
- "oh-my-opencode-darwin-x64-baseline": "5.0.1",
294
- "oh-my-opencode-linux-arm64": "5.0.1",
295
- "oh-my-opencode-linux-arm64-musl": "5.0.1",
296
- "oh-my-opencode-linux-x64": "5.0.1",
297
- "oh-my-opencode-linux-x64-baseline": "5.0.1",
298
- "oh-my-opencode-linux-x64-musl": "5.0.1",
299
- "oh-my-opencode-linux-x64-musl-baseline": "5.0.1",
300
- "oh-my-opencode-windows-arm64": "5.0.1",
301
- "oh-my-opencode-windows-x64": "5.0.1",
302
- "oh-my-opencode-windows-x64-baseline": "5.0.1"
302
+ "oh-my-opencode-darwin-arm64": "5.1.1",
303
+ "oh-my-opencode-darwin-x64": "5.1.1",
304
+ "oh-my-opencode-darwin-x64-baseline": "5.1.1",
305
+ "oh-my-opencode-linux-arm64": "5.1.1",
306
+ "oh-my-opencode-linux-arm64-musl": "5.1.1",
307
+ "oh-my-opencode-linux-x64": "5.1.1",
308
+ "oh-my-opencode-linux-x64-baseline": "5.1.1",
309
+ "oh-my-opencode-linux-x64-musl": "5.1.1",
310
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.1",
311
+ "oh-my-opencode-windows-arm64": "5.1.1",
312
+ "oh-my-opencode-windows-x64": "5.1.1",
313
+ "oh-my-opencode-windows-x64-baseline": "5.1.1"
303
314
  },
304
315
  overrides: {
305
316
  "@earendil-works/pi-agent-core": "0.84.2",
@@ -6396,6 +6407,9 @@ function getActiveReservation(sessionID) {
6396
6407
  pruneExpiredReservations();
6397
6408
  return promptAsyncReservations.get(sessionID);
6398
6409
  }
6410
+ function reservedDispatchResult(reservation) {
6411
+ return reservation.expiresAt === undefined ? { status: "reserved", reservedBy: reservation.source } : { status: "reserved", reservedBy: reservation.source, expiresAt: reservation.expiresAt };
6412
+ }
6399
6413
  function setPromptReservation(sessionID, reservation) {
6400
6414
  promptAsyncReservations.set(sessionID, reservation);
6401
6415
  }
@@ -6445,7 +6459,7 @@ async function dispatchAfterSessionIdle(args) {
6445
6459
  reservedBy: existing.source,
6446
6460
  reservedAgeMs: Date.now() - existing.reservedAt
6447
6461
  });
6448
- return { status: "reserved", reservedBy: existing.source };
6462
+ return reservedDispatchResult(existing);
6449
6463
  }
6450
6464
  const reservation = {
6451
6465
  source,
@@ -6983,7 +6997,7 @@ async function dispatchInternalPrompt(args) {
6983
6997
  if (queueBehavior === "defer") {
6984
6998
  const activeReservation = getActiveReservation(sessionID);
6985
6999
  if (activeReservation) {
6986
- return { status: "reserved", reservedBy: activeReservation.source };
7000
+ return reservedDispatchResult(activeReservation);
6987
7001
  }
6988
7002
  const queuedBy = getQueuedPromptBlocker(sessionID);
6989
7003
  if (queuedBy !== undefined || isPromptQueueDraining(sessionID)) {
@@ -7382,12 +7396,12 @@ var init_category_model_requirements = __esm(() => {
7382
7396
  },
7383
7397
  "deep-low": {
7384
7398
  fallbackChain: [
7385
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol-fast", variant: "medium" },
7386
7399
  {
7387
7400
  providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],
7388
7401
  model: "gpt-5.6-sol",
7389
7402
  variant: "medium"
7390
- }
7403
+ },
7404
+ { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol-fast", variant: "medium" }
7391
7405
  ]
7392
7406
  },
7393
7407
  "deep-high": {
@@ -7439,6 +7453,11 @@ var init_category_model_requirements = __esm(() => {
7439
7453
  },
7440
7454
  "unspecified-low": {
7441
7455
  fallbackChain: [
7456
+ {
7457
+ providers: ["anthropic", "anthropic-api", "github-copilot", "opencode"],
7458
+ model: "claude-sonnet-5-5",
7459
+ variant: "medium"
7460
+ },
7442
7461
  { providers: ["xiaomi", "opencode-go"], model: "mimo-v2.6-pro", variant: "max" },
7443
7462
  { providers: ["xai", "github-copilot", "opencode-go"], model: "grok-4.7", variant: "xhigh" },
7444
7463
  {
@@ -8040,8 +8059,17 @@ var init_model_resolver = () => {};
8040
8059
  // packages/model-core/src/fallback-chain-from-models.ts
8041
8060
  var init_fallback_chain_from_models = () => {};
8042
8061
 
8062
+ // packages/model-core/src/runtime-fallback-auto-retry-signal.ts
8063
+ var init_runtime_fallback_auto_retry_signal = () => {};
8064
+
8065
+ // packages/model-core/src/runtime-fallback-error-shape.ts
8066
+ var init_runtime_fallback_error_shape = () => {};
8067
+
8068
+ // packages/model-core/src/runtime-fallback-error-classifier.ts
8069
+ var init_runtime_fallback_error_classifier = () => {};
8070
+
8043
8071
  // packages/model-core/src/model-error-classifier.ts
8044
- var RETRYABLE_ERROR_NAMES, STOP_ERROR_NAMES, NON_RETRYABLE_ERROR_NAMES;
8072
+ var RETRYABLE_ERROR_NAMES, NON_RETRYABLE_ERROR_NAMES;
8045
8073
  var init_model_error_classifier = __esm(() => {
8046
8074
  RETRYABLE_ERROR_NAMES = new Set([
8047
8075
  "providermodelnotfounderror",
@@ -8050,11 +8078,6 @@ var init_model_error_classifier = __esm(() => {
8050
8078
  "providerconnectionerror",
8051
8079
  "authenticationerror"
8052
8080
  ]);
8053
- STOP_ERROR_NAMES = new Set([
8054
- "quotaexceedederror",
8055
- "insufficientcreditserror",
8056
- "freeusagelimiterror"
8057
- ]);
8058
8081
  NON_RETRYABLE_ERROR_NAMES = new Set([
8059
8082
  "messageabortederror",
8060
8083
  "permissiondeniederror",
@@ -8066,15 +8089,6 @@ var init_model_error_classifier = __esm(() => {
8066
8089
  ]);
8067
8090
  });
8068
8091
 
8069
- // packages/model-core/src/runtime-fallback-auto-retry-signal.ts
8070
- var init_runtime_fallback_auto_retry_signal = () => {};
8071
-
8072
- // packages/model-core/src/runtime-fallback-error-shape.ts
8073
- var init_runtime_fallback_error_shape = () => {};
8074
-
8075
- // packages/model-core/src/runtime-fallback-error-classifier.ts
8076
- var init_runtime_fallback_error_classifier = () => {};
8077
-
8078
8092
  // packages/model-core/src/provider-exhaustion-fallback-policy.ts
8079
8093
  var init_provider_exhaustion_fallback_policy = () => {};
8080
8094
 
@@ -8380,6 +8394,36 @@ var init_supplemental_entries = __esm(() => {
8380
8394
  output: 32768
8381
8395
  }
8382
8396
  },
8397
+ "claude-sonnet-5-5": {
8398
+ id: "claude-sonnet-5-5",
8399
+ family: "claude-sonnet",
8400
+ reasoning: true,
8401
+ temperature: false,
8402
+ toolCall: true,
8403
+ modalities: {
8404
+ input: ["text", "image", "pdf"],
8405
+ output: ["text"]
8406
+ },
8407
+ limit: {
8408
+ context: 1e6,
8409
+ output: 128000
8410
+ }
8411
+ },
8412
+ "anthropic/claude-sonnet-5-5": {
8413
+ id: "anthropic/claude-sonnet-5-5",
8414
+ family: "claude-sonnet",
8415
+ reasoning: true,
8416
+ temperature: false,
8417
+ toolCall: true,
8418
+ modalities: {
8419
+ input: ["text", "image", "pdf"],
8420
+ output: ["text"]
8421
+ },
8422
+ limit: {
8423
+ context: 1e6,
8424
+ output: 128000
8425
+ }
8426
+ },
8383
8427
  "grok-4.7": {
8384
8428
  id: "grok-4.7",
8385
8429
  family: "grok",
@@ -9425,7 +9469,7 @@ var init_openai_categories = __esm(() => {
9425
9469
  },
9426
9470
  {
9427
9471
  name: "deep-low",
9428
- config: { model: "openai/gpt-5.6-sol-fast", variant: "medium" },
9472
+ config: { model: "openai/gpt-5.6-sol", variant: "medium" },
9429
9473
  description: "Default deep lane: one goal, one deliverable, decisions the child can settle from what it reads. **3D graphics, computer/browser use, CAPTCHA, multimodal, backend, logic, and algorithm work is routed here.** Multiple goals fan out as parallel calls.",
9430
9474
  callerGuidance: DEEP_LOW_CATEGORY_CALLER_GUIDANCE,
9431
9475
  promptAppend: DEEP_LOW_CATEGORY_PROMPT_APPEND,
@@ -9450,7 +9494,7 @@ var init_openai_categories = __esm(() => {
9450
9494
  },
9451
9495
  {
9452
9496
  name: "unspecified-low",
9453
- config: { model: "xiaomi/mimo-v2.6-pro", variant: "max" },
9497
+ config: { model: "anthropic/claude-sonnet-5-5", variant: "medium" },
9454
9498
  description: "Tasks that don't fit other categories, low effort required",
9455
9499
  callerGuidance: UNSPECIFIED_LOW_CATEGORY_CALLER_GUIDANCE,
9456
9500
  promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
@@ -74336,6 +74380,29 @@ var init_category = __esm(() => {
74336
74380
  OmoCategoriesConfigSchema = record(string2(), OmoCategoryConfigSchema);
74337
74381
  });
74338
74382
 
74383
+ // packages/omo-config-core/src/schema/computer.ts
74384
+ var positiveInteger, nonNegativeInteger, OmoComputerSettingsLayerSchema, OmoComputerSettingsSchema;
74385
+ var init_computer = __esm(() => {
74386
+ init_zod();
74387
+ positiveInteger = number2().int().positive();
74388
+ nonNegativeInteger = number2().int().nonnegative();
74389
+ OmoComputerSettingsLayerSchema = object({
74390
+ enabled: boolean2().describe("Experimental: register the computer tool in OmO Native sessions (default: on where the host is supported; false leaves it unregistered)"),
74391
+ display: string2().min(1),
74392
+ max_width: positiveInteger,
74393
+ max_height: positiveInteger,
74394
+ screenshot_max_bytes: positiveInteger,
74395
+ stop_hotkey: string2().min(1),
74396
+ allow_host_relay_only_stop: boolean2(),
74397
+ macos_canary: _enum(["session", "off"]),
74398
+ audit_log: object({ enabled: boolean2() }).partial().strict(),
74399
+ screenshot_gc: object({ enabled: boolean2(), stale_ms: nonNegativeInteger, scan_interval_ms: nonNegativeInteger }).partial().strict(),
74400
+ engine_path: string2().min(1),
74401
+ cua_adapter: boolean2()
74402
+ }).partial().strict().describe("Experimental computer use in OmO Native: screenshots, windows, accessibility trees and native mouse and keyboard input. Every key is optional; defaults depend on the host.");
74403
+ OmoComputerSettingsSchema = OmoComputerSettingsLayerSchema;
74404
+ });
74405
+
74339
74406
  // packages/omo-config-core/src/schema/git-master.ts
74340
74407
  var OmoGitMasterSettingsShape, OmoGitMasterSettingsLayerSchema, OmoGitMasterSettingsSchema;
74341
74408
  var init_git_master = __esm(() => {
@@ -74608,11 +74675,11 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
74608
74675
  const record2 = record(string2(), unknown()).parse(input);
74609
74676
  return OmoTaskSettingsSchema.parse({
74610
74677
  ...record2,
74611
- residency_max_children: record2["residency_max_children"] ?? Math.min(DEFAULT_RESIDENCY_MAX_CHILDREN, Math.max(8, resolveParallelism() * 2)),
74678
+ residency_max_children: record2["residency_max_children"] ?? DEFAULT_RESIDENCY_MAX_CHILDREN,
74612
74679
  global_concurrency: record2["global_concurrency"] ?? Math.max(8, resolveParallelism() * 2)
74613
74680
  });
74614
74681
  }
74615
- var DEFAULT_RESIDENCY_MAX_CHILDREN = 16, ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, IsolationBackendKindSchema, OmoTaskIsolationSchema, isolationDefaults, OmoTaskIsolationLayerSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
74682
+ var DEFAULT_RESIDENCY_MAX_CHILDREN = "unlimited", ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, IsolationBackendKindSchema, OmoTaskIsolationSchema, isolationDefaults, OmoTaskIsolationLayerSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
74616
74683
  var init_task = __esm(() => {
74617
74684
  init_zod();
74618
74685
  ResidencyMaxChildrenInputSchema = union([number2().int().nonnegative(), literal("unlimited")]);
@@ -74670,12 +74737,13 @@ var init_task = __esm(() => {
74670
74737
  process_runner: _enum(["host", "child-process"]).default("host"),
74671
74738
  host_engine_policy: _enum(["upgrade", "fallback"]).default("upgrade"),
74672
74739
  host_idle_exit_ms: number2().int().positive().optional(),
74740
+ host_shard_prewarm: _enum(["off", "first-turn", "session-start"]).default("first-turn"),
74673
74741
  default_concurrency: number2().int().nonnegative().default(5),
74674
74742
  global_concurrency: number2().int().nonnegative().default(8),
74675
74743
  provider_concurrency: record(string2(), number2().int().nonnegative()).optional(),
74676
74744
  model_concurrency: record(string2(), number2().int().nonnegative()).optional(),
74677
74745
  max_depth: number2().int().nonnegative().default(1),
74678
- residency_max_children: ResidencyMaxChildrenInputSchema.default(8),
74746
+ residency_max_children: ResidencyMaxChildrenInputSchema.default(DEFAULT_RESIDENCY_MAX_CHILDREN),
74679
74747
  resident_idle_timeout_ms: number2().int().positive().max(Number.MAX_SAFE_INTEGER).default(900000),
74680
74748
  ttl_ms: number2().int().positive().default(86400000),
74681
74749
  state_dir: string2().optional(),
@@ -74719,6 +74787,7 @@ var init_task = __esm(() => {
74719
74787
  process_runner: _enum(["host", "child-process"]).optional(),
74720
74788
  host_engine_policy: _enum(["upgrade", "fallback"]).optional(),
74721
74789
  host_idle_exit_ms: number2().int().positive().optional(),
74790
+ host_shard_prewarm: _enum(["off", "first-turn", "session-start"]).optional(),
74722
74791
  default_concurrency: number2().int().nonnegative().optional(),
74723
74792
  global_concurrency: number2().int().nonnegative().optional(),
74724
74793
  provider_concurrency: record(string2(), number2().int().nonnegative()).optional(),
@@ -74826,6 +74895,7 @@ var init_config = __esm(() => {
74826
74895
  init_zod();
74827
74896
  init_agent();
74828
74897
  init_category();
74898
+ init_computer();
74829
74899
  init_git_master();
74830
74900
  init_memory();
74831
74901
  init_model_catalog();
@@ -74848,6 +74918,7 @@ var init_config = __esm(() => {
74848
74918
  model_profile: string2().optional(),
74849
74919
  memory: OmoMemorySettingsLayerSchema.optional(),
74850
74920
  telemetry: OmoTelemetrySettingsLayerSchema.optional(),
74921
+ computer: OmoComputerSettingsLayerSchema.optional(),
74851
74922
  disabled_skills: OmoDisabledSkillsSchema.optional()
74852
74923
  }).strict();
74853
74924
  OmoConfigProfileSchema = object({
@@ -74862,6 +74933,7 @@ var init_config = __esm(() => {
74862
74933
  model_profile: string2().optional(),
74863
74934
  memory: OmoMemorySettingsLayerSchema.optional(),
74864
74935
  telemetry: OmoTelemetrySettingsLayerSchema.optional(),
74936
+ computer: OmoComputerSettingsLayerSchema.optional(),
74865
74937
  disabled_skills: OmoDisabledSkillsSchema.optional(),
74866
74938
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
74867
74939
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -74881,6 +74953,7 @@ var init_config = __esm(() => {
74881
74953
  model_profile: string2().optional(),
74882
74954
  memory: OmoMemorySettingsSchema.optional(),
74883
74955
  telemetry: OmoTelemetrySettingsSchema.optional(),
74956
+ computer: OmoComputerSettingsSchema.optional(),
74884
74957
  disabled_skills: OmoDisabledSkillsSchema.optional(),
74885
74958
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
74886
74959
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -74903,6 +74976,7 @@ var init_config = __esm(() => {
74903
74976
  model_profile: string2().optional(),
74904
74977
  memory: OmoMemorySettingsLayerSchema.optional(),
74905
74978
  telemetry: OmoTelemetrySettingsLayerSchema.optional(),
74979
+ computer: OmoComputerSettingsLayerSchema.optional(),
74906
74980
  disabled_skills: OmoDisabledSkillsSchema.optional(),
74907
74981
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
74908
74982
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -75048,6 +75122,7 @@ var init_schema = __esm(() => {
75048
75122
  init_task();
75049
75123
  init_team();
75050
75124
  init_telemetry();
75125
+ init_computer();
75051
75126
  });
75052
75127
 
75053
75128
  // packages/omo-config-core/src/loader/disabled-skills.ts
@@ -79073,9 +79148,9 @@ function extractChannel(version) {
79073
79148
 
79074
79149
  // packages/telemetry-core/src/day-claim.ts
79075
79150
  import { closeSync as closeSync3, mkdirSync as mkdirSync9, openSync as openSync3, readdirSync as readdirSync8, rmSync as rmSync3 } from "fs";
79076
- import { join as join52 } from "path";
79151
+ import { join as join53 } from "path";
79077
79152
  function getTelemetryDayClaimFilePath(stateDir, dayUTC) {
79078
- return join52(stateDir, `${CLAIM_PREFIX}${dayUTC}${CLAIM_SUFFIX}`);
79153
+ return join53(stateDir, `${CLAIM_PREFIX}${dayUTC}${CLAIM_SUFFIX}`);
79079
79154
  }
79080
79155
  function claimUtcDay(stateDir, dayUTC) {
79081
79156
  try {
@@ -79101,7 +79176,7 @@ function pruneSupersededClaims(stateDir, dayUTC) {
79101
79176
  if (!entry.startsWith(CLAIM_PREFIX) || !entry.endsWith(CLAIM_SUFFIX))
79102
79177
  continue;
79103
79178
  try {
79104
- rmSync3(join52(stateDir, entry), { force: true });
79179
+ rmSync3(join53(stateDir, entry), { force: true });
79105
79180
  } catch {}
79106
79181
  }
79107
79182
  }
@@ -79110,20 +79185,20 @@ var init_day_claim = () => {};
79110
79185
 
79111
79186
  // packages/telemetry-core/src/activity-state.ts
79112
79187
  import { existsSync as existsSync25, mkdirSync as mkdirSync10, readFileSync as readFileSync12 } from "fs";
79113
- import { basename as basename9, join as join53 } from "path";
79188
+ import { basename as basename9, join as join54 } from "path";
79114
79189
  function resolveTelemetryStateDir(product, options = {}) {
79115
79190
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
79116
79191
  env: options.env,
79117
79192
  osProvider: options.osProvider
79118
79193
  });
79119
- const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
79194
+ const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join54(options.env.XDG_DATA_HOME, product.cacheDirName);
79120
79195
  if (dataDir === xdgStateDir || xdgStateDir === undefined && basename9(dataDir) === product.cacheDirName) {
79121
79196
  return dataDir;
79122
79197
  }
79123
- return join53(dataDir, product.cacheDirName);
79198
+ return join54(dataDir, product.cacheDirName);
79124
79199
  }
79125
79200
  function getTelemetryActivityStateFilePath(stateDir) {
79126
- return join53(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
79201
+ return join54(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
79127
79202
  }
79128
79203
  function getDailyActiveCaptureState(input) {
79129
79204
  const dayUTC = getUtcDayString(input.now ?? new Date);
@@ -79204,9 +79279,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
79204
79279
 
79205
79280
  // packages/telemetry-core/src/diagnostics.ts
79206
79281
  import { appendFileSync as appendFileSync2, existsSync as existsSync26, mkdirSync as mkdirSync11, readFileSync as readFileSync13 } from "fs";
79207
- import { join as join54 } from "path";
79282
+ import { join as join55 } from "path";
79208
79283
  function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
79209
- return join54(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
79284
+ return join55(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
79210
79285
  }
79211
79286
  function writeTelemetryDiagnostic(input, options) {
79212
79287
  const now = options.now ?? new Date;
@@ -85359,7 +85434,7 @@ class SyncSpanContextManager {
85359
85434
  var init_context = () => {};
85360
85435
 
85361
85436
  // node_modules/.bun/@posthog+core@1.55.0/node_modules/@posthog/core/dist/traces/config.mjs
85362
- function positiveInteger(value, fallback) {
85437
+ function positiveInteger2(value, fallback) {
85363
85438
  return typeof value == "number" && Number.isInteger(value) && value >= 1 ? value : fallback;
85364
85439
  }
85365
85440
  function withUsableIdentityKeys(attributes) {
@@ -85394,22 +85469,22 @@ function resolveTracesConfig(config, hostResourceAttributes, logger) {
85394
85469
  const resourceAttributes = assignUserAttributes({
85395
85470
  ...hostResourceAttributes
85396
85471
  }, withUsableIdentityKeys(config?.resourceAttributes));
85397
- const maxExportBatchSize = positiveInteger(config?.maxExportBatchSize, DEFAULT_MAX_EXPORT_BATCH_SIZE);
85472
+ const maxExportBatchSize = positiveInteger2(config?.maxExportBatchSize, DEFAULT_MAX_EXPORT_BATCH_SIZE);
85398
85473
  return {
85399
85474
  serviceName: resourceAttributes?.["service.name"] ?? config?.serviceName,
85400
85475
  serviceVersion: resourceAttributes?.["service.version"] ?? config?.serviceVersion,
85401
85476
  environment: resourceAttributes?.["deployment.environment"] ?? config?.environment,
85402
85477
  resourceAttributes,
85403
85478
  beforeSpanSend: resolveBeforeSpanSend(config?.beforeSpanSend, logger),
85404
- maxAttributesPerSpan: positiveInteger(config?.maxAttributesPerSpan, DEFAULT_MAX_ATTRIBUTES_PER_SPAN),
85405
- maxEventsPerSpan: positiveInteger(config?.maxEventsPerSpan, DEFAULT_MAX_EVENTS_PER_SPAN),
85479
+ maxAttributesPerSpan: positiveInteger2(config?.maxAttributesPerSpan, DEFAULT_MAX_ATTRIBUTES_PER_SPAN),
85480
+ maxEventsPerSpan: positiveInteger2(config?.maxEventsPerSpan, DEFAULT_MAX_EVENTS_PER_SPAN),
85406
85481
  maxAttributesPerEvent: DEFAULT_MAX_ATTRIBUTES_PER_EVENT,
85407
- maxAttributeValueLength: positiveInteger(config?.maxAttributeValueLength, DEFAULT_MAX_ATTRIBUTE_VALUE_LENGTH),
85408
- flushIntervalMs: positiveInteger(config?.flushIntervalMs, DEFAULT_FLUSH_INTERVAL_MS2),
85482
+ maxAttributeValueLength: positiveInteger2(config?.maxAttributeValueLength, DEFAULT_MAX_ATTRIBUTE_VALUE_LENGTH),
85483
+ flushIntervalMs: positiveInteger2(config?.flushIntervalMs, DEFAULT_FLUSH_INTERVAL_MS2),
85409
85484
  maxExportBatchSize,
85410
- maxQueueSize: Math.max(positiveInteger(config?.maxQueueSize, DEFAULT_MAX_QUEUE_SIZE), maxExportBatchSize),
85411
- maxLiveSpans: positiveInteger(config?.maxLiveSpans, DEFAULT_MAX_LIVE_SPANS),
85412
- maxSpanAgeMs: positiveInteger(config?.maxSpanAgeMs, DEFAULT_MAX_SPAN_AGE_MS)
85485
+ maxQueueSize: Math.max(positiveInteger2(config?.maxQueueSize, DEFAULT_MAX_QUEUE_SIZE), maxExportBatchSize),
85486
+ maxLiveSpans: positiveInteger2(config?.maxLiveSpans, DEFAULT_MAX_LIVE_SPANS),
85487
+ maxSpanAgeMs: positiveInteger2(config?.maxSpanAgeMs, DEFAULT_MAX_SPAN_AGE_MS)
85413
85488
  };
85414
85489
  }
85415
85490
  var DEFAULT_FLUSH_INTERVAL_MS2 = 5000, DEFAULT_MAX_EXPORT_BATCH_SIZE = 512, DEFAULT_MAX_QUEUE_SIZE = 2048, DEFAULT_MAX_ATTRIBUTES_PER_SPAN = 128, DEFAULT_MAX_EVENTS_PER_SPAN = 128, DEFAULT_MAX_ATTRIBUTES_PER_EVENT = 128, DEFAULT_MAX_ATTRIBUTE_VALUE_LENGTH = 8192, DEFAULT_MAX_LIVE_SPANS = 1e4, DEFAULT_MAX_SPAN_AGE_MS = 3600000, IDENTITY_KEYS;
@@ -88949,7 +89024,7 @@ var package_default2;
88949
89024
  var init_package2 = __esm(() => {
88950
89025
  package_default2 = {
88951
89026
  name: "@oh-my-opencode/omo-codex",
88952
- version: "5.0.1",
89027
+ version: "5.1.1",
88953
89028
  type: "module",
88954
89029
  private: true,
88955
89030
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -89921,7 +89996,7 @@ var init_update_toasts = __esm(() => {
89921
89996
 
89922
89997
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
89923
89998
  import { existsSync as existsSync48 } from "fs";
89924
- import { dirname as dirname32, join as join78 } from "path";
89999
+ import { dirname as dirname32, join as join79 } from "path";
89925
90000
  import { fileURLToPath as fileURLToPath5 } from "url";
89926
90001
  function defaultGetModuleHostingWorkspace() {
89927
90002
  try {
@@ -90081,7 +90156,7 @@ var init_background_update_check = __esm(() => {
90081
90156
  init_update_toasts();
90082
90157
  defaultDeps4 = {
90083
90158
  existsSync: existsSync48,
90084
- join: join78,
90159
+ join: join79,
90085
90160
  runBunInstallWithDetails,
90086
90161
  log: log2,
90087
90162
  getOpenCodeCacheDir,
@@ -92537,19 +92612,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
92537
92612
  }
92538
92613
 
92539
92614
  // packages/omo-codex/src/install/install-codex.ts
92540
- import { join as join55, resolve as resolve13 } from "path";
92541
-
92542
- // packages/omo-codex/src/install/codex-default-role-config.ts
92543
- init_src4();
92544
- function readDefaultRoleConfig(options = {}) {
92545
- const result = loadOmoConfig({ ...options, harness: "codex" });
92546
- return {
92547
- enabled: result.config.agents?.default?.disable !== true,
92548
- warnings: result.diagnostics.map((diagnostic) => diagnostic.message)
92549
- };
92550
- }
92551
-
92552
- // packages/omo-codex/src/install/install-codex.ts
92615
+ import { join as join56, resolve as resolve13 } from "path";
92553
92616
  import { existsSync as existsSync27 } from "fs";
92554
92617
  import { homedir as homedir6 } from "os";
92555
92618
 
@@ -95450,13 +95513,126 @@ function toCodexResolution(resolution) {
95450
95513
  };
95451
95514
  }
95452
95515
 
95516
+ // packages/omo-codex/src/install/codex-agent-config.ts
95517
+ init_src4();
95518
+ init_reasoning_vocabulary();
95519
+ function readCodexAgentConfig(options = {}) {
95520
+ const result = loadOmoConfig({ ...options, harness: "codex" });
95521
+ const overrides = readAgentOverrides(result);
95522
+ return {
95523
+ defaultRoleEnabled: result.config.agents?.default?.disable !== true,
95524
+ agentOverrides: overrides.agentOverrides,
95525
+ warnings: [...result.diagnostics.map((diagnostic) => diagnostic.message), ...overrides.warnings]
95526
+ };
95527
+ }
95528
+ function unmanagedAgentOverrideWarnings(agentOverrides, managedAgentNames) {
95529
+ return [...agentOverrides.keys()].filter((name) => !managedAgentNames.has(name)).map((name) => `[codex].agents.${name} does not name a LazyCodex-managed agent role; its model override was not applied`);
95530
+ }
95531
+ function readAgentOverrides(result) {
95532
+ let merged = {};
95533
+ for (const layer of result.layers)
95534
+ merged = mergeOmoConfigRecords(merged, layer.config);
95535
+ const profile = result.profile === undefined ? undefined : recordAt2(recordAt2(merged, "profiles"), result.profile);
95536
+ let agents = {};
95537
+ for (const scope of [merged, profile]) {
95538
+ agents = mergeOmoConfigRecords(agents, recordAt2(recordAt2(scope, "[codex]"), "agents") ?? {});
95539
+ }
95540
+ const agentOverrides = new Map;
95541
+ const warnings = [];
95542
+ for (const [name, value] of Object.entries(agents)) {
95543
+ if (name === "default")
95544
+ continue;
95545
+ const parsed = OmoAgentDefSchema.safeParse(value);
95546
+ if (!parsed.success) {
95547
+ warnings.push(`[codex].agents.${name} is invalid and was ignored: ${parsed.error.issues[0]?.message ?? "unknown error"}`);
95548
+ continue;
95549
+ }
95550
+ const override = toCodexAgentOverride(parsed.data.model, parsed.data.reasoning);
95551
+ if (override.model !== undefined || override.reasoningEffort !== undefined)
95552
+ agentOverrides.set(name, override);
95553
+ }
95554
+ return { agentOverrides, warnings };
95555
+ }
95556
+ function toCodexAgentOverride(model, reasoning) {
95557
+ const split = model === undefined ? undefined : splitReasoningSuffix2(model);
95558
+ const effort = codexReasoningEffort(reasoning ?? split?.level);
95559
+ return {
95560
+ ...split === undefined || split.base === "" ? {} : { model: split.base },
95561
+ ...effort === undefined ? {} : { reasoningEffort: effort }
95562
+ };
95563
+ }
95564
+ function codexReasoningEffort(reasoning) {
95565
+ if (reasoning === undefined || reasoning === "auto")
95566
+ return;
95567
+ return reasoning === "off" ? "none" : reasoning;
95568
+ }
95569
+ function recordAt2(value, key) {
95570
+ if (!isPlainRecord4(value))
95571
+ return;
95572
+ const child = value[key];
95573
+ return isPlainRecord4(child) ? child : undefined;
95574
+ }
95575
+
95576
+ // packages/omo-codex/src/install/codex-marketplace-snapshot.ts
95577
+ import { cp as cp3, mkdir as mkdir6, rename as rename4, rm as rm7, writeFile as writeFile6 } from "fs/promises";
95578
+ import { join as join39, sep as sep6 } from "path";
95579
+ var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
95580
+ async function writeInstalledMarketplaceSnapshot(input) {
95581
+ const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
95582
+ await mkdir6(marketplaceRoot, { recursive: true });
95583
+ await writeMarketplaceManifest(marketplaceRoot, input.marketplace);
95584
+ const snapshotPlugins = [];
95585
+ for (const plugin of input.plugins) {
95586
+ snapshotPlugins.push(await writeSnapshotPlugin(marketplaceRoot, plugin));
95587
+ }
95588
+ return snapshotPlugins;
95589
+ }
95590
+ function installedMarketplaceRoot(codexHome, marketplaceName) {
95591
+ return join39(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
95592
+ }
95593
+ async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
95594
+ const manifestDir = join39(marketplaceRoot, ".agents", "plugins");
95595
+ await mkdir6(manifestDir, { recursive: true });
95596
+ const tempPath = join39(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
95597
+ await writeFile6(tempPath, `${JSON.stringify(marketplace, null, "\t")}
95598
+ `);
95599
+ await rename4(tempPath, join39(manifestDir, "marketplace.json"));
95600
+ }
95601
+ async function writeSnapshotPlugin(marketplaceRoot, plugin) {
95602
+ const pluginsDir = join39(marketplaceRoot, "plugins");
95603
+ await mkdir6(pluginsDir, { recursive: true });
95604
+ const targetPath = join39(pluginsDir, plugin.name);
95605
+ const tempPath = join39(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
95606
+ await rm7(tempPath, { recursive: true, force: true });
95607
+ await cp3(plugin.sourcePath, tempPath, {
95608
+ recursive: true,
95609
+ filter: (source) => shouldCopyMarketplaceSourcePath(source, plugin.sourcePath)
95610
+ });
95611
+ await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: plugin.sourcePath });
95612
+ await rm7(targetPath, { recursive: true, force: true });
95613
+ await rename4(tempPath, targetPath);
95614
+ await rewriteCachedMcpManifest(targetPath, plugin.sourcePath);
95615
+ return { name: plugin.name, path: targetPath };
95616
+ }
95617
+ function shouldCopyMarketplaceSourcePath(path, root) {
95618
+ const relative = path === root ? "" : path.slice(root.length + sep6.length);
95619
+ if (relative === "")
95620
+ return true;
95621
+ const parts = relative.split(sep6);
95622
+ return !parts.some((part) => part === ".git" || part === "node_modules");
95623
+ }
95624
+
95453
95625
  // packages/omo-codex/src/install/link-cached-plugin-agents.ts
95454
- import { copyFile, lstat as lstat10, mkdir as mkdir6, readdir as readdir7, rm as rm9, writeFile as writeFile7 } from "fs/promises";
95455
- import { basename as basename7, join as join42 } from "path";
95626
+ import { copyFile, lstat as lstat10, mkdir as mkdir7, readdir as readdir7, readFile as readFile17, rm as rm11, writeFile as writeFile9 } from "fs/promises";
95627
+ import { basename as basename7, join as join44 } from "path";
95628
+
95629
+ // packages/omo-codex/src/install/agent-model-overrides.ts
95630
+ import { readFile as readFile14, rm as rm8, writeFile as writeFile8 } from "fs/promises";
95631
+ import { join as join41 } from "path";
95456
95632
 
95457
95633
  // packages/omo-codex/src/install/preserved-agent-settings.ts
95458
- import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile6 } from "fs/promises";
95459
- import { join as join39 } from "path";
95634
+ import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile7 } from "fs/promises";
95635
+ import { join as join40 } from "path";
95460
95636
 
95461
95637
  // packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
95462
95638
  var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
@@ -95649,7 +95825,7 @@ function resolveManagedAgentReasoning(input) {
95649
95825
 
95650
95826
  // packages/omo-codex/src/install/preserved-agent-settings.ts
95651
95827
  async function capturePreservedAgentReasoning(input) {
95652
- const agentsDir = join39(input.codexHome, "agents");
95828
+ const agentsDir = join40(input.codexHome, "agents");
95653
95829
  if (!await exists2(agentsDir))
95654
95830
  return new Map;
95655
95831
  const preserved = new Map;
@@ -95657,7 +95833,7 @@ async function capturePreservedAgentReasoning(input) {
95657
95833
  for (const entry of agentEntries) {
95658
95834
  if (!entry.name.endsWith(".toml"))
95659
95835
  continue;
95660
- const content = await readTextIfExists(join39(agentsDir, entry.name));
95836
+ const content = await readTextIfExists(join40(agentsDir, entry.name));
95661
95837
  if (content === null)
95662
95838
  continue;
95663
95839
  const effort = extractReasoningEffort(content);
@@ -95671,7 +95847,7 @@ async function capturePreservedAgentReasoning(input) {
95671
95847
  return preserved;
95672
95848
  }
95673
95849
  async function capturePreservedAgentServiceTier(input) {
95674
- const agentsDir = join39(input.codexHome, "agents");
95850
+ const agentsDir = join40(input.codexHome, "agents");
95675
95851
  if (!await exists2(agentsDir))
95676
95852
  return new Map;
95677
95853
  const preserved = new Map;
@@ -95679,7 +95855,7 @@ async function capturePreservedAgentServiceTier(input) {
95679
95855
  for (const entry of agentEntries) {
95680
95856
  if (!entry.name.endsWith(".toml"))
95681
95857
  continue;
95682
- const content = await readTextIfExists(join39(agentsDir, entry.name));
95858
+ const content = await readTextIfExists(join40(agentsDir, entry.name));
95683
95859
  if (content === null)
95684
95860
  continue;
95685
95861
  preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
@@ -95702,7 +95878,7 @@ async function restorePreservedReasoning(input) {
95702
95878
  const replacement = replaceTopLevelStringSetting(content, "model_reasoning_effort", effort, { insertIfMissing: false });
95703
95879
  if (!replacement.replaced)
95704
95880
  return;
95705
- await writeFile6(input.linkPath, replacement.content);
95881
+ await writeFile7(input.linkPath, replacement.content);
95706
95882
  }
95707
95883
  async function restorePreservedServiceTier(input) {
95708
95884
  if (!input.preserved)
@@ -95713,7 +95889,18 @@ async function restorePreservedServiceTier(input) {
95713
95889
  const replacement = replaceTopLevelStringSetting(content, "service_tier", input.value, { insertIfMissing: true });
95714
95890
  if (!replacement.replaced)
95715
95891
  return;
95716
- await writeFile6(input.linkPath, replacement.content);
95892
+ await writeFile7(input.linkPath, replacement.content);
95893
+ }
95894
+ async function restorePreservedModel(input) {
95895
+ if (input.value === null)
95896
+ return;
95897
+ const content = await readFile13(input.linkPath, "utf8");
95898
+ if (extractModel(content) === input.value)
95899
+ return;
95900
+ const replacement = replaceTopLevelStringSetting(content, "model", input.value, { insertIfMissing: true });
95901
+ if (!replacement.replaced)
95902
+ return;
95903
+ await writeFile7(input.linkPath, replacement.content);
95717
95904
  }
95718
95905
  async function readTextIfExists(path) {
95719
95906
  try {
@@ -95811,9 +95998,86 @@ function nodeErrorCode(error) {
95811
95998
  return typeof error.code === "string" ? error.code : null;
95812
95999
  }
95813
96000
 
96001
+ // packages/omo-codex/src/install/agent-model-overrides.ts
96002
+ var RECEIPT_FILE = ".lazycodex-agent-models.json";
96003
+ async function readAgentModelReceipts(codexHome) {
96004
+ const content = await readTextIfExists(receiptPath(codexHome));
96005
+ if (content === null)
96006
+ return new Map;
96007
+ const parsed = parseJson(content);
96008
+ if (!isPlainRecord4(parsed))
96009
+ return new Map;
96010
+ const receipts = new Map;
96011
+ for (const [name, value] of Object.entries(parsed)) {
96012
+ if (!isPlainRecord4(value))
96013
+ continue;
96014
+ const model = value["model"];
96015
+ const reasoningEffort = value["reasoningEffort"];
96016
+ receipts.set(name, {
96017
+ ...typeof model === "string" ? { model } : {},
96018
+ ...typeof reasoningEffort === "string" ? { reasoningEffort } : {}
96019
+ });
96020
+ }
96021
+ return receipts;
96022
+ }
96023
+ async function writeAgentModelReceipts(codexHome, receipts) {
96024
+ const path = receiptPath(codexHome);
96025
+ if (receipts.size === 0) {
96026
+ await rm8(path, { force: true });
96027
+ return;
96028
+ }
96029
+ await writeFile8(path, `${JSON.stringify(Object.fromEntries(receipts), null, "\t")}
96030
+ `);
96031
+ }
96032
+ async function applyAgentOverride(input) {
96033
+ if (input.override === undefined)
96034
+ return;
96035
+ let content = await readFile14(input.linkPath, "utf8");
96036
+ if (input.override.model !== undefined) {
96037
+ content = replaceTopLevelStringSetting(content, "model", input.override.model, { insertIfMissing: true }).content;
96038
+ }
96039
+ if (input.override.reasoningEffort !== undefined) {
96040
+ content = replaceTopLevelStringSetting(content, "model_reasoning_effort", input.override.reasoningEffort, {
96041
+ insertIfMissing: true
96042
+ }).content;
96043
+ }
96044
+ await writeFile8(input.linkPath, content);
96045
+ }
96046
+ function receiptPath(codexHome) {
96047
+ return join41(codexHome, "agents", RECEIPT_FILE);
96048
+ }
96049
+ function parseJson(content) {
96050
+ try {
96051
+ return JSON.parse(content);
96052
+ } catch (error) {
96053
+ if (error instanceof SyntaxError)
96054
+ return null;
96055
+ throw error;
96056
+ }
96057
+ }
96058
+
96059
+ // packages/omo-codex/src/install/managed-agent-model-defaults.ts
96060
+ var PREVIOUSLY_BUNDLED_AGENT_MODELS = new Set([
96061
+ "gpt-5.2",
96062
+ "gpt-5.4-mini",
96063
+ "gpt-5.5",
96064
+ "gpt-5.6-luna",
96065
+ "gpt-5.6-luna-fast",
96066
+ "gpt-5.6-sol",
96067
+ "gpt-5.6-terra",
96068
+ "gpt-6-astra"
96069
+ ]);
96070
+ function handEditedAgentModel(installedModel, receipt) {
96071
+ if (installedModel === null)
96072
+ return null;
96073
+ if (receipt?.model !== undefined)
96074
+ return installedModel === receipt.model ? null : installedModel;
96075
+ return PREVIOUSLY_BUNDLED_AGENT_MODELS.has(installedModel) ? null : installedModel;
96076
+ }
96077
+
95814
96078
  // packages/omo-codex/src/install/retired-managed-agent-purge.ts
95815
- import { lstat as lstat8, readFile as readFile14, rm as rm7 } from "fs/promises";
95816
- import { join as join40 } from "path";
96079
+ import { lstat as lstat8, readFile as readFile15, rm as rm9 } from "fs/promises";
96080
+ import { join as join42 } from "path";
95817
96081
  var RETIRED_MANAGED_AGENT_FILES = [
95818
96082
  {
95819
96083
  fileName: "codex-ultrawork-reviewer.toml",
@@ -95825,11 +96089,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
95825
96089
  }
95826
96090
  ];
95827
96091
  async function purgeRetiredManagedAgentFiles(input) {
95828
- const agentsDir = join40(input.codexHome, "agents");
96092
+ const agentsDir = join42(input.codexHome, "agents");
95829
96093
  if (!await exists3(agentsDir))
95830
96094
  return;
95831
96095
  for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
95832
- const agentPath = join40(agentsDir, retiredAgent.fileName);
96096
+ const agentPath = join42(agentsDir, retiredAgent.fileName);
95833
96097
  if (!await exists3(agentPath))
95834
96098
  continue;
95835
96099
  const agentStat = await lstat8(agentPath);
@@ -95838,7 +96102,7 @@ async function purgeRetiredManagedAgentFiles(input) {
95838
96102
  const content = await readTextIfExists2(agentPath);
95839
96103
  if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
95840
96104
  continue;
95841
- await rm7(agentPath, { force: true });
96105
+ await rm9(agentPath, { force: true });
95842
96106
  }
95843
96107
  }
95844
96108
  function hasRequiredMarkers(content, markers) {
@@ -95846,7 +96110,7 @@ function hasRequiredMarkers(content, markers) {
95846
96110
  }
95847
96111
  async function readTextIfExists2(path) {
95848
96112
  try {
95849
- return await readFile14(path, "utf8");
96113
+ return await readFile15(path, "utf8");
95850
96114
  } catch (error) {
95851
96115
  if (nodeErrorCode2(error) === "ENOENT")
95852
96116
  return null;
@@ -95871,13 +96135,13 @@ function nodeErrorCode2(error) {
95871
96135
 
95872
96136
  // packages/omo-codex/src/install/default-agent-role.ts
95873
96137
  import { createHash as createHash3 } from "crypto";
95874
- import { lstat as lstat9, readFile as readFile15, rm as rm8 } from "fs/promises";
95875
- import { join as join41 } from "path";
96138
+ import { lstat as lstat9, readFile as readFile16, rm as rm10 } from "fs/promises";
96139
+ import { join as join43 } from "path";
95876
96140
  var REGISTRATION = { name: "default", configFile: "./agents/default.toml" };
95877
96141
  async function installDefaultAgentRole(input) {
95878
- const target = join41(input.codexHome, "agents", "default.toml");
95879
- const receipt = join41(input.codexHome, "agents", ".lazycodex-default.sha256");
95880
- const configPath = join41(input.codexHome, "config.toml");
96142
+ const target = join43(input.codexHome, "agents", "default.toml");
96143
+ const receipt = join43(input.codexHome, "agents", ".lazycodex-default.sha256");
96144
+ const configPath = join43(input.codexHome, "config.toml");
95881
96145
  const config = await readIfPresent(configPath);
95882
96146
  const entry = await lstat9(target).catch((error) => {
95883
96147
  if (error instanceof Error && "code" in error && error.code === "ENOENT")
@@ -95900,15 +96164,15 @@ async function installDefaultAgentRole(input) {
95900
96164
  if (next !== config)
95901
96165
  await writeFileAtomic(configPath, next);
95902
96166
  }
95903
- await rm8(target);
95904
- await rm8(receipt);
96167
+ await rm10(target);
96168
+ await rm10(receipt);
95905
96169
  }
95906
96170
  return null;
95907
96171
  }
95908
96172
  if (foreign || existing !== null && !owned) {
95909
96173
  throw new Error("Preserved user-owned agents.default / agents/default.toml. Move it aside to install the LazyCodex fallback, or set [codex].agents.default.disable = true in omo.jsonc. Explicit LazyCodex roles remain required.");
95910
96174
  }
95911
- const worker = await readFile15(input.worker.path, "utf8");
96175
+ const worker = await readFile16(input.worker.path, "utf8");
95912
96176
  const content = worker.replace(/^name\s*=\s*["']lazycodex-worker-medium["']\s*$/m, 'name = "default"');
95913
96177
  if (content === worker)
95914
96178
  throw new Error("Cannot derive default: medium worker has no matching internal name");
@@ -95918,7 +96182,7 @@ async function installDefaultAgentRole(input) {
95918
96182
  }
95919
96183
  async function readIfPresent(path) {
95920
96184
  try {
95921
- return await readFile15(path, "utf8");
96185
+ return await readFile16(path, "utf8");
95922
96186
  } catch (error) {
95923
96187
  if (error instanceof Error && "code" in error && error.code === "ENOENT")
95924
96188
  return null;
@@ -95938,27 +96202,19 @@ async function linkCachedPluginAgents(input) {
95938
96202
  await writeManifest(input.pluginRoot, []);
95939
96203
  return [];
95940
96204
  }
95941
- const agentsDir = join42(input.codexHome, "agents");
95942
- await mkdir6(agentsDir, { recursive: true });
96205
+ const agentsDir = join44(input.codexHome, "agents");
96206
+ await mkdir7(agentsDir, { recursive: true });
96207
+ const previousReceipts = await readAgentModelReceipts(input.codexHome);
96208
+ const receipts = new Map;
95943
96209
  const linked = [];
95944
96210
  for (const agentPath of bundledAgents) {
95945
96211
  const agentFileName = basename7(agentPath);
95946
96212
  const agentName = agentNameFromToml2(agentFileName);
95947
- const linkPath = join42(agentsDir, agentFileName);
95948
- await replaceWithCopy(linkPath, agentPath);
95949
- await restorePreservedReasoning({
95950
- agentName,
95951
- linkPath,
95952
- target: agentPath,
95953
- value: input.preservedReasoning?.get(agentName)
95954
- });
95955
- await restorePreservedServiceTier({
95956
- linkPath,
95957
- preserved: input.preservedServiceTier?.has(agentName) ?? false,
95958
- value: input.preservedServiceTier?.get(agentName) ?? null
95959
- });
96213
+ const linkPath = join44(agentsDir, agentFileName);
96214
+ receipts.set(agentName, await syncAgentFile({ ...input, agentName, agentPath, linkPath, previousReceipt: previousReceipts.get(agentName) }));
95960
96215
  linked.push({ name: agentFileName, path: linkPath, target: agentPath });
95961
96216
  }
96217
+ await writeAgentModelReceipts(input.codexHome, receipts);
95962
96218
  const worker = linked.find((entry) => entry.name === "lazycodex-worker-medium.toml");
95963
96219
  if (worker !== undefined) {
95964
96220
  const fallback = await installDefaultAgentRole({ codexHome: input.codexHome, worker, enabled: input.defaultRoleEnabled !== false });
@@ -95968,8 +96224,33 @@ async function linkCachedPluginAgents(input) {
95968
96224
  await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
95969
96225
  return linked;
95970
96226
  }
96227
+ async function syncAgentFile(input) {
96228
+ const installed = await readTextIfExists(input.linkPath);
96229
+ const installedModel = installed === null ? null : extractModel(installed);
96230
+ const preservedReasoning = input.preservedReasoning?.get(input.agentName);
96231
+ const override = input.agentOverrides?.get(input.agentName);
96232
+ await replaceWithCopy(input.linkPath, input.agentPath);
96233
+ await restorePreservedModel({ linkPath: input.linkPath, value: handEditedAgentModel(installedModel, input.previousReceipt) });
96234
+ await restorePreservedReasoning({
96235
+ agentName: input.agentName,
96236
+ linkPath: input.linkPath,
96237
+ target: input.agentPath,
96238
+ value: preservedReasoning?.effort === input.previousReceipt?.reasoningEffort ? undefined : preservedReasoning
96239
+ });
96240
+ await restorePreservedServiceTier({
96241
+ linkPath: input.linkPath,
96242
+ preserved: input.preservedServiceTier?.has(input.agentName) ?? false,
96243
+ value: input.preservedServiceTier?.get(input.agentName) ?? null
96244
+ });
96245
+ await applyAgentOverride({ linkPath: input.linkPath, override });
96246
+ const model = override?.model ?? extractModel(await readFile17(input.agentPath, "utf8"));
96247
+ return {
96248
+ ...model === null ? {} : { model },
96249
+ ...override?.reasoningEffort === undefined ? {} : { reasoningEffort: override.reasoningEffort }
96250
+ };
96251
+ }
95971
96252
  async function discoverBundledAgents(pluginRoot) {
95972
- const componentsRoot = join42(pluginRoot, "components");
96253
+ const componentsRoot = join44(pluginRoot, "components");
95973
96254
  if (!await exists4(componentsRoot))
95974
96255
  return [];
95975
96256
  const componentEntries = await readdir7(componentsRoot, { withFileTypes: true });
@@ -95977,14 +96258,14 @@ async function discoverBundledAgents(pluginRoot) {
95977
96258
  for (const entry of componentEntries) {
95978
96259
  if (!entry.isDirectory())
95979
96260
  continue;
95980
- const agentsRoot = join42(componentsRoot, entry.name, "agents");
96261
+ const agentsRoot = join44(componentsRoot, entry.name, "agents");
95981
96262
  if (!await exists4(agentsRoot))
95982
96263
  continue;
95983
96264
  const agentEntries = await readdir7(agentsRoot, { withFileTypes: true });
95984
96265
  for (const file of agentEntries) {
95985
96266
  if (!file.isFile() || !file.name.endsWith(".toml"))
95986
96267
  continue;
95987
- agents.push(join42(agentsRoot, file.name));
96268
+ agents.push(join44(agentsRoot, file.name));
95988
96269
  }
95989
96270
  }
95990
96271
  agents.sort();
@@ -96001,12 +96282,12 @@ async function prepareReplacement(linkPath) {
96001
96282
  if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
96002
96283
  throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
96003
96284
  }
96004
- await rm9(linkPath, { force: true });
96285
+ await rm11(linkPath, { force: true });
96005
96286
  }
96006
96287
  async function writeManifest(pluginRoot, agentPaths) {
96007
- const manifestPath = join42(pluginRoot, MANIFEST_FILE);
96288
+ const manifestPath = join44(pluginRoot, MANIFEST_FILE);
96008
96289
  const payload = { agents: [...agentPaths].sort() };
96009
- await writeFile7(manifestPath, `${JSON.stringify(payload, null, "\t")}
96290
+ await writeFile9(manifestPath, `${JSON.stringify(payload, null, "\t")}
96010
96291
  `);
96011
96292
  }
96012
96293
  function agentNameFromToml2(fileName) {
@@ -96028,13 +96309,59 @@ function nodeErrorCode3(error) {
96028
96309
  return typeof error.code === "string" ? error.code : null;
96029
96310
  }
96030
96311
 
96312
+ // packages/omo-codex/src/install/install-codex-agents.ts
96313
+ async function linkInstalledPluginAgents(input) {
96314
+ const { codexHome, log } = input;
96315
+ const preservedReasoning = await capturePreservedAgentReasoning({ codexHome });
96316
+ const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome });
96317
+ const agentSourceRoots = await agentSourceRootsForInstall(input);
96318
+ const omoConfig = readCodexAgentConfig({ cwd: input.projectDirectory, env: input.env });
96319
+ for (const warning of omoConfig.warnings)
96320
+ log(`Warning: ${warning}`);
96321
+ const agentConfigs = new Map;
96322
+ for (const plugin of input.installed) {
96323
+ const agentLinks = await linkCachedPluginAgents({
96324
+ codexHome,
96325
+ pluginRoot: agentSourceRoots.get(plugin.name) ?? plugin.path,
96326
+ platform: input.platform,
96327
+ preservedReasoning,
96328
+ preservedServiceTier,
96329
+ defaultRoleEnabled: omoConfig.defaultRoleEnabled,
96330
+ agentOverrides: omoConfig.agentOverrides
96331
+ });
96332
+ for (const link of agentLinks) {
96333
+ log(`Linked agent ${link.name} -> ${link.target}`);
96334
+ const agentName = agentNameFromToml3(link.name);
96335
+ agentConfigs.set(agentName, { name: agentName, configFile: `./agents/${link.name}` });
96336
+ }
96337
+ }
96338
+ for (const warning of unmanagedAgentOverrideWarnings(omoConfig.agentOverrides, new Set(agentConfigs.keys()))) {
96339
+ log(`Warning: ${warning}`);
96340
+ }
96341
+ return [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name));
96342
+ }
96343
+ async function agentSourceRootsForInstall(input) {
96344
+ if (input.marketplace.name !== "sisyphuslabs") {
96345
+ return new Map(input.installed.map((plugin) => [plugin.name, plugin.path]));
96346
+ }
96347
+ const snapshotPlugins = await writeInstalledMarketplaceSnapshot({
96348
+ codexHome: input.codexHome,
96349
+ marketplace: input.marketplace,
96350
+ plugins: input.pluginSources
96351
+ });
96352
+ return new Map(snapshotPlugins.map((plugin) => [plugin.name, plugin.path]));
96353
+ }
96354
+ function agentNameFromToml3(fileName) {
96355
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
96356
+ }
96357
+
96031
96358
  // packages/omo-codex/src/install/codex-marketplace.ts
96032
- import { readFile as readFile16 } from "fs/promises";
96033
- import { join as join43 } from "path";
96359
+ import { readFile as readFile18 } from "fs/promises";
96360
+ import { join as join45 } from "path";
96034
96361
  var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
96035
96362
  async function readMarketplace(repoRoot, options) {
96036
- const marketplacePath = options?.marketplacePath ?? join43(repoRoot, DEFAULT_MARKETPLACE_PATH);
96037
- const raw = await readFile16(marketplacePath, "utf8");
96363
+ const marketplacePath = options?.marketplacePath ?? join45(repoRoot, DEFAULT_MARKETPLACE_PATH);
96364
+ const raw = await readFile18(marketplacePath, "utf8");
96038
96365
  const parsed = JSON.parse(raw);
96039
96366
  if (!isPlainRecord4(parsed))
96040
96367
  throw new Error("marketplace.json must be an object");
@@ -96052,10 +96379,10 @@ async function readMarketplace(repoRoot, options) {
96052
96379
  function resolvePluginSource(repoRoot, plugin, options) {
96053
96380
  const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
96054
96381
  const relativePath = sourcePath.slice(2);
96055
- return join43(repoRoot, ...relativePath.split(/[\\/]/));
96382
+ return join45(repoRoot, ...relativePath.split(/[\\/]/));
96056
96383
  }
96057
96384
  async function readPluginManifest(pluginRoot) {
96058
- const raw = await readFile16(join43(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
96385
+ const raw = await readFile18(join45(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
96059
96386
  const parsed = JSON.parse(raw);
96060
96387
  if (!isPlainRecord4(parsed))
96061
96388
  throw new Error(`${pluginRoot} plugin.json must be an object`);
@@ -96135,61 +96462,12 @@ function validateLocalSourcePath(path) {
96135
96462
  return path;
96136
96463
  }
96137
96464
 
96138
- // packages/omo-codex/src/install/codex-marketplace-snapshot.ts
96139
- import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm10, writeFile as writeFile8 } from "fs/promises";
96140
- import { join as join44, sep as sep6 } from "path";
96141
- var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
96142
- async function writeInstalledMarketplaceSnapshot(input) {
96143
- const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
96144
- await mkdir7(marketplaceRoot, { recursive: true });
96145
- await writeMarketplaceManifest(marketplaceRoot, input.marketplace);
96146
- const snapshotPlugins = [];
96147
- for (const plugin of input.plugins) {
96148
- snapshotPlugins.push(await writeSnapshotPlugin(marketplaceRoot, plugin));
96149
- }
96150
- return snapshotPlugins;
96151
- }
96152
- function installedMarketplaceRoot(codexHome, marketplaceName) {
96153
- return join44(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
96154
- }
96155
- async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
96156
- const manifestDir = join44(marketplaceRoot, ".agents", "plugins");
96157
- await mkdir7(manifestDir, { recursive: true });
96158
- const tempPath = join44(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
96159
- await writeFile8(tempPath, `${JSON.stringify(marketplace, null, "\t")}
96160
- `);
96161
- await rename4(tempPath, join44(manifestDir, "marketplace.json"));
96162
- }
96163
- async function writeSnapshotPlugin(marketplaceRoot, plugin) {
96164
- const pluginsDir = join44(marketplaceRoot, "plugins");
96165
- await mkdir7(pluginsDir, { recursive: true });
96166
- const targetPath = join44(pluginsDir, plugin.name);
96167
- const tempPath = join44(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
96168
- await rm10(tempPath, { recursive: true, force: true });
96169
- await cp3(plugin.sourcePath, tempPath, {
96170
- recursive: true,
96171
- filter: (source) => shouldCopyMarketplaceSourcePath(source, plugin.sourcePath)
96172
- });
96173
- await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: plugin.sourcePath });
96174
- await rm10(targetPath, { recursive: true, force: true });
96175
- await rename4(tempPath, targetPath);
96176
- await rewriteCachedMcpManifest(targetPath, plugin.sourcePath);
96177
- return { name: plugin.name, path: targetPath };
96178
- }
96179
- function shouldCopyMarketplaceSourcePath(path, root) {
96180
- const relative = path === root ? "" : path.slice(root.length + sep6.length);
96181
- if (relative === "")
96182
- return true;
96183
- const parts = relative.split(sep6);
96184
- return !parts.some((part) => part === ".git" || part === "node_modules");
96185
- }
96186
-
96187
96465
  // packages/omo-codex/src/install/lazycodex-version-stamp.ts
96188
- import { readdir as readdir8, readFile as readFile17, writeFile as writeFile9 } from "fs/promises";
96189
- import { join as join45 } from "path";
96466
+ import { readdir as readdir8, readFile as readFile19, writeFile as writeFile10 } from "fs/promises";
96467
+ import { join as join46 } from "path";
96190
96468
  async function readDistributionManifest(repoRoot) {
96191
96469
  try {
96192
- const parsed = JSON.parse(await readFile17(join45(repoRoot, "package.json"), "utf8"));
96470
+ const parsed = JSON.parse(await readFile19(join46(repoRoot, "package.json"), "utf8"));
96193
96471
  if (!isPlainRecord4(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
96194
96472
  return;
96195
96473
  return {
@@ -96213,19 +96491,19 @@ function resolveLazyCodexPluginVersion(input) {
96213
96491
  return input.manifestVersion ?? "local";
96214
96492
  }
96215
96493
  async function stampLazyCodexPluginVersion(input) {
96216
- const manifestPath = join45(input.pluginRoot, ".codex-plugin", "plugin.json");
96494
+ const manifestPath = join46(input.pluginRoot, ".codex-plugin", "plugin.json");
96217
96495
  const hookPaths = await readPluginHookPaths(manifestPath);
96218
96496
  await stampJsonVersion(manifestPath, input.version);
96219
- await stampJsonVersion(join45(input.pluginRoot, "package.json"), input.version);
96497
+ await stampJsonVersion(join46(input.pluginRoot, "package.json"), input.version);
96220
96498
  for (const hookPath of hookPaths) {
96221
- await stampHookStatusMessages(join45(input.pluginRoot, hookPath), input.version);
96499
+ await stampHookStatusMessages(join46(input.pluginRoot, hookPath), input.version);
96222
96500
  }
96223
96501
  await stampComponentVersions(input);
96224
96502
  }
96225
96503
  async function writeLazyCodexInstallSnapshot(input) {
96226
96504
  if (input.distributionManifest === undefined)
96227
96505
  return;
96228
- await writeFile9(join45(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
96506
+ await writeFile10(join46(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
96229
96507
  packageName: input.distributionManifest.name,
96230
96508
  version: input.distributionManifest.version
96231
96509
  }, null, "\t")}
@@ -96233,11 +96511,11 @@ async function writeLazyCodexInstallSnapshot(input) {
96233
96511
  }
96234
96512
  async function stampJsonVersion(path, version) {
96235
96513
  try {
96236
- const parsed = JSON.parse(await readFile17(path, "utf8"));
96514
+ const parsed = JSON.parse(await readFile19(path, "utf8"));
96237
96515
  if (!isPlainRecord4(parsed))
96238
96516
  return;
96239
96517
  parsed.version = version;
96240
- await writeFile9(path, `${JSON.stringify(parsed, null, "\t")}
96518
+ await writeFile10(path, `${JSON.stringify(parsed, null, "\t")}
96241
96519
  `);
96242
96520
  } catch (error) {
96243
96521
  if (error instanceof Error)
@@ -96247,7 +96525,7 @@ async function stampJsonVersion(path, version) {
96247
96525
  }
96248
96526
  async function readPluginHookPaths(manifestPath) {
96249
96527
  try {
96250
- const parsed = JSON.parse(await readFile17(manifestPath, "utf8"));
96528
+ const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
96251
96529
  if (!isPlainRecord4(parsed))
96252
96530
  return [];
96253
96531
  if (typeof parsed.hooks === "string" && parsed.hooks.trim().length > 0)
@@ -96267,11 +96545,11 @@ function stripDotSlash3(path) {
96267
96545
  }
96268
96546
  async function stampHookStatusMessages(path, version) {
96269
96547
  try {
96270
- const parsed = JSON.parse(await readFile17(path, "utf8"));
96548
+ const parsed = JSON.parse(await readFile19(path, "utf8"));
96271
96549
  if (!isPlainRecord4(parsed))
96272
96550
  return;
96273
96551
  stampHookGroups(parsed.hooks, version);
96274
- await writeFile9(path, `${JSON.stringify(parsed, null, "\t")}
96552
+ await writeFile10(path, `${JSON.stringify(parsed, null, "\t")}
96275
96553
  `);
96276
96554
  } catch (error) {
96277
96555
  if (error instanceof Error)
@@ -96282,16 +96560,16 @@ async function stampHookStatusMessages(path, version) {
96282
96560
  async function stampComponentVersions(input) {
96283
96561
  let entries;
96284
96562
  try {
96285
- entries = await readdir8(join45(input.pluginRoot, "components"));
96563
+ entries = await readdir8(join46(input.pluginRoot, "components"));
96286
96564
  } catch (error) {
96287
96565
  if (error instanceof Error)
96288
96566
  return;
96289
96567
  throw error;
96290
96568
  }
96291
96569
  for (const entry of entries) {
96292
- const componentRoot = join45(input.pluginRoot, "components", entry);
96293
- await stampJsonVersion(join45(componentRoot, "package.json"), input.version);
96294
- await stampHookStatusMessages(join45(componentRoot, "hooks", "hooks.json"), input.version);
96570
+ const componentRoot = join46(input.pluginRoot, "components", entry);
96571
+ await stampJsonVersion(join46(componentRoot, "package.json"), input.version);
96572
+ await stampHookStatusMessages(join46(componentRoot, "hooks", "hooks.json"), input.version);
96295
96573
  }
96296
96574
  }
96297
96575
  function stampHookGroups(hooks, version) {
@@ -96348,8 +96626,8 @@ var defaultRunCommand = async (command, args, options) => {
96348
96626
  };
96349
96627
 
96350
96628
  // packages/omo-codex/src/install/codex-project-local-cleanup.ts
96351
- import { copyFile as copyFile2, lstat as lstat11, readFile as readFile18, writeFile as writeFile10 } from "fs/promises";
96352
- import { dirname as dirname17, join as join46, resolve as resolve11 } from "path";
96629
+ import { copyFile as copyFile2, lstat as lstat11, readFile as readFile20, writeFile as writeFile11 } from "fs/promises";
96630
+ import { dirname as dirname17, join as join47, resolve as resolve11 } from "path";
96353
96631
  var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
96354
96632
  var PROJECT_LOCAL_ARTIFACT_PATHS = [
96355
96633
  ".codex/hooks.json",
@@ -96368,7 +96646,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
96368
96646
  const artifacts = await collectProjectLocalArtifacts(project.artifactRoots);
96369
96647
  const configs = [];
96370
96648
  for (const configPath of project.configPaths) {
96371
- const original = await readFile18(configPath, "utf8");
96649
+ const original = await readFile20(configPath, "utf8");
96372
96650
  const repair = repairProjectLocalCodexConfigText(original);
96373
96651
  if (!repair.changed) {
96374
96652
  configs.push({
@@ -96381,7 +96659,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
96381
96659
  }
96382
96660
  const backupPath = `${configPath}.backup-${formatBackupTimestamp(input.now?.() ?? new Date)}`;
96383
96661
  await copyFile2(configPath, backupPath);
96384
- await writeFile10(configPath, `${repair.config.trimEnd()}
96662
+ await writeFile11(configPath, `${repair.config.trimEnd()}
96385
96663
  `);
96386
96664
  configs.push({
96387
96665
  projectRoot: project.projectRoot,
@@ -96452,17 +96730,17 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
96452
96730
  if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
96453
96731
  throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
96454
96732
  }
96455
- const codexHomeConfigPath = codexHome === undefined ? null : join46(resolve11(codexHome), "config.toml");
96733
+ const codexHomeConfigPath = codexHome === undefined ? null : join47(resolve11(codexHome), "config.toml");
96456
96734
  let current = resolve11(startDirectory);
96457
96735
  const configPathsFromCwd = [];
96458
96736
  while (true) {
96459
- const configPath = join46(current, ".codex", "config.toml");
96737
+ const configPath = join47(current, ".codex", "config.toml");
96460
96738
  if (await isRegularProjectLocalConfig(current, configPath)) {
96461
96739
  if (codexHomeConfigPath === null || resolve11(configPath) !== codexHomeConfigPath) {
96462
96740
  configPathsFromCwd.push(configPath);
96463
96741
  }
96464
96742
  }
96465
- if (await exists5(join46(current, ".git"))) {
96743
+ if (await exists5(join47(current, ".git"))) {
96466
96744
  return configPathsFromCwd.length === 0 ? null : {
96467
96745
  projectRoot: current,
96468
96746
  configPaths: [...configPathsFromCwd].reverse(),
@@ -96482,7 +96760,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
96482
96760
  }
96483
96761
  }
96484
96762
  async function isRegularProjectLocalConfig(directory, configPath) {
96485
- const codexDirStat = await maybeLstat(join46(directory, ".codex"));
96763
+ const codexDirStat = await maybeLstat(join47(directory, ".codex"));
96486
96764
  if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
96487
96765
  return false;
96488
96766
  const configStat = await maybeLstat(configPath);
@@ -96502,7 +96780,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
96502
96780
  const seenPaths = new Set;
96503
96781
  for (const projectRoot of projectRoots) {
96504
96782
  for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
96505
- const artifactPath = join46(projectRoot, relativePath);
96783
+ const artifactPath = join47(projectRoot, relativePath);
96506
96784
  if (seenPaths.has(artifactPath))
96507
96785
  continue;
96508
96786
  const entryStat = await maybeLstat(artifactPath);
@@ -96578,13 +96856,13 @@ function formatUnknownError(error) {
96578
96856
 
96579
96857
  // packages/omo-codex/src/install/lsp-daemon-reaper.ts
96580
96858
  import { createHash as createHash4 } from "crypto";
96581
- import { lstat as lstat12, readFile as readFile20, readdir as readdir10, rm as rm11 } from "fs/promises";
96859
+ import { lstat as lstat12, readFile as readFile22, readdir as readdir10, rm as rm12 } from "fs/promises";
96582
96860
  import { tmpdir as tmpdir3 } from "os";
96583
- import { join as join47, posix as posix6 } from "path";
96861
+ import { join as join48, posix as posix6 } from "path";
96584
96862
 
96585
96863
  // packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
96586
96864
  import { execFile } from "child_process";
96587
- import { readFile as readFile19, readdir as readdir9, readlink as readlink5 } from "fs/promises";
96865
+ import { readFile as readFile21, readdir as readdir9, readlink as readlink5 } from "fs/promises";
96588
96866
  import { connect } from "net";
96589
96867
  import { basename as basename8 } from "path";
96590
96868
  var PROBE_TIMEOUT_MS = 500;
@@ -96626,7 +96904,7 @@ async function attestLegacyDaemonOwnership(input, deps = {}) {
96626
96904
  return false;
96627
96905
  }
96628
96906
  async function attestLinuxOwnership(input, deps) {
96629
- const readFileImpl = deps.readFile ?? readFile19;
96907
+ const readFileImpl = deps.readFile ?? readFile21;
96630
96908
  const readDirImpl = deps.readDir ?? readdir9;
96631
96909
  const readLinkImpl = deps.readLink ?? readlink5;
96632
96910
  const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
@@ -96753,7 +97031,7 @@ async function readBinary(readFileImpl, path) {
96753
97031
  var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
96754
97032
  var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
96755
97033
  async function reapLspDaemons(codexHome, deps = {}) {
96756
- const daemonRoot = join47(codexHome, "codex-lsp", "daemon");
97034
+ const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
96757
97035
  const platform = deps.platform ?? process.platform;
96758
97036
  const tmpDir = deps.tmpDir ?? tmpdir3();
96759
97037
  const probe = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
@@ -96763,7 +97041,7 @@ async function reapLspDaemons(codexHome, deps = {}) {
96763
97041
  const entries = await readdir10(daemonRoot, { withFileTypes: true }).catch(() => []);
96764
97042
  const results = [];
96765
97043
  for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
96766
- const versionPath = join47(daemonRoot, entry.name);
97044
+ const versionPath = join48(daemonRoot, entry.name);
96767
97045
  const parsedVersion = parseVersionEntry(entry.name);
96768
97046
  if (parsedVersion === null || !entry.isDirectory()) {
96769
97047
  await removeVersionDir(versionPath);
@@ -96811,7 +97089,7 @@ function parseVersionEntry(entryName) {
96811
97089
  return LEGACY_VERSION_PATTERN.test(version) ? version : null;
96812
97090
  }
96813
97091
  async function readLegacyMetadata(input) {
96814
- const pidText = await readRegularTrimmedFile(join47(input.versionPath, "daemon.pid"));
97092
+ const pidText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.pid"));
96815
97093
  if (pidText === "non_regular")
96816
97094
  return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
96817
97095
  if (pidText === null)
@@ -96819,7 +97097,7 @@ async function readLegacyMetadata(input) {
96819
97097
  const pid = Number.parseInt(pidText, 10);
96820
97098
  if (!Number.isInteger(pid) || pid <= 0)
96821
97099
  return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
96822
- const endpointText = await readRegularTrimmedFile(join47(input.versionPath, "daemon.endpoint"));
97100
+ const endpointText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.endpoint"));
96823
97101
  if (endpointText === "non_regular")
96824
97102
  return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
96825
97103
  if (endpointText === null)
@@ -96851,14 +97129,14 @@ async function readRegularTrimmedFile(path) {
96851
97129
  return null;
96852
97130
  if (!stats.isFile())
96853
97131
  return "non_regular";
96854
- const content = (await readFile20(path, "utf8")).trim();
97132
+ const content = (await readFile22(path, "utf8")).trim();
96855
97133
  return content.length > 0 ? content : null;
96856
97134
  }
96857
97135
  function shortDigest(value) {
96858
97136
  return createHash4("sha256").update(value).digest("hex").slice(0, 16);
96859
97137
  }
96860
97138
  async function removeVersionDir(path) {
96861
- await rm11(path, { recursive: true, force: true });
97139
+ await rm12(path, { recursive: true, force: true });
96862
97140
  }
96863
97141
  function removed(version, reason) {
96864
97142
  return { version, status: "removed", reason };
@@ -96898,7 +97176,7 @@ function processIsRunning(pid) {
96898
97176
 
96899
97177
  // packages/omo-codex/src/install/codex-installer-bin-dir.ts
96900
97178
  import { homedir as homedir5 } from "os";
96901
- import { join as join48, resolve as resolve12 } from "path";
97179
+ import { join as join49, resolve as resolve12 } from "path";
96902
97180
  function resolveCodexInstallerBinDir(input) {
96903
97181
  const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
96904
97182
  if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
@@ -96907,16 +97185,16 @@ function resolveCodexInstallerBinDir(input) {
96907
97185
  const defaultCodexHome = resolve12(homeDir, ".codex");
96908
97186
  const resolvedCodexHome = resolve12(input.codexHome);
96909
97187
  if (resolvedCodexHome !== defaultCodexHome)
96910
- return join48(resolvedCodexHome, "bin");
97188
+ return join49(resolvedCodexHome, "bin");
96911
97189
  return resolve12(homeDir, ".local", "bin");
96912
97190
  }
96913
97191
 
96914
97192
  // packages/omo-codex/src/install/codex-installed-bin-dir.ts
96915
- import { readFile as readFile21, readdir as readdir11, writeFile as writeFile11 } from "fs/promises";
96916
- import { join as join49 } from "path";
97193
+ import { readFile as readFile23, readdir as readdir11, writeFile as writeFile12 } from "fs/promises";
97194
+ import { join as join50 } from "path";
96917
97195
  var INSTALLED_BIN_DIR_MANIFEST = ".installed-bin-dir.json";
96918
97196
  async function writeInstalledCodexBinDir(input) {
96919
- await writeFile11(join49(input.pluginRoot, INSTALLED_BIN_DIR_MANIFEST), `${JSON.stringify({ binDir: input.binDir }, null, 2)}
97197
+ await writeFile12(join50(input.pluginRoot, INSTALLED_BIN_DIR_MANIFEST), `${JSON.stringify({ binDir: input.binDir }, null, 2)}
96920
97198
  `);
96921
97199
  }
96922
97200
  async function readInstalledCodexBinDir(codexHome) {
@@ -96929,20 +97207,20 @@ async function readInstalledCodexBinDir(codexHome) {
96929
97207
  }
96930
97208
  async function installedBinDirManifestPaths(codexHome) {
96931
97209
  const paths = [
96932
- join49(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_BIN_DIR_MANIFEST)
97210
+ join50(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_BIN_DIR_MANIFEST)
96933
97211
  ];
96934
- const versionRoot = join49(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
97212
+ const versionRoot = join50(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
96935
97213
  const entries = await readdir11(versionRoot, { withFileTypes: true }).catch(() => null);
96936
97214
  if (entries !== null) {
96937
97215
  for (const entry of entries) {
96938
97216
  if (entry.isDirectory())
96939
- paths.push(join49(versionRoot, entry.name, INSTALLED_BIN_DIR_MANIFEST));
97217
+ paths.push(join50(versionRoot, entry.name, INSTALLED_BIN_DIR_MANIFEST));
96940
97218
  }
96941
97219
  }
96942
97220
  return paths;
96943
97221
  }
96944
97222
  async function readBinDirFromManifest(manifestPath) {
96945
- const raw = await readFile21(manifestPath, "utf8").catch(() => null);
97223
+ const raw = await readFile23(manifestPath, "utf8").catch(() => null);
96946
97224
  if (raw === null)
96947
97225
  return null;
96948
97226
  let parsed;
@@ -96960,8 +97238,8 @@ async function readBinDirFromManifest(manifestPath) {
96960
97238
  }
96961
97239
 
96962
97240
  // packages/omo-codex/src/install/codex-git-bash-hooks.ts
96963
- import { readFile as readFile22, writeFile as writeFile12 } from "fs/promises";
96964
- import { join as join50 } from "path";
97241
+ import { readFile as readFile24, writeFile as writeFile13 } from "fs/promises";
97242
+ import { join as join51 } from "path";
96965
97243
  var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
96966
97244
  "./hooks/pre-tool-use-recommending-git-bash-mcp.json",
96967
97245
  "./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
@@ -96969,20 +97247,20 @@ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
96969
97247
  async function removeGitBashHooksOffWindows(input) {
96970
97248
  if (input.platform === "win32")
96971
97249
  return;
96972
- const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
96973
- const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
97250
+ const manifestPath = join51(input.pluginRoot, ".codex-plugin", "plugin.json");
97251
+ const parsed = JSON.parse(await readFile24(manifestPath, "utf8"));
96974
97252
  if (!isPlainRecord4(parsed) || !Array.isArray(parsed.hooks))
96975
97253
  return;
96976
97254
  const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
96977
97255
  if (hooks.length === parsed.hooks.length)
96978
97256
  return;
96979
- await writeFile12(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
97257
+ await writeFile13(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
96980
97258
  `);
96981
97259
  }
96982
97260
 
96983
97261
  // packages/omo-codex/src/install/install-ast-grep-sg.ts
96984
97262
  init_src();
96985
- import { join as join51 } from "path";
97263
+ import { join as join52 } from "path";
96986
97264
  function describeResult(result) {
96987
97265
  if (result.kind === "succeeded")
96988
97266
  return null;
@@ -96996,7 +97274,7 @@ async function installAstGrepForCodex(options) {
96996
97274
  return;
96997
97275
  const platform = options.platform ?? process.platform;
96998
97276
  const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
96999
- const skillDir = join51(plugin.path, "skills", "ast-grep");
97277
+ const skillDir = join52(plugin.path, "skills", "ast-grep");
97000
97278
  const installer = options.installer ?? runAstGrepSkillInstall;
97001
97279
  try {
97002
97280
  const result = await installer({ platform, skillDir, targetDir });
@@ -97029,7 +97307,7 @@ async function runCodexInstaller(options = {}) {
97029
97307
  const env = options.env ?? process.env;
97030
97308
  const platform = options.platform ?? process.platform;
97031
97309
  const repoRoot = resolve13(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env }));
97032
- const codexHome = resolve13(options.codexHome ?? env.CODEX_HOME ?? join55(homedir6(), ".codex"));
97310
+ const codexHome = resolve13(options.codexHome ?? env.CODEX_HOME ?? join56(homedir6(), ".codex"));
97033
97311
  const projectDirectory = resolve13(options.projectDirectory ?? env.OMO_CODEX_PROJECT ?? process.cwd());
97034
97312
  const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env });
97035
97313
  const runCommand = options.runCommand ?? defaultRunCommand;
@@ -97046,14 +97324,13 @@ async function runCodexInstaller(options = {}) {
97046
97324
  if (!gitBashResolution.found) {
97047
97325
  throw new Error(gitBashResolution.installHint);
97048
97326
  }
97049
- const codexPackageRoot = join55(repoRoot, "packages", "omo-codex");
97327
+ const codexPackageRoot = join56(repoRoot, "packages", "omo-codex");
97050
97328
  const marketplace = await readMarketplace(repoRoot, {
97051
- marketplacePath: join55(codexPackageRoot, "marketplace.json")
97329
+ marketplacePath: join56(codexPackageRoot, "marketplace.json")
97052
97330
  });
97053
97331
  const distributionManifest = await readDistributionManifest(repoRoot);
97054
97332
  const installed = [];
97055
97333
  const pluginSources = [];
97056
- const agentConfigs = new Map;
97057
97334
  for (const entry of marketplace.plugins) {
97058
97335
  const sourcePath = resolvePluginSource(codexPackageRoot, entry, { pathOverride: "./plugin" });
97059
97336
  const manifest = await readPluginManifest(sourcePath);
@@ -97094,7 +97371,7 @@ async function runCodexInstaller(options = {}) {
97094
97371
  if (runtimeLink !== null)
97095
97372
  log(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
97096
97373
  else
97097
- log(`Warning: skipped the omo-agent-toolkit runtime wrapper because ${join55(repoRoot, "dist", "cli", "index.js")} is missing; omo-agent-toolkit ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
97374
+ log(`Warning: skipped the omo-agent-toolkit runtime wrapper because ${join56(repoRoot, "dist", "cli", "index.js")} is missing; omo-agent-toolkit ulw-loop commands will be unavailable until a package shipping dist/cli is installed`);
97098
97375
  }
97099
97376
  pluginSources.push({ name: entry.name, sourcePath });
97100
97377
  installed.push(plugin);
@@ -97106,33 +97383,16 @@ async function runCodexInstaller(options = {}) {
97106
97383
  log,
97107
97384
  platform
97108
97385
  });
97109
- const preservedReasoning = await capturePreservedAgentReasoning({ codexHome });
97110
- const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome });
97111
- const agentSourceRoots = await agentSourceRootsForInstall({
97386
+ const agentConfigs = await linkInstalledPluginAgents({
97112
97387
  codexHome,
97388
+ projectDirectory,
97389
+ env,
97390
+ platform,
97391
+ log,
97113
97392
  marketplace,
97114
97393
  installed,
97115
97394
  pluginSources
97116
97395
  });
97117
- const omoConfig = readDefaultRoleConfig({ cwd: projectDirectory, env });
97118
- for (const warning of omoConfig.warnings)
97119
- log(`Warning: ${warning}`);
97120
- for (const plugin of installed) {
97121
- const pluginRoot = agentSourceRoots.get(plugin.name) ?? plugin.path;
97122
- const agentLinks = await linkCachedPluginAgents({
97123
- codexHome,
97124
- pluginRoot,
97125
- platform,
97126
- preservedReasoning,
97127
- preservedServiceTier,
97128
- defaultRoleEnabled: omoConfig.enabled
97129
- });
97130
- for (const link of agentLinks) {
97131
- log(`Linked agent ${link.name} -> ${link.target}`);
97132
- const agentName = agentNameFromToml3(link.name);
97133
- agentConfigs.set(agentName, { name: agentName, configFile: `./agents/${link.name}` });
97134
- }
97135
- }
97136
97396
  const trustedHookStates = (await Promise.all(installed.map((plugin) => trustedHookStatesForPlugin({
97137
97397
  marketplaceName: marketplace.name,
97138
97398
  platform,
@@ -97161,13 +97421,13 @@ async function runCodexInstaller(options = {}) {
97161
97421
  continue;
97162
97422
  log(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
97163
97423
  }
97164
- const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
97424
+ const marketplaceRoot = join56(codexHome, "plugins", "cache", marketplace.name);
97165
97425
  await writeCachedMarketplaceManifest({
97166
97426
  marketplaceName: marketplace.name,
97167
97427
  marketplaceRoot,
97168
97428
  plugins: installed
97169
97429
  });
97170
- const configPath = join55(codexHome, "config.toml");
97430
+ const configPath = join56(codexHome, "config.toml");
97171
97431
  await updateCodexConfig({
97172
97432
  configPath,
97173
97433
  repoRoot: codexPackageRoot,
@@ -97177,7 +97437,7 @@ async function runCodexInstaller(options = {}) {
97177
97437
  platform,
97178
97438
  gitBashEnabled: platform === "win32" && gitBashResolution.found,
97179
97439
  trustedHookStates,
97180
- agentConfigs: [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name)),
97440
+ agentConfigs,
97181
97441
  autonomousPermissions: options.autonomousPermissions !== false,
97182
97442
  ...options.reasoning === undefined ? {} : { reasoning: options.reasoning }
97183
97443
  });
@@ -97204,20 +97464,6 @@ async function runCodexInstaller(options = {}) {
97204
97464
  projectCleanup
97205
97465
  };
97206
97466
  }
97207
- function agentNameFromToml3(fileName) {
97208
- return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
97209
- }
97210
- async function agentSourceRootsForInstall(input) {
97211
- if (input.marketplace.name !== "sisyphuslabs") {
97212
- return new Map(input.installed.map((plugin) => [plugin.name, plugin.path]));
97213
- }
97214
- const snapshotPlugins = await writeInstalledMarketplaceSnapshot({
97215
- codexHome: input.codexHome,
97216
- marketplace: input.marketplace,
97217
- plugins: input.pluginSources
97218
- });
97219
- return new Map(snapshotPlugins.map((plugin) => [plugin.name, plugin.path]));
97220
- }
97221
97467
  function legacyCacheMarketplaces(marketplaceName) {
97222
97468
  return marketplaceName === "sisyphuslabs" ? SISYPHUS_LEGACY_CACHE_MARKETPLACES : [];
97223
97469
  }
@@ -97226,7 +97472,7 @@ function findRepoRootFromImporter(importerDir) {
97226
97472
  for (let depth = 0;depth <= 7; depth += 1) {
97227
97473
  if (isRepoRootWithCodexPlugin(current))
97228
97474
  return current;
97229
- for (const wrapperPackageRoot of [join55(current, "node_modules", "oh-my-openagent"), join55(current, "oh-my-openagent")]) {
97475
+ for (const wrapperPackageRoot of [join56(current, "node_modules", "oh-my-openagent"), join56(current, "oh-my-openagent")]) {
97230
97476
  if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
97231
97477
  return wrapperPackageRoot;
97232
97478
  }
@@ -97244,7 +97490,7 @@ function findRepoRoot(input) {
97244
97490
  return findRepoRootFromImporter(input.importerDir);
97245
97491
  }
97246
97492
  function isRepoRootWithCodexPlugin(repoRoot) {
97247
- return existsSync27(join55(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
97493
+ return existsSync27(join56(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
97248
97494
  }
97249
97495
  function codexMarketplaceSource(marketplaceRoot) {
97250
97496
  return { sourceType: "local", source: marketplaceRoot };
@@ -97379,13 +97625,13 @@ function defaultRunCommand2(command, args) {
97379
97625
  });
97380
97626
  }
97381
97627
  // packages/omo-codex/src/install/codex-cleanup.ts
97382
- import { lstat as lstat15, readFile as readFile25, readdir as readdir13, rm as rm13, rmdir } from "fs/promises";
97628
+ import { lstat as lstat15, readFile as readFile27, readdir as readdir13, rm as rm14, rmdir } from "fs/promises";
97383
97629
  import { homedir as homedir8 } from "os";
97384
- import { isAbsolute as isAbsolute11, join as join58, relative as relative6, resolve as resolve16 } from "path";
97630
+ import { isAbsolute as isAbsolute11, join as join59, relative as relative6, resolve as resolve16 } from "path";
97385
97631
 
97386
97632
  // packages/omo-codex/src/install/codex-cleanup-bins.ts
97387
- import { lstat as lstat13, readFile as readFile23, readdir as readdir12, readlink as readlink6, rm as rm12 } from "fs/promises";
97388
- import { dirname as dirname19, isAbsolute as isAbsolute9, join as join56, resolve as resolve14 } from "path";
97633
+ import { lstat as lstat13, readFile as readFile25, readdir as readdir12, readlink as readlink6, rm as rm13 } from "fs/promises";
97634
+ import { dirname as dirname19, isAbsolute as isAbsolute9, join as join57, resolve as resolve14 } from "path";
97389
97635
  var ROOT_RUNTIME_BIN_NAME = "omo";
97390
97636
  var MANAGED_CODEX_BIN_NAMES = new Set([
97391
97637
  ROOT_RUNTIME_BIN_NAME,
@@ -97415,9 +97661,9 @@ async function removeManagedCodexBins(binDir, platform) {
97415
97661
  const binName = managedBinNameForEntry2(entry.name, platform);
97416
97662
  if (binName === null || !MANAGED_CODEX_BIN_NAMES.has(binName))
97417
97663
  continue;
97418
- const linkPath = join56(binDir, entry.name);
97664
+ const linkPath = join57(binDir, entry.name);
97419
97665
  if (await isManagedCodexBin(linkPath, platform, binName)) {
97420
- await rm12(linkPath, { force: true });
97666
+ await rm13(linkPath, { force: true });
97421
97667
  removed.push(linkPath);
97422
97668
  }
97423
97669
  }
@@ -97446,12 +97692,12 @@ async function isManagedCodexBin(linkPath, platform, binName) {
97446
97692
  }
97447
97693
  if (!entryStat.isFile())
97448
97694
  return false;
97449
- const content = await readFile23(linkPath, "utf8");
97695
+ const content = await readFile25(linkPath, "utf8");
97450
97696
  return content.includes(RUNTIME_WRAPPER_MARKER) || content.includes(COMMAND_SHIM_MARKER);
97451
97697
  }
97452
97698
 
97453
97699
  // packages/omo-codex/src/install/codex-cleanup-config.ts
97454
- import { lstat as lstat14, mkdir as mkdir8, readFile as readFile24, writeFile as writeFile13 } from "fs/promises";
97700
+ import { lstat as lstat14, mkdir as mkdir8, readFile as readFile26, writeFile as writeFile14 } from "fs/promises";
97455
97701
  import { dirname as dirname20 } from "path";
97456
97702
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
97457
97703
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
@@ -97484,14 +97730,14 @@ function cleanupCodexLightConfigText(config) {
97484
97730
  async function cleanupCodexConfig(configPath, now) {
97485
97731
  if (!await configExists(configPath))
97486
97732
  return { changed: false };
97487
- const original = await readFile24(configPath, "utf8");
97733
+ const original = await readFile26(configPath, "utf8");
97488
97734
  const next = cleanupCodexLightConfigText(original);
97489
97735
  if (next === original)
97490
97736
  return { changed: false };
97491
97737
  const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
97492
97738
  await mkdir8(dirname20(configPath), { recursive: true });
97493
- await writeFile13(backupPath, original);
97494
- await writeFile13(configPath, `${next.trimEnd()}
97739
+ await writeFile14(backupPath, original);
97740
+ await writeFile14(configPath, `${next.trimEnd()}
97495
97741
  `);
97496
97742
  return { changed: true, backupPath };
97497
97743
  }
@@ -97568,7 +97814,7 @@ function nodeErrorCode5(error) {
97568
97814
  }
97569
97815
 
97570
97816
  // packages/omo-codex/src/install/codex-cleanup-safety.ts
97571
- import { dirname as dirname21, isAbsolute as isAbsolute10, join as join57, relative as relative5, resolve as resolve15 } from "path";
97817
+ import { dirname as dirname21, isAbsolute as isAbsolute10, join as join58, relative as relative5, resolve as resolve15 } from "path";
97572
97818
  function codexHomeResolvesToFilesystemRoot(codexHome) {
97573
97819
  const resolved = resolve15(codexHome);
97574
97820
  return dirname21(resolved) === resolved;
@@ -97585,11 +97831,11 @@ function validateManagedCleanupTarget(input) {
97585
97831
  if (target === codexHome)
97586
97832
  return skipped(input.path, "outside managed Codex cleanup scope");
97587
97833
  const exactManagedRoots = new Set([
97588
- resolve15(join57(codexHome, "plugins", "cache", "sisyphuslabs")),
97589
- resolve15(join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
97590
- resolve15(join57(codexHome, "runtime", "ast-grep")),
97591
- resolve15(join57(codexHome, "runtime", "node")),
97592
- resolve15(join57(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
97834
+ resolve15(join58(codexHome, "plugins", "cache", "sisyphuslabs")),
97835
+ resolve15(join58(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
97836
+ resolve15(join58(codexHome, "runtime", "ast-grep")),
97837
+ resolve15(join58(codexHome, "runtime", "node")),
97838
+ resolve15(join58(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
97593
97839
  ]);
97594
97840
  if (exactManagedRoots.has(target))
97595
97841
  return null;
@@ -97619,8 +97865,8 @@ function skipped(path, reason) {
97619
97865
  var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
97620
97866
  async function cleanupCodexLight(input = {}) {
97621
97867
  const env = input.env ?? process.env;
97622
- const codexHome = resolve16(input.codexHome ?? env.CODEX_HOME ?? join58(homedir8(), ".codex"));
97623
- const configPath = join58(codexHome, "config.toml");
97868
+ const codexHome = resolve16(input.codexHome ?? env.CODEX_HOME ?? join59(homedir8(), ".codex"));
97869
+ const configPath = join59(codexHome, "config.toml");
97624
97870
  const installedBinDir = await readInstalledCodexBinDir(codexHome);
97625
97871
  const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
97626
97872
  const configCleanup = await cleanupCodexConfig(configPath, input.now);
@@ -97674,17 +97920,17 @@ function firstConfiguredPath(...values) {
97674
97920
  }
97675
97921
  function managedGlobalStatePaths(codexHome) {
97676
97922
  return [
97677
- join58(codexHome, "plugins", "cache", "sisyphuslabs"),
97678
- join58(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
97679
- join58(codexHome, "runtime", "ast-grep"),
97680
- join58(codexHome, "runtime", "node"),
97681
- join58(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
97923
+ join59(codexHome, "plugins", "cache", "sisyphuslabs"),
97924
+ join59(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
97925
+ join59(codexHome, "runtime", "ast-grep"),
97926
+ join59(codexHome, "runtime", "node"),
97927
+ join59(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
97682
97928
  ];
97683
97929
  }
97684
97930
  var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
97685
97931
  async function collectBootstrapDataDirsByGlob(codexHome) {
97686
97932
  const results = [];
97687
- await walkForManagedBootstrapDirs(join58(codexHome, "plugins"), 0, results);
97933
+ await walkForManagedBootstrapDirs(join59(codexHome, "plugins"), 0, results);
97688
97934
  return results;
97689
97935
  }
97690
97936
  async function walkForManagedBootstrapDirs(directory, depth, results) {
@@ -97696,9 +97942,9 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
97696
97942
  for (const entry of entries) {
97697
97943
  if (!entry.isDirectory())
97698
97944
  continue;
97699
- const childPath = join58(directory, entry.name);
97945
+ const childPath = join59(directory, entry.name);
97700
97946
  if (isManagedBootstrapOwnerName(entry.name)) {
97701
- const bootstrapDir = join58(childPath, "bootstrap");
97947
+ const bootstrapDir = join59(childPath, "bootstrap");
97702
97948
  if (await exists6(bootstrapDir))
97703
97949
  results.push(bootstrapDir);
97704
97950
  continue;
@@ -97724,7 +97970,7 @@ async function attemptRemove(path) {
97724
97970
  try {
97725
97971
  if (await lstat15(path).catch(() => null) === null)
97726
97972
  return false;
97727
- await rm13(path, { recursive: true, force: true });
97973
+ await rm14(path, { recursive: true, force: true });
97728
97974
  return true;
97729
97975
  } catch {
97730
97976
  return false;
@@ -97732,7 +97978,7 @@ async function attemptRemove(path) {
97732
97978
  }
97733
97979
  async function pruneEmptyRuntimeDirBestEffort(codexHome) {
97734
97980
  try {
97735
- await rmdir(join58(codexHome, "runtime"));
97981
+ await rmdir(join59(codexHome, "runtime"));
97736
97982
  } catch (error) {
97737
97983
  if (isExpectedRuntimePruneFailure(error))
97738
97984
  return;
@@ -97744,14 +97990,14 @@ function isExpectedRuntimePruneFailure(error) {
97744
97990
  }
97745
97991
  async function collectInstalledAgentPaths(codexHome, configPath) {
97746
97992
  const manifestPaths = [
97747
- join58(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
97993
+ join59(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
97748
97994
  ];
97749
- const versionRoot = join58(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
97995
+ const versionRoot = join59(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
97750
97996
  if (await exists6(versionRoot)) {
97751
97997
  const entries = await readdir13(versionRoot, { withFileTypes: true });
97752
97998
  for (const entry of entries) {
97753
97999
  if (entry.isDirectory())
97754
- manifestPaths.push(join58(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
98000
+ manifestPaths.push(join59(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
97755
98001
  }
97756
98002
  }
97757
98003
  const paths = new Set;
@@ -97768,19 +98014,19 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
97768
98014
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
97769
98015
  if (!await exists6(configPath))
97770
98016
  return [];
97771
- const config = await readFile25(configPath, "utf8");
97772
- return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join58(codexHome, "agents", `${agentName}.toml`));
98017
+ const config = await readFile27(configPath, "utf8");
98018
+ return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join59(codexHome, "agents", `${agentName}.toml`));
97773
98019
  }
97774
98020
  async function readInstalledAgentManifest(manifestPath) {
97775
98021
  if (!await exists6(manifestPath))
97776
98022
  return [];
97777
- const parsed = JSON.parse(await readFile25(manifestPath, "utf8"));
98023
+ const parsed = JSON.parse(await readFile27(manifestPath, "utf8"));
97778
98024
  if (!isPlainRecord4(parsed) || !Array.isArray(parsed.agents))
97779
98025
  return [];
97780
98026
  return parsed.agents.filter((path) => typeof path === "string");
97781
98027
  }
97782
98028
  async function removeManifestListedAgentLinks(codexHome, paths) {
97783
- const agentsDir = join58(codexHome, "agents");
98029
+ const agentsDir = join59(codexHome, "agents");
97784
98030
  const removed = [];
97785
98031
  const skipped = [];
97786
98032
  for (const path of paths) {
@@ -97795,7 +98041,7 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
97795
98041
  skipped.push(path);
97796
98042
  continue;
97797
98043
  }
97798
- await rm13(path, { force: true });
98044
+ await rm14(path, { force: true });
97799
98045
  removed.push(path);
97800
98046
  }
97801
98047
  return { removed, skipped };
@@ -97832,14 +98078,14 @@ function nodeErrorCode6(error) {
97832
98078
  import { execFile as execFile3 } from "child_process";
97833
98079
  import { existsSync as existsSync31 } from "fs";
97834
98080
  import { homedir as homedir11 } from "os";
97835
- import { dirname as dirname25, join as join63, resolve as resolve20 } from "path";
98081
+ import { dirname as dirname25, join as join64, resolve as resolve20 } from "path";
97836
98082
  import { fileURLToPath } from "url";
97837
98083
  import { promisify as promisify2 } from "util";
97838
98084
 
97839
98085
  // packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
97840
98086
  import { existsSync as existsSync29 } from "fs";
97841
98087
  import { homedir as homedir9 } from "os";
97842
- import { join as join59, resolve as resolve17 } from "path";
98088
+ import { join as join60, resolve as resolve17 } from "path";
97843
98089
  var AGENT_DIR_ENV_NAMES = [
97844
98090
  "OMO_CODING_AGENT_DIR",
97845
98091
  "SENPI_CODING_AGENT_DIR",
@@ -97853,25 +98099,25 @@ function resolveAgentHome(options) {
97853
98099
  if (configured)
97854
98100
  return resolve17(configured);
97855
98101
  }
97856
- const brandedHome = join59(homeDir, ".omo");
97857
- const canonical = join59(brandedHome, "agent");
97858
- if (exists(join59(canonical, AGENT_HOME_SENTINEL)))
98102
+ const brandedHome = join60(homeDir, ".omo");
98103
+ const canonical = join60(brandedHome, "agent");
98104
+ if (exists(join60(canonical, AGENT_HOME_SENTINEL)))
97859
98105
  return canonical;
97860
- if (exists(join59(brandedHome, AGENT_HOME_SENTINEL)))
98106
+ if (exists(join60(brandedHome, AGENT_HOME_SENTINEL)))
97861
98107
  return brandedHome;
97862
- return join59(homeDir, ".senpi", "agent");
98108
+ return join60(homeDir, ".senpi", "agent");
97863
98109
  }
97864
98110
 
97865
98111
  // packages/omo-senpi/src/install/local-launcher.ts
97866
98112
  import { chmodSync as chmodSync3, existsSync as existsSync30, mkdirSync as mkdirSync12, readFileSync as readFileSync14, rmSync as rmSync4, writeFileSync as writeFileSync7 } from "fs";
97867
98113
  import { homedir as homedir10 } from "os";
97868
- import { dirname as dirname22, join as join60, resolve as resolve18 } from "path";
98114
+ import { dirname as dirname22, join as join61, resolve as resolve18 } from "path";
97869
98115
  var MARKER = "omo-local-launcher";
97870
98116
  function localLauncherPath(homeDir = homedir10()) {
97871
- return join60(homeDir, ".local", "bin", "omo");
98117
+ return join61(homeDir, ".local", "bin", "omo");
97872
98118
  }
97873
98119
  function localLauncherCmdPath(homeDir = homedir10()) {
97874
- return join60(homeDir, ".local", "bin", "omo.cmd");
98120
+ return join61(homeDir, ".local", "bin", "omo.cmd");
97875
98121
  }
97876
98122
  function releaseChannel(version) {
97877
98123
  return version !== undefined && version.includes("-") ? "beta" : "latest";
@@ -97889,7 +98135,7 @@ function renderLocalLauncher(options) {
97889
98135
  userAgent: "omo",
97890
98136
  originator: "omo",
97891
98137
  changelog: {
97892
- path: join60(options.pluginPath, "CHANGELOG.md").replaceAll("\\", "/")
98138
+ path: join61(options.pluginPath, "CHANGELOG.md").replaceAll("\\", "/")
97893
98139
  },
97894
98140
  update: {
97895
98141
  packageName: "omo-ai",
@@ -97961,8 +98207,8 @@ node "%~dp0omo" %*\r
97961
98207
  // packages/omo-senpi/src/install/plugin-artifacts.ts
97962
98208
  import { createHash as createHash6 } from "crypto";
97963
98209
  import { constants as constants9 } from "fs";
97964
- import { access as access2, readFile as readFile27, stat as stat6 } from "fs/promises";
97965
- import { dirname as dirname24, join as join62 } from "path";
98210
+ import { access as access2, readFile as readFile29, stat as stat6 } from "fs/promises";
98211
+ import { dirname as dirname24, join as join63 } from "path";
97966
98212
 
97967
98213
  // packages/memory-core/src/personas/manifest.ts
97968
98214
  var PERSONA_ASSET_FILENAMES = {
@@ -97980,18 +98226,18 @@ var PERSONA_ASSET_FILES = [
97980
98226
 
97981
98227
  // packages/omo-senpi/src/install/senpi-settings.ts
97982
98228
  import { constants as constants8 } from "fs";
97983
- import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile26, rename as rename5, writeFile as writeFile14 } from "fs/promises";
97984
- import { basename as basename10, dirname as dirname23, join as join61, resolve as resolve19 } from "path";
98229
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile28, rename as rename5, writeFile as writeFile15 } from "fs/promises";
98230
+ import { basename as basename10, dirname as dirname23, join as join62, resolve as resolve19 } from "path";
97985
98231
  var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
97986
98232
  var GENERATED_PLUGIN_BASENAME = /^omo-senpi-cli-plugin-[A-Za-z0-9]{6}$/;
97987
98233
  var LEGACY_BUILTIN_SHADOW_PACKAGES = [
97988
- join61("packages", "pi-goal"),
97989
- join61("packages", "pi-webfetch")
98234
+ join62("packages", "pi-goal"),
98235
+ join62("packages", "pi-webfetch")
97990
98236
  ];
97991
98237
  async function readSettings(settingsPath) {
97992
98238
  let raw;
97993
98239
  try {
97994
- raw = await readFile26(settingsPath, "utf8");
98240
+ raw = await readFile28(settingsPath, "utf8");
97995
98241
  } catch (error) {
97996
98242
  if (isErrno(error, "ENOENT"))
97997
98243
  return {};
@@ -98038,11 +98284,11 @@ async function writeSettingsAtomically(settingsPath, settings) {
98038
98284
  if (await fileExists(settingsPath)) {
98039
98285
  await copyFile3(settingsPath, backupPath);
98040
98286
  } else {
98041
- await writeFile14(backupPath, `{}
98287
+ await writeFile15(backupPath, `{}
98042
98288
  `, "utf8");
98043
98289
  }
98044
98290
  const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
98045
- await writeFile14(tempPath, `${JSON.stringify(settings, null, 2)}
98291
+ await writeFile15(tempPath, `${JSON.stringify(settings, null, 2)}
98046
98292
  `, "utf8");
98047
98293
  await rename5(tempPath, settingsPath);
98048
98294
  return backupPath;
@@ -98065,7 +98311,7 @@ function isRecord15(value) {
98065
98311
  async function readPackageName(packagePath) {
98066
98312
  let raw;
98067
98313
  try {
98068
- raw = await readFile26(join61(packagePath, "package.json"), "utf8");
98314
+ raw = await readFile28(join62(packagePath, "package.json"), "utf8");
98069
98315
  } catch (error) {
98070
98316
  if (isErrno(error, "ENOENT") || isErrno(error, "ENOTDIR"))
98071
98317
  return;
@@ -98097,52 +98343,54 @@ function isErrno(error, code) {
98097
98343
 
98098
98344
  // packages/omo-senpi/src/install/plugin-artifacts.ts
98099
98345
  var REQUIRED_PLUGIN_ARTIFACTS = [
98100
- join62("extensions", "omo.js"),
98101
- join62("extensions", "omo-task.js"),
98102
- join62("extensions", "omo-member.js"),
98103
- join62("extensions", "memory-run-supervisor.mjs"),
98104
- ...PERSONA_ASSET_FILES.map((filename) => join62("extensions", filename)),
98105
- join62("skills", "ast-grep", "SKILL.md"),
98106
- join62("skills", "browser", "SKILL.md"),
98107
- join62("skills", "coding-agent-sessions", "SKILL.md"),
98108
- join62("skills", "debugging", "SKILL.md"),
98109
- join62("skills", "frontend", "SKILL.md"),
98110
- join62("skills", "git-master", "SKILL.md"),
98111
- join62("skills", "init-deep", "SKILL.md"),
98112
- join62("skills", "lsp-setup", "SKILL.md"),
98113
- join62("skills", "programming", "SKILL.md"),
98114
- join62("skills", "refactor", "SKILL.md"),
98115
- join62("skills", "remove-ai-slops", "SKILL.md"),
98116
- join62("skills", "review-work", "SKILL.md"),
98117
- join62("skills", "ultimate-browsing", "SKILL.md"),
98118
- join62("skills", "ultrawork", "SKILL.md"),
98119
- join62("skills", "ulw-execute", "SKILL.md"),
98120
- join62("skills", "ulw-loop", "SKILL.md"),
98121
- join62("skills", "ulw-plan", "SKILL.md"),
98122
- join62("skills", "ulw-research", "SKILL.md"),
98123
- join62("skills", "visual-qa", "SKILL.md"),
98124
- join62("skills-conditional", "x-search", "SKILL.md"),
98125
- join62("runtime", "agent-toolkit-sdk", "sdk.js"),
98126
- join62("runtime", "ast-grep-mcp", "cli.js"),
98127
- join62("runtime", "lsp-daemon", "dist", "cli.js"),
98128
- join62("runtime", "lsp-daemon", "dist", "index.js"),
98129
- join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
98130
- join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
98131
- join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
98132
- join62("runtime", "lsp-daemon", "dist", "package.json"),
98133
- join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
98134
- join62("scripts", "install.mjs"),
98346
+ join63("extensions", "omo.js"),
98347
+ join63("extensions", "omo-task.js"),
98348
+ join63("extensions", "omo-computer-use.js"),
98349
+ join63("extensions", "assets.generated.json"),
98350
+ join63("extensions", "omo-member.js"),
98351
+ join63("extensions", "memory-run-supervisor.mjs"),
98352
+ ...PERSONA_ASSET_FILES.map((filename) => join63("extensions", filename)),
98353
+ join63("skills", "ast-grep", "SKILL.md"),
98354
+ join63("skills", "browser", "SKILL.md"),
98355
+ join63("skills", "coding-agent-sessions", "SKILL.md"),
98356
+ join63("skills", "debugging", "SKILL.md"),
98357
+ join63("skills", "frontend", "SKILL.md"),
98358
+ join63("skills", "git-master", "SKILL.md"),
98359
+ join63("skills", "init-deep", "SKILL.md"),
98360
+ join63("skills", "lsp-setup", "SKILL.md"),
98361
+ join63("skills", "programming", "SKILL.md"),
98362
+ join63("skills", "refactor", "SKILL.md"),
98363
+ join63("skills", "remove-ai-slops", "SKILL.md"),
98364
+ join63("skills", "review-work", "SKILL.md"),
98365
+ join63("skills", "ultimate-browsing", "SKILL.md"),
98366
+ join63("skills", "ultrawork", "SKILL.md"),
98367
+ join63("skills", "ulw-execute", "SKILL.md"),
98368
+ join63("skills", "ulw-loop", "SKILL.md"),
98369
+ join63("skills", "ulw-plan", "SKILL.md"),
98370
+ join63("skills", "ulw-research", "SKILL.md"),
98371
+ join63("skills", "visual-qa", "SKILL.md"),
98372
+ join63("skills-conditional", "x-search", "SKILL.md"),
98373
+ join63("runtime", "agent-toolkit-sdk", "sdk.js"),
98374
+ join63("runtime", "ast-grep-mcp", "cli.js"),
98375
+ join63("runtime", "lsp-daemon", "dist", "cli.js"),
98376
+ join63("runtime", "lsp-daemon", "dist", "index.js"),
98377
+ join63("runtime", "lsp-daemon", "dist", "index.d.ts"),
98378
+ join63("runtime", "lsp-daemon", "dist", "daemon-client.js"),
98379
+ join63("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
98380
+ join63("runtime", "lsp-daemon", "dist", "package.json"),
98381
+ join63("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
98382
+ join63("scripts", "install.mjs"),
98135
98383
  "daemon-launch-spec.json"
98136
98384
  ];
98137
98385
  async function ensurePluginArtifacts(context) {
98138
98386
  if (context.allowBuild) {
98139
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
98140
- await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
98141
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
98142
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
98143
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
98144
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
98145
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-x-search-skill.mjs")], { cwd: context.repoRoot });
98387
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
98388
+ await context.runCommand("node", [join63("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
98389
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
98390
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
98391
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
98392
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
98393
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "stage-x-search-skill.mjs")], { cwd: context.repoRoot });
98146
98394
  }
98147
98395
  if (await hasMissingPluginArtifact(context.pluginPath)) {
98148
98396
  throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
@@ -98151,14 +98399,14 @@ async function ensurePluginArtifacts(context) {
98151
98399
  }
98152
98400
  async function hasMissingPluginArtifact(pluginPath) {
98153
98401
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
98154
- if (!await fileExists2(join62(pluginPath, artifact)))
98402
+ if (!await fileExists2(join63(pluginPath, artifact)))
98155
98403
  return true;
98156
98404
  }
98157
98405
  return false;
98158
98406
  }
98159
98407
  async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
98160
- const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
98161
- const manifestPath = join62(dirname24(runtimeEntry), "manifest.json");
98408
+ const runtimeEntry = join63(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
98409
+ const manifestPath = join63(dirname24(runtimeEntry), "manifest.json");
98162
98410
  let runtimeStat;
98163
98411
  try {
98164
98412
  runtimeStat = await stat6(runtimeEntry);
@@ -98173,7 +98421,7 @@ async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
98173
98421
  }
98174
98422
  let manifest;
98175
98423
  try {
98176
- manifest = JSON.parse(await readFile27(manifestPath, "utf8"));
98424
+ manifest = JSON.parse(await readFile29(manifestPath, "utf8"));
98177
98425
  } catch (error) {
98178
98426
  throw astGrepIntegrityError(runtimeEntry, `manifest is unreadable or invalid JSON: ${messageOf(error)}`);
98179
98427
  }
@@ -98182,7 +98430,7 @@ async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
98182
98430
  }
98183
98431
  let actualSha256;
98184
98432
  try {
98185
- actualSha256 = createHash6("sha256").update(await readFile27(runtimeEntry)).digest("hex");
98433
+ actualSha256 = createHash6("sha256").update(await readFile29(runtimeEntry)).digest("hex");
98186
98434
  } catch (error) {
98187
98435
  throw astGrepIntegrityError(runtimeEntry, `runtime hash could not be computed: ${messageOf(error)}`);
98188
98436
  }
@@ -98233,7 +98481,7 @@ async function runSenpiInstaller(options = {}) {
98233
98481
  const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
98234
98482
  const launcherPath = installLocalLauncher({
98235
98483
  pluginPath: context.pluginPath,
98236
- senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js"),
98484
+ senpiCliPath: join64(context.repoRoot, "packages", "coding-agent", "dist", "cli.js"),
98237
98485
  homeDir: context.homeDir
98238
98486
  });
98239
98487
  return {
@@ -98253,13 +98501,13 @@ function resolveInstallContext(options) {
98253
98501
  const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname25(fileURLToPath(import.meta.url))) : dirname25(resolve20(options.pluginPath))));
98254
98502
  const homeDir = options.homeDir ?? env.HOME ?? homedir11();
98255
98503
  const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env, homeDir }));
98256
- const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
98504
+ const pluginPath = resolve20(options.pluginPath ?? join64(repoRoot, "packages", "omo-senpi", "plugin"));
98257
98505
  return {
98258
98506
  env,
98259
98507
  repoRoot,
98260
98508
  agentDir,
98261
98509
  homeDir,
98262
- settingsPath: join63(agentDir, "settings.json"),
98510
+ settingsPath: join64(agentDir, "settings.json"),
98263
98511
  pluginPath,
98264
98512
  platform: options.platform ?? process.platform,
98265
98513
  allowBuild,
@@ -98276,7 +98524,7 @@ async function defaultRunCommand3(command, args, options) {
98276
98524
  function findRepoRoot2(importerDir) {
98277
98525
  let current = importerDir;
98278
98526
  for (let depth = 0;depth <= 7; depth += 1) {
98279
- if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
98527
+ if (fileExistsSync(join64(current, "packages", "omo-senpi", "plugin", "package.json")))
98280
98528
  return current;
98281
98529
  current = resolve20(current, "..");
98282
98530
  }
@@ -98290,8 +98538,8 @@ async function runNativeDevInstaller(options) {
98290
98538
  return runSenpiInstaller(options);
98291
98539
  }
98292
98540
  // packages/omo-opencode/src/cli/install-native/legacy-omo-bin.ts
98293
- import { lstatSync as lstatSync4, readFileSync as readFileSync15, realpathSync as realpathSync8 } from "fs";
98294
- import { dirname as dirname26, isAbsolute as isAbsolute12, join as join64, posix as posix9, win32 as win325 } from "path";
98541
+ import { lstatSync as lstatSync4, readFileSync as readFileSync15, realpathSync as realpathSync8, statSync as statSync4 } from "fs";
98542
+ import { dirname as dirname26, isAbsolute as isAbsolute12, join as join65, posix as posix9, win32 as win325 } from "path";
98295
98543
  var NATIVE_OMO_PACKAGE = "omo-ai";
98296
98544
  var LEGACY_OMO_BIN_PACKAGES = ["oh-my-openagent", "oh-my-opencode", "lazycodex"];
98297
98545
  var CODEX_LIGHT_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
@@ -98356,7 +98604,7 @@ function classify(owner) {
98356
98604
  }
98357
98605
  function omoShimPathsIn(directory, isWindows) {
98358
98606
  const suffixes = isWindows ? WINDOWS_BIN_SUFFIXES : [""];
98359
- return suffixes.map((suffix) => join64(directory, `${OMO_BIN_NAME}${suffix}`)).filter(pathExists);
98607
+ return suffixes.map((suffix) => join65(directory, `${OMO_BIN_NAME}${suffix}`)).filter(pathExists);
98360
98608
  }
98361
98609
  function pathExists(path) {
98362
98610
  try {
@@ -98372,12 +98620,11 @@ function resolveOwner(binPath) {
98372
98620
  if (fromLink !== null)
98373
98621
  return fromLink;
98374
98622
  const shim = readShimText(binPath);
98375
- if (shim === null)
98376
- return null;
98377
- const lightWrapper = codexLightWrapperOwner(shim);
98623
+ const lightWrapper = shim === null ? null : codexLightWrapperOwner(shim);
98378
98624
  if (lightWrapper !== null)
98379
98625
  return lightWrapper;
98380
- for (const entry of shimEntryPaths(shim, dirname26(binPath))) {
98626
+ const entries = [...shim === null ? [] : shimEntryPaths(shim, dirname26(binPath)), ...bunxEntryPaths(binPath)];
98627
+ for (const entry of entries) {
98381
98628
  if (!isInsideNodeModules(entry) || !pathExists(entry))
98382
98629
  continue;
98383
98630
  const owner = ownerOfFile(entry);
@@ -98392,12 +98639,29 @@ function shimEntryPaths(shim, shimDirectory) {
98392
98639
  const quoted = match[0];
98393
98640
  const relativeToShim = quoted.match(/^(?:%~?dp0%?|\$\{?basedir\}?)[\\/]?(.*)$/)?.[1];
98394
98641
  if (relativeToShim !== undefined)
98395
- paths.push(join64(shimDirectory, relativeToShim.replace(/\\/g, "/")));
98642
+ paths.push(join65(shimDirectory, relativeToShim.replace(/\\/g, "/")));
98396
98643
  else if (isAbsolute12(quoted))
98397
98644
  paths.push(quoted);
98398
98645
  }
98399
98646
  return paths;
98400
98647
  }
98648
+ function bunxEntryPaths(binPath) {
98649
+ if (!/\.exe$/i.test(binPath))
98650
+ return [];
98651
+ const sidecar = `${binPath.slice(0, -4)}.bunx`;
98652
+ let contents;
98653
+ try {
98654
+ if (!statSync4(sidecar).isFile())
98655
+ return [];
98656
+ contents = readFileSync15(sidecar).toString("utf16le");
98657
+ } catch {
98658
+ return [];
98659
+ }
98660
+ const end = contents.indexOf('"\x00');
98661
+ if (end <= 0)
98662
+ return [];
98663
+ return [join65(dirname26(dirname26(binPath)), contents.slice(0, end).replace(/\\/g, "/"))];
98664
+ }
98401
98665
  function codexLightWrapperOwner(shim) {
98402
98666
  if (!shim.includes(CODEX_LIGHT_WRAPPER_MARKER))
98403
98667
  return null;
@@ -98410,7 +98674,7 @@ function isInsideNodeModules(path) {
98410
98674
  function ownerOfFile(file) {
98411
98675
  let directory = dirname26(file);
98412
98676
  for (let depth = 0;depth < OWNER_WALK_UP_LIMIT; depth += 1) {
98413
- const manifest = readWholeFile(join64(directory, "package.json"));
98677
+ const manifest = readWholeFile(join65(directory, "package.json"));
98414
98678
  if (manifest !== null) {
98415
98679
  const parsed = parseManifest(manifest);
98416
98680
  if (parsed !== null)
@@ -98708,12 +98972,12 @@ init_provider_availability();
98708
98972
 
98709
98973
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
98710
98974
  import { existsSync as existsSync33, mkdirSync as mkdirSync13, readFileSync as readFileSync17 } from "fs";
98711
- import { join as join66 } from "path";
98975
+ import { join as join67 } from "path";
98712
98976
 
98713
98977
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
98714
98978
  init_shared();
98715
98979
  import { existsSync as existsSync32, readFileSync as readFileSync16 } from "fs";
98716
- import { join as join65 } from "path";
98980
+ import { join as join66 } from "path";
98717
98981
  var TUI_SUBPATH = "tui";
98718
98982
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
98719
98983
  function tuiPluginSpecName(entry) {
@@ -98733,7 +98997,7 @@ function fileEntryPackageJsonPath(entry) {
98733
98997
  let path = entry.slice("file:".length);
98734
98998
  if (path.startsWith("//"))
98735
98999
  path = path.slice(2);
98736
- return join65(path, "package.json");
99000
+ return join66(path, "package.json");
98737
99001
  }
98738
99002
  function packageJsonExportsTui(pkgJsonPath) {
98739
99003
  if (!existsSync32(pkgJsonPath))
@@ -98772,7 +99036,7 @@ function packageExportsTuiForServerEntry(entry) {
98772
99036
  const packageName = packageNameFromServerEntry(entry);
98773
99037
  if (packageName === null)
98774
99038
  return null;
98775
- return packageJsonExportsTui(join65(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
99039
+ return packageJsonExportsTui(join66(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
98776
99040
  }
98777
99041
  function isOurFilePluginEntry(entry) {
98778
99042
  if (typeof entry !== "string" || !entry.startsWith("file:"))
@@ -98859,7 +99123,7 @@ function detectServerPluginRegistration() {
98859
99123
  }
98860
99124
  }
98861
99125
  function detectTuiPluginRegistration() {
98862
- const tuiJsonPath = join65(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
99126
+ const tuiJsonPath = join66(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
98863
99127
  if (!existsSync32(tuiJsonPath)) {
98864
99128
  return {
98865
99129
  registered: false,
@@ -99035,10 +99299,10 @@ function readConfig(path) {
99035
99299
  return null;
99036
99300
  }
99037
99301
  function readServerConfig(configDir) {
99038
- const jsoncPath = join66(configDir, "opencode.jsonc");
99302
+ const jsoncPath = join67(configDir, "opencode.jsonc");
99039
99303
  if (existsSync33(jsoncPath))
99040
99304
  return readConfig(jsoncPath);
99041
- const jsonPath = join66(configDir, "opencode.json");
99305
+ const jsonPath = join67(configDir, "opencode.json");
99042
99306
  if (existsSync33(jsonPath))
99043
99307
  return readConfig(jsonPath);
99044
99308
  return null;
@@ -99095,7 +99359,7 @@ function ensureTuiPluginEntry(opts = {}) {
99095
99359
  if (!desiredEntry) {
99096
99360
  return { changed: false, reason: "no-server-entry" };
99097
99361
  }
99098
- const tuiJsonPath = join66(configDir, "tui.json");
99362
+ const tuiJsonPath = join67(configDir, "tui.json");
99099
99363
  const { config, malformed } = readTuiConfig(tuiJsonPath);
99100
99364
  if (malformed || pluginFieldInvalid(config)) {
99101
99365
  return { changed: false, reason: "malformed" };
@@ -99116,10 +99380,10 @@ function ensureTuiPluginEntry(opts = {}) {
99116
99380
  init_shared();
99117
99381
  init_config_context();
99118
99382
  import { existsSync as existsSync34, readFileSync as readFileSync18 } from "fs";
99119
- import { join as join67 } from "path";
99383
+ import { join as join68 } from "path";
99120
99384
  function readPluginEntries(configDir) {
99121
99385
  for (const name of ["opencode.jsonc", "opencode.json"]) {
99122
- const configPath = join67(configDir, name);
99386
+ const configPath = join68(configDir, name);
99123
99387
  if (!existsSync34(configPath))
99124
99388
  continue;
99125
99389
  try {
@@ -99167,7 +99431,7 @@ function refreshOpenCodePluginSandboxes(options = {}) {
99167
99431
 
99168
99432
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
99169
99433
  import { homedir as homedir13 } from "os";
99170
- import { join as join68 } from "path";
99434
+ import { join as join69 } from "path";
99171
99435
 
99172
99436
  // packages/shared-skills/index.mjs
99173
99437
  import { existsSync as existsSync35 } from "fs";
@@ -99189,9 +99453,9 @@ function describeResult2(result) {
99189
99453
  }
99190
99454
  async function installAstGrepForOpenCode(options = {}) {
99191
99455
  const platform = options.platform ?? process.platform;
99192
- const baseDir = join68(options.homeDir ?? homedir13(), ".omo");
99456
+ const baseDir = join69(options.homeDir ?? homedir13(), ".omo");
99193
99457
  const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
99194
- const skillDir = join68(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
99458
+ const skillDir = join69(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
99195
99459
  const installer = options.installer ?? runAstGrepSkillInstall;
99196
99460
  try {
99197
99461
  const result = await installer({ platform, skillDir, targetDir });
@@ -103327,20 +103591,41 @@ var BOULDER_FILE = "boulder.json";
103327
103591
  var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
103328
103592
  var NOTEPAD_DIR = "notepads";
103329
103593
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
103594
+ // packages/boulder-state/src/markdown-fence.ts
103595
+ var FENCE_PATTERN = /^[ \t]{0,3}(`{3,}|~{3,})(.*)$/;
103596
+ function parseOpeningFence(line) {
103597
+ const match = line.match(FENCE_PATTERN);
103598
+ const run = match?.[1];
103599
+ const info = match?.[2];
103600
+ const marker = run?.charAt(0);
103601
+ if (run === undefined || info === undefined || marker !== "`" && marker !== "~" || marker === "`" && info.includes("`")) {
103602
+ return null;
103603
+ }
103604
+ return { marker, length: run.length };
103605
+ }
103606
+ function isClosingFence(line, fence) {
103607
+ const run = line.match(/^[ \t]{0,3}(`{3,}|~{3,})[ \t]*$/)?.[1];
103608
+ return run?.charAt(0) === fence.marker && run.length >= fence.length;
103609
+ }
103610
+
103330
103611
  // packages/boulder-state/src/plan-checklist.ts
103331
- var SIMPLE_CHECKBOX_PATTERN = /^[-*][ \t]*\[[ \t]*([xX]?)[ \t]*\][ \t]+(.+)$/;
103612
+ var SIMPLE_CHECKBOX_PATTERN = /^[-*][ \t]*\[[ \t]*([xX~]?)[ \t]*\][ \t]+(.+)$/;
103332
103613
  var TODO_HEADING_PATTERN = /^##[ \t]+TODOs(?:[ \t]+#+)?[ \t]*$/i;
103333
103614
  var FINAL_VERIFICATION_HEADING_PATTERN = /^##[ \t]+Final Verification Wave(?:[ \t]+#+)?[ \t]*$/i;
103334
103615
  var SECTION_BOUNDARY_HEADING_PATTERN = /^#{1,2}(?:[ \t]+|$)/;
103335
- var FENCE_PATTERN = /^[ \t]{0,3}(`{3,}|~{3,})(.*)$/;
103336
- var TODO_CHECKBOX_PATTERN = /^- \[([ xX])\] ([1-9]\d*\. .+)$/;
103337
- var FINAL_WAVE_CHECKBOX_PATTERN = /^- \[([ xX])\] (F[1-9]\d*\. .+)$/i;
103616
+ var STRUCTURED_CHECKBOX_PATTERN = /^- \[([ xX~])\] (.+)$/;
103617
+ var TODO_TASK_LABEL_PATTERN = /^([1-9]\d*|T[1-9]\d*(?:\.[1-9]\d*[a-z]?)?)(?:\.[ \t]+|[ \t]+(?:[-\u2014][ \t]+)?)(.+)$/i;
103618
+ var FINAL_WAVE_TASK_LABEL_PATTERN = /^([FH][1-9]\d*(?:\.[1-9]\d*[a-z]?)?)(?:\.[ \t]+|[ \t]+(?:[-\u2014][ \t]+)?)(.+)$/i;
103338
103619
  function parsePlanChecklist(markdown) {
103339
103620
  const lines = markdown.split(/\r?\n/);
103340
103621
  if (!hasStructuredSection(lines)) {
103341
103622
  return parseSimpleChecklist(lines);
103342
103623
  }
103343
- return parseStructuredPlan(lines).checklist;
103624
+ const structuredPlan = parseStructuredPlan(lines);
103625
+ if (structuredPlan.checklist.total === 0 && structuredPlan.hasUntrackedTopLevelCheckbox) {
103626
+ return parseSimpleChecklist(lines);
103627
+ }
103628
+ return structuredPlan.checklist;
103344
103629
  }
103345
103630
  function parseCurrentTopLevelTask(markdown) {
103346
103631
  const lines = markdown.split(/\r?\n/);
@@ -103350,10 +103635,12 @@ function parseCurrentTopLevelTask(markdown) {
103350
103635
  return parseStructuredPlan(lines).nextTask;
103351
103636
  }
103352
103637
  function parseStructuredPlan(lines) {
103638
+ let completed = 0;
103353
103639
  let remaining = 0;
103354
103640
  let total = 0;
103355
103641
  let nextTaskLabel = null;
103356
103642
  let nextTask = null;
103643
+ let hasUntrackedTopLevelCheckbox = false;
103357
103644
  let section = "other";
103358
103645
  let fence = null;
103359
103646
  for (const line of lines) {
@@ -103373,6 +103660,9 @@ function parseStructuredPlan(lines) {
103373
103660
  continue;
103374
103661
  }
103375
103662
  if (section === "other") {
103663
+ if (parseSimpleTopLevelCheckbox(line) !== null) {
103664
+ hasUntrackedTopLevelCheckbox = true;
103665
+ }
103376
103666
  continue;
103377
103667
  }
103378
103668
  const checkbox = parseStructuredTopLevelCheckbox(line, section);
@@ -103380,7 +103670,11 @@ function parseStructuredPlan(lines) {
103380
103670
  continue;
103381
103671
  }
103382
103672
  total += 1;
103383
- if (checkbox.checked) {
103673
+ if (checkbox.status === "done") {
103674
+ completed += 1;
103675
+ continue;
103676
+ }
103677
+ if (checkbox.status === "in-progress") {
103384
103678
  continue;
103385
103679
  }
103386
103680
  remaining += 1;
@@ -103391,15 +103685,17 @@ function parseStructuredPlan(lines) {
103391
103685
  }
103392
103686
  return {
103393
103687
  checklist: {
103394
- completed: total - remaining,
103688
+ completed,
103395
103689
  remaining,
103396
103690
  total,
103397
103691
  nextTaskLabel
103398
103692
  },
103399
- nextTask
103693
+ nextTask,
103694
+ hasUntrackedTopLevelCheckbox
103400
103695
  };
103401
103696
  }
103402
103697
  function parseSimpleChecklist(lines) {
103698
+ let completed = 0;
103403
103699
  let remaining = 0;
103404
103700
  let total = 0;
103405
103701
  let nextTaskLabel = null;
@@ -103421,7 +103717,11 @@ function parseSimpleChecklist(lines) {
103421
103717
  continue;
103422
103718
  }
103423
103719
  total += 1;
103424
- if (checkbox.checked) {
103720
+ if (checkbox.status === "done") {
103721
+ completed += 1;
103722
+ continue;
103723
+ }
103724
+ if (checkbox.status === "in-progress") {
103425
103725
  continue;
103426
103726
  }
103427
103727
  remaining += 1;
@@ -103429,7 +103729,7 @@ function parseSimpleChecklist(lines) {
103429
103729
  nextTaskLabel = checkbox.label;
103430
103730
  }
103431
103731
  }
103432
- return { completed: total - remaining, remaining, total, nextTaskLabel };
103732
+ return { completed, remaining, total, nextTaskLabel };
103433
103733
  }
103434
103734
  function parseSimpleTopLevelCheckbox(line) {
103435
103735
  const match = line.match(SIMPLE_CHECKBOX_PATTERN);
@@ -103438,7 +103738,13 @@ function parseSimpleTopLevelCheckbox(line) {
103438
103738
  if (marker === undefined || label === undefined) {
103439
103739
  return null;
103440
103740
  }
103441
- return { checked: marker.toLowerCase() === "x", label };
103741
+ return { status: parseCheckboxStatus(marker), label };
103742
+ }
103743
+ function parseCheckboxStatus(marker) {
103744
+ if (marker.toLowerCase() === "x") {
103745
+ return "done";
103746
+ }
103747
+ return marker === "~" ? "in-progress" : "open";
103442
103748
  }
103443
103749
  function hasStructuredSection(lines) {
103444
103750
  let fence = null;
@@ -103470,8 +103776,7 @@ function parseStructuredSectionHeading(line) {
103470
103776
  return "other";
103471
103777
  }
103472
103778
  function parseStructuredTopLevelCheckbox(line, section) {
103473
- const pattern = section === "todo" ? TODO_CHECKBOX_PATTERN : FINAL_WAVE_CHECKBOX_PATTERN;
103474
- const match = line.match(pattern);
103779
+ const match = line.match(STRUCTURED_CHECKBOX_PATTERN);
103475
103780
  const marker = match?.[1];
103476
103781
  const label = match?.[2];
103477
103782
  if (marker === undefined || label === undefined) {
@@ -103481,10 +103786,10 @@ function parseStructuredTopLevelCheckbox(line, section) {
103481
103786
  if (task === null) {
103482
103787
  return null;
103483
103788
  }
103484
- return { checked: marker.toLowerCase() === "x", label, task };
103789
+ return { status: parseCheckboxStatus(marker), label, task };
103485
103790
  }
103486
103791
  function buildTaskRef(section, label) {
103487
- const pattern = section === "todo" ? /^([1-9]\d*)\. (.+)$/ : /^(F[1-9]\d*)\. (.+)$/i;
103792
+ const pattern = section === "todo" ? TODO_TASK_LABEL_PATTERN : FINAL_WAVE_TASK_LABEL_PATTERN;
103488
103793
  const match = label.match(pattern);
103489
103794
  const rawLabel = match?.[1];
103490
103795
  const title = match?.[2];
@@ -103498,20 +103803,6 @@ function buildTaskRef(section, label) {
103498
103803
  title
103499
103804
  };
103500
103805
  }
103501
- function parseOpeningFence(line) {
103502
- const match = line.match(FENCE_PATTERN);
103503
- const run = match?.[1];
103504
- const info = match?.[2];
103505
- const marker = run?.charAt(0);
103506
- if (run === undefined || info === undefined || marker !== "`" && marker !== "~" || marker === "`" && info.includes("`")) {
103507
- return null;
103508
- }
103509
- return { marker, length: run.length };
103510
- }
103511
- function isClosingFence(line, fence) {
103512
- const run = line.match(/^[ \t]{0,3}(`{3,}|~{3,})[ \t]*$/)?.[1];
103513
- return run?.charAt(0) === fence.marker && run.length >= fence.length;
103514
- }
103515
103806
  // packages/boulder-state/src/top-level-task.ts
103516
103807
  import { existsSync as existsSync36, readFileSync as readFileSync19 } from "fs";
103517
103808
  function readCurrentTopLevelTask(planPath) {
@@ -103527,9 +103818,9 @@ function readCurrentTopLevelTask(planPath) {
103527
103818
  }
103528
103819
  // packages/boulder-state/src/storage/path.ts
103529
103820
  import { existsSync as existsSync37 } from "fs";
103530
- import { isAbsolute as isAbsolute13, join as join69, relative as relative8, resolve as resolve21 } from "path";
103821
+ import { isAbsolute as isAbsolute13, join as join70, relative as relative8, resolve as resolve21 } from "path";
103531
103822
  function getBoulderFilePath(directory) {
103532
- return join69(directory, BOULDER_DIR, BOULDER_FILE);
103823
+ return join70(directory, BOULDER_DIR, BOULDER_FILE);
103533
103824
  }
103534
103825
  function resolveTrackedPath(baseDirectory, trackedPath) {
103535
103826
  return isAbsolute13(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
@@ -103553,7 +103844,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
103553
103844
  return resolveBoulderPlanPath(directory, work);
103554
103845
  }
103555
103846
  // packages/boulder-state/src/storage/plan-progress.ts
103556
- import { existsSync as existsSync38, readFileSync as readFileSync20, readdirSync as readdirSync9, statSync as statSync4 } from "fs";
103847
+ import { existsSync as existsSync38, readFileSync as readFileSync20, readdirSync as readdirSync9, statSync as statSync5 } from "fs";
103557
103848
  function getPlanProgress(planPath) {
103558
103849
  if (!existsSync38(planPath)) {
103559
103850
  return { total: 0, completed: 0, isComplete: false };
@@ -103714,9 +104005,9 @@ init_state();
103714
104005
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
103715
104006
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
103716
104007
  import { existsSync as existsSync40, mkdirSync as mkdirSync14, readFileSync as readFileSync22, rmSync as rmSync6, writeFileSync as writeFileSync8 } from "fs";
103717
- import { join as join70 } from "path";
104008
+ import { join as join71 } from "path";
103718
104009
  function getMarkerPath(directory, sessionID) {
103719
- return join70(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
104010
+ return join71(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
103720
104011
  }
103721
104012
  function readContinuationMarker(directory, sessionID) {
103722
104013
  const markerPath = getMarkerPath(directory, sessionID);
@@ -103789,7 +104080,7 @@ async function isSessionInBoulderLineage(input) {
103789
104080
  init_shared();
103790
104081
  init_compaction_marker();
103791
104082
  import { readFileSync as readFileSync23, readdirSync as readdirSync10 } from "fs";
103792
- import { join as join71 } from "path";
104083
+ import { join as join72 } from "path";
103793
104084
  var defaultSessionLastAgentDeps = {
103794
104085
  getMessageDir,
103795
104086
  isSqliteBackend,
@@ -103849,7 +104140,7 @@ async function getLastAgentFromSession(sessionID, client, deps = {}) {
103849
104140
  try {
103850
104141
  const messages = readdirSync10(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
103851
104142
  try {
103852
- const content = readFileSync23(join71(messageDir, fileName), "utf-8");
104143
+ const content = readFileSync23(join72(messageDir, fileName), "utf-8");
103853
104144
  const parsed = JSON.parse(content);
103854
104145
  return {
103855
104146
  fileName,
@@ -103893,7 +104184,7 @@ init_agent_display_names();
103893
104184
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
103894
104185
  init_frontmatter2();
103895
104186
  import { existsSync as existsSync41, readFileSync as readFileSync24, writeFileSync as writeFileSync9, unlinkSync as unlinkSync6, mkdirSync as mkdirSync15 } from "fs";
103896
- import { dirname as dirname28, join as join72 } from "path";
104187
+ import { dirname as dirname28, join as join73 } from "path";
103897
104188
 
103898
104189
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
103899
104190
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -103902,7 +104193,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
103902
104193
 
103903
104194
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
103904
104195
  function getStateFilePath(directory, customPath) {
103905
- return customPath ? join72(directory, customPath) : join72(directory, DEFAULT_STATE_FILE);
104196
+ return customPath ? join73(directory, customPath) : join73(directory, DEFAULT_STATE_FILE);
103906
104197
  }
103907
104198
  function readState(directory, customPath) {
103908
104199
  const filePath = getStateFilePath(directory, customPath);
@@ -103972,7 +104263,7 @@ async function hasActiveBoulderContinuation(directory, sessionID, client) {
103972
104263
  if (!boulder || !boulder.active_plan)
103973
104264
  return false;
103974
104265
  const progress = getPlanProgress(resolveBoulderPlanPath(directory, boulder));
103975
- if (progress.isComplete)
104266
+ if (progress.isComplete || progress.total === 0)
103976
104267
  return false;
103977
104268
  if (!client)
103978
104269
  return false;
@@ -105009,7 +105300,7 @@ init_extract_semver();
105009
105300
  init_bun_which_shim();
105010
105301
  import { existsSync as existsSync49, accessSync as accessSync4, constants as constants12 } from "fs";
105011
105302
  import { homedir as homedir16 } from "os";
105012
- import { join as join79 } from "path";
105303
+ import { join as join80 } from "path";
105013
105304
 
105014
105305
  // packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
105015
105306
  init_spawn_with_windows_hide();
@@ -105101,17 +105392,17 @@ function getDesktopAppPaths(platform) {
105101
105392
  case "darwin":
105102
105393
  return [
105103
105394
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
105104
- join79(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
105395
+ join80(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
105105
105396
  ];
105106
105397
  case "win32": {
105107
105398
  const programFiles = process.env.ProgramFiles;
105108
105399
  const localAppData = process.env.LOCALAPPDATA;
105109
105400
  const paths = [];
105110
105401
  if (programFiles) {
105111
- paths.push(join79(programFiles, "OpenCode", "OpenCode.exe"));
105402
+ paths.push(join80(programFiles, "OpenCode", "OpenCode.exe"));
105112
105403
  }
105113
105404
  if (localAppData) {
105114
- paths.push(join79(localAppData, "OpenCode", "OpenCode.exe"));
105405
+ paths.push(join80(localAppData, "OpenCode", "OpenCode.exe"));
105115
105406
  }
105116
105407
  return paths;
105117
105408
  }
@@ -105119,8 +105410,8 @@ function getDesktopAppPaths(platform) {
105119
105410
  return [
105120
105411
  "/usr/bin/opencode",
105121
105412
  "/usr/lib/opencode/opencode",
105122
- join79(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
105123
- join79(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
105413
+ join80(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
105414
+ join80(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
105124
105415
  ];
105125
105416
  default:
105126
105417
  return [];
@@ -105152,7 +105443,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
105152
105443
  const candidates = getCommandCandidates2(platform);
105153
105444
  for (const entry of pathEnv.split(delimiter).filter(Boolean)) {
105154
105445
  for (const command of candidates) {
105155
- const fullPath = join79(entry, command);
105446
+ const fullPath = join80(entry, command);
105156
105447
  if (checkExists(fullPath) && isExecutable2(fullPath)) {
105157
105448
  return { binary: command, path: fullPath };
105158
105449
  }
@@ -105296,22 +105587,22 @@ init_package_json_locator();
105296
105587
  import { existsSync as existsSync51, readFileSync as readFileSync33, readdirSync as readdirSync12 } from "fs";
105297
105588
  import { createRequire } from "module";
105298
105589
  import { homedir as homedir17 } from "os";
105299
- import { join as join80 } from "path";
105590
+ import { join as join81 } from "path";
105300
105591
  import { fileURLToPath as fileURLToPath6 } from "url";
105301
105592
  init_shared();
105302
105593
  function getPlatformDefaultCacheDir(platform = process.platform) {
105303
105594
  if (platform === "darwin")
105304
- return join80(homedir17(), "Library", "Caches");
105595
+ return join81(homedir17(), "Library", "Caches");
105305
105596
  if (platform === "win32")
105306
- return process.env.LOCALAPPDATA ?? join80(homedir17(), "AppData", "Local");
105307
- return join80(homedir17(), ".cache");
105597
+ return process.env.LOCALAPPDATA ?? join81(homedir17(), "AppData", "Local");
105598
+ return join81(homedir17(), ".cache");
105308
105599
  }
105309
105600
  function resolveOpenCodeCacheDir() {
105310
105601
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
105311
105602
  if (xdgCacheHome)
105312
- return join80(xdgCacheHome, "opencode");
105603
+ return join81(xdgCacheHome, "opencode");
105313
105604
  const fromShared = getOpenCodeCacheDir();
105314
- const platformDefault = join80(getPlatformDefaultCacheDir(), "opencode");
105605
+ const platformDefault = join81(getPlatformDefaultCacheDir(), "opencode");
105315
105606
  if (existsSync51(fromShared) || !existsSync51(platformDefault))
105316
105607
  return fromShared;
105317
105608
  return platformDefault;
@@ -105343,11 +105634,11 @@ function normalizeVersion(value) {
105343
105634
  function createPackageCandidates(rootDir) {
105344
105635
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
105345
105636
  packageName,
105346
- installedPackagePath: join80(rootDir, "node_modules", packageName, "package.json")
105637
+ installedPackagePath: join81(rootDir, "node_modules", packageName, "package.json")
105347
105638
  }));
105348
105639
  }
105349
105640
  function createTaggedInstallCandidates(rootDir) {
105350
- const packagesDir = join80(rootDir, "packages");
105641
+ const packagesDir = join81(rootDir, "packages");
105351
105642
  if (!existsSync51(packagesDir))
105352
105643
  return [];
105353
105644
  const candidates = [];
@@ -105355,14 +105646,14 @@ function createTaggedInstallCandidates(rootDir) {
105355
105646
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
105356
105647
  if (packageName === undefined)
105357
105648
  continue;
105358
- const installDir = join80(packagesDir, entryName);
105649
+ const installDir = join81(packagesDir, entryName);
105359
105650
  candidates.push({
105360
105651
  cacheDir: installDir,
105361
- cachePackagePath: join80(installDir, "package.json"),
105652
+ cachePackagePath: join81(installDir, "package.json"),
105362
105653
  packageCandidates: [
105363
105654
  {
105364
105655
  packageName,
105365
- installedPackagePath: join80(installDir, "node_modules", packageName, "package.json")
105656
+ installedPackagePath: join81(installDir, "node_modules", packageName, "package.json")
105366
105657
  }
105367
105658
  ]
105368
105659
  });
@@ -105407,13 +105698,13 @@ function getLoadedPluginVersion() {
105407
105698
  const candidates = [
105408
105699
  {
105409
105700
  cacheDir: configDir,
105410
- cachePackagePath: join80(configDir, "package.json"),
105701
+ cachePackagePath: join81(configDir, "package.json"),
105411
105702
  packageCandidates: createPackageCandidates(configDir)
105412
105703
  },
105413
105704
  ...createTaggedInstallCandidates(configDir),
105414
105705
  {
105415
105706
  cacheDir,
105416
- cachePackagePath: join80(cacheDir, "package.json"),
105707
+ cachePackagePath: join81(cacheDir, "package.json"),
105417
105708
  packageCandidates: createPackageCandidates(cacheDir)
105418
105709
  },
105419
105710
  ...createTaggedInstallCandidates(cacheDir)
@@ -105606,18 +105897,18 @@ async function checkSystem(deps = defaultDeps5) {
105606
105897
  init_shared();
105607
105898
  import { existsSync as existsSync53, readFileSync as readFileSync35 } from "fs";
105608
105899
  import { homedir as homedir18 } from "os";
105609
- import { join as join81 } from "path";
105900
+ import { join as join82 } from "path";
105610
105901
  function getUserConfigDir2() {
105611
105902
  const xdgConfig = process.env.XDG_CONFIG_HOME;
105612
105903
  if (xdgConfig)
105613
- return join81(xdgConfig, "opencode");
105614
- return join81(homedir18(), ".config", "opencode");
105904
+ return join82(xdgConfig, "opencode");
105905
+ return join82(homedir18(), ".config", "opencode");
105615
105906
  }
105616
105907
  function loadCustomProviderNames() {
105617
105908
  const configDir = getUserConfigDir2();
105618
105909
  const candidatePaths = [
105619
- join81(configDir, "opencode.json"),
105620
- join81(configDir, "opencode.jsonc")
105910
+ join82(configDir, "opencode.json"),
105911
+ join82(configDir, "opencode.jsonc")
105621
105912
  ];
105622
105913
  for (const configPath of candidatePaths) {
105623
105914
  if (!existsSync53(configPath))
@@ -105638,7 +105929,7 @@ function loadCustomProviderNames() {
105638
105929
  return [];
105639
105930
  }
105640
105931
  function loadAvailableModelsFromCache() {
105641
- const cacheFile = join81(getOpenCodeCacheDir(), "models.json");
105932
+ const cacheFile = join82(getOpenCodeCacheDir(), "models.json");
105642
105933
  const customProviders = loadCustomProviderNames();
105643
105934
  if (!existsSync53(cacheFile)) {
105644
105935
  if (customProviders.length > 0) {
@@ -105700,7 +105991,7 @@ function loadOmoConfig2() {
105700
105991
 
105701
105992
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
105702
105993
  init_shared();
105703
- import { join as join82 } from "path";
105994
+ import { join as join83 } from "path";
105704
105995
 
105705
105996
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
105706
105997
  function formatModelWithVariant(model, variant) {
@@ -105742,7 +106033,7 @@ function formatCapabilityResolutionLabel(mode) {
105742
106033
  }
105743
106034
  function buildModelResolutionDetails(options) {
105744
106035
  const details = [];
105745
- const cacheFile = join82(getOpenCodeCacheDir(), "models.json");
106036
+ const cacheFile = join83(getOpenCodeCacheDir(), "models.json");
105746
106037
  details.push("\u2550\u2550\u2550 Available Models (from cache) \u2550\u2550\u2550");
105747
106038
  details.push("");
105748
106039
  if (options.available.cacheExists) {
@@ -106083,7 +106374,7 @@ init_src4();
106083
106374
  init_main();
106084
106375
  init_config_migration();
106085
106376
  import { existsSync as existsSync54, readFileSync as readFileSync36 } from "fs";
106086
- import { join as join83 } from "path";
106377
+ import { join as join84 } from "path";
106087
106378
  var CANONICAL_REPLACEMENT = new Map([
106088
106379
  ["variant", "reasoning"],
106089
106380
  ["reasoningEffort", "reasoning"],
@@ -106144,7 +106435,7 @@ function userConfigPaths() {
106144
106435
  const home = process.env.HOME ?? process.env.USERPROFILE;
106145
106436
  if (home === undefined || home.length === 0)
106146
106437
  return [];
106147
- return [join83(home, ".omo", "omo.jsonc"), join83(home, ".omo", "omo.json")];
106438
+ return [join84(home, ".omo", "omo.jsonc"), join84(home, ".omo", "omo.json")];
106148
106439
  }
106149
106440
  async function checkDeprecatedReasoningKeys() {
106150
106441
  const issues = [];
@@ -106170,31 +106461,43 @@ init_src();
106170
106461
  import { existsSync as existsSync55 } from "fs";
106171
106462
  import { createRequire as createRequire2 } from "module";
106172
106463
  import { homedir as homedir20 } from "os";
106173
- import { dirname as dirname33, join as join86 } from "path";
106464
+ import { dirname as dirname33, join as join88 } from "path";
106174
106465
 
106175
106466
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
106176
- import { join as join85 } from "path";
106467
+ import { join as join87 } from "path";
106177
106468
  import { homedir as homedir19, tmpdir as tmpdir4 } from "os";
106178
106469
  // packages/comment-checker-core/src/release.ts
106179
- import { join as join84 } from "path";
106470
+ import { join as join85 } from "path";
106471
+ var COMMENT_CHECKER_RELEASE_VERSION = "0.8.0";
106180
106472
  function commentCheckerBinaryName(platform) {
106181
106473
  return platform === "win32" ? "comment-checker.exe" : "comment-checker";
106182
106474
  }
106183
106475
  function commentCheckerCacheDir(input) {
106184
106476
  if (input.platform === "win32") {
106185
106477
  const localAppData = input.env.LOCALAPPDATA || input.env.APPDATA;
106186
- const base = localAppData || join84(input.homedir, "AppData", "Local");
106187
- return join84(base, input.cacheDirName, "bin");
106478
+ const base = localAppData || join85(input.homedir, "AppData", "Local");
106479
+ return join85(base, input.cacheDirName, "bin");
106480
+ }
106481
+ const base = input.env.XDG_CACHE_HOME || join85(input.homedir, ".cache");
106482
+ return join85(base, input.cacheDirName, "bin");
106483
+ }
106484
+ // packages/comment-checker-core/src/cached-release.ts
106485
+ import { readFileSync as readFileSync37, writeFileSync as writeFileSync12 } from "fs";
106486
+ import { join as join86 } from "path";
106487
+ var COMMENT_CHECKER_VERSION_MARKER = "comment-checker.version";
106488
+ function isCachedCommentCheckerCurrent(cacheDir, readFile = (path) => readFileSync37(path, "utf-8")) {
106489
+ try {
106490
+ return readFile(join86(cacheDir, COMMENT_CHECKER_VERSION_MARKER)).trim() === COMMENT_CHECKER_RELEASE_VERSION;
106491
+ } catch {
106492
+ return false;
106188
106493
  }
106189
- const base = input.env.XDG_CACHE_HOME || join84(input.homedir, ".cache");
106190
- return join84(base, input.cacheDirName, "bin");
106191
106494
  }
106192
106495
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
106193
106496
  init_binary_downloader();
106194
106497
  init_logger2();
106195
106498
  init_plugin_identity();
106196
106499
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
106197
- var DEBUG_FILE = join85(tmpdir4(), "comment-checker-debug.log");
106500
+ var DEBUG_FILE = join87(tmpdir4(), "comment-checker-debug.log");
106198
106501
  function getCacheDir2() {
106199
106502
  return commentCheckerCacheDir({
106200
106503
  platform: process.platform,
@@ -106207,7 +106510,9 @@ function getBinaryName() {
106207
106510
  return commentCheckerBinaryName(process.platform);
106208
106511
  }
106209
106512
  function getCachedBinaryPath2() {
106210
- return getCachedBinaryPath(getCacheDir2(), getBinaryName());
106513
+ const cacheDir = getCacheDir2();
106514
+ const cached = getCachedBinaryPath(cacheDir, getBinaryName());
106515
+ return cached !== null && isCachedCommentCheckerCurrent(cacheDir) ? cached : null;
106211
106516
  }
106212
106517
 
106213
106518
  // packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
@@ -106251,7 +106556,7 @@ async function getBinaryVersion(binary) {
106251
106556
  }
106252
106557
  }
106253
106558
  async function checkAstGrepCli() {
106254
- const runtimeDir = astGrepRuntimeDir(join86(homedir20(), ".omo"));
106559
+ const runtimeDir = astGrepRuntimeDir(join88(homedir20(), ".omo"));
106255
106560
  const sgPath = findSgBinarySync({ runtimeDir });
106256
106561
  if (sgPath === null) {
106257
106562
  return {
@@ -106281,10 +106586,10 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
106281
106586
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
106282
106587
  try {
106283
106588
  const packageDir = baseDirOverride ?? dirname33(resolvePackageJsonPath());
106284
- const vendorPath = join86(packageDir, "vendor", platformKey, binaryName);
106589
+ const vendorPath = join88(packageDir, "vendor", platformKey, binaryName);
106285
106590
  if (existsSync55(vendorPath))
106286
106591
  return vendorPath;
106287
- const binPath = join86(packageDir, "bin", binaryName);
106592
+ const binPath = join88(packageDir, "bin", binaryName);
106288
106593
  if (existsSync55(binPath))
106289
106594
  return binPath;
106290
106595
  } catch (error) {
@@ -106431,7 +106736,7 @@ async function getGhCliInfo(dependencies = {}) {
106431
106736
  // packages/omo-opencode/src/mcp/lsp.ts
106432
106737
  init_zod();
106433
106738
  init_opencode_config_dir();
106434
- import { existsSync as existsSync56, readFileSync as readFileSync37 } from "fs";
106739
+ import { existsSync as existsSync56, readFileSync as readFileSync38 } from "fs";
106435
106740
  import { delimiter as delimiter3, dirname as dirname34, resolve as resolve23 } from "path";
106436
106741
  import { fileURLToPath as fileURLToPath7 } from "url";
106437
106742
 
@@ -106575,7 +106880,7 @@ function findBootstrapRoot(candidates, pathExists) {
106575
106880
  }
106576
106881
  function readDaemonPackageVersion(root) {
106577
106882
  try {
106578
- const packageJson = JSON.parse(readFileSync37(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
106883
+ const packageJson = JSON.parse(readFileSync38(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
106579
106884
  return DaemonPackageSchema.parse(packageJson).version;
106580
106885
  } catch (error) {
106581
106886
  if (!(error instanceof Error))
@@ -106658,15 +106963,15 @@ function getInstalledLspServers(options = {}) {
106658
106963
 
106659
106964
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
106660
106965
  init_shared();
106661
- import { existsSync as existsSync57, readFileSync as readFileSync38 } from "fs";
106966
+ import { existsSync as existsSync57, readFileSync as readFileSync39 } from "fs";
106662
106967
  import { homedir as homedir21 } from "os";
106663
- import { join as join87 } from "path";
106968
+ import { join as join89 } from "path";
106664
106969
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
106665
106970
  function getMcpConfigPaths() {
106666
106971
  return [
106667
- join87(homedir21(), ".claude", ".mcp.json"),
106668
- join87(process.cwd(), ".mcp.json"),
106669
- join87(process.cwd(), ".claude", ".mcp.json")
106972
+ join89(homedir21(), ".claude", ".mcp.json"),
106973
+ join89(process.cwd(), ".mcp.json"),
106974
+ join89(process.cwd(), ".claude", ".mcp.json")
106670
106975
  ];
106671
106976
  }
106672
106977
  function loadUserMcpConfig() {
@@ -106675,7 +106980,7 @@ function loadUserMcpConfig() {
106675
106980
  if (!existsSync57(configPath))
106676
106981
  continue;
106677
106982
  try {
106678
- const content = readFileSync38(configPath, "utf-8");
106983
+ const content = readFileSync39(configPath, "utf-8");
106679
106984
  const config = parseJsonc(content);
106680
106985
  if (config.mcpServers) {
106681
106986
  Object.assign(servers, config.mcpServers);
@@ -106810,7 +107115,7 @@ async function checkTools() {
106810
107115
 
106811
107116
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
106812
107117
  init_src5();
106813
- import { existsSync as existsSync58, readFileSync as readFileSync39 } from "fs";
107118
+ import { existsSync as existsSync58, readFileSync as readFileSync40 } from "fs";
106814
107119
  function isTelemetryState(value) {
106815
107120
  return value !== null && typeof value === "object" && !Array.isArray(value);
106816
107121
  }
@@ -106820,7 +107125,7 @@ function readLastActiveDay(stateFilePath) {
106820
107125
  }
106821
107126
  let parsed;
106822
107127
  try {
106823
- parsed = JSON.parse(readFileSync39(stateFilePath, "utf-8"));
107128
+ parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
106824
107129
  } catch (error) {
106825
107130
  if (error instanceof Error) {
106826
107131
  return "unreadable";
@@ -106946,9 +107251,9 @@ async function pathExists2(dir) {
106946
107251
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
106947
107252
  init_src();
106948
107253
  import { existsSync as existsSync59 } from "fs";
106949
- import { lstat as lstat16, readdir as readdir14, readFile as readFile28 } from "fs/promises";
107254
+ import { lstat as lstat16, readdir as readdir14, readFile as readFile30 } from "fs/promises";
106950
107255
  import { homedir as homedir23 } from "os";
106951
- import { basename as basename12, join as join88, resolve as resolve24 } from "path";
107256
+ import { basename as basename12, join as join90, resolve as resolve24 } from "path";
106952
107257
  // packages/omo-opencode/package.json
106953
107258
  var package_default3 = {
106954
107259
  name: "@oh-my-opencode/omo-opencode",
@@ -107018,13 +107323,13 @@ var CODEX_BIN_NAMES = [
107018
107323
  "omo-git-bash-hook"
107019
107324
  ];
107020
107325
  async function gatherCodexSummary(deps = {}) {
107021
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join88(homedir23(), ".codex"));
107326
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join90(homedir23(), ".codex"));
107022
107327
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
107023
107328
  const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
107024
107329
  const pluginRoot = await resolveInstalledPluginRoot(codexHome);
107025
- const manifest = pluginRoot === null ? null : await readJson(join88(pluginRoot, ".codex-plugin", "plugin.json"));
107026
- const installSnapshot = pluginRoot === null ? null : await readJson(join88(pluginRoot, "lazycodex-install.json"));
107027
- const configPath = join88(codexHome, "config.toml");
107330
+ const manifest = pluginRoot === null ? null : await readJson(join90(pluginRoot, ".codex-plugin", "plugin.json"));
107331
+ const installSnapshot = pluginRoot === null ? null : await readJson(join90(pluginRoot, "lazycodex-install.json"));
107332
+ const configPath = join90(codexHome, "config.toml");
107028
107333
  const pluginVersion = stringField(manifest, "version");
107029
107334
  return {
107030
107335
  codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -107081,7 +107386,7 @@ function buildCodexIssues(summary) {
107081
107386
  if (summary.pluginRoot === null) {
107082
107387
  issues.push({
107083
107388
  title: "OMO Codex plugin is not installed",
107084
- description: `Expected cached plugin at ${join88("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
107389
+ description: `Expected cached plugin at ${join90("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
107085
107390
  fix: "Run: npx lazycodex-ai install",
107086
107391
  severity: "error",
107087
107392
  affects: ["plugin loading"]
@@ -107146,12 +107451,12 @@ function buildCodexIssues(summary) {
107146
107451
  return issues;
107147
107452
  }
107148
107453
  async function resolveInstalledPluginRoot(codexHome) {
107149
- const pluginRoot = join88(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
107454
+ const pluginRoot = join90(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
107150
107455
  if (!existsSync59(pluginRoot))
107151
107456
  return null;
107152
107457
  const versions = await readdir14(pluginRoot, { withFileTypes: true });
107153
107458
  const candidates = versions.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
107154
- return candidates.length === 0 ? null : join88(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
107459
+ return candidates.length === 0 ? null : join90(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
107155
107460
  }
107156
107461
  async function readCodexConfigSummary(configPath) {
107157
107462
  if (!existsSync59(configPath)) {
@@ -107165,7 +107470,7 @@ async function readCodexConfigSummary(configPath) {
107165
107470
  companionLifecycleHookStateEvents: []
107166
107471
  };
107167
107472
  }
107168
- const content = await readFile28(configPath, "utf8");
107473
+ const content = await readFile30(configPath, "utf8");
107169
107474
  return {
107170
107475
  exists: true,
107171
107476
  marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
@@ -107179,13 +107484,13 @@ async function readCodexConfigSummary(configPath) {
107179
107484
  async function readLinkedBins(binDir) {
107180
107485
  const linked = [];
107181
107486
  for (const name of CODEX_BIN_NAMES) {
107182
- if (await pathExists3(join88(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
107487
+ if (await pathExists3(join90(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
107183
107488
  linked.push(name);
107184
107489
  }
107185
107490
  return linked;
107186
107491
  }
107187
107492
  async function readLinkedAgents(codexHome) {
107188
- const agentsDir = join88(codexHome, "agents");
107493
+ const agentsDir = join90(codexHome, "agents");
107189
107494
  if (!existsSync59(agentsDir))
107190
107495
  return [];
107191
107496
  const entries = await readdir14(agentsDir, { withFileTypes: true });
@@ -107193,7 +107498,7 @@ async function readLinkedAgents(codexHome) {
107193
107498
  }
107194
107499
  async function readJson(path) {
107195
107500
  try {
107196
- const parsed = JSON.parse(await readFile28(path, "utf8"));
107501
+ const parsed = JSON.parse(await readFile30(path, "utf8"));
107197
107502
  return isPlainRecord(parsed) ? parsed : null;
107198
107503
  } catch (error) {
107199
107504
  if (error instanceof Error)
@@ -107317,9 +107622,9 @@ function resolveLatestVersion(input) {
107317
107622
 
107318
107623
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
107319
107624
  init_src();
107320
- import { readdir as readdir15, readFile as readFile29, stat as stat7 } from "fs/promises";
107625
+ import { readdir as readdir15, readFile as readFile31, stat as stat7 } from "fs/promises";
107321
107626
  import { homedir as homedir24 } from "os";
107322
- import { dirname as dirname35, isAbsolute as isAbsolute14, join as join89, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
107627
+ import { dirname as dirname35, isAbsolute as isAbsolute14, join as join91, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
107323
107628
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
107324
107629
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
107325
107630
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -107329,7 +107634,7 @@ async function checkCodexComponents(deps = {}) {
107329
107634
  const env = deps.env ?? process.env;
107330
107635
  const platform = deps.platform ?? process.platform;
107331
107636
  const arch = deps.arch ?? process.arch;
107332
- const codexHome = resolve25(deps.codexHome ?? env["CODEX_HOME"] ?? join89(homedir24(), ".codex"));
107637
+ const codexHome = resolve25(deps.codexHome ?? env["CODEX_HOME"] ?? join91(homedir24(), ".codex"));
107333
107638
  const summary = await gatherCodexSummary({ ...deps, codexHome });
107334
107639
  if (summary.pluginRoot === null) {
107335
107640
  return {
@@ -107354,7 +107659,7 @@ async function checkCodexComponents(deps = {}) {
107354
107659
  });
107355
107660
  }
107356
107661
  const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
107357
- const runtimeSgPath = join89(runtimeSgDir, sgBinaryName(platform));
107662
+ const runtimeSgPath = join91(runtimeSgDir, sgBinaryName(platform));
107358
107663
  const sg = findSgBinarySync({
107359
107664
  arch,
107360
107665
  env,
@@ -107466,7 +107771,7 @@ async function findManifestPaths(root, manifestName) {
107466
107771
  for (const entry of entries) {
107467
107772
  if (entry.name === "node_modules" || entry.name === ".git")
107468
107773
  continue;
107469
- const entryPath = join89(root, entry.name);
107774
+ const entryPath = join91(root, entry.name);
107470
107775
  if (entry.isDirectory()) {
107471
107776
  paths.push(...await findManifestPaths(entryPath, manifestName));
107472
107777
  continue;
@@ -107510,18 +107815,18 @@ function isPluginRuntimePathArg(arg) {
107510
107815
  return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute14(arg));
107511
107816
  }
107512
107817
  function runtimeSgDirectory(codexHome, platform, arch) {
107513
- return join89(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
107818
+ return join91(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
107514
107819
  }
107515
107820
  function describeSgSource(sgPath, env, runtimeSgDir, platform) {
107516
107821
  const override = env[SG_PATH_ENV_KEY]?.trim();
107517
107822
  if (override !== undefined && override.length > 0 && sgPath === override)
107518
107823
  return `env override ${SG_PATH_ENV_KEY}`;
107519
- if (sgPath === join89(runtimeSgDir, sgBinaryName(platform)))
107824
+ if (sgPath === join91(runtimeSgDir, sgBinaryName(platform)))
107520
107825
  return "runtime dir";
107521
107826
  return "PATH";
107522
107827
  }
107523
107828
  async function readBootstrapStateSummary(codexHome) {
107524
- const statePath = join89(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
107829
+ const statePath = join91(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
107525
107830
  const raw = await readJson2(statePath);
107526
107831
  if (raw === null)
107527
107832
  return null;
@@ -107570,7 +107875,7 @@ function degradedDetailLines(entries) {
107570
107875
  }
107571
107876
  async function readJson2(path) {
107572
107877
  try {
107573
- const parsed = JSON.parse(await readFile29(path, "utf8"));
107878
+ const parsed = JSON.parse(await readFile31(path, "utf8"));
107574
107879
  return isRecord18(parsed) ? parsed : null;
107575
107880
  } catch (error) {
107576
107881
  if (error instanceof Error)
@@ -107598,18 +107903,18 @@ function isRecord18(value) {
107598
107903
 
107599
107904
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
107600
107905
  import { existsSync as existsSync60 } from "fs";
107601
- import { readFile as readFile30 } from "fs/promises";
107906
+ import { readFile as readFile32 } from "fs/promises";
107602
107907
  import { homedir as homedir25 } from "os";
107603
- import { join as join90, resolve as resolve26 } from "path";
107908
+ import { join as join92, resolve as resolve26 } from "path";
107604
107909
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
107605
107910
  var CHECK_NAME = "codex-runtime-wrapper";
107606
107911
  var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
107607
107912
  async function checkCodexRuntimeWrapper(deps = {}) {
107608
- const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join90(homedir25(), ".codex"));
107913
+ const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join92(homedir25(), ".codex"));
107609
107914
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
107610
107915
  const platform = deps.platform ?? process.platform;
107611
- const wrapperPath = join90(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
107612
- const legacyWrapperPath = join90(binDir, platform === "win32" ? "omo.cmd" : "omo");
107916
+ const wrapperPath = join92(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
107917
+ const legacyWrapperPath = join92(binDir, platform === "win32" ? "omo.cmd" : "omo");
107613
107918
  const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
107614
107919
  const issues = [];
107615
107920
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
@@ -107643,7 +107948,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
107643
107948
  }
107644
107949
  async function readRuntimeWrapper(path) {
107645
107950
  try {
107646
- return await readFile30(path, "utf8");
107951
+ return await readFile32(path, "utf8");
107647
107952
  } catch (error) {
107648
107953
  if (error instanceof Error)
107649
107954
  return null;
@@ -108140,17 +108445,17 @@ import {
108140
108445
  existsSync as existsSync63,
108141
108446
  mkdirSync as mkdirSync17,
108142
108447
  readdirSync as readdirSync13,
108143
- readFileSync as readFileSync41,
108448
+ readFileSync as readFileSync42,
108144
108449
  renameSync as renameSync8,
108145
108450
  unlinkSync as unlinkSync9,
108146
- writeFileSync as writeFileSync13
108451
+ writeFileSync as writeFileSync14
108147
108452
  } from "fs";
108148
- import { basename as basename13, dirname as dirname36, join as join93 } from "path";
108453
+ import { basename as basename13, dirname as dirname36, join as join95 } from "path";
108149
108454
 
108150
108455
  // packages/mcp-client-core/src/config-dir.ts
108151
108456
  import { existsSync as existsSync61, realpathSync as realpathSync10 } from "fs";
108152
108457
  import { homedir as homedir26 } from "os";
108153
- import { join as join91, resolve as resolve27 } from "path";
108458
+ import { join as join93, resolve as resolve27 } from "path";
108154
108459
  function resolveConfigPath2(pathValue) {
108155
108460
  const resolvedPath = resolve27(pathValue);
108156
108461
  if (!existsSync61(resolvedPath))
@@ -108168,13 +108473,13 @@ function getOpenCodeCliConfigDir(env = process.env) {
108168
108473
  if (customConfigDir) {
108169
108474
  return resolveConfigPath2(customConfigDir);
108170
108475
  }
108171
- const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() || join91(homedir26(), ".config");
108172
- return resolveConfigPath2(join91(xdgConfigDir, "opencode"));
108476
+ const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() || join93(homedir26(), ".config");
108477
+ return resolveConfigPath2(join93(xdgConfigDir, "opencode"));
108173
108478
  }
108174
108479
 
108175
108480
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
108176
- import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync40, renameSync as renameSync7, writeFileSync as writeFileSync12 } from "fs";
108177
- import { join as join92 } from "path";
108481
+ import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync7, writeFileSync as writeFileSync13 } from "fs";
108482
+ import { join as join94 } from "path";
108178
108483
  var INDEX_FILE_NAME = "index.json";
108179
108484
  function isTokenIndex(value) {
108180
108485
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -108182,14 +108487,14 @@ function isTokenIndex(value) {
108182
108487
  return Object.values(value).every((entry) => typeof entry === "string");
108183
108488
  }
108184
108489
  function getIndexPath(storageDir) {
108185
- return join92(storageDir, INDEX_FILE_NAME);
108490
+ return join94(storageDir, INDEX_FILE_NAME);
108186
108491
  }
108187
108492
  function readTokenIndex(storageDir) {
108188
108493
  const indexPath = getIndexPath(storageDir);
108189
108494
  if (!existsSync62(indexPath))
108190
108495
  return {};
108191
108496
  try {
108192
- const parsed = JSON.parse(readFileSync40(indexPath, "utf-8"));
108497
+ const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
108193
108498
  return isTokenIndex(parsed) ? parsed : {};
108194
108499
  } catch (readError) {
108195
108500
  if (!(readError instanceof Error))
@@ -108201,7 +108506,7 @@ function writeTokenIndex(storageDir, index) {
108201
108506
  try {
108202
108507
  const indexPath = getIndexPath(storageDir);
108203
108508
  const tempPath = `${indexPath}.tmp.${Date.now()}`;
108204
- writeFileSync12(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
108509
+ writeFileSync13(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
108205
108510
  chmodSync4(tempPath, 384);
108206
108511
  renameSync7(tempPath, indexPath);
108207
108512
  return true;
@@ -108226,16 +108531,16 @@ function deleteTokenIndexEntry(storageDir, hash) {
108226
108531
  var STORAGE_DIR_NAME = "mcp-oauth";
108227
108532
  var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
108228
108533
  function getMcpOauthStorageDir() {
108229
- return join93(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
108534
+ return join95(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
108230
108535
  }
108231
108536
  function getMcpOauthServerHash(serverHost, resource) {
108232
108537
  return createHash7("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
108233
108538
  }
108234
108539
  function getMcpOauthStoragePath(serverHost, resource) {
108235
- return join93(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
108540
+ return join95(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
108236
108541
  }
108237
108542
  function getLegacyStoragePath() {
108238
- return join93(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
108543
+ return join95(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
108239
108544
  }
108240
108545
  function normalizeHost2(serverHost) {
108241
108546
  let host = serverHost.trim();
@@ -108299,7 +108604,7 @@ function readTokenFile(filePath) {
108299
108604
  if (!existsSync63(filePath))
108300
108605
  return null;
108301
108606
  try {
108302
- const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
108607
+ const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
108303
108608
  return isOAuthTokenData(parsed) ? parsed : null;
108304
108609
  } catch (readError) {
108305
108610
  if (!(readError instanceof Error))
@@ -108312,7 +108617,7 @@ function readLegacyStore() {
108312
108617
  if (!existsSync63(filePath))
108313
108618
  return null;
108314
108619
  try {
108315
- const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
108620
+ const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
108316
108621
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
108317
108622
  return null;
108318
108623
  const result = {};
@@ -108334,7 +108639,7 @@ function writeTokenFile(filePath, token) {
108334
108639
  mkdirSync17(dir, { recursive: true });
108335
108640
  }
108336
108641
  const tempPath = `${filePath}.tmp.${Date.now()}`;
108337
- writeFileSync13(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
108642
+ writeFileSync14(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
108338
108643
  chmodSync5(tempPath, 384);
108339
108644
  renameSync8(tempPath, filePath);
108340
108645
  return true;
@@ -108390,7 +108695,7 @@ function deleteLegacyToken(serverHost, resource) {
108390
108695
  function writeLegacyStore(store) {
108391
108696
  try {
108392
108697
  const filePath = getLegacyStoragePath();
108393
- writeFileSync13(filePath, JSON.stringify(store, null, 2), { encoding: "utf-8", mode: 384 });
108698
+ writeFileSync14(filePath, JSON.stringify(store, null, 2), { encoding: "utf-8", mode: 384 });
108394
108699
  chmodSync5(filePath, 384);
108395
108700
  return true;
108396
108701
  } catch (writeError) {
@@ -108414,7 +108719,7 @@ function listTokensByHost(serverHost) {
108414
108719
  for (const [hash, indexedKey] of Object.entries(index)) {
108415
108720
  if (!indexedKey.startsWith(prefix))
108416
108721
  continue;
108417
- const indexedToken = readTokenFile(join93(getMcpOauthStorageDir(), `${hash}.json`));
108722
+ const indexedToken = readTokenFile(join95(getMcpOauthStorageDir(), `${hash}.json`));
108418
108723
  if (indexedToken)
108419
108724
  result[indexedKey] = indexedToken;
108420
108725
  }
@@ -108429,7 +108734,7 @@ function listAllTokens() {
108429
108734
  for (const entry of readdirSync13(dir, { withFileTypes: true })) {
108430
108735
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
108431
108736
  continue;
108432
- const token = readTokenFile(join93(dir, entry.name));
108737
+ const token = readTokenFile(join95(dir, entry.name));
108433
108738
  const hash = basename13(entry.name, ".json");
108434
108739
  if (token)
108435
108740
  result[index[hash] ?? hash] = token;
@@ -109153,7 +109458,7 @@ async function boulder(options) {
109153
109458
  }
109154
109459
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
109155
109460
  import { spawn as spawn5 } from "child_process";
109156
- import { existsSync as existsSync65, readFileSync as readFileSync42, realpathSync as realpathSync11 } from "fs";
109461
+ import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync11 } from "fs";
109157
109462
  import { homedir as homedir27 } from "os";
109158
109463
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
109159
109464
  function resolveCodexUlwLoopCommand(input = {}) {
@@ -109203,7 +109508,7 @@ function resolveLegacyLocalOmoBin(env, homeDir, currentExecutablePaths) {
109203
109508
  }
109204
109509
  function isGeneratedRuntimeWrapper(candidate) {
109205
109510
  try {
109206
- return readFileSync42(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
109511
+ return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
109207
109512
  } catch (error) {
109208
109513
  if (error instanceof Error)
109209
109514
  return false;