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
@@ -65,7 +65,7 @@ var package_default;
65
65
  var init_package = __esm(() => {
66
66
  package_default = {
67
67
  name: "oh-my-opencode",
68
- version: "5.0.1",
68
+ version: "5.1.1",
69
69
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
70
70
  main: "./dist/index.js",
71
71
  types: "dist/index.d.ts",
@@ -98,6 +98,11 @@ var init_package = __esm(() => {
98
98
  "packages/omo-codex",
99
99
  "packages/omo-senpi",
100
100
  "packages/senpi-task",
101
+ "packages/senpi-desktop-protocol",
102
+ "packages/senpi-desktop-engine",
103
+ "packages/senpi-desktop-prelude",
104
+ "packages/senpi-desktop-service",
105
+ "packages/senpi-desktop-tool",
101
106
  "packages/omo-opencode",
102
107
  "packages/omo-native"
103
108
  ],
@@ -199,7 +204,7 @@ var init_package = __esm(() => {
199
204
  prepublishOnly: "bun run clean && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && bun run build",
200
205
  "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",
201
206
  typecheck: "tsgo --noEmit && bun run typecheck:script && bun run typecheck:packages",
202
- "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",
207
+ "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",
203
208
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
204
209
  test: "bun test --timeout 20000",
205
210
  "changelog:section": "bun script/changelog-section.ts",
@@ -208,7 +213,8 @@ var init_package = __esm(() => {
208
213
  "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",
209
214
  "test:windows-codex": "bun run test:codex",
210
215
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build",
211
- "build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build"
216
+ "build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build",
217
+ "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"
212
218
  },
213
219
  keywords: [
214
220
  "opencode",
@@ -248,7 +254,7 @@ var init_package = __esm(() => {
248
254
  zod: "^4.6.5"
249
255
  },
250
256
  devDependencies: {
251
- "@code-yeongyu/senpi": "2026.9.27",
257
+ "@code-yeongyu/senpi": "2026.9.29",
252
258
  "@oh-my-opencode/agents-md-core": "workspace:*",
253
259
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
254
260
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -257,11 +263,11 @@ var init_package = __esm(() => {
257
263
  "@oh-my-opencode/delegate-core": "workspace:*",
258
264
  "@oh-my-opencode/git-bash-mcp": "workspace:*",
259
265
  "@oh-my-opencode/hashline-core": "workspace:*",
260
- "@oh-my-opencode/lsp-core": "workspace:*",
261
266
  "@oh-my-opencode/isolation-core": "workspace:*",
262
- "@oh-my-opencode/memory-core": "workspace:*",
267
+ "@oh-my-opencode/lsp-core": "workspace:*",
263
268
  "@oh-my-opencode/mcp-client-core": "workspace:*",
264
269
  "@oh-my-opencode/mcp-stdio-core": "workspace:*",
270
+ "@oh-my-opencode/memory-core": "workspace:*",
265
271
  "@oh-my-opencode/model-core": "workspace:*",
266
272
  "@oh-my-opencode/omo-codex": "workspace:*",
267
273
  "@oh-my-opencode/omo-config-core": "workspace:*",
@@ -270,6 +276,11 @@ var init_package = __esm(() => {
270
276
  "@oh-my-opencode/openclaw-core": "workspace:*",
271
277
  "@oh-my-opencode/prompts-core": "workspace:*",
272
278
  "@oh-my-opencode/rules-engine": "workspace:*",
279
+ "@oh-my-opencode/senpi-desktop-engine": "workspace:*",
280
+ "@oh-my-opencode/senpi-desktop-prelude": "workspace:*",
281
+ "@oh-my-opencode/senpi-desktop-protocol": "workspace:*",
282
+ "@oh-my-opencode/senpi-desktop-service": "workspace:*",
283
+ "@oh-my-opencode/senpi-desktop-tool": "workspace:*",
273
284
  "@oh-my-opencode/senpi-task": "workspace:*",
274
285
  "@oh-my-opencode/shared-skills": "workspace:*",
275
286
  "@oh-my-opencode/skills-loader-core": "workspace:*",
@@ -289,18 +300,18 @@ var init_package = __esm(() => {
289
300
  typescript: "^7.0.2"
290
301
  },
291
302
  optionalDependencies: {
292
- "oh-my-opencode-darwin-arm64": "5.0.1",
293
- "oh-my-opencode-darwin-x64": "5.0.1",
294
- "oh-my-opencode-darwin-x64-baseline": "5.0.1",
295
- "oh-my-opencode-linux-arm64": "5.0.1",
296
- "oh-my-opencode-linux-arm64-musl": "5.0.1",
297
- "oh-my-opencode-linux-x64": "5.0.1",
298
- "oh-my-opencode-linux-x64-baseline": "5.0.1",
299
- "oh-my-opencode-linux-x64-musl": "5.0.1",
300
- "oh-my-opencode-linux-x64-musl-baseline": "5.0.1",
301
- "oh-my-opencode-windows-arm64": "5.0.1",
302
- "oh-my-opencode-windows-x64": "5.0.1",
303
- "oh-my-opencode-windows-x64-baseline": "5.0.1"
303
+ "oh-my-opencode-darwin-arm64": "5.1.1",
304
+ "oh-my-opencode-darwin-x64": "5.1.1",
305
+ "oh-my-opencode-darwin-x64-baseline": "5.1.1",
306
+ "oh-my-opencode-linux-arm64": "5.1.1",
307
+ "oh-my-opencode-linux-arm64-musl": "5.1.1",
308
+ "oh-my-opencode-linux-x64": "5.1.1",
309
+ "oh-my-opencode-linux-x64-baseline": "5.1.1",
310
+ "oh-my-opencode-linux-x64-musl": "5.1.1",
311
+ "oh-my-opencode-linux-x64-musl-baseline": "5.1.1",
312
+ "oh-my-opencode-windows-arm64": "5.1.1",
313
+ "oh-my-opencode-windows-x64": "5.1.1",
314
+ "oh-my-opencode-windows-x64-baseline": "5.1.1"
304
315
  },
305
316
  overrides: {
306
317
  "@earendil-works/pi-agent-core": "0.84.2",
@@ -6397,6 +6408,9 @@ function getActiveReservation(sessionID) {
6397
6408
  pruneExpiredReservations();
6398
6409
  return promptAsyncReservations.get(sessionID);
6399
6410
  }
6411
+ function reservedDispatchResult(reservation) {
6412
+ return reservation.expiresAt === undefined ? { status: "reserved", reservedBy: reservation.source } : { status: "reserved", reservedBy: reservation.source, expiresAt: reservation.expiresAt };
6413
+ }
6400
6414
  function setPromptReservation(sessionID, reservation) {
6401
6415
  promptAsyncReservations.set(sessionID, reservation);
6402
6416
  }
@@ -6446,7 +6460,7 @@ async function dispatchAfterSessionIdle(args) {
6446
6460
  reservedBy: existing.source,
6447
6461
  reservedAgeMs: Date.now() - existing.reservedAt
6448
6462
  });
6449
- return { status: "reserved", reservedBy: existing.source };
6463
+ return reservedDispatchResult(existing);
6450
6464
  }
6451
6465
  const reservation = {
6452
6466
  source,
@@ -6984,7 +6998,7 @@ async function dispatchInternalPrompt(args) {
6984
6998
  if (queueBehavior === "defer") {
6985
6999
  const activeReservation = getActiveReservation(sessionID);
6986
7000
  if (activeReservation) {
6987
- return { status: "reserved", reservedBy: activeReservation.source };
7001
+ return reservedDispatchResult(activeReservation);
6988
7002
  }
6989
7003
  const queuedBy = getQueuedPromptBlocker(sessionID);
6990
7004
  if (queuedBy !== undefined || isPromptQueueDraining(sessionID)) {
@@ -7383,12 +7397,12 @@ var init_category_model_requirements = __esm(() => {
7383
7397
  },
7384
7398
  "deep-low": {
7385
7399
  fallbackChain: [
7386
- { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol-fast", variant: "medium" },
7387
7400
  {
7388
7401
  providers: ["openai", "chatgpt-subscription", "github-copilot", "opencode"],
7389
7402
  model: "gpt-5.6-sol",
7390
7403
  variant: "medium"
7391
- }
7404
+ },
7405
+ { providers: ["openai", "chatgpt-subscription"], model: "gpt-5.6-sol-fast", variant: "medium" }
7392
7406
  ]
7393
7407
  },
7394
7408
  "deep-high": {
@@ -7440,6 +7454,11 @@ var init_category_model_requirements = __esm(() => {
7440
7454
  },
7441
7455
  "unspecified-low": {
7442
7456
  fallbackChain: [
7457
+ {
7458
+ providers: ["anthropic", "anthropic-api", "github-copilot", "opencode"],
7459
+ model: "claude-sonnet-5-5",
7460
+ variant: "medium"
7461
+ },
7443
7462
  { providers: ["xiaomi", "opencode-go"], model: "mimo-v2.6-pro", variant: "max" },
7444
7463
  { providers: ["xai", "github-copilot", "opencode-go"], model: "grok-4.7", variant: "xhigh" },
7445
7464
  {
@@ -8041,8 +8060,17 @@ var init_model_resolver = () => {};
8041
8060
  // packages/model-core/src/fallback-chain-from-models.ts
8042
8061
  var init_fallback_chain_from_models = () => {};
8043
8062
 
8063
+ // packages/model-core/src/runtime-fallback-auto-retry-signal.ts
8064
+ var init_runtime_fallback_auto_retry_signal = () => {};
8065
+
8066
+ // packages/model-core/src/runtime-fallback-error-shape.ts
8067
+ var init_runtime_fallback_error_shape = () => {};
8068
+
8069
+ // packages/model-core/src/runtime-fallback-error-classifier.ts
8070
+ var init_runtime_fallback_error_classifier = () => {};
8071
+
8044
8072
  // packages/model-core/src/model-error-classifier.ts
8045
- var RETRYABLE_ERROR_NAMES, STOP_ERROR_NAMES, NON_RETRYABLE_ERROR_NAMES;
8073
+ var RETRYABLE_ERROR_NAMES, NON_RETRYABLE_ERROR_NAMES;
8046
8074
  var init_model_error_classifier = __esm(() => {
8047
8075
  RETRYABLE_ERROR_NAMES = new Set([
8048
8076
  "providermodelnotfounderror",
@@ -8051,11 +8079,6 @@ var init_model_error_classifier = __esm(() => {
8051
8079
  "providerconnectionerror",
8052
8080
  "authenticationerror"
8053
8081
  ]);
8054
- STOP_ERROR_NAMES = new Set([
8055
- "quotaexceedederror",
8056
- "insufficientcreditserror",
8057
- "freeusagelimiterror"
8058
- ]);
8059
8082
  NON_RETRYABLE_ERROR_NAMES = new Set([
8060
8083
  "messageabortederror",
8061
8084
  "permissiondeniederror",
@@ -8067,15 +8090,6 @@ var init_model_error_classifier = __esm(() => {
8067
8090
  ]);
8068
8091
  });
8069
8092
 
8070
- // packages/model-core/src/runtime-fallback-auto-retry-signal.ts
8071
- var init_runtime_fallback_auto_retry_signal = () => {};
8072
-
8073
- // packages/model-core/src/runtime-fallback-error-shape.ts
8074
- var init_runtime_fallback_error_shape = () => {};
8075
-
8076
- // packages/model-core/src/runtime-fallback-error-classifier.ts
8077
- var init_runtime_fallback_error_classifier = () => {};
8078
-
8079
8093
  // packages/model-core/src/provider-exhaustion-fallback-policy.ts
8080
8094
  var init_provider_exhaustion_fallback_policy = () => {};
8081
8095
 
@@ -8381,6 +8395,36 @@ var init_supplemental_entries = __esm(() => {
8381
8395
  output: 32768
8382
8396
  }
8383
8397
  },
8398
+ "claude-sonnet-5-5": {
8399
+ id: "claude-sonnet-5-5",
8400
+ family: "claude-sonnet",
8401
+ reasoning: true,
8402
+ temperature: false,
8403
+ toolCall: true,
8404
+ modalities: {
8405
+ input: ["text", "image", "pdf"],
8406
+ output: ["text"]
8407
+ },
8408
+ limit: {
8409
+ context: 1e6,
8410
+ output: 128000
8411
+ }
8412
+ },
8413
+ "anthropic/claude-sonnet-5-5": {
8414
+ id: "anthropic/claude-sonnet-5-5",
8415
+ family: "claude-sonnet",
8416
+ reasoning: true,
8417
+ temperature: false,
8418
+ toolCall: true,
8419
+ modalities: {
8420
+ input: ["text", "image", "pdf"],
8421
+ output: ["text"]
8422
+ },
8423
+ limit: {
8424
+ context: 1e6,
8425
+ output: 128000
8426
+ }
8427
+ },
8384
8428
  "grok-4.7": {
8385
8429
  id: "grok-4.7",
8386
8430
  family: "grok",
@@ -9426,7 +9470,7 @@ var init_openai_categories = __esm(() => {
9426
9470
  },
9427
9471
  {
9428
9472
  name: "deep-low",
9429
- config: { model: "openai/gpt-5.6-sol-fast", variant: "medium" },
9473
+ config: { model: "openai/gpt-5.6-sol", variant: "medium" },
9430
9474
  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.",
9431
9475
  callerGuidance: DEEP_LOW_CATEGORY_CALLER_GUIDANCE,
9432
9476
  promptAppend: DEEP_LOW_CATEGORY_PROMPT_APPEND,
@@ -9451,7 +9495,7 @@ var init_openai_categories = __esm(() => {
9451
9495
  },
9452
9496
  {
9453
9497
  name: "unspecified-low",
9454
- config: { model: "xiaomi/mimo-v2.6-pro", variant: "max" },
9498
+ config: { model: "anthropic/claude-sonnet-5-5", variant: "medium" },
9455
9499
  description: "Tasks that don't fit other categories, low effort required",
9456
9500
  callerGuidance: UNSPECIFIED_LOW_CATEGORY_CALLER_GUIDANCE,
9457
9501
  promptAppend: UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND
@@ -74415,6 +74459,29 @@ var init_category = __esm(() => {
74415
74459
  OmoCategoriesConfigSchema = record(string2(), OmoCategoryConfigSchema);
74416
74460
  });
74417
74461
 
74462
+ // packages/omo-config-core/src/schema/computer.ts
74463
+ var positiveInteger, nonNegativeInteger, OmoComputerSettingsLayerSchema, OmoComputerSettingsSchema;
74464
+ var init_computer = __esm(() => {
74465
+ init_zod();
74466
+ positiveInteger = number2().int().positive();
74467
+ nonNegativeInteger = number2().int().nonnegative();
74468
+ OmoComputerSettingsLayerSchema = object({
74469
+ enabled: boolean2().describe("Experimental: register the computer tool in OmO Native sessions (default: on where the host is supported; false leaves it unregistered)"),
74470
+ display: string2().min(1),
74471
+ max_width: positiveInteger,
74472
+ max_height: positiveInteger,
74473
+ screenshot_max_bytes: positiveInteger,
74474
+ stop_hotkey: string2().min(1),
74475
+ allow_host_relay_only_stop: boolean2(),
74476
+ macos_canary: _enum(["session", "off"]),
74477
+ audit_log: object({ enabled: boolean2() }).partial().strict(),
74478
+ screenshot_gc: object({ enabled: boolean2(), stale_ms: nonNegativeInteger, scan_interval_ms: nonNegativeInteger }).partial().strict(),
74479
+ engine_path: string2().min(1),
74480
+ cua_adapter: boolean2()
74481
+ }).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.");
74482
+ OmoComputerSettingsSchema = OmoComputerSettingsLayerSchema;
74483
+ });
74484
+
74418
74485
  // packages/omo-config-core/src/schema/git-master.ts
74419
74486
  var OmoGitMasterSettingsShape, OmoGitMasterSettingsLayerSchema, OmoGitMasterSettingsSchema;
74420
74487
  var init_git_master = __esm(() => {
@@ -74687,11 +74754,11 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
74687
74754
  const record2 = record(string2(), unknown()).parse(input);
74688
74755
  return OmoTaskSettingsSchema.parse({
74689
74756
  ...record2,
74690
- residency_max_children: record2["residency_max_children"] ?? Math.min(DEFAULT_RESIDENCY_MAX_CHILDREN, Math.max(8, resolveParallelism() * 2)),
74757
+ residency_max_children: record2["residency_max_children"] ?? DEFAULT_RESIDENCY_MAX_CHILDREN,
74691
74758
  global_concurrency: record2["global_concurrency"] ?? Math.max(8, resolveParallelism() * 2)
74692
74759
  });
74693
74760
  }
74694
- var DEFAULT_RESIDENCY_MAX_CHILDREN = 16, ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, IsolationBackendKindSchema, OmoTaskIsolationSchema, isolationDefaults, OmoTaskIsolationLayerSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
74761
+ var DEFAULT_RESIDENCY_MAX_CHILDREN = "unlimited", ResidencyMaxChildrenInputSchema, OmoTaskWaitSchema, OmoTaskTeamSettingsSchema, OmoTaskWarningsSchema, IsolationBackendKindSchema, OmoTaskIsolationSchema, isolationDefaults, OmoTaskIsolationLayerSchema, OmoTaskDagSettingsSchema, OmoTaskSettingsSchema, OmoTaskDagSettingsLayerSchema, OmoTaskWaitLayerSchema, OmoTaskTeamSettingsLayerSchema, OmoTaskWarningsLayerSchema, OmoTaskSettingsLayerSchema;
74695
74762
  var init_task = __esm(() => {
74696
74763
  init_zod();
74697
74764
  ResidencyMaxChildrenInputSchema = union([number2().int().nonnegative(), literal("unlimited")]);
@@ -74749,12 +74816,13 @@ var init_task = __esm(() => {
74749
74816
  process_runner: _enum(["host", "child-process"]).default("host"),
74750
74817
  host_engine_policy: _enum(["upgrade", "fallback"]).default("upgrade"),
74751
74818
  host_idle_exit_ms: number2().int().positive().optional(),
74819
+ host_shard_prewarm: _enum(["off", "first-turn", "session-start"]).default("first-turn"),
74752
74820
  default_concurrency: number2().int().nonnegative().default(5),
74753
74821
  global_concurrency: number2().int().nonnegative().default(8),
74754
74822
  provider_concurrency: record(string2(), number2().int().nonnegative()).optional(),
74755
74823
  model_concurrency: record(string2(), number2().int().nonnegative()).optional(),
74756
74824
  max_depth: number2().int().nonnegative().default(1),
74757
- residency_max_children: ResidencyMaxChildrenInputSchema.default(8),
74825
+ residency_max_children: ResidencyMaxChildrenInputSchema.default(DEFAULT_RESIDENCY_MAX_CHILDREN),
74758
74826
  resident_idle_timeout_ms: number2().int().positive().max(Number.MAX_SAFE_INTEGER).default(900000),
74759
74827
  ttl_ms: number2().int().positive().default(86400000),
74760
74828
  state_dir: string2().optional(),
@@ -74798,6 +74866,7 @@ var init_task = __esm(() => {
74798
74866
  process_runner: _enum(["host", "child-process"]).optional(),
74799
74867
  host_engine_policy: _enum(["upgrade", "fallback"]).optional(),
74800
74868
  host_idle_exit_ms: number2().int().positive().optional(),
74869
+ host_shard_prewarm: _enum(["off", "first-turn", "session-start"]).optional(),
74801
74870
  default_concurrency: number2().int().nonnegative().optional(),
74802
74871
  global_concurrency: number2().int().nonnegative().optional(),
74803
74872
  provider_concurrency: record(string2(), number2().int().nonnegative()).optional(),
@@ -74905,6 +74974,7 @@ var init_config = __esm(() => {
74905
74974
  init_zod();
74906
74975
  init_agent();
74907
74976
  init_category();
74977
+ init_computer();
74908
74978
  init_git_master();
74909
74979
  init_memory();
74910
74980
  init_model_catalog();
@@ -74927,6 +74997,7 @@ var init_config = __esm(() => {
74927
74997
  model_profile: string2().optional(),
74928
74998
  memory: OmoMemorySettingsLayerSchema.optional(),
74929
74999
  telemetry: OmoTelemetrySettingsLayerSchema.optional(),
75000
+ computer: OmoComputerSettingsLayerSchema.optional(),
74930
75001
  disabled_skills: OmoDisabledSkillsSchema.optional()
74931
75002
  }).strict();
74932
75003
  OmoConfigProfileSchema = object({
@@ -74941,6 +75012,7 @@ var init_config = __esm(() => {
74941
75012
  model_profile: string2().optional(),
74942
75013
  memory: OmoMemorySettingsLayerSchema.optional(),
74943
75014
  telemetry: OmoTelemetrySettingsLayerSchema.optional(),
75015
+ computer: OmoComputerSettingsLayerSchema.optional(),
74944
75016
  disabled_skills: OmoDisabledSkillsSchema.optional(),
74945
75017
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
74946
75018
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -74960,6 +75032,7 @@ var init_config = __esm(() => {
74960
75032
  model_profile: string2().optional(),
74961
75033
  memory: OmoMemorySettingsSchema.optional(),
74962
75034
  telemetry: OmoTelemetrySettingsSchema.optional(),
75035
+ computer: OmoComputerSettingsSchema.optional(),
74963
75036
  disabled_skills: OmoDisabledSkillsSchema.optional(),
74964
75037
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
74965
75038
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -74982,6 +75055,7 @@ var init_config = __esm(() => {
74982
75055
  model_profile: string2().optional(),
74983
75056
  memory: OmoMemorySettingsLayerSchema.optional(),
74984
75057
  telemetry: OmoTelemetrySettingsLayerSchema.optional(),
75058
+ computer: OmoComputerSettingsLayerSchema.optional(),
74985
75059
  disabled_skills: OmoDisabledSkillsSchema.optional(),
74986
75060
  "[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
74987
75061
  "[native]": OmoTypedHarnessConfigSchema.optional(),
@@ -75127,6 +75201,7 @@ var init_schema = __esm(() => {
75127
75201
  init_task();
75128
75202
  init_team();
75129
75203
  init_telemetry();
75204
+ init_computer();
75130
75205
  });
75131
75206
 
75132
75207
  // packages/omo-config-core/src/loader/disabled-skills.ts
@@ -79152,9 +79227,9 @@ function extractChannel(version) {
79152
79227
 
79153
79228
  // packages/telemetry-core/src/day-claim.ts
79154
79229
  import { closeSync as closeSync3, mkdirSync as mkdirSync9, openSync as openSync3, readdirSync as readdirSync8, rmSync as rmSync3 } from "node:fs";
79155
- import { join as join52 } from "node:path";
79230
+ import { join as join53 } from "node:path";
79156
79231
  function getTelemetryDayClaimFilePath(stateDir, dayUTC) {
79157
- return join52(stateDir, `${CLAIM_PREFIX}${dayUTC}${CLAIM_SUFFIX}`);
79232
+ return join53(stateDir, `${CLAIM_PREFIX}${dayUTC}${CLAIM_SUFFIX}`);
79158
79233
  }
79159
79234
  function claimUtcDay(stateDir, dayUTC) {
79160
79235
  try {
@@ -79180,7 +79255,7 @@ function pruneSupersededClaims(stateDir, dayUTC) {
79180
79255
  if (!entry.startsWith(CLAIM_PREFIX) || !entry.endsWith(CLAIM_SUFFIX))
79181
79256
  continue;
79182
79257
  try {
79183
- rmSync3(join52(stateDir, entry), { force: true });
79258
+ rmSync3(join53(stateDir, entry), { force: true });
79184
79259
  } catch {}
79185
79260
  }
79186
79261
  }
@@ -79189,20 +79264,20 @@ var init_day_claim = () => {};
79189
79264
 
79190
79265
  // packages/telemetry-core/src/activity-state.ts
79191
79266
  import { existsSync as existsSync25, mkdirSync as mkdirSync10, readFileSync as readFileSync12 } from "node:fs";
79192
- import { basename as basename9, join as join53 } from "node:path";
79267
+ import { basename as basename9, join as join54 } from "node:path";
79193
79268
  function resolveTelemetryStateDir(product, options = {}) {
79194
79269
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
79195
79270
  env: options.env,
79196
79271
  osProvider: options.osProvider
79197
79272
  });
79198
- const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
79273
+ const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join54(options.env.XDG_DATA_HOME, product.cacheDirName);
79199
79274
  if (dataDir === xdgStateDir || xdgStateDir === undefined && basename9(dataDir) === product.cacheDirName) {
79200
79275
  return dataDir;
79201
79276
  }
79202
- return join53(dataDir, product.cacheDirName);
79277
+ return join54(dataDir, product.cacheDirName);
79203
79278
  }
79204
79279
  function getTelemetryActivityStateFilePath(stateDir) {
79205
- return join53(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
79280
+ return join54(stateDir, POSTHOG_ACTIVITY_STATE_FILE);
79206
79281
  }
79207
79282
  function getDailyActiveCaptureState(input) {
79208
79283
  const dayUTC = getUtcDayString(input.now ?? new Date);
@@ -79283,9 +79358,9 @@ var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_POSTHOG_API_KEY =
79283
79358
 
79284
79359
  // packages/telemetry-core/src/diagnostics.ts
79285
79360
  import { appendFileSync as appendFileSync2, existsSync as existsSync26, mkdirSync as mkdirSync11, readFileSync as readFileSync13 } from "node:fs";
79286
- import { join as join54 } from "node:path";
79361
+ import { join as join55 } from "node:path";
79287
79362
  function getTelemetryDiagnosticsFilePath(diagnosticsDir) {
79288
- return join54(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
79363
+ return join55(diagnosticsDir, DIAGNOSTICS_FILE_NAME);
79289
79364
  }
79290
79365
  function writeTelemetryDiagnostic(input, options) {
79291
79366
  const now = options.now ?? new Date;
@@ -85438,7 +85513,7 @@ class SyncSpanContextManager {
85438
85513
  var init_context = () => {};
85439
85514
 
85440
85515
  // node_modules/.bun/@posthog+core@1.55.0/node_modules/@posthog/core/dist/traces/config.mjs
85441
- function positiveInteger(value, fallback) {
85516
+ function positiveInteger2(value, fallback) {
85442
85517
  return typeof value == "number" && Number.isInteger(value) && value >= 1 ? value : fallback;
85443
85518
  }
85444
85519
  function withUsableIdentityKeys(attributes) {
@@ -85473,22 +85548,22 @@ function resolveTracesConfig(config, hostResourceAttributes, logger) {
85473
85548
  const resourceAttributes = assignUserAttributes({
85474
85549
  ...hostResourceAttributes
85475
85550
  }, withUsableIdentityKeys(config?.resourceAttributes));
85476
- const maxExportBatchSize = positiveInteger(config?.maxExportBatchSize, DEFAULT_MAX_EXPORT_BATCH_SIZE);
85551
+ const maxExportBatchSize = positiveInteger2(config?.maxExportBatchSize, DEFAULT_MAX_EXPORT_BATCH_SIZE);
85477
85552
  return {
85478
85553
  serviceName: resourceAttributes?.["service.name"] ?? config?.serviceName,
85479
85554
  serviceVersion: resourceAttributes?.["service.version"] ?? config?.serviceVersion,
85480
85555
  environment: resourceAttributes?.["deployment.environment"] ?? config?.environment,
85481
85556
  resourceAttributes,
85482
85557
  beforeSpanSend: resolveBeforeSpanSend(config?.beforeSpanSend, logger),
85483
- maxAttributesPerSpan: positiveInteger(config?.maxAttributesPerSpan, DEFAULT_MAX_ATTRIBUTES_PER_SPAN),
85484
- maxEventsPerSpan: positiveInteger(config?.maxEventsPerSpan, DEFAULT_MAX_EVENTS_PER_SPAN),
85558
+ maxAttributesPerSpan: positiveInteger2(config?.maxAttributesPerSpan, DEFAULT_MAX_ATTRIBUTES_PER_SPAN),
85559
+ maxEventsPerSpan: positiveInteger2(config?.maxEventsPerSpan, DEFAULT_MAX_EVENTS_PER_SPAN),
85485
85560
  maxAttributesPerEvent: DEFAULT_MAX_ATTRIBUTES_PER_EVENT,
85486
- maxAttributeValueLength: positiveInteger(config?.maxAttributeValueLength, DEFAULT_MAX_ATTRIBUTE_VALUE_LENGTH),
85487
- flushIntervalMs: positiveInteger(config?.flushIntervalMs, DEFAULT_FLUSH_INTERVAL_MS2),
85561
+ maxAttributeValueLength: positiveInteger2(config?.maxAttributeValueLength, DEFAULT_MAX_ATTRIBUTE_VALUE_LENGTH),
85562
+ flushIntervalMs: positiveInteger2(config?.flushIntervalMs, DEFAULT_FLUSH_INTERVAL_MS2),
85488
85563
  maxExportBatchSize,
85489
- maxQueueSize: Math.max(positiveInteger(config?.maxQueueSize, DEFAULT_MAX_QUEUE_SIZE), maxExportBatchSize),
85490
- maxLiveSpans: positiveInteger(config?.maxLiveSpans, DEFAULT_MAX_LIVE_SPANS),
85491
- maxSpanAgeMs: positiveInteger(config?.maxSpanAgeMs, DEFAULT_MAX_SPAN_AGE_MS)
85564
+ maxQueueSize: Math.max(positiveInteger2(config?.maxQueueSize, DEFAULT_MAX_QUEUE_SIZE), maxExportBatchSize),
85565
+ maxLiveSpans: positiveInteger2(config?.maxLiveSpans, DEFAULT_MAX_LIVE_SPANS),
85566
+ maxSpanAgeMs: positiveInteger2(config?.maxSpanAgeMs, DEFAULT_MAX_SPAN_AGE_MS)
85492
85567
  };
85493
85568
  }
85494
85569
  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;
@@ -89028,7 +89103,7 @@ var package_default2;
89028
89103
  var init_package2 = __esm(() => {
89029
89104
  package_default2 = {
89030
89105
  name: "@oh-my-opencode/omo-codex",
89031
- version: "5.0.1",
89106
+ version: "5.1.1",
89032
89107
  type: "module",
89033
89108
  private: true,
89034
89109
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -90000,7 +90075,7 @@ var init_update_toasts = __esm(() => {
90000
90075
 
90001
90076
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
90002
90077
  import { existsSync as existsSync48 } from "node:fs";
90003
- import { dirname as dirname32, join as join78 } from "node:path";
90078
+ import { dirname as dirname32, join as join79 } from "node:path";
90004
90079
  import { fileURLToPath as fileURLToPath5 } from "node:url";
90005
90080
  function defaultGetModuleHostingWorkspace() {
90006
90081
  try {
@@ -90160,7 +90235,7 @@ var init_background_update_check = __esm(() => {
90160
90235
  init_update_toasts();
90161
90236
  defaultDeps4 = {
90162
90237
  existsSync: existsSync48,
90163
- join: join78,
90238
+ join: join79,
90164
90239
  runBunInstallWithDetails,
90165
90240
  log: log2,
90166
90241
  getOpenCodeCacheDir,
@@ -92616,19 +92691,7 @@ function getUnsupportedOpenCodeVersionMessage(openCodeVersion) {
92616
92691
  }
92617
92692
 
92618
92693
  // packages/omo-codex/src/install/install-codex.ts
92619
- import { join as join55, resolve as resolve13 } from "node:path";
92620
-
92621
- // packages/omo-codex/src/install/codex-default-role-config.ts
92622
- init_src4();
92623
- function readDefaultRoleConfig(options = {}) {
92624
- const result = loadOmoConfig({ ...options, harness: "codex" });
92625
- return {
92626
- enabled: result.config.agents?.default?.disable !== true,
92627
- warnings: result.diagnostics.map((diagnostic) => diagnostic.message)
92628
- };
92629
- }
92630
-
92631
- // packages/omo-codex/src/install/install-codex.ts
92694
+ import { join as join56, resolve as resolve13 } from "node:path";
92632
92695
  import { existsSync as existsSync27 } from "node:fs";
92633
92696
  import { homedir as homedir6 } from "node:os";
92634
92697
 
@@ -95529,13 +95592,126 @@ function toCodexResolution(resolution) {
95529
95592
  };
95530
95593
  }
95531
95594
 
95595
+ // packages/omo-codex/src/install/codex-agent-config.ts
95596
+ init_src4();
95597
+ init_reasoning_vocabulary();
95598
+ function readCodexAgentConfig(options = {}) {
95599
+ const result = loadOmoConfig({ ...options, harness: "codex" });
95600
+ const overrides = readAgentOverrides(result);
95601
+ return {
95602
+ defaultRoleEnabled: result.config.agents?.default?.disable !== true,
95603
+ agentOverrides: overrides.agentOverrides,
95604
+ warnings: [...result.diagnostics.map((diagnostic) => diagnostic.message), ...overrides.warnings]
95605
+ };
95606
+ }
95607
+ function unmanagedAgentOverrideWarnings(agentOverrides, managedAgentNames) {
95608
+ 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`);
95609
+ }
95610
+ function readAgentOverrides(result) {
95611
+ let merged = {};
95612
+ for (const layer of result.layers)
95613
+ merged = mergeOmoConfigRecords(merged, layer.config);
95614
+ const profile = result.profile === undefined ? undefined : recordAt2(recordAt2(merged, "profiles"), result.profile);
95615
+ let agents = {};
95616
+ for (const scope of [merged, profile]) {
95617
+ agents = mergeOmoConfigRecords(agents, recordAt2(recordAt2(scope, "[codex]"), "agents") ?? {});
95618
+ }
95619
+ const agentOverrides = new Map;
95620
+ const warnings = [];
95621
+ for (const [name, value] of Object.entries(agents)) {
95622
+ if (name === "default")
95623
+ continue;
95624
+ const parsed = OmoAgentDefSchema.safeParse(value);
95625
+ if (!parsed.success) {
95626
+ warnings.push(`[codex].agents.${name} is invalid and was ignored: ${parsed.error.issues[0]?.message ?? "unknown error"}`);
95627
+ continue;
95628
+ }
95629
+ const override = toCodexAgentOverride(parsed.data.model, parsed.data.reasoning);
95630
+ if (override.model !== undefined || override.reasoningEffort !== undefined)
95631
+ agentOverrides.set(name, override);
95632
+ }
95633
+ return { agentOverrides, warnings };
95634
+ }
95635
+ function toCodexAgentOverride(model, reasoning) {
95636
+ const split = model === undefined ? undefined : splitReasoningSuffix2(model);
95637
+ const effort = codexReasoningEffort(reasoning ?? split?.level);
95638
+ return {
95639
+ ...split === undefined || split.base === "" ? {} : { model: split.base },
95640
+ ...effort === undefined ? {} : { reasoningEffort: effort }
95641
+ };
95642
+ }
95643
+ function codexReasoningEffort(reasoning) {
95644
+ if (reasoning === undefined || reasoning === "auto")
95645
+ return;
95646
+ return reasoning === "off" ? "none" : reasoning;
95647
+ }
95648
+ function recordAt2(value, key) {
95649
+ if (!isPlainRecord4(value))
95650
+ return;
95651
+ const child = value[key];
95652
+ return isPlainRecord4(child) ? child : undefined;
95653
+ }
95654
+
95655
+ // packages/omo-codex/src/install/codex-marketplace-snapshot.ts
95656
+ import { cp as cp3, mkdir as mkdir6, rename as rename4, rm as rm7, writeFile as writeFile6 } from "node:fs/promises";
95657
+ import { join as join39, sep as sep6 } from "node:path";
95658
+ var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
95659
+ async function writeInstalledMarketplaceSnapshot(input) {
95660
+ const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
95661
+ await mkdir6(marketplaceRoot, { recursive: true });
95662
+ await writeMarketplaceManifest(marketplaceRoot, input.marketplace);
95663
+ const snapshotPlugins = [];
95664
+ for (const plugin of input.plugins) {
95665
+ snapshotPlugins.push(await writeSnapshotPlugin(marketplaceRoot, plugin));
95666
+ }
95667
+ return snapshotPlugins;
95668
+ }
95669
+ function installedMarketplaceRoot(codexHome, marketplaceName) {
95670
+ return join39(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
95671
+ }
95672
+ async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
95673
+ const manifestDir = join39(marketplaceRoot, ".agents", "plugins");
95674
+ await mkdir6(manifestDir, { recursive: true });
95675
+ const tempPath = join39(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
95676
+ await writeFile6(tempPath, `${JSON.stringify(marketplace, null, "\t")}
95677
+ `);
95678
+ await rename4(tempPath, join39(manifestDir, "marketplace.json"));
95679
+ }
95680
+ async function writeSnapshotPlugin(marketplaceRoot, plugin) {
95681
+ const pluginsDir = join39(marketplaceRoot, "plugins");
95682
+ await mkdir6(pluginsDir, { recursive: true });
95683
+ const targetPath = join39(pluginsDir, plugin.name);
95684
+ const tempPath = join39(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
95685
+ await rm7(tempPath, { recursive: true, force: true });
95686
+ await cp3(plugin.sourcePath, tempPath, {
95687
+ recursive: true,
95688
+ filter: (source) => shouldCopyMarketplaceSourcePath(source, plugin.sourcePath)
95689
+ });
95690
+ await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: plugin.sourcePath });
95691
+ await rm7(targetPath, { recursive: true, force: true });
95692
+ await rename4(tempPath, targetPath);
95693
+ await rewriteCachedMcpManifest(targetPath, plugin.sourcePath);
95694
+ return { name: plugin.name, path: targetPath };
95695
+ }
95696
+ function shouldCopyMarketplaceSourcePath(path, root) {
95697
+ const relative = path === root ? "" : path.slice(root.length + sep6.length);
95698
+ if (relative === "")
95699
+ return true;
95700
+ const parts = relative.split(sep6);
95701
+ return !parts.some((part) => part === ".git" || part === "node_modules");
95702
+ }
95703
+
95532
95704
  // packages/omo-codex/src/install/link-cached-plugin-agents.ts
95533
- import { copyFile, lstat as lstat10, mkdir as mkdir6, readdir as readdir7, rm as rm9, writeFile as writeFile7 } from "node:fs/promises";
95534
- import { basename as basename7, join as join42 } from "node:path";
95705
+ import { copyFile, lstat as lstat10, mkdir as mkdir7, readdir as readdir7, readFile as readFile17, rm as rm11, writeFile as writeFile9 } from "node:fs/promises";
95706
+ import { basename as basename7, join as join44 } from "node:path";
95707
+
95708
+ // packages/omo-codex/src/install/agent-model-overrides.ts
95709
+ import { readFile as readFile14, rm as rm8, writeFile as writeFile8 } from "node:fs/promises";
95710
+ import { join as join41 } from "node:path";
95535
95711
 
95536
95712
  // packages/omo-codex/src/install/preserved-agent-settings.ts
95537
- import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile6 } from "node:fs/promises";
95538
- import { join as join39 } from "node:path";
95713
+ import { lstat as lstat7, readFile as readFile13, readdir as readdir6, writeFile as writeFile7 } from "node:fs/promises";
95714
+ import { join as join40 } from "node:path";
95539
95715
 
95540
95716
  // packages/omo-codex/src/install/managed-agent-reasoning-defaults.ts
95541
95717
  var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
@@ -95728,7 +95904,7 @@ function resolveManagedAgentReasoning(input) {
95728
95904
 
95729
95905
  // packages/omo-codex/src/install/preserved-agent-settings.ts
95730
95906
  async function capturePreservedAgentReasoning(input) {
95731
- const agentsDir = join39(input.codexHome, "agents");
95907
+ const agentsDir = join40(input.codexHome, "agents");
95732
95908
  if (!await exists2(agentsDir))
95733
95909
  return new Map;
95734
95910
  const preserved = new Map;
@@ -95736,7 +95912,7 @@ async function capturePreservedAgentReasoning(input) {
95736
95912
  for (const entry of agentEntries) {
95737
95913
  if (!entry.name.endsWith(".toml"))
95738
95914
  continue;
95739
- const content = await readTextIfExists(join39(agentsDir, entry.name));
95915
+ const content = await readTextIfExists(join40(agentsDir, entry.name));
95740
95916
  if (content === null)
95741
95917
  continue;
95742
95918
  const effort = extractReasoningEffort(content);
@@ -95750,7 +95926,7 @@ async function capturePreservedAgentReasoning(input) {
95750
95926
  return preserved;
95751
95927
  }
95752
95928
  async function capturePreservedAgentServiceTier(input) {
95753
- const agentsDir = join39(input.codexHome, "agents");
95929
+ const agentsDir = join40(input.codexHome, "agents");
95754
95930
  if (!await exists2(agentsDir))
95755
95931
  return new Map;
95756
95932
  const preserved = new Map;
@@ -95758,7 +95934,7 @@ async function capturePreservedAgentServiceTier(input) {
95758
95934
  for (const entry of agentEntries) {
95759
95935
  if (!entry.name.endsWith(".toml"))
95760
95936
  continue;
95761
- const content = await readTextIfExists(join39(agentsDir, entry.name));
95937
+ const content = await readTextIfExists(join40(agentsDir, entry.name));
95762
95938
  if (content === null)
95763
95939
  continue;
95764
95940
  preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
@@ -95781,7 +95957,7 @@ async function restorePreservedReasoning(input) {
95781
95957
  const replacement = replaceTopLevelStringSetting(content, "model_reasoning_effort", effort, { insertIfMissing: false });
95782
95958
  if (!replacement.replaced)
95783
95959
  return;
95784
- await writeFile6(input.linkPath, replacement.content);
95960
+ await writeFile7(input.linkPath, replacement.content);
95785
95961
  }
95786
95962
  async function restorePreservedServiceTier(input) {
95787
95963
  if (!input.preserved)
@@ -95792,7 +95968,18 @@ async function restorePreservedServiceTier(input) {
95792
95968
  const replacement = replaceTopLevelStringSetting(content, "service_tier", input.value, { insertIfMissing: true });
95793
95969
  if (!replacement.replaced)
95794
95970
  return;
95795
- await writeFile6(input.linkPath, replacement.content);
95971
+ await writeFile7(input.linkPath, replacement.content);
95972
+ }
95973
+ async function restorePreservedModel(input) {
95974
+ if (input.value === null)
95975
+ return;
95976
+ const content = await readFile13(input.linkPath, "utf8");
95977
+ if (extractModel(content) === input.value)
95978
+ return;
95979
+ const replacement = replaceTopLevelStringSetting(content, "model", input.value, { insertIfMissing: true });
95980
+ if (!replacement.replaced)
95981
+ return;
95982
+ await writeFile7(input.linkPath, replacement.content);
95796
95983
  }
95797
95984
  async function readTextIfExists(path) {
95798
95985
  try {
@@ -95890,9 +96077,86 @@ function nodeErrorCode(error) {
95890
96077
  return typeof error.code === "string" ? error.code : null;
95891
96078
  }
95892
96079
 
96080
+ // packages/omo-codex/src/install/agent-model-overrides.ts
96081
+ var RECEIPT_FILE = ".lazycodex-agent-models.json";
96082
+ async function readAgentModelReceipts(codexHome) {
96083
+ const content = await readTextIfExists(receiptPath(codexHome));
96084
+ if (content === null)
96085
+ return new Map;
96086
+ const parsed = parseJson(content);
96087
+ if (!isPlainRecord4(parsed))
96088
+ return new Map;
96089
+ const receipts = new Map;
96090
+ for (const [name, value] of Object.entries(parsed)) {
96091
+ if (!isPlainRecord4(value))
96092
+ continue;
96093
+ const model = value["model"];
96094
+ const reasoningEffort = value["reasoningEffort"];
96095
+ receipts.set(name, {
96096
+ ...typeof model === "string" ? { model } : {},
96097
+ ...typeof reasoningEffort === "string" ? { reasoningEffort } : {}
96098
+ });
96099
+ }
96100
+ return receipts;
96101
+ }
96102
+ async function writeAgentModelReceipts(codexHome, receipts) {
96103
+ const path = receiptPath(codexHome);
96104
+ if (receipts.size === 0) {
96105
+ await rm8(path, { force: true });
96106
+ return;
96107
+ }
96108
+ await writeFile8(path, `${JSON.stringify(Object.fromEntries(receipts), null, "\t")}
96109
+ `);
96110
+ }
96111
+ async function applyAgentOverride(input) {
96112
+ if (input.override === undefined)
96113
+ return;
96114
+ let content = await readFile14(input.linkPath, "utf8");
96115
+ if (input.override.model !== undefined) {
96116
+ content = replaceTopLevelStringSetting(content, "model", input.override.model, { insertIfMissing: true }).content;
96117
+ }
96118
+ if (input.override.reasoningEffort !== undefined) {
96119
+ content = replaceTopLevelStringSetting(content, "model_reasoning_effort", input.override.reasoningEffort, {
96120
+ insertIfMissing: true
96121
+ }).content;
96122
+ }
96123
+ await writeFile8(input.linkPath, content);
96124
+ }
96125
+ function receiptPath(codexHome) {
96126
+ return join41(codexHome, "agents", RECEIPT_FILE);
96127
+ }
96128
+ function parseJson(content) {
96129
+ try {
96130
+ return JSON.parse(content);
96131
+ } catch (error) {
96132
+ if (error instanceof SyntaxError)
96133
+ return null;
96134
+ throw error;
96135
+ }
96136
+ }
96137
+
96138
+ // packages/omo-codex/src/install/managed-agent-model-defaults.ts
96139
+ var PREVIOUSLY_BUNDLED_AGENT_MODELS = new Set([
96140
+ "gpt-5.2",
96141
+ "gpt-5.4-mini",
96142
+ "gpt-5.5",
96143
+ "gpt-5.6-luna",
96144
+ "gpt-5.6-luna-fast",
96145
+ "gpt-5.6-sol",
96146
+ "gpt-5.6-terra",
96147
+ "gpt-6-astra"
96148
+ ]);
96149
+ function handEditedAgentModel(installedModel, receipt) {
96150
+ if (installedModel === null)
96151
+ return null;
96152
+ if (receipt?.model !== undefined)
96153
+ return installedModel === receipt.model ? null : installedModel;
96154
+ return PREVIOUSLY_BUNDLED_AGENT_MODELS.has(installedModel) ? null : installedModel;
96155
+ }
96156
+
95893
96157
  // packages/omo-codex/src/install/retired-managed-agent-purge.ts
95894
- import { lstat as lstat8, readFile as readFile14, rm as rm7 } from "node:fs/promises";
95895
- import { join as join40 } from "node:path";
96158
+ import { lstat as lstat8, readFile as readFile15, rm as rm9 } from "node:fs/promises";
96159
+ import { join as join42 } from "node:path";
95896
96160
  var RETIRED_MANAGED_AGENT_FILES = [
95897
96161
  {
95898
96162
  fileName: "codex-ultrawork-reviewer.toml",
@@ -95904,11 +96168,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
95904
96168
  }
95905
96169
  ];
95906
96170
  async function purgeRetiredManagedAgentFiles(input) {
95907
- const agentsDir = join40(input.codexHome, "agents");
96171
+ const agentsDir = join42(input.codexHome, "agents");
95908
96172
  if (!await exists3(agentsDir))
95909
96173
  return;
95910
96174
  for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
95911
- const agentPath = join40(agentsDir, retiredAgent.fileName);
96175
+ const agentPath = join42(agentsDir, retiredAgent.fileName);
95912
96176
  if (!await exists3(agentPath))
95913
96177
  continue;
95914
96178
  const agentStat = await lstat8(agentPath);
@@ -95917,7 +96181,7 @@ async function purgeRetiredManagedAgentFiles(input) {
95917
96181
  const content = await readTextIfExists2(agentPath);
95918
96182
  if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
95919
96183
  continue;
95920
- await rm7(agentPath, { force: true });
96184
+ await rm9(agentPath, { force: true });
95921
96185
  }
95922
96186
  }
95923
96187
  function hasRequiredMarkers(content, markers) {
@@ -95925,7 +96189,7 @@ function hasRequiredMarkers(content, markers) {
95925
96189
  }
95926
96190
  async function readTextIfExists2(path) {
95927
96191
  try {
95928
- return await readFile14(path, "utf8");
96192
+ return await readFile15(path, "utf8");
95929
96193
  } catch (error) {
95930
96194
  if (nodeErrorCode2(error) === "ENOENT")
95931
96195
  return null;
@@ -95950,13 +96214,13 @@ function nodeErrorCode2(error) {
95950
96214
 
95951
96215
  // packages/omo-codex/src/install/default-agent-role.ts
95952
96216
  import { createHash as createHash3 } from "node:crypto";
95953
- import { lstat as lstat9, readFile as readFile15, rm as rm8 } from "node:fs/promises";
95954
- import { join as join41 } from "node:path";
96217
+ import { lstat as lstat9, readFile as readFile16, rm as rm10 } from "node:fs/promises";
96218
+ import { join as join43 } from "node:path";
95955
96219
  var REGISTRATION = { name: "default", configFile: "./agents/default.toml" };
95956
96220
  async function installDefaultAgentRole(input) {
95957
- const target = join41(input.codexHome, "agents", "default.toml");
95958
- const receipt = join41(input.codexHome, "agents", ".lazycodex-default.sha256");
95959
- const configPath = join41(input.codexHome, "config.toml");
96221
+ const target = join43(input.codexHome, "agents", "default.toml");
96222
+ const receipt = join43(input.codexHome, "agents", ".lazycodex-default.sha256");
96223
+ const configPath = join43(input.codexHome, "config.toml");
95960
96224
  const config = await readIfPresent(configPath);
95961
96225
  const entry = await lstat9(target).catch((error) => {
95962
96226
  if (error instanceof Error && "code" in error && error.code === "ENOENT")
@@ -95979,15 +96243,15 @@ async function installDefaultAgentRole(input) {
95979
96243
  if (next !== config)
95980
96244
  await writeFileAtomic(configPath, next);
95981
96245
  }
95982
- await rm8(target);
95983
- await rm8(receipt);
96246
+ await rm10(target);
96247
+ await rm10(receipt);
95984
96248
  }
95985
96249
  return null;
95986
96250
  }
95987
96251
  if (foreign || existing !== null && !owned) {
95988
96252
  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.");
95989
96253
  }
95990
- const worker = await readFile15(input.worker.path, "utf8");
96254
+ const worker = await readFile16(input.worker.path, "utf8");
95991
96255
  const content = worker.replace(/^name\s*=\s*["']lazycodex-worker-medium["']\s*$/m, 'name = "default"');
95992
96256
  if (content === worker)
95993
96257
  throw new Error("Cannot derive default: medium worker has no matching internal name");
@@ -95997,7 +96261,7 @@ async function installDefaultAgentRole(input) {
95997
96261
  }
95998
96262
  async function readIfPresent(path) {
95999
96263
  try {
96000
- return await readFile15(path, "utf8");
96264
+ return await readFile16(path, "utf8");
96001
96265
  } catch (error) {
96002
96266
  if (error instanceof Error && "code" in error && error.code === "ENOENT")
96003
96267
  return null;
@@ -96017,27 +96281,19 @@ async function linkCachedPluginAgents(input) {
96017
96281
  await writeManifest(input.pluginRoot, []);
96018
96282
  return [];
96019
96283
  }
96020
- const agentsDir = join42(input.codexHome, "agents");
96021
- await mkdir6(agentsDir, { recursive: true });
96284
+ const agentsDir = join44(input.codexHome, "agents");
96285
+ await mkdir7(agentsDir, { recursive: true });
96286
+ const previousReceipts = await readAgentModelReceipts(input.codexHome);
96287
+ const receipts = new Map;
96022
96288
  const linked = [];
96023
96289
  for (const agentPath of bundledAgents) {
96024
96290
  const agentFileName = basename7(agentPath);
96025
96291
  const agentName = agentNameFromToml2(agentFileName);
96026
- const linkPath = join42(agentsDir, agentFileName);
96027
- await replaceWithCopy(linkPath, agentPath);
96028
- await restorePreservedReasoning({
96029
- agentName,
96030
- linkPath,
96031
- target: agentPath,
96032
- value: input.preservedReasoning?.get(agentName)
96033
- });
96034
- await restorePreservedServiceTier({
96035
- linkPath,
96036
- preserved: input.preservedServiceTier?.has(agentName) ?? false,
96037
- value: input.preservedServiceTier?.get(agentName) ?? null
96038
- });
96292
+ const linkPath = join44(agentsDir, agentFileName);
96293
+ receipts.set(agentName, await syncAgentFile({ ...input, agentName, agentPath, linkPath, previousReceipt: previousReceipts.get(agentName) }));
96039
96294
  linked.push({ name: agentFileName, path: linkPath, target: agentPath });
96040
96295
  }
96296
+ await writeAgentModelReceipts(input.codexHome, receipts);
96041
96297
  const worker = linked.find((entry) => entry.name === "lazycodex-worker-medium.toml");
96042
96298
  if (worker !== undefined) {
96043
96299
  const fallback = await installDefaultAgentRole({ codexHome: input.codexHome, worker, enabled: input.defaultRoleEnabled !== false });
@@ -96047,8 +96303,33 @@ async function linkCachedPluginAgents(input) {
96047
96303
  await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
96048
96304
  return linked;
96049
96305
  }
96306
+ async function syncAgentFile(input) {
96307
+ const installed = await readTextIfExists(input.linkPath);
96308
+ const installedModel = installed === null ? null : extractModel(installed);
96309
+ const preservedReasoning = input.preservedReasoning?.get(input.agentName);
96310
+ const override = input.agentOverrides?.get(input.agentName);
96311
+ await replaceWithCopy(input.linkPath, input.agentPath);
96312
+ await restorePreservedModel({ linkPath: input.linkPath, value: handEditedAgentModel(installedModel, input.previousReceipt) });
96313
+ await restorePreservedReasoning({
96314
+ agentName: input.agentName,
96315
+ linkPath: input.linkPath,
96316
+ target: input.agentPath,
96317
+ value: preservedReasoning?.effort === input.previousReceipt?.reasoningEffort ? undefined : preservedReasoning
96318
+ });
96319
+ await restorePreservedServiceTier({
96320
+ linkPath: input.linkPath,
96321
+ preserved: input.preservedServiceTier?.has(input.agentName) ?? false,
96322
+ value: input.preservedServiceTier?.get(input.agentName) ?? null
96323
+ });
96324
+ await applyAgentOverride({ linkPath: input.linkPath, override });
96325
+ const model = override?.model ?? extractModel(await readFile17(input.agentPath, "utf8"));
96326
+ return {
96327
+ ...model === null ? {} : { model },
96328
+ ...override?.reasoningEffort === undefined ? {} : { reasoningEffort: override.reasoningEffort }
96329
+ };
96330
+ }
96050
96331
  async function discoverBundledAgents(pluginRoot) {
96051
- const componentsRoot = join42(pluginRoot, "components");
96332
+ const componentsRoot = join44(pluginRoot, "components");
96052
96333
  if (!await exists4(componentsRoot))
96053
96334
  return [];
96054
96335
  const componentEntries = await readdir7(componentsRoot, { withFileTypes: true });
@@ -96056,14 +96337,14 @@ async function discoverBundledAgents(pluginRoot) {
96056
96337
  for (const entry of componentEntries) {
96057
96338
  if (!entry.isDirectory())
96058
96339
  continue;
96059
- const agentsRoot = join42(componentsRoot, entry.name, "agents");
96340
+ const agentsRoot = join44(componentsRoot, entry.name, "agents");
96060
96341
  if (!await exists4(agentsRoot))
96061
96342
  continue;
96062
96343
  const agentEntries = await readdir7(agentsRoot, { withFileTypes: true });
96063
96344
  for (const file of agentEntries) {
96064
96345
  if (!file.isFile() || !file.name.endsWith(".toml"))
96065
96346
  continue;
96066
- agents.push(join42(agentsRoot, file.name));
96347
+ agents.push(join44(agentsRoot, file.name));
96067
96348
  }
96068
96349
  }
96069
96350
  agents.sort();
@@ -96080,12 +96361,12 @@ async function prepareReplacement(linkPath) {
96080
96361
  if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
96081
96362
  throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
96082
96363
  }
96083
- await rm9(linkPath, { force: true });
96364
+ await rm11(linkPath, { force: true });
96084
96365
  }
96085
96366
  async function writeManifest(pluginRoot, agentPaths) {
96086
- const manifestPath = join42(pluginRoot, MANIFEST_FILE);
96367
+ const manifestPath = join44(pluginRoot, MANIFEST_FILE);
96087
96368
  const payload = { agents: [...agentPaths].sort() };
96088
- await writeFile7(manifestPath, `${JSON.stringify(payload, null, "\t")}
96369
+ await writeFile9(manifestPath, `${JSON.stringify(payload, null, "\t")}
96089
96370
  `);
96090
96371
  }
96091
96372
  function agentNameFromToml2(fileName) {
@@ -96107,13 +96388,59 @@ function nodeErrorCode3(error) {
96107
96388
  return typeof error.code === "string" ? error.code : null;
96108
96389
  }
96109
96390
 
96391
+ // packages/omo-codex/src/install/install-codex-agents.ts
96392
+ async function linkInstalledPluginAgents(input) {
96393
+ const { codexHome, log } = input;
96394
+ const preservedReasoning = await capturePreservedAgentReasoning({ codexHome });
96395
+ const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome });
96396
+ const agentSourceRoots = await agentSourceRootsForInstall(input);
96397
+ const omoConfig = readCodexAgentConfig({ cwd: input.projectDirectory, env: input.env });
96398
+ for (const warning of omoConfig.warnings)
96399
+ log(`Warning: ${warning}`);
96400
+ const agentConfigs = new Map;
96401
+ for (const plugin of input.installed) {
96402
+ const agentLinks = await linkCachedPluginAgents({
96403
+ codexHome,
96404
+ pluginRoot: agentSourceRoots.get(plugin.name) ?? plugin.path,
96405
+ platform: input.platform,
96406
+ preservedReasoning,
96407
+ preservedServiceTier,
96408
+ defaultRoleEnabled: omoConfig.defaultRoleEnabled,
96409
+ agentOverrides: omoConfig.agentOverrides
96410
+ });
96411
+ for (const link of agentLinks) {
96412
+ log(`Linked agent ${link.name} -> ${link.target}`);
96413
+ const agentName = agentNameFromToml3(link.name);
96414
+ agentConfigs.set(agentName, { name: agentName, configFile: `./agents/${link.name}` });
96415
+ }
96416
+ }
96417
+ for (const warning of unmanagedAgentOverrideWarnings(omoConfig.agentOverrides, new Set(agentConfigs.keys()))) {
96418
+ log(`Warning: ${warning}`);
96419
+ }
96420
+ return [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name));
96421
+ }
96422
+ async function agentSourceRootsForInstall(input) {
96423
+ if (input.marketplace.name !== "sisyphuslabs") {
96424
+ return new Map(input.installed.map((plugin) => [plugin.name, plugin.path]));
96425
+ }
96426
+ const snapshotPlugins = await writeInstalledMarketplaceSnapshot({
96427
+ codexHome: input.codexHome,
96428
+ marketplace: input.marketplace,
96429
+ plugins: input.pluginSources
96430
+ });
96431
+ return new Map(snapshotPlugins.map((plugin) => [plugin.name, plugin.path]));
96432
+ }
96433
+ function agentNameFromToml3(fileName) {
96434
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
96435
+ }
96436
+
96110
96437
  // packages/omo-codex/src/install/codex-marketplace.ts
96111
- import { readFile as readFile16 } from "node:fs/promises";
96112
- import { join as join43 } from "node:path";
96438
+ import { readFile as readFile18 } from "node:fs/promises";
96439
+ import { join as join45 } from "node:path";
96113
96440
  var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
96114
96441
  async function readMarketplace(repoRoot, options) {
96115
- const marketplacePath = options?.marketplacePath ?? join43(repoRoot, DEFAULT_MARKETPLACE_PATH);
96116
- const raw = await readFile16(marketplacePath, "utf8");
96442
+ const marketplacePath = options?.marketplacePath ?? join45(repoRoot, DEFAULT_MARKETPLACE_PATH);
96443
+ const raw = await readFile18(marketplacePath, "utf8");
96117
96444
  const parsed = JSON.parse(raw);
96118
96445
  if (!isPlainRecord4(parsed))
96119
96446
  throw new Error("marketplace.json must be an object");
@@ -96131,10 +96458,10 @@ async function readMarketplace(repoRoot, options) {
96131
96458
  function resolvePluginSource(repoRoot, plugin, options) {
96132
96459
  const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
96133
96460
  const relativePath = sourcePath.slice(2);
96134
- return join43(repoRoot, ...relativePath.split(/[\\/]/));
96461
+ return join45(repoRoot, ...relativePath.split(/[\\/]/));
96135
96462
  }
96136
96463
  async function readPluginManifest(pluginRoot) {
96137
- const raw = await readFile16(join43(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
96464
+ const raw = await readFile18(join45(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
96138
96465
  const parsed = JSON.parse(raw);
96139
96466
  if (!isPlainRecord4(parsed))
96140
96467
  throw new Error(`${pluginRoot} plugin.json must be an object`);
@@ -96214,61 +96541,12 @@ function validateLocalSourcePath(path) {
96214
96541
  return path;
96215
96542
  }
96216
96543
 
96217
- // packages/omo-codex/src/install/codex-marketplace-snapshot.ts
96218
- import { cp as cp3, mkdir as mkdir7, rename as rename4, rm as rm10, writeFile as writeFile8 } from "node:fs/promises";
96219
- import { join as join44, sep as sep6 } from "node:path";
96220
- var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
96221
- async function writeInstalledMarketplaceSnapshot(input) {
96222
- const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
96223
- await mkdir7(marketplaceRoot, { recursive: true });
96224
- await writeMarketplaceManifest(marketplaceRoot, input.marketplace);
96225
- const snapshotPlugins = [];
96226
- for (const plugin of input.plugins) {
96227
- snapshotPlugins.push(await writeSnapshotPlugin(marketplaceRoot, plugin));
96228
- }
96229
- return snapshotPlugins;
96230
- }
96231
- function installedMarketplaceRoot(codexHome, marketplaceName) {
96232
- return join44(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
96233
- }
96234
- async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
96235
- const manifestDir = join44(marketplaceRoot, ".agents", "plugins");
96236
- await mkdir7(manifestDir, { recursive: true });
96237
- const tempPath = join44(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
96238
- await writeFile8(tempPath, `${JSON.stringify(marketplace, null, "\t")}
96239
- `);
96240
- await rename4(tempPath, join44(manifestDir, "marketplace.json"));
96241
- }
96242
- async function writeSnapshotPlugin(marketplaceRoot, plugin) {
96243
- const pluginsDir = join44(marketplaceRoot, "plugins");
96244
- await mkdir7(pluginsDir, { recursive: true });
96245
- const targetPath = join44(pluginsDir, plugin.name);
96246
- const tempPath = join44(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
96247
- await rm10(tempPath, { recursive: true, force: true });
96248
- await cp3(plugin.sourcePath, tempPath, {
96249
- recursive: true,
96250
- filter: (source) => shouldCopyMarketplaceSourcePath(source, plugin.sourcePath)
96251
- });
96252
- await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: plugin.sourcePath });
96253
- await rm10(targetPath, { recursive: true, force: true });
96254
- await rename4(tempPath, targetPath);
96255
- await rewriteCachedMcpManifest(targetPath, plugin.sourcePath);
96256
- return { name: plugin.name, path: targetPath };
96257
- }
96258
- function shouldCopyMarketplaceSourcePath(path, root) {
96259
- const relative = path === root ? "" : path.slice(root.length + sep6.length);
96260
- if (relative === "")
96261
- return true;
96262
- const parts = relative.split(sep6);
96263
- return !parts.some((part) => part === ".git" || part === "node_modules");
96264
- }
96265
-
96266
96544
  // packages/omo-codex/src/install/lazycodex-version-stamp.ts
96267
- import { readdir as readdir8, readFile as readFile17, writeFile as writeFile9 } from "node:fs/promises";
96268
- import { join as join45 } from "node:path";
96545
+ import { readdir as readdir8, readFile as readFile19, writeFile as writeFile10 } from "node:fs/promises";
96546
+ import { join as join46 } from "node:path";
96269
96547
  async function readDistributionManifest(repoRoot) {
96270
96548
  try {
96271
- const parsed = JSON.parse(await readFile17(join45(repoRoot, "package.json"), "utf8"));
96549
+ const parsed = JSON.parse(await readFile19(join46(repoRoot, "package.json"), "utf8"));
96272
96550
  if (!isPlainRecord4(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
96273
96551
  return;
96274
96552
  return {
@@ -96292,19 +96570,19 @@ function resolveLazyCodexPluginVersion(input) {
96292
96570
  return input.manifestVersion ?? "local";
96293
96571
  }
96294
96572
  async function stampLazyCodexPluginVersion(input) {
96295
- const manifestPath = join45(input.pluginRoot, ".codex-plugin", "plugin.json");
96573
+ const manifestPath = join46(input.pluginRoot, ".codex-plugin", "plugin.json");
96296
96574
  const hookPaths = await readPluginHookPaths(manifestPath);
96297
96575
  await stampJsonVersion(manifestPath, input.version);
96298
- await stampJsonVersion(join45(input.pluginRoot, "package.json"), input.version);
96576
+ await stampJsonVersion(join46(input.pluginRoot, "package.json"), input.version);
96299
96577
  for (const hookPath of hookPaths) {
96300
- await stampHookStatusMessages(join45(input.pluginRoot, hookPath), input.version);
96578
+ await stampHookStatusMessages(join46(input.pluginRoot, hookPath), input.version);
96301
96579
  }
96302
96580
  await stampComponentVersions(input);
96303
96581
  }
96304
96582
  async function writeLazyCodexInstallSnapshot(input) {
96305
96583
  if (input.distributionManifest === undefined)
96306
96584
  return;
96307
- await writeFile9(join45(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
96585
+ await writeFile10(join46(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
96308
96586
  packageName: input.distributionManifest.name,
96309
96587
  version: input.distributionManifest.version
96310
96588
  }, null, "\t")}
@@ -96312,11 +96590,11 @@ async function writeLazyCodexInstallSnapshot(input) {
96312
96590
  }
96313
96591
  async function stampJsonVersion(path, version) {
96314
96592
  try {
96315
- const parsed = JSON.parse(await readFile17(path, "utf8"));
96593
+ const parsed = JSON.parse(await readFile19(path, "utf8"));
96316
96594
  if (!isPlainRecord4(parsed))
96317
96595
  return;
96318
96596
  parsed.version = version;
96319
- await writeFile9(path, `${JSON.stringify(parsed, null, "\t")}
96597
+ await writeFile10(path, `${JSON.stringify(parsed, null, "\t")}
96320
96598
  `);
96321
96599
  } catch (error) {
96322
96600
  if (error instanceof Error)
@@ -96326,7 +96604,7 @@ async function stampJsonVersion(path, version) {
96326
96604
  }
96327
96605
  async function readPluginHookPaths(manifestPath) {
96328
96606
  try {
96329
- const parsed = JSON.parse(await readFile17(manifestPath, "utf8"));
96607
+ const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
96330
96608
  if (!isPlainRecord4(parsed))
96331
96609
  return [];
96332
96610
  if (typeof parsed.hooks === "string" && parsed.hooks.trim().length > 0)
@@ -96346,11 +96624,11 @@ function stripDotSlash3(path) {
96346
96624
  }
96347
96625
  async function stampHookStatusMessages(path, version) {
96348
96626
  try {
96349
- const parsed = JSON.parse(await readFile17(path, "utf8"));
96627
+ const parsed = JSON.parse(await readFile19(path, "utf8"));
96350
96628
  if (!isPlainRecord4(parsed))
96351
96629
  return;
96352
96630
  stampHookGroups(parsed.hooks, version);
96353
- await writeFile9(path, `${JSON.stringify(parsed, null, "\t")}
96631
+ await writeFile10(path, `${JSON.stringify(parsed, null, "\t")}
96354
96632
  `);
96355
96633
  } catch (error) {
96356
96634
  if (error instanceof Error)
@@ -96361,16 +96639,16 @@ async function stampHookStatusMessages(path, version) {
96361
96639
  async function stampComponentVersions(input) {
96362
96640
  let entries;
96363
96641
  try {
96364
- entries = await readdir8(join45(input.pluginRoot, "components"));
96642
+ entries = await readdir8(join46(input.pluginRoot, "components"));
96365
96643
  } catch (error) {
96366
96644
  if (error instanceof Error)
96367
96645
  return;
96368
96646
  throw error;
96369
96647
  }
96370
96648
  for (const entry of entries) {
96371
- const componentRoot = join45(input.pluginRoot, "components", entry);
96372
- await stampJsonVersion(join45(componentRoot, "package.json"), input.version);
96373
- await stampHookStatusMessages(join45(componentRoot, "hooks", "hooks.json"), input.version);
96649
+ const componentRoot = join46(input.pluginRoot, "components", entry);
96650
+ await stampJsonVersion(join46(componentRoot, "package.json"), input.version);
96651
+ await stampHookStatusMessages(join46(componentRoot, "hooks", "hooks.json"), input.version);
96374
96652
  }
96375
96653
  }
96376
96654
  function stampHookGroups(hooks, version) {
@@ -96427,8 +96705,8 @@ var defaultRunCommand = async (command, args, options) => {
96427
96705
  };
96428
96706
 
96429
96707
  // packages/omo-codex/src/install/codex-project-local-cleanup.ts
96430
- import { copyFile as copyFile2, lstat as lstat11, readFile as readFile18, writeFile as writeFile10 } from "node:fs/promises";
96431
- import { dirname as dirname17, join as join46, resolve as resolve11 } from "node:path";
96708
+ import { copyFile as copyFile2, lstat as lstat11, readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
96709
+ import { dirname as dirname17, join as join47, resolve as resolve11 } from "node:path";
96432
96710
  var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
96433
96711
  var PROJECT_LOCAL_ARTIFACT_PATHS = [
96434
96712
  ".codex/hooks.json",
@@ -96447,7 +96725,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
96447
96725
  const artifacts = await collectProjectLocalArtifacts(project.artifactRoots);
96448
96726
  const configs = [];
96449
96727
  for (const configPath of project.configPaths) {
96450
- const original = await readFile18(configPath, "utf8");
96728
+ const original = await readFile20(configPath, "utf8");
96451
96729
  const repair = repairProjectLocalCodexConfigText(original);
96452
96730
  if (!repair.changed) {
96453
96731
  configs.push({
@@ -96460,7 +96738,7 @@ async function repairNearestProjectLocalCodexArtifacts(input) {
96460
96738
  }
96461
96739
  const backupPath = `${configPath}.backup-${formatBackupTimestamp(input.now?.() ?? new Date)}`;
96462
96740
  await copyFile2(configPath, backupPath);
96463
- await writeFile10(configPath, `${repair.config.trimEnd()}
96741
+ await writeFile11(configPath, `${repair.config.trimEnd()}
96464
96742
  `);
96465
96743
  configs.push({
96466
96744
  projectRoot: project.projectRoot,
@@ -96531,17 +96809,17 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
96531
96809
  if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
96532
96810
  throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
96533
96811
  }
96534
- const codexHomeConfigPath = codexHome === undefined ? null : join46(resolve11(codexHome), "config.toml");
96812
+ const codexHomeConfigPath = codexHome === undefined ? null : join47(resolve11(codexHome), "config.toml");
96535
96813
  let current = resolve11(startDirectory);
96536
96814
  const configPathsFromCwd = [];
96537
96815
  while (true) {
96538
- const configPath = join46(current, ".codex", "config.toml");
96816
+ const configPath = join47(current, ".codex", "config.toml");
96539
96817
  if (await isRegularProjectLocalConfig(current, configPath)) {
96540
96818
  if (codexHomeConfigPath === null || resolve11(configPath) !== codexHomeConfigPath) {
96541
96819
  configPathsFromCwd.push(configPath);
96542
96820
  }
96543
96821
  }
96544
- if (await exists5(join46(current, ".git"))) {
96822
+ if (await exists5(join47(current, ".git"))) {
96545
96823
  return configPathsFromCwd.length === 0 ? null : {
96546
96824
  projectRoot: current,
96547
96825
  configPaths: [...configPathsFromCwd].reverse(),
@@ -96561,7 +96839,7 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
96561
96839
  }
96562
96840
  }
96563
96841
  async function isRegularProjectLocalConfig(directory, configPath) {
96564
- const codexDirStat = await maybeLstat(join46(directory, ".codex"));
96842
+ const codexDirStat = await maybeLstat(join47(directory, ".codex"));
96565
96843
  if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
96566
96844
  return false;
96567
96845
  const configStat = await maybeLstat(configPath);
@@ -96581,7 +96859,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
96581
96859
  const seenPaths = new Set;
96582
96860
  for (const projectRoot of projectRoots) {
96583
96861
  for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
96584
- const artifactPath = join46(projectRoot, relativePath);
96862
+ const artifactPath = join47(projectRoot, relativePath);
96585
96863
  if (seenPaths.has(artifactPath))
96586
96864
  continue;
96587
96865
  const entryStat = await maybeLstat(artifactPath);
@@ -96657,13 +96935,13 @@ function formatUnknownError(error) {
96657
96935
 
96658
96936
  // packages/omo-codex/src/install/lsp-daemon-reaper.ts
96659
96937
  import { createHash as createHash4 } from "node:crypto";
96660
- import { lstat as lstat12, readFile as readFile20, readdir as readdir10, rm as rm11 } from "node:fs/promises";
96938
+ import { lstat as lstat12, readFile as readFile22, readdir as readdir10, rm as rm12 } from "node:fs/promises";
96661
96939
  import { tmpdir as tmpdir3 } from "node:os";
96662
- import { join as join47, posix as posix6 } from "node:path";
96940
+ import { join as join48, posix as posix6 } from "node:path";
96663
96941
 
96664
96942
  // packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
96665
96943
  import { execFile } from "node:child_process";
96666
- import { readFile as readFile19, readdir as readdir9, readlink as readlink5 } from "node:fs/promises";
96944
+ import { readFile as readFile21, readdir as readdir9, readlink as readlink5 } from "node:fs/promises";
96667
96945
  import { connect } from "node:net";
96668
96946
  import { basename as basename8 } from "node:path";
96669
96947
  var PROBE_TIMEOUT_MS = 500;
@@ -96705,7 +96983,7 @@ async function attestLegacyDaemonOwnership(input, deps = {}) {
96705
96983
  return false;
96706
96984
  }
96707
96985
  async function attestLinuxOwnership(input, deps) {
96708
- const readFileImpl = deps.readFile ?? readFile19;
96986
+ const readFileImpl = deps.readFile ?? readFile21;
96709
96987
  const readDirImpl = deps.readDir ?? readdir9;
96710
96988
  const readLinkImpl = deps.readLink ?? readlink5;
96711
96989
  const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
@@ -96832,7 +97110,7 @@ async function readBinary(readFileImpl, path) {
96832
97110
  var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
96833
97111
  var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
96834
97112
  async function reapLspDaemons(codexHome, deps = {}) {
96835
- const daemonRoot = join47(codexHome, "codex-lsp", "daemon");
97113
+ const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
96836
97114
  const platform = deps.platform ?? process.platform;
96837
97115
  const tmpDir = deps.tmpDir ?? tmpdir3();
96838
97116
  const probe = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
@@ -96842,7 +97120,7 @@ async function reapLspDaemons(codexHome, deps = {}) {
96842
97120
  const entries = await readdir10(daemonRoot, { withFileTypes: true }).catch(() => []);
96843
97121
  const results = [];
96844
97122
  for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
96845
- const versionPath = join47(daemonRoot, entry.name);
97123
+ const versionPath = join48(daemonRoot, entry.name);
96846
97124
  const parsedVersion = parseVersionEntry(entry.name);
96847
97125
  if (parsedVersion === null || !entry.isDirectory()) {
96848
97126
  await removeVersionDir(versionPath);
@@ -96890,7 +97168,7 @@ function parseVersionEntry(entryName) {
96890
97168
  return LEGACY_VERSION_PATTERN.test(version) ? version : null;
96891
97169
  }
96892
97170
  async function readLegacyMetadata(input) {
96893
- const pidText = await readRegularTrimmedFile(join47(input.versionPath, "daemon.pid"));
97171
+ const pidText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.pid"));
96894
97172
  if (pidText === "non_regular")
96895
97173
  return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
96896
97174
  if (pidText === null)
@@ -96898,7 +97176,7 @@ async function readLegacyMetadata(input) {
96898
97176
  const pid = Number.parseInt(pidText, 10);
96899
97177
  if (!Number.isInteger(pid) || pid <= 0)
96900
97178
  return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
96901
- const endpointText = await readRegularTrimmedFile(join47(input.versionPath, "daemon.endpoint"));
97179
+ const endpointText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.endpoint"));
96902
97180
  if (endpointText === "non_regular")
96903
97181
  return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
96904
97182
  if (endpointText === null)
@@ -96930,14 +97208,14 @@ async function readRegularTrimmedFile(path) {
96930
97208
  return null;
96931
97209
  if (!stats.isFile())
96932
97210
  return "non_regular";
96933
- const content = (await readFile20(path, "utf8")).trim();
97211
+ const content = (await readFile22(path, "utf8")).trim();
96934
97212
  return content.length > 0 ? content : null;
96935
97213
  }
96936
97214
  function shortDigest(value) {
96937
97215
  return createHash4("sha256").update(value).digest("hex").slice(0, 16);
96938
97216
  }
96939
97217
  async function removeVersionDir(path) {
96940
- await rm11(path, { recursive: true, force: true });
97218
+ await rm12(path, { recursive: true, force: true });
96941
97219
  }
96942
97220
  function removed(version, reason) {
96943
97221
  return { version, status: "removed", reason };
@@ -96977,7 +97255,7 @@ function processIsRunning(pid) {
96977
97255
 
96978
97256
  // packages/omo-codex/src/install/codex-installer-bin-dir.ts
96979
97257
  import { homedir as homedir5 } from "node:os";
96980
- import { join as join48, resolve as resolve12 } from "node:path";
97258
+ import { join as join49, resolve as resolve12 } from "node:path";
96981
97259
  function resolveCodexInstallerBinDir(input) {
96982
97260
  const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
96983
97261
  if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
@@ -96986,16 +97264,16 @@ function resolveCodexInstallerBinDir(input) {
96986
97264
  const defaultCodexHome = resolve12(homeDir, ".codex");
96987
97265
  const resolvedCodexHome = resolve12(input.codexHome);
96988
97266
  if (resolvedCodexHome !== defaultCodexHome)
96989
- return join48(resolvedCodexHome, "bin");
97267
+ return join49(resolvedCodexHome, "bin");
96990
97268
  return resolve12(homeDir, ".local", "bin");
96991
97269
  }
96992
97270
 
96993
97271
  // packages/omo-codex/src/install/codex-installed-bin-dir.ts
96994
- import { readFile as readFile21, readdir as readdir11, writeFile as writeFile11 } from "node:fs/promises";
96995
- import { join as join49 } from "node:path";
97272
+ import { readFile as readFile23, readdir as readdir11, writeFile as writeFile12 } from "node:fs/promises";
97273
+ import { join as join50 } from "node:path";
96996
97274
  var INSTALLED_BIN_DIR_MANIFEST = ".installed-bin-dir.json";
96997
97275
  async function writeInstalledCodexBinDir(input) {
96998
- await writeFile11(join49(input.pluginRoot, INSTALLED_BIN_DIR_MANIFEST), `${JSON.stringify({ binDir: input.binDir }, null, 2)}
97276
+ await writeFile12(join50(input.pluginRoot, INSTALLED_BIN_DIR_MANIFEST), `${JSON.stringify({ binDir: input.binDir }, null, 2)}
96999
97277
  `);
97000
97278
  }
97001
97279
  async function readInstalledCodexBinDir(codexHome) {
@@ -97008,20 +97286,20 @@ async function readInstalledCodexBinDir(codexHome) {
97008
97286
  }
97009
97287
  async function installedBinDirManifestPaths(codexHome) {
97010
97288
  const paths = [
97011
- join49(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_BIN_DIR_MANIFEST)
97289
+ join50(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_BIN_DIR_MANIFEST)
97012
97290
  ];
97013
- const versionRoot = join49(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
97291
+ const versionRoot = join50(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
97014
97292
  const entries = await readdir11(versionRoot, { withFileTypes: true }).catch(() => null);
97015
97293
  if (entries !== null) {
97016
97294
  for (const entry of entries) {
97017
97295
  if (entry.isDirectory())
97018
- paths.push(join49(versionRoot, entry.name, INSTALLED_BIN_DIR_MANIFEST));
97296
+ paths.push(join50(versionRoot, entry.name, INSTALLED_BIN_DIR_MANIFEST));
97019
97297
  }
97020
97298
  }
97021
97299
  return paths;
97022
97300
  }
97023
97301
  async function readBinDirFromManifest(manifestPath) {
97024
- const raw = await readFile21(manifestPath, "utf8").catch(() => null);
97302
+ const raw = await readFile23(manifestPath, "utf8").catch(() => null);
97025
97303
  if (raw === null)
97026
97304
  return null;
97027
97305
  let parsed;
@@ -97039,8 +97317,8 @@ async function readBinDirFromManifest(manifestPath) {
97039
97317
  }
97040
97318
 
97041
97319
  // packages/omo-codex/src/install/codex-git-bash-hooks.ts
97042
- import { readFile as readFile22, writeFile as writeFile12 } from "node:fs/promises";
97043
- import { join as join50 } from "node:path";
97320
+ import { readFile as readFile24, writeFile as writeFile13 } from "node:fs/promises";
97321
+ import { join as join51 } from "node:path";
97044
97322
  var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
97045
97323
  "./hooks/pre-tool-use-recommending-git-bash-mcp.json",
97046
97324
  "./hooks/post-compact-resetting-git-bash-mcp-reminder.json"
@@ -97048,20 +97326,20 @@ var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
97048
97326
  async function removeGitBashHooksOffWindows(input) {
97049
97327
  if (input.platform === "win32")
97050
97328
  return;
97051
- const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
97052
- const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
97329
+ const manifestPath = join51(input.pluginRoot, ".codex-plugin", "plugin.json");
97330
+ const parsed = JSON.parse(await readFile24(manifestPath, "utf8"));
97053
97331
  if (!isPlainRecord4(parsed) || !Array.isArray(parsed.hooks))
97054
97332
  return;
97055
97333
  const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
97056
97334
  if (hooks.length === parsed.hooks.length)
97057
97335
  return;
97058
- await writeFile12(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
97336
+ await writeFile13(manifestPath, `${JSON.stringify({ ...parsed, hooks }, null, "\t")}
97059
97337
  `);
97060
97338
  }
97061
97339
 
97062
97340
  // packages/omo-codex/src/install/install-ast-grep-sg.ts
97063
97341
  init_src();
97064
- import { join as join51 } from "node:path";
97342
+ import { join as join52 } from "node:path";
97065
97343
  function describeResult(result) {
97066
97344
  if (result.kind === "succeeded")
97067
97345
  return null;
@@ -97075,7 +97353,7 @@ async function installAstGrepForCodex(options) {
97075
97353
  return;
97076
97354
  const platform = options.platform ?? process.platform;
97077
97355
  const targetDir = astGrepRuntimeDir(options.codexHome, platform, options.arch ?? process.arch);
97078
- const skillDir = join51(plugin.path, "skills", "ast-grep");
97356
+ const skillDir = join52(plugin.path, "skills", "ast-grep");
97079
97357
  const installer = options.installer ?? runAstGrepSkillInstall;
97080
97358
  try {
97081
97359
  const result = await installer({ platform, skillDir, targetDir });
@@ -97108,7 +97386,7 @@ async function runCodexInstaller(options = {}) {
97108
97386
  const env = options.env ?? process.env;
97109
97387
  const platform = options.platform ?? process.platform;
97110
97388
  const repoRoot = resolve13(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env }));
97111
- const codexHome = resolve13(options.codexHome ?? env.CODEX_HOME ?? join55(homedir6(), ".codex"));
97389
+ const codexHome = resolve13(options.codexHome ?? env.CODEX_HOME ?? join56(homedir6(), ".codex"));
97112
97390
  const projectDirectory = resolve13(options.projectDirectory ?? env.OMO_CODEX_PROJECT ?? process.cwd());
97113
97391
  const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env });
97114
97392
  const runCommand = options.runCommand ?? defaultRunCommand;
@@ -97125,14 +97403,13 @@ async function runCodexInstaller(options = {}) {
97125
97403
  if (!gitBashResolution.found) {
97126
97404
  throw new Error(gitBashResolution.installHint);
97127
97405
  }
97128
- const codexPackageRoot = join55(repoRoot, "packages", "omo-codex");
97406
+ const codexPackageRoot = join56(repoRoot, "packages", "omo-codex");
97129
97407
  const marketplace = await readMarketplace(repoRoot, {
97130
- marketplacePath: join55(codexPackageRoot, "marketplace.json")
97408
+ marketplacePath: join56(codexPackageRoot, "marketplace.json")
97131
97409
  });
97132
97410
  const distributionManifest = await readDistributionManifest(repoRoot);
97133
97411
  const installed = [];
97134
97412
  const pluginSources = [];
97135
- const agentConfigs = new Map;
97136
97413
  for (const entry of marketplace.plugins) {
97137
97414
  const sourcePath = resolvePluginSource(codexPackageRoot, entry, { pathOverride: "./plugin" });
97138
97415
  const manifest = await readPluginManifest(sourcePath);
@@ -97173,7 +97450,7 @@ async function runCodexInstaller(options = {}) {
97173
97450
  if (runtimeLink !== null)
97174
97451
  log(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
97175
97452
  else
97176
- 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`);
97453
+ 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`);
97177
97454
  }
97178
97455
  pluginSources.push({ name: entry.name, sourcePath });
97179
97456
  installed.push(plugin);
@@ -97185,33 +97462,16 @@ async function runCodexInstaller(options = {}) {
97185
97462
  log,
97186
97463
  platform
97187
97464
  });
97188
- const preservedReasoning = await capturePreservedAgentReasoning({ codexHome });
97189
- const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome });
97190
- const agentSourceRoots = await agentSourceRootsForInstall({
97465
+ const agentConfigs = await linkInstalledPluginAgents({
97191
97466
  codexHome,
97467
+ projectDirectory,
97468
+ env,
97469
+ platform,
97470
+ log,
97192
97471
  marketplace,
97193
97472
  installed,
97194
97473
  pluginSources
97195
97474
  });
97196
- const omoConfig = readDefaultRoleConfig({ cwd: projectDirectory, env });
97197
- for (const warning of omoConfig.warnings)
97198
- log(`Warning: ${warning}`);
97199
- for (const plugin of installed) {
97200
- const pluginRoot = agentSourceRoots.get(plugin.name) ?? plugin.path;
97201
- const agentLinks = await linkCachedPluginAgents({
97202
- codexHome,
97203
- pluginRoot,
97204
- platform,
97205
- preservedReasoning,
97206
- preservedServiceTier,
97207
- defaultRoleEnabled: omoConfig.enabled
97208
- });
97209
- for (const link of agentLinks) {
97210
- log(`Linked agent ${link.name} -> ${link.target}`);
97211
- const agentName = agentNameFromToml3(link.name);
97212
- agentConfigs.set(agentName, { name: agentName, configFile: `./agents/${link.name}` });
97213
- }
97214
- }
97215
97475
  const trustedHookStates = (await Promise.all(installed.map((plugin) => trustedHookStatesForPlugin({
97216
97476
  marketplaceName: marketplace.name,
97217
97477
  platform,
@@ -97240,13 +97500,13 @@ async function runCodexInstaller(options = {}) {
97240
97500
  continue;
97241
97501
  log(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
97242
97502
  }
97243
- const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
97503
+ const marketplaceRoot = join56(codexHome, "plugins", "cache", marketplace.name);
97244
97504
  await writeCachedMarketplaceManifest({
97245
97505
  marketplaceName: marketplace.name,
97246
97506
  marketplaceRoot,
97247
97507
  plugins: installed
97248
97508
  });
97249
- const configPath = join55(codexHome, "config.toml");
97509
+ const configPath = join56(codexHome, "config.toml");
97250
97510
  await updateCodexConfig({
97251
97511
  configPath,
97252
97512
  repoRoot: codexPackageRoot,
@@ -97256,7 +97516,7 @@ async function runCodexInstaller(options = {}) {
97256
97516
  platform,
97257
97517
  gitBashEnabled: platform === "win32" && gitBashResolution.found,
97258
97518
  trustedHookStates,
97259
- agentConfigs: [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name)),
97519
+ agentConfigs,
97260
97520
  autonomousPermissions: options.autonomousPermissions !== false,
97261
97521
  ...options.reasoning === undefined ? {} : { reasoning: options.reasoning }
97262
97522
  });
@@ -97283,20 +97543,6 @@ async function runCodexInstaller(options = {}) {
97283
97543
  projectCleanup
97284
97544
  };
97285
97545
  }
97286
- function agentNameFromToml3(fileName) {
97287
- return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
97288
- }
97289
- async function agentSourceRootsForInstall(input) {
97290
- if (input.marketplace.name !== "sisyphuslabs") {
97291
- return new Map(input.installed.map((plugin) => [plugin.name, plugin.path]));
97292
- }
97293
- const snapshotPlugins = await writeInstalledMarketplaceSnapshot({
97294
- codexHome: input.codexHome,
97295
- marketplace: input.marketplace,
97296
- plugins: input.pluginSources
97297
- });
97298
- return new Map(snapshotPlugins.map((plugin) => [plugin.name, plugin.path]));
97299
- }
97300
97546
  function legacyCacheMarketplaces(marketplaceName) {
97301
97547
  return marketplaceName === "sisyphuslabs" ? SISYPHUS_LEGACY_CACHE_MARKETPLACES : [];
97302
97548
  }
@@ -97305,7 +97551,7 @@ function findRepoRootFromImporter(importerDir) {
97305
97551
  for (let depth = 0;depth <= 7; depth += 1) {
97306
97552
  if (isRepoRootWithCodexPlugin(current))
97307
97553
  return current;
97308
- for (const wrapperPackageRoot of [join55(current, "node_modules", "oh-my-openagent"), join55(current, "oh-my-openagent")]) {
97554
+ for (const wrapperPackageRoot of [join56(current, "node_modules", "oh-my-openagent"), join56(current, "oh-my-openagent")]) {
97309
97555
  if (isRepoRootWithCodexPlugin(wrapperPackageRoot))
97310
97556
  return wrapperPackageRoot;
97311
97557
  }
@@ -97323,7 +97569,7 @@ function findRepoRoot(input) {
97323
97569
  return findRepoRootFromImporter(input.importerDir);
97324
97570
  }
97325
97571
  function isRepoRootWithCodexPlugin(repoRoot) {
97326
- return existsSync27(join55(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
97572
+ return existsSync27(join56(repoRoot, "packages", "omo-codex", "plugin", ".codex-plugin", "plugin.json"));
97327
97573
  }
97328
97574
  function codexMarketplaceSource(marketplaceRoot) {
97329
97575
  return { sourceType: "local", source: marketplaceRoot };
@@ -97458,13 +97704,13 @@ function defaultRunCommand2(command, args) {
97458
97704
  });
97459
97705
  }
97460
97706
  // packages/omo-codex/src/install/codex-cleanup.ts
97461
- import { lstat as lstat15, readFile as readFile25, readdir as readdir13, rm as rm13, rmdir } from "node:fs/promises";
97707
+ import { lstat as lstat15, readFile as readFile27, readdir as readdir13, rm as rm14, rmdir } from "node:fs/promises";
97462
97708
  import { homedir as homedir8 } from "node:os";
97463
- import { isAbsolute as isAbsolute11, join as join58, relative as relative6, resolve as resolve16 } from "node:path";
97709
+ import { isAbsolute as isAbsolute11, join as join59, relative as relative6, resolve as resolve16 } from "node:path";
97464
97710
 
97465
97711
  // packages/omo-codex/src/install/codex-cleanup-bins.ts
97466
- import { lstat as lstat13, readFile as readFile23, readdir as readdir12, readlink as readlink6, rm as rm12 } from "node:fs/promises";
97467
- import { dirname as dirname19, isAbsolute as isAbsolute9, join as join56, resolve as resolve14 } from "node:path";
97712
+ import { lstat as lstat13, readFile as readFile25, readdir as readdir12, readlink as readlink6, rm as rm13 } from "node:fs/promises";
97713
+ import { dirname as dirname19, isAbsolute as isAbsolute9, join as join57, resolve as resolve14 } from "node:path";
97468
97714
  var ROOT_RUNTIME_BIN_NAME = "omo";
97469
97715
  var MANAGED_CODEX_BIN_NAMES = new Set([
97470
97716
  ROOT_RUNTIME_BIN_NAME,
@@ -97494,9 +97740,9 @@ async function removeManagedCodexBins(binDir, platform) {
97494
97740
  const binName = managedBinNameForEntry2(entry.name, platform);
97495
97741
  if (binName === null || !MANAGED_CODEX_BIN_NAMES.has(binName))
97496
97742
  continue;
97497
- const linkPath = join56(binDir, entry.name);
97743
+ const linkPath = join57(binDir, entry.name);
97498
97744
  if (await isManagedCodexBin(linkPath, platform, binName)) {
97499
- await rm12(linkPath, { force: true });
97745
+ await rm13(linkPath, { force: true });
97500
97746
  removed.push(linkPath);
97501
97747
  }
97502
97748
  }
@@ -97525,12 +97771,12 @@ async function isManagedCodexBin(linkPath, platform, binName) {
97525
97771
  }
97526
97772
  if (!entryStat.isFile())
97527
97773
  return false;
97528
- const content = await readFile23(linkPath, "utf8");
97774
+ const content = await readFile25(linkPath, "utf8");
97529
97775
  return content.includes(RUNTIME_WRAPPER_MARKER) || content.includes(COMMAND_SHIM_MARKER);
97530
97776
  }
97531
97777
 
97532
97778
  // packages/omo-codex/src/install/codex-cleanup-config.ts
97533
- import { lstat as lstat14, mkdir as mkdir8, readFile as readFile24, writeFile as writeFile13 } from "node:fs/promises";
97779
+ import { lstat as lstat14, mkdir as mkdir8, readFile as readFile26, writeFile as writeFile14 } from "node:fs/promises";
97534
97780
  import { dirname as dirname20 } from "node:path";
97535
97781
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
97536
97782
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
@@ -97563,14 +97809,14 @@ function cleanupCodexLightConfigText(config) {
97563
97809
  async function cleanupCodexConfig(configPath, now) {
97564
97810
  if (!await configExists(configPath))
97565
97811
  return { changed: false };
97566
- const original = await readFile24(configPath, "utf8");
97812
+ const original = await readFile26(configPath, "utf8");
97567
97813
  const next = cleanupCodexLightConfigText(original);
97568
97814
  if (next === original)
97569
97815
  return { changed: false };
97570
97816
  const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
97571
97817
  await mkdir8(dirname20(configPath), { recursive: true });
97572
- await writeFile13(backupPath, original);
97573
- await writeFile13(configPath, `${next.trimEnd()}
97818
+ await writeFile14(backupPath, original);
97819
+ await writeFile14(configPath, `${next.trimEnd()}
97574
97820
  `);
97575
97821
  return { changed: true, backupPath };
97576
97822
  }
@@ -97647,7 +97893,7 @@ function nodeErrorCode5(error) {
97647
97893
  }
97648
97894
 
97649
97895
  // packages/omo-codex/src/install/codex-cleanup-safety.ts
97650
- import { dirname as dirname21, isAbsolute as isAbsolute10, join as join57, relative as relative5, resolve as resolve15 } from "node:path";
97896
+ import { dirname as dirname21, isAbsolute as isAbsolute10, join as join58, relative as relative5, resolve as resolve15 } from "node:path";
97651
97897
  function codexHomeResolvesToFilesystemRoot(codexHome) {
97652
97898
  const resolved = resolve15(codexHome);
97653
97899
  return dirname21(resolved) === resolved;
@@ -97664,11 +97910,11 @@ function validateManagedCleanupTarget(input) {
97664
97910
  if (target === codexHome)
97665
97911
  return skipped(input.path, "outside managed Codex cleanup scope");
97666
97912
  const exactManagedRoots = new Set([
97667
- resolve15(join57(codexHome, "plugins", "cache", "sisyphuslabs")),
97668
- resolve15(join57(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
97669
- resolve15(join57(codexHome, "runtime", "ast-grep")),
97670
- resolve15(join57(codexHome, "runtime", "node")),
97671
- resolve15(join57(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
97913
+ resolve15(join58(codexHome, "plugins", "cache", "sisyphuslabs")),
97914
+ resolve15(join58(codexHome, ".tmp", "marketplaces", "sisyphuslabs")),
97915
+ resolve15(join58(codexHome, "runtime", "ast-grep")),
97916
+ resolve15(join58(codexHome, "runtime", "node")),
97917
+ resolve15(join58(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap"))
97672
97918
  ]);
97673
97919
  if (exactManagedRoots.has(target))
97674
97920
  return null;
@@ -97698,8 +97944,8 @@ function skipped(path, reason) {
97698
97944
  var INSTALLED_AGENTS_MANIFEST = ".installed-agents.json";
97699
97945
  async function cleanupCodexLight(input = {}) {
97700
97946
  const env = input.env ?? process.env;
97701
- const codexHome = resolve16(input.codexHome ?? env.CODEX_HOME ?? join58(homedir8(), ".codex"));
97702
- const configPath = join58(codexHome, "config.toml");
97947
+ const codexHome = resolve16(input.codexHome ?? env.CODEX_HOME ?? join59(homedir8(), ".codex"));
97948
+ const configPath = join59(codexHome, "config.toml");
97703
97949
  const installedBinDir = await readInstalledCodexBinDir(codexHome);
97704
97950
  const agentPaths = await collectInstalledAgentPaths(codexHome, configPath);
97705
97951
  const configCleanup = await cleanupCodexConfig(configPath, input.now);
@@ -97753,17 +97999,17 @@ function firstConfiguredPath(...values) {
97753
97999
  }
97754
98000
  function managedGlobalStatePaths(codexHome) {
97755
98001
  return [
97756
- join58(codexHome, "plugins", "cache", "sisyphuslabs"),
97757
- join58(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
97758
- join58(codexHome, "runtime", "ast-grep"),
97759
- join58(codexHome, "runtime", "node"),
97760
- join58(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
98002
+ join59(codexHome, "plugins", "cache", "sisyphuslabs"),
98003
+ join59(codexHome, ".tmp", "marketplaces", "sisyphuslabs"),
98004
+ join59(codexHome, "runtime", "ast-grep"),
98005
+ join59(codexHome, "runtime", "node"),
98006
+ join59(codexHome, "plugins", "data", "omo-sisyphuslabs", "bootstrap")
97761
98007
  ];
97762
98008
  }
97763
98009
  var BOOTSTRAP_DATA_GLOB_MAX_DEPTH = 5;
97764
98010
  async function collectBootstrapDataDirsByGlob(codexHome) {
97765
98011
  const results = [];
97766
- await walkForManagedBootstrapDirs(join58(codexHome, "plugins"), 0, results);
98012
+ await walkForManagedBootstrapDirs(join59(codexHome, "plugins"), 0, results);
97767
98013
  return results;
97768
98014
  }
97769
98015
  async function walkForManagedBootstrapDirs(directory, depth, results) {
@@ -97775,9 +98021,9 @@ async function walkForManagedBootstrapDirs(directory, depth, results) {
97775
98021
  for (const entry of entries) {
97776
98022
  if (!entry.isDirectory())
97777
98023
  continue;
97778
- const childPath = join58(directory, entry.name);
98024
+ const childPath = join59(directory, entry.name);
97779
98025
  if (isManagedBootstrapOwnerName(entry.name)) {
97780
- const bootstrapDir = join58(childPath, "bootstrap");
98026
+ const bootstrapDir = join59(childPath, "bootstrap");
97781
98027
  if (await exists6(bootstrapDir))
97782
98028
  results.push(bootstrapDir);
97783
98029
  continue;
@@ -97803,7 +98049,7 @@ async function attemptRemove(path) {
97803
98049
  try {
97804
98050
  if (await lstat15(path).catch(() => null) === null)
97805
98051
  return false;
97806
- await rm13(path, { recursive: true, force: true });
98052
+ await rm14(path, { recursive: true, force: true });
97807
98053
  return true;
97808
98054
  } catch {
97809
98055
  return false;
@@ -97811,7 +98057,7 @@ async function attemptRemove(path) {
97811
98057
  }
97812
98058
  async function pruneEmptyRuntimeDirBestEffort(codexHome) {
97813
98059
  try {
97814
- await rmdir(join58(codexHome, "runtime"));
98060
+ await rmdir(join59(codexHome, "runtime"));
97815
98061
  } catch (error) {
97816
98062
  if (isExpectedRuntimePruneFailure(error))
97817
98063
  return;
@@ -97823,14 +98069,14 @@ function isExpectedRuntimePruneFailure(error) {
97823
98069
  }
97824
98070
  async function collectInstalledAgentPaths(codexHome, configPath) {
97825
98071
  const manifestPaths = [
97826
- join58(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
98072
+ join59(codexHome, ".tmp", "marketplaces", "sisyphuslabs", "plugins", "omo", INSTALLED_AGENTS_MANIFEST)
97827
98073
  ];
97828
- const versionRoot = join58(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
98074
+ const versionRoot = join59(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
97829
98075
  if (await exists6(versionRoot)) {
97830
98076
  const entries = await readdir13(versionRoot, { withFileTypes: true });
97831
98077
  for (const entry of entries) {
97832
98078
  if (entry.isDirectory())
97833
- manifestPaths.push(join58(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
98079
+ manifestPaths.push(join59(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
97834
98080
  }
97835
98081
  }
97836
98082
  const paths = new Set;
@@ -97847,19 +98093,19 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
97847
98093
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
97848
98094
  if (!await exists6(configPath))
97849
98095
  return [];
97850
- const config = await readFile25(configPath, "utf8");
97851
- return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join58(codexHome, "agents", `${agentName}.toml`));
98096
+ const config = await readFile27(configPath, "utf8");
98097
+ return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join59(codexHome, "agents", `${agentName}.toml`));
97852
98098
  }
97853
98099
  async function readInstalledAgentManifest(manifestPath) {
97854
98100
  if (!await exists6(manifestPath))
97855
98101
  return [];
97856
- const parsed = JSON.parse(await readFile25(manifestPath, "utf8"));
98102
+ const parsed = JSON.parse(await readFile27(manifestPath, "utf8"));
97857
98103
  if (!isPlainRecord4(parsed) || !Array.isArray(parsed.agents))
97858
98104
  return [];
97859
98105
  return parsed.agents.filter((path) => typeof path === "string");
97860
98106
  }
97861
98107
  async function removeManifestListedAgentLinks(codexHome, paths) {
97862
- const agentsDir = join58(codexHome, "agents");
98108
+ const agentsDir = join59(codexHome, "agents");
97863
98109
  const removed = [];
97864
98110
  const skipped = [];
97865
98111
  for (const path of paths) {
@@ -97874,7 +98120,7 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
97874
98120
  skipped.push(path);
97875
98121
  continue;
97876
98122
  }
97877
- await rm13(path, { force: true });
98123
+ await rm14(path, { force: true });
97878
98124
  removed.push(path);
97879
98125
  }
97880
98126
  return { removed, skipped };
@@ -97911,14 +98157,14 @@ function nodeErrorCode6(error) {
97911
98157
  import { execFile as execFile3 } from "node:child_process";
97912
98158
  import { existsSync as existsSync31 } from "node:fs";
97913
98159
  import { homedir as homedir11 } from "node:os";
97914
- import { dirname as dirname25, join as join63, resolve as resolve20 } from "node:path";
98160
+ import { dirname as dirname25, join as join64, resolve as resolve20 } from "node:path";
97915
98161
  import { fileURLToPath } from "node:url";
97916
98162
  import { promisify as promisify2 } from "node:util";
97917
98163
 
97918
98164
  // packages/omo-senpi/src/components/agent-home/resolve-agent-home.ts
97919
98165
  import { existsSync as existsSync29 } from "node:fs";
97920
98166
  import { homedir as homedir9 } from "node:os";
97921
- import { join as join59, resolve as resolve17 } from "node:path";
98167
+ import { join as join60, resolve as resolve17 } from "node:path";
97922
98168
  var AGENT_DIR_ENV_NAMES = [
97923
98169
  "OMO_CODING_AGENT_DIR",
97924
98170
  "SENPI_CODING_AGENT_DIR",
@@ -97932,25 +98178,25 @@ function resolveAgentHome(options) {
97932
98178
  if (configured)
97933
98179
  return resolve17(configured);
97934
98180
  }
97935
- const brandedHome = join59(homeDir, ".omo");
97936
- const canonical = join59(brandedHome, "agent");
97937
- if (exists(join59(canonical, AGENT_HOME_SENTINEL)))
98181
+ const brandedHome = join60(homeDir, ".omo");
98182
+ const canonical = join60(brandedHome, "agent");
98183
+ if (exists(join60(canonical, AGENT_HOME_SENTINEL)))
97938
98184
  return canonical;
97939
- if (exists(join59(brandedHome, AGENT_HOME_SENTINEL)))
98185
+ if (exists(join60(brandedHome, AGENT_HOME_SENTINEL)))
97940
98186
  return brandedHome;
97941
- return join59(homeDir, ".senpi", "agent");
98187
+ return join60(homeDir, ".senpi", "agent");
97942
98188
  }
97943
98189
 
97944
98190
  // packages/omo-senpi/src/install/local-launcher.ts
97945
98191
  import { chmodSync as chmodSync3, existsSync as existsSync30, mkdirSync as mkdirSync12, readFileSync as readFileSync14, rmSync as rmSync4, writeFileSync as writeFileSync7 } from "node:fs";
97946
98192
  import { homedir as homedir10 } from "node:os";
97947
- import { dirname as dirname22, join as join60, resolve as resolve18 } from "node:path";
98193
+ import { dirname as dirname22, join as join61, resolve as resolve18 } from "node:path";
97948
98194
  var MARKER = "omo-local-launcher";
97949
98195
  function localLauncherPath(homeDir = homedir10()) {
97950
- return join60(homeDir, ".local", "bin", "omo");
98196
+ return join61(homeDir, ".local", "bin", "omo");
97951
98197
  }
97952
98198
  function localLauncherCmdPath(homeDir = homedir10()) {
97953
- return join60(homeDir, ".local", "bin", "omo.cmd");
98199
+ return join61(homeDir, ".local", "bin", "omo.cmd");
97954
98200
  }
97955
98201
  function releaseChannel(version) {
97956
98202
  return version !== undefined && version.includes("-") ? "beta" : "latest";
@@ -97968,7 +98214,7 @@ function renderLocalLauncher(options) {
97968
98214
  userAgent: "omo",
97969
98215
  originator: "omo",
97970
98216
  changelog: {
97971
- path: join60(options.pluginPath, "CHANGELOG.md").replaceAll("\\", "/")
98217
+ path: join61(options.pluginPath, "CHANGELOG.md").replaceAll("\\", "/")
97972
98218
  },
97973
98219
  update: {
97974
98220
  packageName: "omo-ai",
@@ -98040,8 +98286,8 @@ node "%~dp0omo" %*\r
98040
98286
  // packages/omo-senpi/src/install/plugin-artifacts.ts
98041
98287
  import { createHash as createHash6 } from "node:crypto";
98042
98288
  import { constants as constants9 } from "node:fs";
98043
- import { access as access2, readFile as readFile27, stat as stat6 } from "node:fs/promises";
98044
- import { dirname as dirname24, join as join62 } from "node:path";
98289
+ import { access as access2, readFile as readFile29, stat as stat6 } from "node:fs/promises";
98290
+ import { dirname as dirname24, join as join63 } from "node:path";
98045
98291
 
98046
98292
  // packages/memory-core/src/personas/manifest.ts
98047
98293
  var PERSONA_ASSET_FILENAMES = {
@@ -98059,18 +98305,18 @@ var PERSONA_ASSET_FILES = [
98059
98305
 
98060
98306
  // packages/omo-senpi/src/install/senpi-settings.ts
98061
98307
  import { constants as constants8 } from "node:fs";
98062
- import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile26, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
98063
- import { basename as basename10, dirname as dirname23, join as join61, resolve as resolve19 } from "node:path";
98308
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile28, rename as rename5, writeFile as writeFile15 } from "node:fs/promises";
98309
+ import { basename as basename10, dirname as dirname23, join as join62, resolve as resolve19 } from "node:path";
98064
98310
  var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
98065
98311
  var GENERATED_PLUGIN_BASENAME = /^omo-senpi-cli-plugin-[A-Za-z0-9]{6}$/;
98066
98312
  var LEGACY_BUILTIN_SHADOW_PACKAGES = [
98067
- join61("packages", "pi-goal"),
98068
- join61("packages", "pi-webfetch")
98313
+ join62("packages", "pi-goal"),
98314
+ join62("packages", "pi-webfetch")
98069
98315
  ];
98070
98316
  async function readSettings(settingsPath) {
98071
98317
  let raw;
98072
98318
  try {
98073
- raw = await readFile26(settingsPath, "utf8");
98319
+ raw = await readFile28(settingsPath, "utf8");
98074
98320
  } catch (error) {
98075
98321
  if (isErrno(error, "ENOENT"))
98076
98322
  return {};
@@ -98117,11 +98363,11 @@ async function writeSettingsAtomically(settingsPath, settings) {
98117
98363
  if (await fileExists(settingsPath)) {
98118
98364
  await copyFile3(settingsPath, backupPath);
98119
98365
  } else {
98120
- await writeFile14(backupPath, `{}
98366
+ await writeFile15(backupPath, `{}
98121
98367
  `, "utf8");
98122
98368
  }
98123
98369
  const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
98124
- await writeFile14(tempPath, `${JSON.stringify(settings, null, 2)}
98370
+ await writeFile15(tempPath, `${JSON.stringify(settings, null, 2)}
98125
98371
  `, "utf8");
98126
98372
  await rename5(tempPath, settingsPath);
98127
98373
  return backupPath;
@@ -98144,7 +98390,7 @@ function isRecord15(value) {
98144
98390
  async function readPackageName(packagePath) {
98145
98391
  let raw;
98146
98392
  try {
98147
- raw = await readFile26(join61(packagePath, "package.json"), "utf8");
98393
+ raw = await readFile28(join62(packagePath, "package.json"), "utf8");
98148
98394
  } catch (error) {
98149
98395
  if (isErrno(error, "ENOENT") || isErrno(error, "ENOTDIR"))
98150
98396
  return;
@@ -98176,52 +98422,54 @@ function isErrno(error, code) {
98176
98422
 
98177
98423
  // packages/omo-senpi/src/install/plugin-artifacts.ts
98178
98424
  var REQUIRED_PLUGIN_ARTIFACTS = [
98179
- join62("extensions", "omo.js"),
98180
- join62("extensions", "omo-task.js"),
98181
- join62("extensions", "omo-member.js"),
98182
- join62("extensions", "memory-run-supervisor.mjs"),
98183
- ...PERSONA_ASSET_FILES.map((filename) => join62("extensions", filename)),
98184
- join62("skills", "ast-grep", "SKILL.md"),
98185
- join62("skills", "browser", "SKILL.md"),
98186
- join62("skills", "coding-agent-sessions", "SKILL.md"),
98187
- join62("skills", "debugging", "SKILL.md"),
98188
- join62("skills", "frontend", "SKILL.md"),
98189
- join62("skills", "git-master", "SKILL.md"),
98190
- join62("skills", "init-deep", "SKILL.md"),
98191
- join62("skills", "lsp-setup", "SKILL.md"),
98192
- join62("skills", "programming", "SKILL.md"),
98193
- join62("skills", "refactor", "SKILL.md"),
98194
- join62("skills", "remove-ai-slops", "SKILL.md"),
98195
- join62("skills", "review-work", "SKILL.md"),
98196
- join62("skills", "ultimate-browsing", "SKILL.md"),
98197
- join62("skills", "ultrawork", "SKILL.md"),
98198
- join62("skills", "ulw-execute", "SKILL.md"),
98199
- join62("skills", "ulw-loop", "SKILL.md"),
98200
- join62("skills", "ulw-plan", "SKILL.md"),
98201
- join62("skills", "ulw-research", "SKILL.md"),
98202
- join62("skills", "visual-qa", "SKILL.md"),
98203
- join62("skills-conditional", "x-search", "SKILL.md"),
98204
- join62("runtime", "agent-toolkit-sdk", "sdk.js"),
98205
- join62("runtime", "ast-grep-mcp", "cli.js"),
98206
- join62("runtime", "lsp-daemon", "dist", "cli.js"),
98207
- join62("runtime", "lsp-daemon", "dist", "index.js"),
98208
- join62("runtime", "lsp-daemon", "dist", "index.d.ts"),
98209
- join62("runtime", "lsp-daemon", "dist", "daemon-client.js"),
98210
- join62("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
98211
- join62("runtime", "lsp-daemon", "dist", "package.json"),
98212
- join62("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
98213
- join62("scripts", "install.mjs"),
98425
+ join63("extensions", "omo.js"),
98426
+ join63("extensions", "omo-task.js"),
98427
+ join63("extensions", "omo-computer-use.js"),
98428
+ join63("extensions", "assets.generated.json"),
98429
+ join63("extensions", "omo-member.js"),
98430
+ join63("extensions", "memory-run-supervisor.mjs"),
98431
+ ...PERSONA_ASSET_FILES.map((filename) => join63("extensions", filename)),
98432
+ join63("skills", "ast-grep", "SKILL.md"),
98433
+ join63("skills", "browser", "SKILL.md"),
98434
+ join63("skills", "coding-agent-sessions", "SKILL.md"),
98435
+ join63("skills", "debugging", "SKILL.md"),
98436
+ join63("skills", "frontend", "SKILL.md"),
98437
+ join63("skills", "git-master", "SKILL.md"),
98438
+ join63("skills", "init-deep", "SKILL.md"),
98439
+ join63("skills", "lsp-setup", "SKILL.md"),
98440
+ join63("skills", "programming", "SKILL.md"),
98441
+ join63("skills", "refactor", "SKILL.md"),
98442
+ join63("skills", "remove-ai-slops", "SKILL.md"),
98443
+ join63("skills", "review-work", "SKILL.md"),
98444
+ join63("skills", "ultimate-browsing", "SKILL.md"),
98445
+ join63("skills", "ultrawork", "SKILL.md"),
98446
+ join63("skills", "ulw-execute", "SKILL.md"),
98447
+ join63("skills", "ulw-loop", "SKILL.md"),
98448
+ join63("skills", "ulw-plan", "SKILL.md"),
98449
+ join63("skills", "ulw-research", "SKILL.md"),
98450
+ join63("skills", "visual-qa", "SKILL.md"),
98451
+ join63("skills-conditional", "x-search", "SKILL.md"),
98452
+ join63("runtime", "agent-toolkit-sdk", "sdk.js"),
98453
+ join63("runtime", "ast-grep-mcp", "cli.js"),
98454
+ join63("runtime", "lsp-daemon", "dist", "cli.js"),
98455
+ join63("runtime", "lsp-daemon", "dist", "index.js"),
98456
+ join63("runtime", "lsp-daemon", "dist", "index.d.ts"),
98457
+ join63("runtime", "lsp-daemon", "dist", "daemon-client.js"),
98458
+ join63("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
98459
+ join63("runtime", "lsp-daemon", "dist", "package.json"),
98460
+ join63("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
98461
+ join63("scripts", "install.mjs"),
98214
98462
  "daemon-launch-spec.json"
98215
98463
  ];
98216
98464
  async function ensurePluginArtifacts(context) {
98217
98465
  if (context.allowBuild) {
98218
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
98219
- await context.runCommand("node", [join62("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
98220
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
98221
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
98222
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
98223
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
98224
- await context.runCommand("node", [join62(context.pluginPath, "scripts", "stage-x-search-skill.mjs")], { cwd: context.repoRoot });
98466
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
98467
+ await context.runCommand("node", [join63("packages", "omo-codex", "plugin", "scripts", "materialize-shared-upstreams.mjs")], { cwd: context.repoRoot });
98468
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
98469
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
98470
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
98471
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "stage-ast-grep-mcp-runtime.mjs")], { cwd: context.repoRoot });
98472
+ await context.runCommand("node", [join63(context.pluginPath, "scripts", "stage-x-search-skill.mjs")], { cwd: context.repoRoot });
98225
98473
  }
98226
98474
  if (await hasMissingPluginArtifact(context.pluginPath)) {
98227
98475
  throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
@@ -98230,14 +98478,14 @@ async function ensurePluginArtifacts(context) {
98230
98478
  }
98231
98479
  async function hasMissingPluginArtifact(pluginPath) {
98232
98480
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
98233
- if (!await fileExists2(join62(pluginPath, artifact)))
98481
+ if (!await fileExists2(join63(pluginPath, artifact)))
98234
98482
  return true;
98235
98483
  }
98236
98484
  return false;
98237
98485
  }
98238
98486
  async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
98239
- const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
98240
- const manifestPath = join62(dirname24(runtimeEntry), "manifest.json");
98487
+ const runtimeEntry = join63(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
98488
+ const manifestPath = join63(dirname24(runtimeEntry), "manifest.json");
98241
98489
  let runtimeStat;
98242
98490
  try {
98243
98491
  runtimeStat = await stat6(runtimeEntry);
@@ -98252,7 +98500,7 @@ async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
98252
98500
  }
98253
98501
  let manifest;
98254
98502
  try {
98255
- manifest = JSON.parse(await readFile27(manifestPath, "utf8"));
98503
+ manifest = JSON.parse(await readFile29(manifestPath, "utf8"));
98256
98504
  } catch (error) {
98257
98505
  throw astGrepIntegrityError(runtimeEntry, `manifest is unreadable or invalid JSON: ${messageOf(error)}`);
98258
98506
  }
@@ -98261,7 +98509,7 @@ async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
98261
98509
  }
98262
98510
  let actualSha256;
98263
98511
  try {
98264
- actualSha256 = createHash6("sha256").update(await readFile27(runtimeEntry)).digest("hex");
98512
+ actualSha256 = createHash6("sha256").update(await readFile29(runtimeEntry)).digest("hex");
98265
98513
  } catch (error) {
98266
98514
  throw astGrepIntegrityError(runtimeEntry, `runtime hash could not be computed: ${messageOf(error)}`);
98267
98515
  }
@@ -98312,7 +98560,7 @@ async function runSenpiInstaller(options = {}) {
98312
98560
  const backupPath = await writeSettingsAtomically(context.settingsPath, settings);
98313
98561
  const launcherPath = installLocalLauncher({
98314
98562
  pluginPath: context.pluginPath,
98315
- senpiCliPath: join63(context.repoRoot, "packages", "coding-agent", "dist", "cli.js"),
98563
+ senpiCliPath: join64(context.repoRoot, "packages", "coding-agent", "dist", "cli.js"),
98316
98564
  homeDir: context.homeDir
98317
98565
  });
98318
98566
  return {
@@ -98332,13 +98580,13 @@ function resolveInstallContext(options) {
98332
98580
  const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname25(fileURLToPath(import.meta.url))) : dirname25(resolve20(options.pluginPath))));
98333
98581
  const homeDir = options.homeDir ?? env.HOME ?? homedir11();
98334
98582
  const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env, homeDir }));
98335
- const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
98583
+ const pluginPath = resolve20(options.pluginPath ?? join64(repoRoot, "packages", "omo-senpi", "plugin"));
98336
98584
  return {
98337
98585
  env,
98338
98586
  repoRoot,
98339
98587
  agentDir,
98340
98588
  homeDir,
98341
- settingsPath: join63(agentDir, "settings.json"),
98589
+ settingsPath: join64(agentDir, "settings.json"),
98342
98590
  pluginPath,
98343
98591
  platform: options.platform ?? process.platform,
98344
98592
  allowBuild,
@@ -98355,7 +98603,7 @@ async function defaultRunCommand3(command, args, options) {
98355
98603
  function findRepoRoot2(importerDir) {
98356
98604
  let current = importerDir;
98357
98605
  for (let depth = 0;depth <= 7; depth += 1) {
98358
- if (fileExistsSync(join63(current, "packages", "omo-senpi", "plugin", "package.json")))
98606
+ if (fileExistsSync(join64(current, "packages", "omo-senpi", "plugin", "package.json")))
98359
98607
  return current;
98360
98608
  current = resolve20(current, "..");
98361
98609
  }
@@ -98369,8 +98617,8 @@ async function runNativeDevInstaller(options) {
98369
98617
  return runSenpiInstaller(options);
98370
98618
  }
98371
98619
  // packages/omo-opencode/src/cli/install-native/legacy-omo-bin.ts
98372
- import { lstatSync as lstatSync4, readFileSync as readFileSync15, realpathSync as realpathSync8 } from "node:fs";
98373
- import { dirname as dirname26, isAbsolute as isAbsolute12, join as join64, posix as posix9, win32 as win325 } from "node:path";
98620
+ import { lstatSync as lstatSync4, readFileSync as readFileSync15, realpathSync as realpathSync8, statSync as statSync4 } from "node:fs";
98621
+ import { dirname as dirname26, isAbsolute as isAbsolute12, join as join65, posix as posix9, win32 as win325 } from "node:path";
98374
98622
  var NATIVE_OMO_PACKAGE = "omo-ai";
98375
98623
  var LEGACY_OMO_BIN_PACKAGES = ["oh-my-openagent", "oh-my-opencode", "lazycodex"];
98376
98624
  var CODEX_LIGHT_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
@@ -98435,7 +98683,7 @@ function classify(owner) {
98435
98683
  }
98436
98684
  function omoShimPathsIn(directory, isWindows) {
98437
98685
  const suffixes = isWindows ? WINDOWS_BIN_SUFFIXES : [""];
98438
- return suffixes.map((suffix) => join64(directory, `${OMO_BIN_NAME}${suffix}`)).filter(pathExists);
98686
+ return suffixes.map((suffix) => join65(directory, `${OMO_BIN_NAME}${suffix}`)).filter(pathExists);
98439
98687
  }
98440
98688
  function pathExists(path) {
98441
98689
  try {
@@ -98451,12 +98699,11 @@ function resolveOwner(binPath) {
98451
98699
  if (fromLink !== null)
98452
98700
  return fromLink;
98453
98701
  const shim = readShimText(binPath);
98454
- if (shim === null)
98455
- return null;
98456
- const lightWrapper = codexLightWrapperOwner(shim);
98702
+ const lightWrapper = shim === null ? null : codexLightWrapperOwner(shim);
98457
98703
  if (lightWrapper !== null)
98458
98704
  return lightWrapper;
98459
- for (const entry of shimEntryPaths(shim, dirname26(binPath))) {
98705
+ const entries = [...shim === null ? [] : shimEntryPaths(shim, dirname26(binPath)), ...bunxEntryPaths(binPath)];
98706
+ for (const entry of entries) {
98460
98707
  if (!isInsideNodeModules(entry) || !pathExists(entry))
98461
98708
  continue;
98462
98709
  const owner = ownerOfFile(entry);
@@ -98471,12 +98718,29 @@ function shimEntryPaths(shim, shimDirectory) {
98471
98718
  const quoted = match[0];
98472
98719
  const relativeToShim = quoted.match(/^(?:%~?dp0%?|\$\{?basedir\}?)[\\/]?(.*)$/)?.[1];
98473
98720
  if (relativeToShim !== undefined)
98474
- paths.push(join64(shimDirectory, relativeToShim.replace(/\\/g, "/")));
98721
+ paths.push(join65(shimDirectory, relativeToShim.replace(/\\/g, "/")));
98475
98722
  else if (isAbsolute12(quoted))
98476
98723
  paths.push(quoted);
98477
98724
  }
98478
98725
  return paths;
98479
98726
  }
98727
+ function bunxEntryPaths(binPath) {
98728
+ if (!/\.exe$/i.test(binPath))
98729
+ return [];
98730
+ const sidecar = `${binPath.slice(0, -4)}.bunx`;
98731
+ let contents;
98732
+ try {
98733
+ if (!statSync4(sidecar).isFile())
98734
+ return [];
98735
+ contents = readFileSync15(sidecar).toString("utf16le");
98736
+ } catch {
98737
+ return [];
98738
+ }
98739
+ const end = contents.indexOf('"\x00');
98740
+ if (end <= 0)
98741
+ return [];
98742
+ return [join65(dirname26(dirname26(binPath)), contents.slice(0, end).replace(/\\/g, "/"))];
98743
+ }
98480
98744
  function codexLightWrapperOwner(shim) {
98481
98745
  if (!shim.includes(CODEX_LIGHT_WRAPPER_MARKER))
98482
98746
  return null;
@@ -98489,7 +98753,7 @@ function isInsideNodeModules(path) {
98489
98753
  function ownerOfFile(file) {
98490
98754
  let directory = dirname26(file);
98491
98755
  for (let depth = 0;depth < OWNER_WALK_UP_LIMIT; depth += 1) {
98492
- const manifest = readWholeFile(join64(directory, "package.json"));
98756
+ const manifest = readWholeFile(join65(directory, "package.json"));
98493
98757
  if (manifest !== null) {
98494
98758
  const parsed = parseManifest(manifest);
98495
98759
  if (parsed !== null)
@@ -98787,12 +99051,12 @@ init_provider_availability();
98787
99051
 
98788
99052
  // packages/omo-opencode/src/cli/config-manager/add-tui-plugin-to-tui-config.ts
98789
99053
  import { existsSync as existsSync33, mkdirSync as mkdirSync13, readFileSync as readFileSync17 } from "node:fs";
98790
- import { join as join66 } from "node:path";
99054
+ import { join as join67 } from "node:path";
98791
99055
 
98792
99056
  // packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
98793
99057
  init_shared();
98794
99058
  import { existsSync as existsSync32, readFileSync as readFileSync16 } from "node:fs";
98795
- import { join as join65 } from "node:path";
99059
+ import { join as join66 } from "node:path";
98796
99060
  var TUI_SUBPATH = "tui";
98797
99061
  var TUI_EXPORT_SUBPATH = `./${TUI_SUBPATH}`;
98798
99062
  function tuiPluginSpecName(entry) {
@@ -98812,7 +99076,7 @@ function fileEntryPackageJsonPath(entry) {
98812
99076
  let path = entry.slice("file:".length);
98813
99077
  if (path.startsWith("//"))
98814
99078
  path = path.slice(2);
98815
- return join65(path, "package.json");
99079
+ return join66(path, "package.json");
98816
99080
  }
98817
99081
  function packageJsonExportsTui(pkgJsonPath) {
98818
99082
  if (!existsSync32(pkgJsonPath))
@@ -98851,7 +99115,7 @@ function packageExportsTuiForServerEntry(entry) {
98851
99115
  const packageName = packageNameFromServerEntry(entry);
98852
99116
  if (packageName === null)
98853
99117
  return null;
98854
- return packageJsonExportsTui(join65(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
99118
+ return packageJsonExportsTui(join66(getOpenCodeConfigDir({ binary: "opencode" }), "node_modules", packageName, "package.json"));
98855
99119
  }
98856
99120
  function isOurFilePluginEntry(entry) {
98857
99121
  if (typeof entry !== "string" || !entry.startsWith("file:"))
@@ -98938,7 +99202,7 @@ function detectServerPluginRegistration() {
98938
99202
  }
98939
99203
  }
98940
99204
  function detectTuiPluginRegistration() {
98941
- const tuiJsonPath = join65(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
99205
+ const tuiJsonPath = join66(getOpenCodeConfigDir({ binary: "opencode" }), "tui.json");
98942
99206
  if (!existsSync32(tuiJsonPath)) {
98943
99207
  return {
98944
99208
  registered: false,
@@ -99114,10 +99378,10 @@ function readConfig(path) {
99114
99378
  return null;
99115
99379
  }
99116
99380
  function readServerConfig(configDir) {
99117
- const jsoncPath = join66(configDir, "opencode.jsonc");
99381
+ const jsoncPath = join67(configDir, "opencode.jsonc");
99118
99382
  if (existsSync33(jsoncPath))
99119
99383
  return readConfig(jsoncPath);
99120
- const jsonPath = join66(configDir, "opencode.json");
99384
+ const jsonPath = join67(configDir, "opencode.json");
99121
99385
  if (existsSync33(jsonPath))
99122
99386
  return readConfig(jsonPath);
99123
99387
  return null;
@@ -99174,7 +99438,7 @@ function ensureTuiPluginEntry(opts = {}) {
99174
99438
  if (!desiredEntry) {
99175
99439
  return { changed: false, reason: "no-server-entry" };
99176
99440
  }
99177
- const tuiJsonPath = join66(configDir, "tui.json");
99441
+ const tuiJsonPath = join67(configDir, "tui.json");
99178
99442
  const { config, malformed } = readTuiConfig(tuiJsonPath);
99179
99443
  if (malformed || pluginFieldInvalid(config)) {
99180
99444
  return { changed: false, reason: "malformed" };
@@ -99195,10 +99459,10 @@ function ensureTuiPluginEntry(opts = {}) {
99195
99459
  init_shared();
99196
99460
  init_config_context();
99197
99461
  import { existsSync as existsSync34, readFileSync as readFileSync18 } from "node:fs";
99198
- import { join as join67 } from "node:path";
99462
+ import { join as join68 } from "node:path";
99199
99463
  function readPluginEntries(configDir) {
99200
99464
  for (const name of ["opencode.jsonc", "opencode.json"]) {
99201
- const configPath = join67(configDir, name);
99465
+ const configPath = join68(configDir, name);
99202
99466
  if (!existsSync34(configPath))
99203
99467
  continue;
99204
99468
  try {
@@ -99246,7 +99510,7 @@ function refreshOpenCodePluginSandboxes(options = {}) {
99246
99510
 
99247
99511
  // packages/omo-opencode/src/cli/install-ast-grep-sg.ts
99248
99512
  import { homedir as homedir13 } from "node:os";
99249
- import { join as join68 } from "node:path";
99513
+ import { join as join69 } from "node:path";
99250
99514
 
99251
99515
  // packages/shared-skills/index.mjs
99252
99516
  import { existsSync as existsSync35 } from "node:fs";
@@ -99268,9 +99532,9 @@ function describeResult2(result) {
99268
99532
  }
99269
99533
  async function installAstGrepForOpenCode(options = {}) {
99270
99534
  const platform = options.platform ?? process.platform;
99271
- const baseDir = join68(options.homeDir ?? homedir13(), ".omo");
99535
+ const baseDir = join69(options.homeDir ?? homedir13(), ".omo");
99272
99536
  const targetDir = astGrepRuntimeDir(baseDir, platform, options.arch ?? process.arch);
99273
- const skillDir = join68(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
99537
+ const skillDir = join69(options.sharedSkillsRoot ?? sharedSkillsRootPath(), "ast-grep");
99274
99538
  const installer = options.installer ?? runAstGrepSkillInstall;
99275
99539
  try {
99276
99540
  const result = await installer({ platform, skillDir, targetDir });
@@ -103406,20 +103670,41 @@ var BOULDER_FILE = "boulder.json";
103406
103670
  var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
103407
103671
  var NOTEPAD_DIR = "notepads";
103408
103672
  var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
103673
+ // packages/boulder-state/src/markdown-fence.ts
103674
+ var FENCE_PATTERN = /^[ \t]{0,3}(`{3,}|~{3,})(.*)$/;
103675
+ function parseOpeningFence(line) {
103676
+ const match = line.match(FENCE_PATTERN);
103677
+ const run = match?.[1];
103678
+ const info = match?.[2];
103679
+ const marker = run?.charAt(0);
103680
+ if (run === undefined || info === undefined || marker !== "`" && marker !== "~" || marker === "`" && info.includes("`")) {
103681
+ return null;
103682
+ }
103683
+ return { marker, length: run.length };
103684
+ }
103685
+ function isClosingFence(line, fence) {
103686
+ const run = line.match(/^[ \t]{0,3}(`{3,}|~{3,})[ \t]*$/)?.[1];
103687
+ return run?.charAt(0) === fence.marker && run.length >= fence.length;
103688
+ }
103689
+
103409
103690
  // packages/boulder-state/src/plan-checklist.ts
103410
- var SIMPLE_CHECKBOX_PATTERN = /^[-*][ \t]*\[[ \t]*([xX]?)[ \t]*\][ \t]+(.+)$/;
103691
+ var SIMPLE_CHECKBOX_PATTERN = /^[-*][ \t]*\[[ \t]*([xX~]?)[ \t]*\][ \t]+(.+)$/;
103411
103692
  var TODO_HEADING_PATTERN = /^##[ \t]+TODOs(?:[ \t]+#+)?[ \t]*$/i;
103412
103693
  var FINAL_VERIFICATION_HEADING_PATTERN = /^##[ \t]+Final Verification Wave(?:[ \t]+#+)?[ \t]*$/i;
103413
103694
  var SECTION_BOUNDARY_HEADING_PATTERN = /^#{1,2}(?:[ \t]+|$)/;
103414
- var FENCE_PATTERN = /^[ \t]{0,3}(`{3,}|~{3,})(.*)$/;
103415
- var TODO_CHECKBOX_PATTERN = /^- \[([ xX])\] ([1-9]\d*\. .+)$/;
103416
- var FINAL_WAVE_CHECKBOX_PATTERN = /^- \[([ xX])\] (F[1-9]\d*\. .+)$/i;
103695
+ var STRUCTURED_CHECKBOX_PATTERN = /^- \[([ xX~])\] (.+)$/;
103696
+ var TODO_TASK_LABEL_PATTERN = /^([1-9]\d*|T[1-9]\d*(?:\.[1-9]\d*[a-z]?)?)(?:\.[ \t]+|[ \t]+(?:[-\u2014][ \t]+)?)(.+)$/i;
103697
+ var FINAL_WAVE_TASK_LABEL_PATTERN = /^([FH][1-9]\d*(?:\.[1-9]\d*[a-z]?)?)(?:\.[ \t]+|[ \t]+(?:[-\u2014][ \t]+)?)(.+)$/i;
103417
103698
  function parsePlanChecklist(markdown) {
103418
103699
  const lines = markdown.split(/\r?\n/);
103419
103700
  if (!hasStructuredSection(lines)) {
103420
103701
  return parseSimpleChecklist(lines);
103421
103702
  }
103422
- return parseStructuredPlan(lines).checklist;
103703
+ const structuredPlan = parseStructuredPlan(lines);
103704
+ if (structuredPlan.checklist.total === 0 && structuredPlan.hasUntrackedTopLevelCheckbox) {
103705
+ return parseSimpleChecklist(lines);
103706
+ }
103707
+ return structuredPlan.checklist;
103423
103708
  }
103424
103709
  function parseCurrentTopLevelTask(markdown) {
103425
103710
  const lines = markdown.split(/\r?\n/);
@@ -103429,10 +103714,12 @@ function parseCurrentTopLevelTask(markdown) {
103429
103714
  return parseStructuredPlan(lines).nextTask;
103430
103715
  }
103431
103716
  function parseStructuredPlan(lines) {
103717
+ let completed = 0;
103432
103718
  let remaining = 0;
103433
103719
  let total = 0;
103434
103720
  let nextTaskLabel = null;
103435
103721
  let nextTask = null;
103722
+ let hasUntrackedTopLevelCheckbox = false;
103436
103723
  let section = "other";
103437
103724
  let fence = null;
103438
103725
  for (const line of lines) {
@@ -103452,6 +103739,9 @@ function parseStructuredPlan(lines) {
103452
103739
  continue;
103453
103740
  }
103454
103741
  if (section === "other") {
103742
+ if (parseSimpleTopLevelCheckbox(line) !== null) {
103743
+ hasUntrackedTopLevelCheckbox = true;
103744
+ }
103455
103745
  continue;
103456
103746
  }
103457
103747
  const checkbox = parseStructuredTopLevelCheckbox(line, section);
@@ -103459,7 +103749,11 @@ function parseStructuredPlan(lines) {
103459
103749
  continue;
103460
103750
  }
103461
103751
  total += 1;
103462
- if (checkbox.checked) {
103752
+ if (checkbox.status === "done") {
103753
+ completed += 1;
103754
+ continue;
103755
+ }
103756
+ if (checkbox.status === "in-progress") {
103463
103757
  continue;
103464
103758
  }
103465
103759
  remaining += 1;
@@ -103470,15 +103764,17 @@ function parseStructuredPlan(lines) {
103470
103764
  }
103471
103765
  return {
103472
103766
  checklist: {
103473
- completed: total - remaining,
103767
+ completed,
103474
103768
  remaining,
103475
103769
  total,
103476
103770
  nextTaskLabel
103477
103771
  },
103478
- nextTask
103772
+ nextTask,
103773
+ hasUntrackedTopLevelCheckbox
103479
103774
  };
103480
103775
  }
103481
103776
  function parseSimpleChecklist(lines) {
103777
+ let completed = 0;
103482
103778
  let remaining = 0;
103483
103779
  let total = 0;
103484
103780
  let nextTaskLabel = null;
@@ -103500,7 +103796,11 @@ function parseSimpleChecklist(lines) {
103500
103796
  continue;
103501
103797
  }
103502
103798
  total += 1;
103503
- if (checkbox.checked) {
103799
+ if (checkbox.status === "done") {
103800
+ completed += 1;
103801
+ continue;
103802
+ }
103803
+ if (checkbox.status === "in-progress") {
103504
103804
  continue;
103505
103805
  }
103506
103806
  remaining += 1;
@@ -103508,7 +103808,7 @@ function parseSimpleChecklist(lines) {
103508
103808
  nextTaskLabel = checkbox.label;
103509
103809
  }
103510
103810
  }
103511
- return { completed: total - remaining, remaining, total, nextTaskLabel };
103811
+ return { completed, remaining, total, nextTaskLabel };
103512
103812
  }
103513
103813
  function parseSimpleTopLevelCheckbox(line) {
103514
103814
  const match = line.match(SIMPLE_CHECKBOX_PATTERN);
@@ -103517,7 +103817,13 @@ function parseSimpleTopLevelCheckbox(line) {
103517
103817
  if (marker === undefined || label === undefined) {
103518
103818
  return null;
103519
103819
  }
103520
- return { checked: marker.toLowerCase() === "x", label };
103820
+ return { status: parseCheckboxStatus(marker), label };
103821
+ }
103822
+ function parseCheckboxStatus(marker) {
103823
+ if (marker.toLowerCase() === "x") {
103824
+ return "done";
103825
+ }
103826
+ return marker === "~" ? "in-progress" : "open";
103521
103827
  }
103522
103828
  function hasStructuredSection(lines) {
103523
103829
  let fence = null;
@@ -103549,8 +103855,7 @@ function parseStructuredSectionHeading(line) {
103549
103855
  return "other";
103550
103856
  }
103551
103857
  function parseStructuredTopLevelCheckbox(line, section) {
103552
- const pattern = section === "todo" ? TODO_CHECKBOX_PATTERN : FINAL_WAVE_CHECKBOX_PATTERN;
103553
- const match = line.match(pattern);
103858
+ const match = line.match(STRUCTURED_CHECKBOX_PATTERN);
103554
103859
  const marker = match?.[1];
103555
103860
  const label = match?.[2];
103556
103861
  if (marker === undefined || label === undefined) {
@@ -103560,10 +103865,10 @@ function parseStructuredTopLevelCheckbox(line, section) {
103560
103865
  if (task === null) {
103561
103866
  return null;
103562
103867
  }
103563
- return { checked: marker.toLowerCase() === "x", label, task };
103868
+ return { status: parseCheckboxStatus(marker), label, task };
103564
103869
  }
103565
103870
  function buildTaskRef(section, label) {
103566
- const pattern = section === "todo" ? /^([1-9]\d*)\. (.+)$/ : /^(F[1-9]\d*)\. (.+)$/i;
103871
+ const pattern = section === "todo" ? TODO_TASK_LABEL_PATTERN : FINAL_WAVE_TASK_LABEL_PATTERN;
103567
103872
  const match = label.match(pattern);
103568
103873
  const rawLabel = match?.[1];
103569
103874
  const title = match?.[2];
@@ -103577,20 +103882,6 @@ function buildTaskRef(section, label) {
103577
103882
  title
103578
103883
  };
103579
103884
  }
103580
- function parseOpeningFence(line) {
103581
- const match = line.match(FENCE_PATTERN);
103582
- const run = match?.[1];
103583
- const info = match?.[2];
103584
- const marker = run?.charAt(0);
103585
- if (run === undefined || info === undefined || marker !== "`" && marker !== "~" || marker === "`" && info.includes("`")) {
103586
- return null;
103587
- }
103588
- return { marker, length: run.length };
103589
- }
103590
- function isClosingFence(line, fence) {
103591
- const run = line.match(/^[ \t]{0,3}(`{3,}|~{3,})[ \t]*$/)?.[1];
103592
- return run?.charAt(0) === fence.marker && run.length >= fence.length;
103593
- }
103594
103885
  // packages/boulder-state/src/top-level-task.ts
103595
103886
  import { existsSync as existsSync36, readFileSync as readFileSync19 } from "node:fs";
103596
103887
  function readCurrentTopLevelTask(planPath) {
@@ -103606,9 +103897,9 @@ function readCurrentTopLevelTask(planPath) {
103606
103897
  }
103607
103898
  // packages/boulder-state/src/storage/path.ts
103608
103899
  import { existsSync as existsSync37 } from "node:fs";
103609
- import { isAbsolute as isAbsolute13, join as join69, relative as relative8, resolve as resolve21 } from "node:path";
103900
+ import { isAbsolute as isAbsolute13, join as join70, relative as relative8, resolve as resolve21 } from "node:path";
103610
103901
  function getBoulderFilePath(directory) {
103611
- return join69(directory, BOULDER_DIR, BOULDER_FILE);
103902
+ return join70(directory, BOULDER_DIR, BOULDER_FILE);
103612
103903
  }
103613
103904
  function resolveTrackedPath(baseDirectory, trackedPath) {
103614
103905
  return isAbsolute13(trackedPath) ? resolve21(trackedPath) : resolve21(baseDirectory, trackedPath);
@@ -103632,7 +103923,7 @@ function resolveBoulderPlanPathForWork(directory, work) {
103632
103923
  return resolveBoulderPlanPath(directory, work);
103633
103924
  }
103634
103925
  // packages/boulder-state/src/storage/plan-progress.ts
103635
- import { existsSync as existsSync38, readFileSync as readFileSync20, readdirSync as readdirSync9, statSync as statSync4 } from "node:fs";
103926
+ import { existsSync as existsSync38, readFileSync as readFileSync20, readdirSync as readdirSync9, statSync as statSync5 } from "node:fs";
103636
103927
  function getPlanProgress(planPath) {
103637
103928
  if (!existsSync38(planPath)) {
103638
103929
  return { total: 0, completed: 0, isComplete: false };
@@ -103793,9 +104084,9 @@ init_state();
103793
104084
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
103794
104085
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
103795
104086
  import { existsSync as existsSync40, mkdirSync as mkdirSync14, readFileSync as readFileSync22, rmSync as rmSync6, writeFileSync as writeFileSync8 } from "node:fs";
103796
- import { join as join70 } from "node:path";
104087
+ import { join as join71 } from "node:path";
103797
104088
  function getMarkerPath(directory, sessionID) {
103798
- return join70(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
104089
+ return join71(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
103799
104090
  }
103800
104091
  function readContinuationMarker(directory, sessionID) {
103801
104092
  const markerPath = getMarkerPath(directory, sessionID);
@@ -103868,7 +104159,7 @@ async function isSessionInBoulderLineage(input) {
103868
104159
  init_shared();
103869
104160
  init_compaction_marker();
103870
104161
  import { readFileSync as readFileSync23, readdirSync as readdirSync10 } from "node:fs";
103871
- import { join as join71 } from "node:path";
104162
+ import { join as join72 } from "node:path";
103872
104163
  var defaultSessionLastAgentDeps = {
103873
104164
  getMessageDir,
103874
104165
  isSqliteBackend,
@@ -103928,7 +104219,7 @@ async function getLastAgentFromSession(sessionID, client, deps = {}) {
103928
104219
  try {
103929
104220
  const messages = readdirSync10(messageDir).filter((fileName) => fileName.endsWith(".json")).map((fileName) => {
103930
104221
  try {
103931
- const content = readFileSync23(join71(messageDir, fileName), "utf-8");
104222
+ const content = readFileSync23(join72(messageDir, fileName), "utf-8");
103932
104223
  const parsed = JSON.parse(content);
103933
104224
  return {
103934
104225
  fileName,
@@ -103972,7 +104263,7 @@ init_agent_display_names();
103972
104263
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
103973
104264
  init_frontmatter2();
103974
104265
  import { existsSync as existsSync41, readFileSync as readFileSync24, writeFileSync as writeFileSync9, unlinkSync as unlinkSync6, mkdirSync as mkdirSync15 } from "node:fs";
103975
- import { dirname as dirname28, join as join72 } from "node:path";
104266
+ import { dirname as dirname28, join as join73 } from "node:path";
103976
104267
 
103977
104268
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
103978
104269
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -103981,7 +104272,7 @@ var DEFAULT_COMPLETION_PROMISE = "DONE";
103981
104272
 
103982
104273
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
103983
104274
  function getStateFilePath(directory, customPath) {
103984
- return customPath ? join72(directory, customPath) : join72(directory, DEFAULT_STATE_FILE);
104275
+ return customPath ? join73(directory, customPath) : join73(directory, DEFAULT_STATE_FILE);
103985
104276
  }
103986
104277
  function readState(directory, customPath) {
103987
104278
  const filePath = getStateFilePath(directory, customPath);
@@ -104051,7 +104342,7 @@ async function hasActiveBoulderContinuation(directory, sessionID, client) {
104051
104342
  if (!boulder || !boulder.active_plan)
104052
104343
  return false;
104053
104344
  const progress = getPlanProgress(resolveBoulderPlanPath(directory, boulder));
104054
- if (progress.isComplete)
104345
+ if (progress.isComplete || progress.total === 0)
104055
104346
  return false;
104056
104347
  if (!client)
104057
104348
  return false;
@@ -105088,7 +105379,7 @@ init_extract_semver();
105088
105379
  init_bun_which_shim();
105089
105380
  import { existsSync as existsSync49, accessSync as accessSync4, constants as constants12 } from "node:fs";
105090
105381
  import { homedir as homedir16 } from "node:os";
105091
- import { join as join79 } from "node:path";
105382
+ import { join as join80 } from "node:path";
105092
105383
 
105093
105384
  // packages/omo-opencode/src/cli/doctor/framework/spawn-with-timeout.ts
105094
105385
  init_spawn_with_windows_hide();
@@ -105180,17 +105471,17 @@ function getDesktopAppPaths(platform) {
105180
105471
  case "darwin":
105181
105472
  return [
105182
105473
  "/Applications/OpenCode.app/Contents/MacOS/OpenCode",
105183
- join79(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
105474
+ join80(home, "Applications", "OpenCode.app", "Contents", "MacOS", "OpenCode")
105184
105475
  ];
105185
105476
  case "win32": {
105186
105477
  const programFiles = process.env.ProgramFiles;
105187
105478
  const localAppData = process.env.LOCALAPPDATA;
105188
105479
  const paths = [];
105189
105480
  if (programFiles) {
105190
- paths.push(join79(programFiles, "OpenCode", "OpenCode.exe"));
105481
+ paths.push(join80(programFiles, "OpenCode", "OpenCode.exe"));
105191
105482
  }
105192
105483
  if (localAppData) {
105193
- paths.push(join79(localAppData, "OpenCode", "OpenCode.exe"));
105484
+ paths.push(join80(localAppData, "OpenCode", "OpenCode.exe"));
105194
105485
  }
105195
105486
  return paths;
105196
105487
  }
@@ -105198,8 +105489,8 @@ function getDesktopAppPaths(platform) {
105198
105489
  return [
105199
105490
  "/usr/bin/opencode",
105200
105491
  "/usr/lib/opencode/opencode",
105201
- join79(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
105202
- join79(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
105492
+ join80(home, "Applications", "opencode-desktop-linux-x86_64.AppImage"),
105493
+ join80(home, "Applications", "opencode-desktop-linux-aarch64.AppImage")
105203
105494
  ];
105204
105495
  default:
105205
105496
  return [];
@@ -105231,7 +105522,7 @@ async function findOpenCodeBinary(platform = process.platform, checkExists = exi
105231
105522
  const candidates = getCommandCandidates2(platform);
105232
105523
  for (const entry of pathEnv.split(delimiter).filter(Boolean)) {
105233
105524
  for (const command of candidates) {
105234
- const fullPath = join79(entry, command);
105525
+ const fullPath = join80(entry, command);
105235
105526
  if (checkExists(fullPath) && isExecutable2(fullPath)) {
105236
105527
  return { binary: command, path: fullPath };
105237
105528
  }
@@ -105375,22 +105666,22 @@ init_package_json_locator();
105375
105666
  import { existsSync as existsSync51, readFileSync as readFileSync33, readdirSync as readdirSync12 } from "node:fs";
105376
105667
  import { createRequire as createRequire2 } from "node:module";
105377
105668
  import { homedir as homedir17 } from "node:os";
105378
- import { join as join80 } from "node:path";
105669
+ import { join as join81 } from "node:path";
105379
105670
  import { fileURLToPath as fileURLToPath6 } from "node:url";
105380
105671
  init_shared();
105381
105672
  function getPlatformDefaultCacheDir(platform = process.platform) {
105382
105673
  if (platform === "darwin")
105383
- return join80(homedir17(), "Library", "Caches");
105674
+ return join81(homedir17(), "Library", "Caches");
105384
105675
  if (platform === "win32")
105385
- return process.env.LOCALAPPDATA ?? join80(homedir17(), "AppData", "Local");
105386
- return join80(homedir17(), ".cache");
105676
+ return process.env.LOCALAPPDATA ?? join81(homedir17(), "AppData", "Local");
105677
+ return join81(homedir17(), ".cache");
105387
105678
  }
105388
105679
  function resolveOpenCodeCacheDir() {
105389
105680
  const xdgCacheHome = process.env.XDG_CACHE_HOME;
105390
105681
  if (xdgCacheHome)
105391
- return join80(xdgCacheHome, "opencode");
105682
+ return join81(xdgCacheHome, "opencode");
105392
105683
  const fromShared = getOpenCodeCacheDir();
105393
- const platformDefault = join80(getPlatformDefaultCacheDir(), "opencode");
105684
+ const platformDefault = join81(getPlatformDefaultCacheDir(), "opencode");
105394
105685
  if (existsSync51(fromShared) || !existsSync51(platformDefault))
105395
105686
  return fromShared;
105396
105687
  return platformDefault;
@@ -105422,11 +105713,11 @@ function normalizeVersion(value) {
105422
105713
  function createPackageCandidates(rootDir) {
105423
105714
  return ACCEPTED_PACKAGE_NAMES.map((packageName) => ({
105424
105715
  packageName,
105425
- installedPackagePath: join80(rootDir, "node_modules", packageName, "package.json")
105716
+ installedPackagePath: join81(rootDir, "node_modules", packageName, "package.json")
105426
105717
  }));
105427
105718
  }
105428
105719
  function createTaggedInstallCandidates(rootDir) {
105429
- const packagesDir = join80(rootDir, "packages");
105720
+ const packagesDir = join81(rootDir, "packages");
105430
105721
  if (!existsSync51(packagesDir))
105431
105722
  return [];
105432
105723
  const candidates = [];
@@ -105434,14 +105725,14 @@ function createTaggedInstallCandidates(rootDir) {
105434
105725
  const packageName = ACCEPTED_PACKAGE_NAMES.find((name) => entryName.startsWith(`${name}@`));
105435
105726
  if (packageName === undefined)
105436
105727
  continue;
105437
- const installDir = join80(packagesDir, entryName);
105728
+ const installDir = join81(packagesDir, entryName);
105438
105729
  candidates.push({
105439
105730
  cacheDir: installDir,
105440
- cachePackagePath: join80(installDir, "package.json"),
105731
+ cachePackagePath: join81(installDir, "package.json"),
105441
105732
  packageCandidates: [
105442
105733
  {
105443
105734
  packageName,
105444
- installedPackagePath: join80(installDir, "node_modules", packageName, "package.json")
105735
+ installedPackagePath: join81(installDir, "node_modules", packageName, "package.json")
105445
105736
  }
105446
105737
  ]
105447
105738
  });
@@ -105486,13 +105777,13 @@ function getLoadedPluginVersion() {
105486
105777
  const candidates = [
105487
105778
  {
105488
105779
  cacheDir: configDir,
105489
- cachePackagePath: join80(configDir, "package.json"),
105780
+ cachePackagePath: join81(configDir, "package.json"),
105490
105781
  packageCandidates: createPackageCandidates(configDir)
105491
105782
  },
105492
105783
  ...createTaggedInstallCandidates(configDir),
105493
105784
  {
105494
105785
  cacheDir,
105495
- cachePackagePath: join80(cacheDir, "package.json"),
105786
+ cachePackagePath: join81(cacheDir, "package.json"),
105496
105787
  packageCandidates: createPackageCandidates(cacheDir)
105497
105788
  },
105498
105789
  ...createTaggedInstallCandidates(cacheDir)
@@ -105685,18 +105976,18 @@ async function checkSystem(deps = defaultDeps5) {
105685
105976
  init_shared();
105686
105977
  import { existsSync as existsSync53, readFileSync as readFileSync35 } from "node:fs";
105687
105978
  import { homedir as homedir18 } from "node:os";
105688
- import { join as join81 } from "node:path";
105979
+ import { join as join82 } from "node:path";
105689
105980
  function getUserConfigDir2() {
105690
105981
  const xdgConfig = process.env.XDG_CONFIG_HOME;
105691
105982
  if (xdgConfig)
105692
- return join81(xdgConfig, "opencode");
105693
- return join81(homedir18(), ".config", "opencode");
105983
+ return join82(xdgConfig, "opencode");
105984
+ return join82(homedir18(), ".config", "opencode");
105694
105985
  }
105695
105986
  function loadCustomProviderNames() {
105696
105987
  const configDir = getUserConfigDir2();
105697
105988
  const candidatePaths = [
105698
- join81(configDir, "opencode.json"),
105699
- join81(configDir, "opencode.jsonc")
105989
+ join82(configDir, "opencode.json"),
105990
+ join82(configDir, "opencode.jsonc")
105700
105991
  ];
105701
105992
  for (const configPath of candidatePaths) {
105702
105993
  if (!existsSync53(configPath))
@@ -105717,7 +106008,7 @@ function loadCustomProviderNames() {
105717
106008
  return [];
105718
106009
  }
105719
106010
  function loadAvailableModelsFromCache() {
105720
- const cacheFile = join81(getOpenCodeCacheDir(), "models.json");
106011
+ const cacheFile = join82(getOpenCodeCacheDir(), "models.json");
105721
106012
  const customProviders = loadCustomProviderNames();
105722
106013
  if (!existsSync53(cacheFile)) {
105723
106014
  if (customProviders.length > 0) {
@@ -105779,7 +106070,7 @@ function loadOmoConfig2() {
105779
106070
 
105780
106071
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
105781
106072
  init_shared();
105782
- import { join as join82 } from "node:path";
106073
+ import { join as join83 } from "node:path";
105783
106074
 
105784
106075
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-variant.ts
105785
106076
  function formatModelWithVariant(model, variant) {
@@ -105821,7 +106112,7 @@ function formatCapabilityResolutionLabel(mode) {
105821
106112
  }
105822
106113
  function buildModelResolutionDetails(options) {
105823
106114
  const details = [];
105824
- const cacheFile = join82(getOpenCodeCacheDir(), "models.json");
106115
+ const cacheFile = join83(getOpenCodeCacheDir(), "models.json");
105825
106116
  details.push("═══ Available Models (from cache) ═══");
105826
106117
  details.push("");
105827
106118
  if (options.available.cacheExists) {
@@ -106162,7 +106453,7 @@ init_src4();
106162
106453
  init_main();
106163
106454
  init_config_migration();
106164
106455
  import { existsSync as existsSync54, readFileSync as readFileSync36 } from "node:fs";
106165
- import { join as join83 } from "node:path";
106456
+ import { join as join84 } from "node:path";
106166
106457
  var CANONICAL_REPLACEMENT = new Map([
106167
106458
  ["variant", "reasoning"],
106168
106459
  ["reasoningEffort", "reasoning"],
@@ -106223,7 +106514,7 @@ function userConfigPaths() {
106223
106514
  const home = process.env.HOME ?? process.env.USERPROFILE;
106224
106515
  if (home === undefined || home.length === 0)
106225
106516
  return [];
106226
- return [join83(home, ".omo", "omo.jsonc"), join83(home, ".omo", "omo.json")];
106517
+ return [join84(home, ".omo", "omo.jsonc"), join84(home, ".omo", "omo.json")];
106227
106518
  }
106228
106519
  async function checkDeprecatedReasoningKeys() {
106229
106520
  const issues = [];
@@ -106249,31 +106540,43 @@ init_src();
106249
106540
  import { existsSync as existsSync55 } from "node:fs";
106250
106541
  import { createRequire as createRequire3 } from "node:module";
106251
106542
  import { homedir as homedir20 } from "node:os";
106252
- import { dirname as dirname33, join as join86 } from "node:path";
106543
+ import { dirname as dirname33, join as join88 } from "node:path";
106253
106544
 
106254
106545
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
106255
- import { join as join85 } from "path";
106546
+ import { join as join87 } from "path";
106256
106547
  import { homedir as homedir19, tmpdir as tmpdir4 } from "os";
106257
106548
  // packages/comment-checker-core/src/release.ts
106258
- import { join as join84 } from "node:path";
106549
+ import { join as join85 } from "node:path";
106550
+ var COMMENT_CHECKER_RELEASE_VERSION = "0.8.0";
106259
106551
  function commentCheckerBinaryName(platform) {
106260
106552
  return platform === "win32" ? "comment-checker.exe" : "comment-checker";
106261
106553
  }
106262
106554
  function commentCheckerCacheDir(input) {
106263
106555
  if (input.platform === "win32") {
106264
106556
  const localAppData = input.env.LOCALAPPDATA || input.env.APPDATA;
106265
- const base = localAppData || join84(input.homedir, "AppData", "Local");
106266
- return join84(base, input.cacheDirName, "bin");
106557
+ const base = localAppData || join85(input.homedir, "AppData", "Local");
106558
+ return join85(base, input.cacheDirName, "bin");
106559
+ }
106560
+ const base = input.env.XDG_CACHE_HOME || join85(input.homedir, ".cache");
106561
+ return join85(base, input.cacheDirName, "bin");
106562
+ }
106563
+ // packages/comment-checker-core/src/cached-release.ts
106564
+ import { readFileSync as readFileSync37, writeFileSync as writeFileSync12 } from "node:fs";
106565
+ import { join as join86 } from "node:path";
106566
+ var COMMENT_CHECKER_VERSION_MARKER = "comment-checker.version";
106567
+ function isCachedCommentCheckerCurrent(cacheDir, readFile = (path) => readFileSync37(path, "utf-8")) {
106568
+ try {
106569
+ return readFile(join86(cacheDir, COMMENT_CHECKER_VERSION_MARKER)).trim() === COMMENT_CHECKER_RELEASE_VERSION;
106570
+ } catch {
106571
+ return false;
106267
106572
  }
106268
- const base = input.env.XDG_CACHE_HOME || join84(input.homedir, ".cache");
106269
- return join84(base, input.cacheDirName, "bin");
106270
106573
  }
106271
106574
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
106272
106575
  init_binary_downloader();
106273
106576
  init_logger2();
106274
106577
  init_plugin_identity();
106275
106578
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
106276
- var DEBUG_FILE = join85(tmpdir4(), "comment-checker-debug.log");
106579
+ var DEBUG_FILE = join87(tmpdir4(), "comment-checker-debug.log");
106277
106580
  function getCacheDir2() {
106278
106581
  return commentCheckerCacheDir({
106279
106582
  platform: process.platform,
@@ -106286,7 +106589,9 @@ function getBinaryName() {
106286
106589
  return commentCheckerBinaryName(process.platform);
106287
106590
  }
106288
106591
  function getCachedBinaryPath2() {
106289
- return getCachedBinaryPath(getCacheDir2(), getBinaryName());
106592
+ const cacheDir = getCacheDir2();
106593
+ const cached = getCachedBinaryPath(cacheDir, getBinaryName());
106594
+ return cached !== null && isCachedCommentCheckerCurrent(cacheDir) ? cached : null;
106290
106595
  }
106291
106596
 
106292
106597
  // packages/omo-opencode/src/cli/doctor/checks/dependencies.ts
@@ -106330,7 +106635,7 @@ async function getBinaryVersion(binary) {
106330
106635
  }
106331
106636
  }
106332
106637
  async function checkAstGrepCli() {
106333
- const runtimeDir = astGrepRuntimeDir(join86(homedir20(), ".omo"));
106638
+ const runtimeDir = astGrepRuntimeDir(join88(homedir20(), ".omo"));
106334
106639
  const sgPath = findSgBinarySync({ runtimeDir });
106335
106640
  if (sgPath === null) {
106336
106641
  return {
@@ -106360,10 +106665,10 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
106360
106665
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
106361
106666
  try {
106362
106667
  const packageDir = baseDirOverride ?? dirname33(resolvePackageJsonPath());
106363
- const vendorPath = join86(packageDir, "vendor", platformKey, binaryName);
106668
+ const vendorPath = join88(packageDir, "vendor", platformKey, binaryName);
106364
106669
  if (existsSync55(vendorPath))
106365
106670
  return vendorPath;
106366
- const binPath = join86(packageDir, "bin", binaryName);
106671
+ const binPath = join88(packageDir, "bin", binaryName);
106367
106672
  if (existsSync55(binPath))
106368
106673
  return binPath;
106369
106674
  } catch (error) {
@@ -106510,7 +106815,7 @@ async function getGhCliInfo(dependencies = {}) {
106510
106815
  // packages/omo-opencode/src/mcp/lsp.ts
106511
106816
  init_zod();
106512
106817
  init_opencode_config_dir();
106513
- import { existsSync as existsSync56, readFileSync as readFileSync37 } from "node:fs";
106818
+ import { existsSync as existsSync56, readFileSync as readFileSync38 } from "node:fs";
106514
106819
  import { delimiter as delimiter3, dirname as dirname34, resolve as resolve23 } from "node:path";
106515
106820
  import { fileURLToPath as fileURLToPath7 } from "node:url";
106516
106821
 
@@ -106654,7 +106959,7 @@ function findBootstrapRoot(candidates, pathExists) {
106654
106959
  }
106655
106960
  function readDaemonPackageVersion(root) {
106656
106961
  try {
106657
- const packageJson = JSON.parse(readFileSync37(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
106962
+ const packageJson = JSON.parse(readFileSync38(resolve23(root, PACKAGE_REL, "package.json"), "utf-8"));
106658
106963
  return DaemonPackageSchema.parse(packageJson).version;
106659
106964
  } catch (error) {
106660
106965
  if (!(error instanceof Error))
@@ -106737,15 +107042,15 @@ function getInstalledLspServers(options = {}) {
106737
107042
 
106738
107043
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
106739
107044
  init_shared();
106740
- import { existsSync as existsSync57, readFileSync as readFileSync38 } from "node:fs";
107045
+ import { existsSync as existsSync57, readFileSync as readFileSync39 } from "node:fs";
106741
107046
  import { homedir as homedir21 } from "node:os";
106742
- import { join as join87 } from "node:path";
107047
+ import { join as join89 } from "node:path";
106743
107048
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
106744
107049
  function getMcpConfigPaths() {
106745
107050
  return [
106746
- join87(homedir21(), ".claude", ".mcp.json"),
106747
- join87(process.cwd(), ".mcp.json"),
106748
- join87(process.cwd(), ".claude", ".mcp.json")
107051
+ join89(homedir21(), ".claude", ".mcp.json"),
107052
+ join89(process.cwd(), ".mcp.json"),
107053
+ join89(process.cwd(), ".claude", ".mcp.json")
106749
107054
  ];
106750
107055
  }
106751
107056
  function loadUserMcpConfig() {
@@ -106754,7 +107059,7 @@ function loadUserMcpConfig() {
106754
107059
  if (!existsSync57(configPath))
106755
107060
  continue;
106756
107061
  try {
106757
- const content = readFileSync38(configPath, "utf-8");
107062
+ const content = readFileSync39(configPath, "utf-8");
106758
107063
  const config = parseJsonc(content);
106759
107064
  if (config.mcpServers) {
106760
107065
  Object.assign(servers, config.mcpServers);
@@ -106889,7 +107194,7 @@ async function checkTools() {
106889
107194
 
106890
107195
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
106891
107196
  init_src5();
106892
- import { existsSync as existsSync58, readFileSync as readFileSync39 } from "node:fs";
107197
+ import { existsSync as existsSync58, readFileSync as readFileSync40 } from "node:fs";
106893
107198
  function isTelemetryState(value) {
106894
107199
  return value !== null && typeof value === "object" && !Array.isArray(value);
106895
107200
  }
@@ -106899,7 +107204,7 @@ function readLastActiveDay(stateFilePath) {
106899
107204
  }
106900
107205
  let parsed;
106901
107206
  try {
106902
- parsed = JSON.parse(readFileSync39(stateFilePath, "utf-8"));
107207
+ parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
106903
107208
  } catch (error) {
106904
107209
  if (error instanceof Error) {
106905
107210
  return "unreadable";
@@ -107025,9 +107330,9 @@ async function pathExists2(dir) {
107025
107330
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
107026
107331
  init_src();
107027
107332
  import { existsSync as existsSync59 } from "node:fs";
107028
- import { lstat as lstat16, readdir as readdir14, readFile as readFile28 } from "node:fs/promises";
107333
+ import { lstat as lstat16, readdir as readdir14, readFile as readFile30 } from "node:fs/promises";
107029
107334
  import { homedir as homedir23 } from "node:os";
107030
- import { basename as basename12, join as join88, resolve as resolve24 } from "node:path";
107335
+ import { basename as basename12, join as join90, resolve as resolve24 } from "node:path";
107031
107336
  // packages/omo-opencode/package.json
107032
107337
  var package_default3 = {
107033
107338
  name: "@oh-my-opencode/omo-opencode",
@@ -107097,13 +107402,13 @@ var CODEX_BIN_NAMES = [
107097
107402
  "omo-git-bash-hook"
107098
107403
  ];
107099
107404
  async function gatherCodexSummary(deps = {}) {
107100
- const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join88(homedir23(), ".codex"));
107405
+ const codexHome = resolve24(deps.codexHome ?? process.env.CODEX_HOME ?? join90(homedir23(), ".codex"));
107101
107406
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
107102
107407
  const detection = await (deps.detectCodexInstallation ?? detectCodexInstallation)();
107103
107408
  const pluginRoot = await resolveInstalledPluginRoot(codexHome);
107104
- const manifest = pluginRoot === null ? null : await readJson(join88(pluginRoot, ".codex-plugin", "plugin.json"));
107105
- const installSnapshot = pluginRoot === null ? null : await readJson(join88(pluginRoot, "lazycodex-install.json"));
107106
- const configPath = join88(codexHome, "config.toml");
107409
+ const manifest = pluginRoot === null ? null : await readJson(join90(pluginRoot, ".codex-plugin", "plugin.json"));
107410
+ const installSnapshot = pluginRoot === null ? null : await readJson(join90(pluginRoot, "lazycodex-install.json"));
107411
+ const configPath = join90(codexHome, "config.toml");
107107
107412
  const pluginVersion = stringField(manifest, "version");
107108
107413
  return {
107109
107414
  codexPath: detection.found && "path" in detection ? detection.path : null,
@@ -107160,7 +107465,7 @@ function buildCodexIssues(summary) {
107160
107465
  if (summary.pluginRoot === null) {
107161
107466
  issues.push({
107162
107467
  title: "OMO Codex plugin is not installed",
107163
- description: `Expected cached plugin at ${join88("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
107468
+ description: `Expected cached plugin at ${join90("plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2, DEFAULT_PLUGIN_VERSION)} under CODEX_HOME.`,
107164
107469
  fix: "Run: npx lazycodex-ai install",
107165
107470
  severity: "error",
107166
107471
  affects: ["plugin loading"]
@@ -107225,12 +107530,12 @@ function buildCodexIssues(summary) {
107225
107530
  return issues;
107226
107531
  }
107227
107532
  async function resolveInstalledPluginRoot(codexHome) {
107228
- const pluginRoot = join88(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
107533
+ const pluginRoot = join90(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
107229
107534
  if (!existsSync59(pluginRoot))
107230
107535
  return null;
107231
107536
  const versions = await readdir14(pluginRoot, { withFileTypes: true });
107232
107537
  const candidates = versions.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
107233
- return candidates.length === 0 ? null : join88(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
107538
+ return candidates.length === 0 ? null : join90(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
107234
107539
  }
107235
107540
  async function readCodexConfigSummary(configPath) {
107236
107541
  if (!existsSync59(configPath)) {
@@ -107244,7 +107549,7 @@ async function readCodexConfigSummary(configPath) {
107244
107549
  companionLifecycleHookStateEvents: []
107245
107550
  };
107246
107551
  }
107247
- const content = await readFile28(configPath, "utf8");
107552
+ const content = await readFile30(configPath, "utf8");
107248
107553
  return {
107249
107554
  exists: true,
107250
107555
  marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
@@ -107258,13 +107563,13 @@ async function readCodexConfigSummary(configPath) {
107258
107563
  async function readLinkedBins(binDir) {
107259
107564
  const linked = [];
107260
107565
  for (const name of CODEX_BIN_NAMES) {
107261
- if (await pathExists3(join88(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
107566
+ if (await pathExists3(join90(binDir, process.platform === "win32" ? `${name}.cmd` : name)))
107262
107567
  linked.push(name);
107263
107568
  }
107264
107569
  return linked;
107265
107570
  }
107266
107571
  async function readLinkedAgents(codexHome) {
107267
- const agentsDir = join88(codexHome, "agents");
107572
+ const agentsDir = join90(codexHome, "agents");
107268
107573
  if (!existsSync59(agentsDir))
107269
107574
  return [];
107270
107575
  const entries = await readdir14(agentsDir, { withFileTypes: true });
@@ -107272,7 +107577,7 @@ async function readLinkedAgents(codexHome) {
107272
107577
  }
107273
107578
  async function readJson(path) {
107274
107579
  try {
107275
- const parsed = JSON.parse(await readFile28(path, "utf8"));
107580
+ const parsed = JSON.parse(await readFile30(path, "utf8"));
107276
107581
  return isPlainRecord(parsed) ? parsed : null;
107277
107582
  } catch (error) {
107278
107583
  if (error instanceof Error)
@@ -107396,9 +107701,9 @@ function resolveLatestVersion(input) {
107396
107701
 
107397
107702
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
107398
107703
  init_src();
107399
- import { readdir as readdir15, readFile as readFile29, stat as stat7 } from "node:fs/promises";
107704
+ import { readdir as readdir15, readFile as readFile31, stat as stat7 } from "node:fs/promises";
107400
107705
  import { homedir as homedir24 } from "node:os";
107401
- import { dirname as dirname35, isAbsolute as isAbsolute14, join as join89, relative as relative9, resolve as resolve25, sep as sep9 } from "node:path";
107706
+ import { dirname as dirname35, isAbsolute as isAbsolute14, join as join91, relative as relative9, resolve as resolve25, sep as sep9 } from "node:path";
107402
107707
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
107403
107708
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
107404
107709
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -107408,7 +107713,7 @@ async function checkCodexComponents(deps = {}) {
107408
107713
  const env = deps.env ?? process.env;
107409
107714
  const platform = deps.platform ?? process.platform;
107410
107715
  const arch = deps.arch ?? process.arch;
107411
- const codexHome = resolve25(deps.codexHome ?? env["CODEX_HOME"] ?? join89(homedir24(), ".codex"));
107716
+ const codexHome = resolve25(deps.codexHome ?? env["CODEX_HOME"] ?? join91(homedir24(), ".codex"));
107412
107717
  const summary = await gatherCodexSummary({ ...deps, codexHome });
107413
107718
  if (summary.pluginRoot === null) {
107414
107719
  return {
@@ -107433,7 +107738,7 @@ async function checkCodexComponents(deps = {}) {
107433
107738
  });
107434
107739
  }
107435
107740
  const runtimeSgDir = runtimeSgDirectory(codexHome, platform, arch);
107436
- const runtimeSgPath = join89(runtimeSgDir, sgBinaryName(platform));
107741
+ const runtimeSgPath = join91(runtimeSgDir, sgBinaryName(platform));
107437
107742
  const sg = findSgBinarySync({
107438
107743
  arch,
107439
107744
  env,
@@ -107545,7 +107850,7 @@ async function findManifestPaths(root, manifestName) {
107545
107850
  for (const entry of entries) {
107546
107851
  if (entry.name === "node_modules" || entry.name === ".git")
107547
107852
  continue;
107548
- const entryPath = join89(root, entry.name);
107853
+ const entryPath = join91(root, entry.name);
107549
107854
  if (entry.isDirectory()) {
107550
107855
  paths.push(...await findManifestPaths(entryPath, manifestName));
107551
107856
  continue;
@@ -107589,18 +107894,18 @@ function isPluginRuntimePathArg(arg) {
107589
107894
  return normalized.endsWith(".js") && normalized.includes("/dist/") && (normalized.startsWith("./") || normalized.startsWith("../") || normalized.startsWith("components/") || normalized.startsWith("/") || isAbsolute14(arg));
107590
107895
  }
107591
107896
  function runtimeSgDirectory(codexHome, platform, arch) {
107592
- return join89(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
107897
+ return join91(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
107593
107898
  }
107594
107899
  function describeSgSource(sgPath, env, runtimeSgDir, platform) {
107595
107900
  const override = env[SG_PATH_ENV_KEY]?.trim();
107596
107901
  if (override !== undefined && override.length > 0 && sgPath === override)
107597
107902
  return `env override ${SG_PATH_ENV_KEY}`;
107598
- if (sgPath === join89(runtimeSgDir, sgBinaryName(platform)))
107903
+ if (sgPath === join91(runtimeSgDir, sgBinaryName(platform)))
107599
107904
  return "runtime dir";
107600
107905
  return "PATH";
107601
107906
  }
107602
107907
  async function readBootstrapStateSummary(codexHome) {
107603
- const statePath = join89(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
107908
+ const statePath = join91(codexHome, "plugins", "data", PLUGIN_DATA_DIR_NAME, "bootstrap", "state.json");
107604
107909
  const raw = await readJson2(statePath);
107605
107910
  if (raw === null)
107606
107911
  return null;
@@ -107649,7 +107954,7 @@ function degradedDetailLines(entries) {
107649
107954
  }
107650
107955
  async function readJson2(path) {
107651
107956
  try {
107652
- const parsed = JSON.parse(await readFile29(path, "utf8"));
107957
+ const parsed = JSON.parse(await readFile31(path, "utf8"));
107653
107958
  return isRecord18(parsed) ? parsed : null;
107654
107959
  } catch (error) {
107655
107960
  if (error instanceof Error)
@@ -107677,18 +107982,18 @@ function isRecord18(value) {
107677
107982
 
107678
107983
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
107679
107984
  import { existsSync as existsSync60 } from "node:fs";
107680
- import { readFile as readFile30 } from "node:fs/promises";
107985
+ import { readFile as readFile32 } from "node:fs/promises";
107681
107986
  import { homedir as homedir25 } from "node:os";
107682
- import { join as join90, resolve as resolve26 } from "node:path";
107987
+ import { join as join92, resolve as resolve26 } from "node:path";
107683
107988
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
107684
107989
  var CHECK_NAME = "codex-runtime-wrapper";
107685
107990
  var REINSTALL_COMMAND = "npx --yes lazycodex-ai@latest install --no-tui";
107686
107991
  async function checkCodexRuntimeWrapper(deps = {}) {
107687
- const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join90(homedir25(), ".codex"));
107992
+ const codexHome = resolve26(deps.codexHome ?? process.env.CODEX_HOME ?? join92(homedir25(), ".codex"));
107688
107993
  const binDir = resolveCodexInstallerBinDir({ binDir: deps.binDir, codexHome, env: process.env });
107689
107994
  const platform = deps.platform ?? process.platform;
107690
- const wrapperPath = join90(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
107691
- const legacyWrapperPath = join90(binDir, platform === "win32" ? "omo.cmd" : "omo");
107995
+ const wrapperPath = join92(binDir, platform === "win32" ? "omo-agent-toolkit.cmd" : "omo-agent-toolkit");
107996
+ const legacyWrapperPath = join92(binDir, platform === "win32" ? "omo.cmd" : "omo");
107692
107997
  const [wrapper, legacyWrapper] = await Promise.all([readRuntimeWrapper(wrapperPath), readRuntimeWrapper(legacyWrapperPath)]);
107693
107998
  const issues = [];
107694
107999
  if (wrapper?.includes(RUNTIME_WRAPPER_MARKER2) === true) {
@@ -107722,7 +108027,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
107722
108027
  }
107723
108028
  async function readRuntimeWrapper(path) {
107724
108029
  try {
107725
- return await readFile30(path, "utf8");
108030
+ return await readFile32(path, "utf8");
107726
108031
  } catch (error) {
107727
108032
  if (error instanceof Error)
107728
108033
  return null;
@@ -108219,17 +108524,17 @@ import {
108219
108524
  existsSync as existsSync63,
108220
108525
  mkdirSync as mkdirSync17,
108221
108526
  readdirSync as readdirSync13,
108222
- readFileSync as readFileSync41,
108527
+ readFileSync as readFileSync42,
108223
108528
  renameSync as renameSync8,
108224
108529
  unlinkSync as unlinkSync9,
108225
- writeFileSync as writeFileSync13
108530
+ writeFileSync as writeFileSync14
108226
108531
  } from "node:fs";
108227
- import { basename as basename13, dirname as dirname36, join as join93 } from "node:path";
108532
+ import { basename as basename13, dirname as dirname36, join as join95 } from "node:path";
108228
108533
 
108229
108534
  // packages/mcp-client-core/src/config-dir.ts
108230
108535
  import { existsSync as existsSync61, realpathSync as realpathSync10 } from "node:fs";
108231
108536
  import { homedir as homedir26 } from "node:os";
108232
- import { join as join91, resolve as resolve27 } from "node:path";
108537
+ import { join as join93, resolve as resolve27 } from "node:path";
108233
108538
  function resolveConfigPath2(pathValue) {
108234
108539
  const resolvedPath = resolve27(pathValue);
108235
108540
  if (!existsSync61(resolvedPath))
@@ -108247,13 +108552,13 @@ function getOpenCodeCliConfigDir(env = process.env) {
108247
108552
  if (customConfigDir) {
108248
108553
  return resolveConfigPath2(customConfigDir);
108249
108554
  }
108250
- const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() || join91(homedir26(), ".config");
108251
- return resolveConfigPath2(join91(xdgConfigDir, "opencode"));
108555
+ const xdgConfigDir = env["XDG_CONFIG_HOME"]?.trim() || join93(homedir26(), ".config");
108556
+ return resolveConfigPath2(join93(xdgConfigDir, "opencode"));
108252
108557
  }
108253
108558
 
108254
108559
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
108255
- import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync40, renameSync as renameSync7, writeFileSync as writeFileSync12 } from "node:fs";
108256
- import { join as join92 } from "node:path";
108560
+ import { chmodSync as chmodSync4, existsSync as existsSync62, readFileSync as readFileSync41, renameSync as renameSync7, writeFileSync as writeFileSync13 } from "node:fs";
108561
+ import { join as join94 } from "node:path";
108257
108562
  var INDEX_FILE_NAME = "index.json";
108258
108563
  function isTokenIndex(value) {
108259
108564
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -108261,14 +108566,14 @@ function isTokenIndex(value) {
108261
108566
  return Object.values(value).every((entry) => typeof entry === "string");
108262
108567
  }
108263
108568
  function getIndexPath(storageDir) {
108264
- return join92(storageDir, INDEX_FILE_NAME);
108569
+ return join94(storageDir, INDEX_FILE_NAME);
108265
108570
  }
108266
108571
  function readTokenIndex(storageDir) {
108267
108572
  const indexPath = getIndexPath(storageDir);
108268
108573
  if (!existsSync62(indexPath))
108269
108574
  return {};
108270
108575
  try {
108271
- const parsed = JSON.parse(readFileSync40(indexPath, "utf-8"));
108576
+ const parsed = JSON.parse(readFileSync41(indexPath, "utf-8"));
108272
108577
  return isTokenIndex(parsed) ? parsed : {};
108273
108578
  } catch (readError) {
108274
108579
  if (!(readError instanceof Error))
@@ -108280,7 +108585,7 @@ function writeTokenIndex(storageDir, index) {
108280
108585
  try {
108281
108586
  const indexPath = getIndexPath(storageDir);
108282
108587
  const tempPath = `${indexPath}.tmp.${Date.now()}`;
108283
- writeFileSync12(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
108588
+ writeFileSync13(tempPath, JSON.stringify(index, null, 2), { encoding: "utf-8", mode: 384 });
108284
108589
  chmodSync4(tempPath, 384);
108285
108590
  renameSync7(tempPath, indexPath);
108286
108591
  return true;
@@ -108305,16 +108610,16 @@ function deleteTokenIndexEntry(storageDir, hash) {
108305
108610
  var STORAGE_DIR_NAME = "mcp-oauth";
108306
108611
  var LEGACY_STORAGE_FILE_NAME = "mcp-oauth.json";
108307
108612
  function getMcpOauthStorageDir() {
108308
- return join93(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
108613
+ return join95(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
108309
108614
  }
108310
108615
  function getMcpOauthServerHash(serverHost, resource) {
108311
108616
  return createHash7("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
108312
108617
  }
108313
108618
  function getMcpOauthStoragePath(serverHost, resource) {
108314
- return join93(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
108619
+ return join95(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
108315
108620
  }
108316
108621
  function getLegacyStoragePath() {
108317
- return join93(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
108622
+ return join95(getOpenCodeCliConfigDir(), LEGACY_STORAGE_FILE_NAME);
108318
108623
  }
108319
108624
  function normalizeHost2(serverHost) {
108320
108625
  let host = serverHost.trim();
@@ -108378,7 +108683,7 @@ function readTokenFile(filePath) {
108378
108683
  if (!existsSync63(filePath))
108379
108684
  return null;
108380
108685
  try {
108381
- const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
108686
+ const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
108382
108687
  return isOAuthTokenData(parsed) ? parsed : null;
108383
108688
  } catch (readError) {
108384
108689
  if (!(readError instanceof Error))
@@ -108391,7 +108696,7 @@ function readLegacyStore() {
108391
108696
  if (!existsSync63(filePath))
108392
108697
  return null;
108393
108698
  try {
108394
- const parsed = JSON.parse(readFileSync41(filePath, "utf-8"));
108699
+ const parsed = JSON.parse(readFileSync42(filePath, "utf-8"));
108395
108700
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
108396
108701
  return null;
108397
108702
  const result = {};
@@ -108413,7 +108718,7 @@ function writeTokenFile(filePath, token) {
108413
108718
  mkdirSync17(dir, { recursive: true });
108414
108719
  }
108415
108720
  const tempPath = `${filePath}.tmp.${Date.now()}`;
108416
- writeFileSync13(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
108721
+ writeFileSync14(tempPath, JSON.stringify(token, null, 2), { encoding: "utf-8", mode: 384 });
108417
108722
  chmodSync5(tempPath, 384);
108418
108723
  renameSync8(tempPath, filePath);
108419
108724
  return true;
@@ -108469,7 +108774,7 @@ function deleteLegacyToken(serverHost, resource) {
108469
108774
  function writeLegacyStore(store) {
108470
108775
  try {
108471
108776
  const filePath = getLegacyStoragePath();
108472
- writeFileSync13(filePath, JSON.stringify(store, null, 2), { encoding: "utf-8", mode: 384 });
108777
+ writeFileSync14(filePath, JSON.stringify(store, null, 2), { encoding: "utf-8", mode: 384 });
108473
108778
  chmodSync5(filePath, 384);
108474
108779
  return true;
108475
108780
  } catch (writeError) {
@@ -108493,7 +108798,7 @@ function listTokensByHost(serverHost) {
108493
108798
  for (const [hash, indexedKey] of Object.entries(index)) {
108494
108799
  if (!indexedKey.startsWith(prefix))
108495
108800
  continue;
108496
- const indexedToken = readTokenFile(join93(getMcpOauthStorageDir(), `${hash}.json`));
108801
+ const indexedToken = readTokenFile(join95(getMcpOauthStorageDir(), `${hash}.json`));
108497
108802
  if (indexedToken)
108498
108803
  result[indexedKey] = indexedToken;
108499
108804
  }
@@ -108508,7 +108813,7 @@ function listAllTokens() {
108508
108813
  for (const entry of readdirSync13(dir, { withFileTypes: true })) {
108509
108814
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
108510
108815
  continue;
108511
- const token = readTokenFile(join93(dir, entry.name));
108816
+ const token = readTokenFile(join95(dir, entry.name));
108512
108817
  const hash = basename13(entry.name, ".json");
108513
108818
  if (token)
108514
108819
  result[index[hash] ?? hash] = token;
@@ -109232,7 +109537,7 @@ async function boulder(options) {
109232
109537
  }
109233
109538
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
109234
109539
  import { spawn as spawn5 } from "node:child_process";
109235
- import { existsSync as existsSync65, readFileSync as readFileSync42, realpathSync as realpathSync11 } from "node:fs";
109540
+ import { existsSync as existsSync65, readFileSync as readFileSync43, realpathSync as realpathSync11 } from "node:fs";
109236
109541
  import { homedir as homedir27 } from "node:os";
109237
109542
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
109238
109543
  function resolveCodexUlwLoopCommand(input = {}) {
@@ -109282,7 +109587,7 @@ function resolveLegacyLocalOmoBin(env, homeDir, currentExecutablePaths) {
109282
109587
  }
109283
109588
  function isGeneratedRuntimeWrapper(candidate) {
109284
109589
  try {
109285
- return readFileSync42(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
109590
+ return readFileSync43(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
109286
109591
  } catch (error) {
109287
109592
  if (error instanceof Error)
109288
109593
  return false;