oh-my-opencode 4.9.2 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/.agents/skills/opencode-qa/scripts/lib/common.sh +39 -1
  2. package/.agents/skills/tech-debt-audit/SKILL.md +277 -0
  3. package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +1 -1
  4. package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +1 -1
  5. package/bin/platform.js +5 -0
  6. package/bin/platform.test.ts +56 -0
  7. package/dist/agents/atlas/agent.d.ts +4 -3
  8. package/dist/agents/gpt-apply-patch-guard.d.ts +2 -2
  9. package/dist/agents/hephaestus/agent.d.ts +5 -0
  10. package/dist/agents/hephaestus/index.d.ts +1 -1
  11. package/dist/agents/metis.d.ts +1 -0
  12. package/dist/agents/prometheus/system-prompt.d.ts +1 -1
  13. package/dist/agents/sisyphus/kimi-k2-7.d.ts +17 -0
  14. package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
  15. package/dist/agents/sisyphus-junior/kimi-k2-7.d.ts +11 -0
  16. package/dist/agents/types.d.ts +2 -2
  17. package/dist/cli/doctor/checks/codex-components.d.ts +13 -0
  18. package/dist/cli/doctor/checks/tui-plugin-config.d.ts +1 -0
  19. package/dist/cli/doctor/constants.d.ts +1 -1
  20. package/dist/cli/index.js +929 -291
  21. package/dist/cli/install-codex/codex-cleanup.d.ts +4 -0
  22. package/dist/cli/install-codex/install-codex-test-fixtures.d.ts +34 -0
  23. package/dist/cli/install-codex/link-cached-plugin-agents.d.ts +4 -0
  24. package/dist/cli/model-fallback.d.ts +1 -0
  25. package/dist/cli/provider-availability.d.ts +2 -0
  26. package/dist/cli-node/index.js +929 -291
  27. package/dist/config/schema/agent-overrides.d.ts +80 -16
  28. package/dist/config/schema/experimental.d.ts +0 -1
  29. package/dist/config/schema/hooks.d.ts +0 -1
  30. package/dist/config/schema/internal/permission.d.ts +5 -1
  31. package/dist/config/schema/oh-my-opencode-config.d.ts +75 -16
  32. package/dist/create-hooks.d.ts +0 -1
  33. package/dist/features/background-agent/index.d.ts +1 -1
  34. package/dist/features/background-agent/manager.d.ts +6 -0
  35. package/dist/features/background-agent/types.d.ts +2 -0
  36. package/dist/features/claude-code-plugin-loader/types.d.ts +3 -0
  37. package/dist/features/claude-code-session-state/state.d.ts +1 -0
  38. package/dist/features/skill-mcp-manager/manager.d.ts +11 -7
  39. package/dist/features/team-mode/team-mailbox/pending-delivery-recovery.d.ts +31 -0
  40. package/dist/features/team-mode/team-runtime/delete-team.d.ts +2 -1
  41. package/dist/features/team-mode/tools/lifecycle-inline-spec.d.ts +2 -2
  42. package/dist/features/tmux-subagent/stale-tmux-resource-sweeper.d.ts +12 -0
  43. package/dist/features/tool-metadata-store/store.d.ts +5 -0
  44. package/dist/hooks/anthropic-context-window-limit-recovery/storage/constants.d.ts +3 -0
  45. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/messages-reader.d.ts +1 -1
  46. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/part-content.d.ts +1 -1
  47. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/parts-reader.d.ts +1 -1
  48. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery/storage}/types.d.ts +0 -13
  49. package/dist/hooks/auto-update-checker/checker/bundled-version.d.ts +1 -0
  50. package/dist/hooks/auto-update-checker/checker.d.ts +1 -0
  51. package/dist/hooks/auto-update-checker/constants.d.ts +3 -3
  52. package/dist/hooks/auto-update-checker/hook.d.ts +2 -1
  53. package/dist/hooks/claude-code-hooks/types.d.ts +4 -0
  54. package/dist/hooks/index.d.ts +0 -1
  55. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +5 -0
  56. package/dist/index.js +2991 -2367
  57. package/dist/oh-my-opencode.schema.json +120 -18
  58. package/dist/plugin/build-team-idle-wake-hint-client.d.ts +2 -0
  59. package/dist/plugin/event-session-lifecycle.d.ts +0 -3
  60. package/dist/plugin/hooks/create-continuation-hooks.d.ts +0 -6
  61. package/dist/plugin/hooks/create-core-hooks.d.ts +0 -1
  62. package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
  63. package/dist/shared/command-executor/execute-hook-command.d.ts +7 -0
  64. package/dist/shared/plugin-identity.d.ts +2 -2
  65. package/dist/shared/tmux/tmux-utils/server-health.d.ts +2 -1
  66. package/dist/shared/tmux/tmux-utils/stale-attach-pane-sweep.d.ts +16 -0
  67. package/dist/shared/tmux/tmux-utils.d.ts +1 -0
  68. package/dist/tools/background-task/clients.d.ts +2 -0
  69. package/dist/tools/background-task/full-session-format.d.ts +1 -0
  70. package/dist/tools/background-task/types.d.ts +1 -0
  71. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +1 -1
  72. package/dist/tools/delegate-task/sync-session-lifecycle.d.ts +2 -1
  73. package/dist/tools/look-at/look-at-input-preparer.d.ts +6 -2
  74. package/dist/tools/look-at/look-at-prompt.d.ts +2 -1
  75. package/dist/tools/look-at/look-at-session-runner.d.ts +3 -4
  76. package/dist/tools/look-at/types.d.ts +2 -0
  77. package/dist/tools/session-manager/types.d.ts +1 -0
  78. package/dist/tools/skill-mcp/types.d.ts +1 -0
  79. package/package.json +14 -13
  80. package/packages/ast-grep-mcp/dist/cli.js +50 -17
  81. package/packages/lsp-daemon/dist/cli.js +8 -5
  82. package/packages/lsp-daemon/dist/index.js +8 -5
  83. package/packages/lsp-tools-mcp/dist/lsp/connection.js +1 -1
  84. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +2 -2
  85. package/packages/lsp-tools-mcp/dist/lsp/transport.d.ts +10 -1
  86. package/packages/lsp-tools-mcp/dist/lsp/transport.js +6 -3
  87. package/packages/omo-codex/lazycodex-repository/.github/workflows/pr-source-guidance.yml +11 -12
  88. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  89. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +2583 -0
  90. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +17 -0
  91. package/packages/omo-codex/plugin/components/bootstrap/manifests/ast-grep.json +22 -0
  92. package/packages/omo-codex/plugin/components/bootstrap/manifests/node.json +10 -0
  93. package/packages/omo-codex/plugin/components/bootstrap/package.json +20 -0
  94. package/packages/omo-codex/plugin/components/bootstrap/scripts/bootstrap.ps1 +310 -0
  95. package/packages/omo-codex/plugin/components/bootstrap/scripts/build.mjs +35 -0
  96. package/packages/omo-codex/plugin/components/bootstrap/scripts/generate-manifests.mjs +115 -0
  97. package/packages/omo-codex/plugin/components/bootstrap/src/cli.ts +153 -0
  98. package/packages/omo-codex/plugin/components/bootstrap/src/download.ts +212 -0
  99. package/packages/omo-codex/plugin/components/bootstrap/src/environment.ts +286 -0
  100. package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +108 -0
  101. package/packages/omo-codex/plugin/components/bootstrap/src/provision.ts +243 -0
  102. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +294 -0
  103. package/packages/omo-codex/plugin/components/bootstrap/src/worker.ts +279 -0
  104. package/packages/omo-codex/plugin/components/bootstrap/test/download.test.ts +295 -0
  105. package/packages/omo-codex/plugin/components/bootstrap/test/environment.test.ts +375 -0
  106. package/packages/omo-codex/plugin/components/bootstrap/test/provision.test.ts +464 -0
  107. package/packages/omo-codex/plugin/components/bootstrap/tsconfig.json +25 -0
  108. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  109. package/packages/omo-codex/plugin/components/comment-checker/package.json +4 -4
  110. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  111. package/packages/omo-codex/plugin/components/git-bash/package.json +2 -2
  112. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +6 -10
  113. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  114. package/packages/omo-codex/plugin/components/lsp/package.json +4 -4
  115. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.test.mjs +8 -3
  116. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +5 -8
  117. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-cli.test.ts +24 -1
  118. package/packages/omo-codex/plugin/components/rules/bundled-rules/windows-git-bash.md +3 -1
  119. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  120. package/packages/omo-codex/plugin/components/rules/package.json +4 -4
  121. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +35 -1
  122. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  123. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +4 -4
  124. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  125. package/packages/omo-codex/plugin/components/telemetry/package.json +4 -4
  126. package/packages/omo-codex/plugin/components/ultrawork/biome.json +1 -1
  127. package/packages/omo-codex/plugin/components/ultrawork/directive.md +155 -99
  128. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  129. package/packages/omo-codex/plugin/components/ultrawork/package.json +4 -4
  130. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +19 -51
  131. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +46 -51
  132. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +19 -0
  133. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -1
  134. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +9 -1
  135. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -0
  136. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +18 -0
  137. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +1 -3
  138. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  139. package/packages/omo-codex/plugin/components/ulw-loop/package.json +4 -4
  140. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +6 -2
  141. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +19 -0
  142. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +1 -1
  143. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +6 -0
  144. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-complete-goals.test.ts +26 -1
  145. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-json-errors.test.ts +89 -0
  146. package/packages/omo-codex/plugin/hooks/hooks.json +27 -16
  147. package/packages/omo-codex/plugin/package-lock.json +193 -193
  148. package/packages/omo-codex/plugin/package.json +1 -1
  149. package/packages/omo-codex/plugin/scripts/auto-update-state.d.mts +20 -0
  150. package/packages/omo-codex/plugin/scripts/auto-update.mjs +28 -8
  151. package/packages/omo-codex/plugin/scripts/build-components.mjs +36 -5
  152. package/packages/omo-codex/plugin/scripts/install-flow.mjs +43 -0
  153. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +79 -28
  154. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/agents/openai.yaml +2 -2
  155. package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +7 -6
  156. package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +1 -1
  157. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +19 -51
  158. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +46 -51
  159. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -0
  160. package/packages/omo-codex/plugin/test/auto-update.test.mjs +145 -0
  161. package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +250 -0
  162. package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +166 -0
  163. package/packages/omo-codex/plugin/test/bootstrap-orchestration.test.mjs +371 -0
  164. package/packages/omo-codex/plugin/test/bootstrap-ps-guard.test.mjs +134 -0
  165. package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +249 -0
  166. package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +10 -1
  167. package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +46 -0
  168. package/packages/omo-codex/scripts/atomic-write.test.mjs +82 -0
  169. package/packages/omo-codex/scripts/install/agents.d.mts +18 -0
  170. package/packages/omo-codex/scripts/install/agents.mjs +78 -5
  171. package/packages/omo-codex/scripts/install/atomic-write.mjs +59 -0
  172. package/packages/omo-codex/scripts/install/bin-dir.d.mts +7 -0
  173. package/packages/omo-codex/scripts/install/bin-links.d.mts +18 -0
  174. package/packages/omo-codex/scripts/install/config.d.mts +35 -0
  175. package/packages/omo-codex/scripts/install/config.mjs +13 -3
  176. package/packages/omo-codex/scripts/install/git-bash-mcp-env.d.mts +5 -0
  177. package/packages/omo-codex/scripts/install/git-bash.d.mts +23 -0
  178. package/packages/omo-codex/scripts/install/hook-trust.d.mts +10 -0
  179. package/packages/omo-codex/scripts/install-agent-links.test.mjs +41 -0
  180. package/packages/omo-codex/scripts/install-local.mjs +3 -2
  181. package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +79 -28
  182. package/packages/shared-skills/skills/lcx-contribute-bug-fix/agents/openai.yaml +2 -2
  183. package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +7 -6
  184. package/packages/shared-skills/skills/lcx-report-bug/agents/openai.yaml +1 -1
  185. package/dist/hooks/session-recovery/constants.d.ts +0 -4
  186. package/dist/hooks/session-recovery/detect-error-type.d.ts +0 -4
  187. package/dist/hooks/session-recovery/error-recovery.d.ts +0 -4
  188. package/dist/hooks/session-recovery/hook-types.d.ts +0 -22
  189. package/dist/hooks/session-recovery/hook.d.ts +0 -4
  190. package/dist/hooks/session-recovery/index.d.ts +0 -5
  191. package/dist/hooks/session-recovery/interrupted-idle-message-fetch-timeout.d.ts +0 -7
  192. package/dist/hooks/session-recovery/interrupted-tool-results.d.ts +0 -3
  193. package/dist/hooks/session-recovery/message-state.d.ts +0 -4
  194. package/dist/hooks/session-recovery/recover-thinking-block-order.d.ts +0 -5
  195. package/dist/hooks/session-recovery/recover-thinking-disabled-violation.d.ts +0 -5
  196. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +0 -10
  197. package/dist/hooks/session-recovery/recover-unavailable-tool.d.ts +0 -5
  198. package/dist/hooks/session-recovery/resume.d.ts +0 -7
  199. package/dist/hooks/session-recovery/storage/latest-assistant-message.d.ts +0 -5
  200. package/dist/hooks/session-recovery/storage/orphan-thinking-search.d.ts +0 -2
  201. package/dist/hooks/session-recovery/storage/thinking-block-search.d.ts +0 -2
  202. package/dist/hooks/session-recovery/storage/thinking-prepend.d.ts +0 -33
  203. package/dist/hooks/session-recovery/storage/thinking-strip.d.ts +0 -11
  204. package/dist/hooks/session-recovery/storage.d.ts +0 -20
  205. package/dist/plugin/event-session-recovery.d.ts +0 -9
  206. package/dist/plugin/user-abort-interrupted-recovery-guard.d.ts +0 -6
  207. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/empty-messages.d.ts +0 -0
  208. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/empty-text.d.ts +0 -0
  209. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/message-dir.d.ts +0 -0
  210. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/part-id.d.ts +0 -0
  211. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/text-part-injector.d.ts +0 -0
@@ -331,9 +331,11 @@ function errorMessage(error) {
331
331
  return String(error);
332
332
  }
333
333
  // src/sg-cli-path.ts
334
- import { createRequire } from "module";
335
- import { dirname, join as join2 } from "path";
336
- import { existsSync, statSync as statSync2 } from "fs";
334
+ import { createRequire } from "node:module";
335
+ import { homedir as defaultHomedir } from "node:os";
336
+ import { dirname, join as join2 } from "node:path";
337
+ import { existsSync, statSync as statSync2 } from "node:fs";
338
+ var SG_PATH_ENV_KEY = "OMO_AST_GREP_SG_PATH";
337
339
  var WINDOWS_EXECUTABLE_EXTENSIONS = [".exe", ".cmd", ".bat"];
338
340
  function isValidBinary(filePath) {
339
341
  try {
@@ -364,17 +366,15 @@ function executableCandidates(filePath, platform = process.platform) {
364
366
  }
365
367
  return candidates;
366
368
  }
367
- function findValidExecutable(filePath) {
368
- for (const candidate of executableCandidates(filePath)) {
369
+ function findValidExecutable(filePath, platform = process.platform) {
370
+ for (const candidate of executableCandidates(filePath, platform)) {
369
371
  if (existsSync(candidate) && isValidBinary(candidate)) {
370
372
  return candidate;
371
373
  }
372
374
  }
373
375
  return null;
374
376
  }
375
- function getPlatformPackageName() {
376
- const platform = process.platform;
377
- const arch = process.arch;
377
+ function getPlatformPackageName(platform, arch) {
378
378
  const platformMap = {
379
379
  "darwin-arm64": "@ast-grep/cli-darwin-arm64",
380
380
  "darwin-x64": "@ast-grep/cli-darwin-x64",
@@ -389,14 +389,48 @@ function getPlatformPackageName() {
389
389
  function isModuleResolutionFailure(error) {
390
390
  return error instanceof Error && (error.message.includes("Cannot find module") || error.message.includes("Cannot find package"));
391
391
  }
392
- function findSgCliPathSync() {
392
+ function defaultResolveModulePath(specifier) {
393
+ const require2 = createRequire(import.meta.url);
394
+ return require2.resolve(specifier);
395
+ }
396
+ function nonEmptyValue(value) {
397
+ if (value === undefined)
398
+ return;
399
+ const trimmed = value.trim();
400
+ return trimmed.length === 0 ? undefined : trimmed;
401
+ }
402
+ function findEnvOverrideSgPath(env, platform) {
403
+ const overridePath = nonEmptyValue(env[SG_PATH_ENV_KEY]);
404
+ if (overridePath === undefined)
405
+ return null;
406
+ return findValidExecutable(overridePath, platform);
407
+ }
408
+ function findRuntimeDirSgPath(env, platform, arch, homedir) {
409
+ const codexHome = nonEmptyValue(env["CODEX_HOME"]) ?? join2(homedir(), ".codex");
410
+ const binaryName = platform === "win32" ? "sg.exe" : "sg";
411
+ const runtimePath = join2(codexHome, "runtime", "ast-grep", `${platform}-${arch}`, binaryName);
412
+ return findValidExecutable(runtimePath, platform);
413
+ }
414
+ function findSgCliPathSync(options = {}) {
415
+ const env = options.env ?? process.env;
416
+ const platform = options.platform ?? process.platform;
417
+ const arch = options.arch ?? process.arch;
418
+ const homedir = options.homedir ?? defaultHomedir;
419
+ const resolveModulePath = options.resolveModulePath ?? defaultResolveModulePath;
420
+ const envOverridePath = findEnvOverrideSgPath(env, platform);
421
+ if (envOverridePath) {
422
+ return envOverridePath;
423
+ }
424
+ const runtimeDirPath = findRuntimeDirSgPath(env, platform, arch, homedir);
425
+ if (runtimeDirPath) {
426
+ return runtimeDirPath;
427
+ }
393
428
  const binaryName = "sg";
394
429
  try {
395
- const require2 = createRequire(import.meta.url);
396
- const cliPackageJsonPath = require2.resolve("@ast-grep/cli/package.json");
430
+ const cliPackageJsonPath = resolveModulePath("@ast-grep/cli/package.json");
397
431
  const cliDirectory = dirname(cliPackageJsonPath);
398
432
  const sgPath = join2(cliDirectory, binaryName);
399
- const validSgPath = findValidExecutable(sgPath);
433
+ const validSgPath = findValidExecutable(sgPath, platform);
400
434
  if (validSgPath) {
401
435
  return validSgPath;
402
436
  }
@@ -405,15 +439,14 @@ function findSgCliPathSync() {
405
439
  throw error;
406
440
  }
407
441
  }
408
- const platformPackage = getPlatformPackageName();
442
+ const platformPackage = getPlatformPackageName(platform, arch);
409
443
  if (platformPackage) {
410
444
  try {
411
- const require2 = createRequire(import.meta.url);
412
- const packageJsonPath = require2.resolve(`${platformPackage}/package.json`);
445
+ const packageJsonPath = resolveModulePath(`${platformPackage}/package.json`);
413
446
  const packageDirectory = dirname(packageJsonPath);
414
447
  const astGrepBinaryName = "ast-grep";
415
448
  const binaryPath = join2(packageDirectory, astGrepBinaryName);
416
- const validBinaryPath = findValidExecutable(binaryPath);
449
+ const validBinaryPath = findValidExecutable(binaryPath, platform);
417
450
  if (validBinaryPath) {
418
451
  return validBinaryPath;
419
452
  }
@@ -423,7 +456,7 @@ function findSgCliPathSync() {
423
456
  }
424
457
  }
425
458
  }
426
- if (process.platform === "darwin") {
459
+ if (platform === "darwin") {
427
460
  const homebrewPaths = ["/opt/homebrew/bin/sg", "/usr/local/bin/sg"];
428
461
  for (const path of homebrewPaths) {
429
462
  if (existsSync(path) && isValidBinary(path)) {
@@ -552,7 +552,7 @@ function parseDiagnosticsParams(params) {
552
552
  }
553
553
 
554
554
  class LspClientTransport {
555
- constructor(root, server) {
555
+ constructor(root, server, timeouts = {}) {
556
556
  this.root = root;
557
557
  this.server = server;
558
558
  this.proc = null;
@@ -560,6 +560,8 @@ class LspClientTransport {
560
560
  this.stderrBuffer = [];
561
561
  this.processExited = false;
562
562
  this.diagnosticsStore = new Map;
563
+ this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
564
+ this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
563
565
  }
564
566
  pid() {
565
567
  return this.proc?.pid;
@@ -634,13 +636,14 @@ class LspClientTransport {
634
636
  `);
635
637
  throw new LspProcessExitedError(this.server.id, this.root, this.proc?.exitCode ?? null, stderrTail || undefined);
636
638
  }
639
+ const timeoutMs = args[1]?.timeoutMs ?? this.requestTimeoutMs;
637
640
  let timeoutHandle = null;
638
641
  const timeoutPromise = new Promise((_, reject) => {
639
642
  timeoutHandle = setTimeout(() => {
640
643
  const stderrTail = this.stderrBuffer.slice(-5).join(`
641
644
  `);
642
645
  reject(new LspRequestTimeoutError(method, stderrTail || undefined));
643
- }, REQUEST_TIMEOUT_MS);
646
+ }, timeoutMs);
644
647
  });
645
648
  try {
646
649
  const requestPromise = args.length === 0 ? this.connection.sendRequest(method) : this.connection.sendRequest(method, args[0]);
@@ -812,7 +815,7 @@ class LspClientConnection extends LspClientTransport {
812
815
  }
813
816
  },
814
817
  initializationOptions: this.server.initialization
815
- });
818
+ }, { timeoutMs: this.initializeTimeoutMs });
816
819
  await this.sendNotification("initialized");
817
820
  await this.sendNotification("workspace/didChangeConfiguration", {
818
821
  settings: { json: { validate: { enable: true } } }
@@ -1569,7 +1572,7 @@ var BUILTIN_SERVERS = {
1569
1572
  zls: { command: ["zls"], extensions: [".zig", ".zon"] },
1570
1573
  csharp: { command: ["csharp-ls"], extensions: [".cs"] },
1571
1574
  fsharp: { command: ["fsautocomplete"], extensions: [".fs", ".fsi", ".fsx", ".fsscript"] },
1572
- "sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".objc", ".objcpp"] },
1575
+ "sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".m", ".mm"] },
1573
1576
  rust: { command: ["rust-analyzer"], extensions: [".rs"] },
1574
1577
  clangd: {
1575
1578
  command: ["clangd", "--background-index", "--clang-tidy"],
@@ -1607,7 +1610,7 @@ var BUILTIN_SERVERS = {
1607
1610
  command: ["haskell-language-server-wrapper", "--lsp"],
1608
1611
  extensions: [".hs", ".lhs"]
1609
1612
  },
1610
- "kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] },
1613
+ "kotlin-ls": { command: ["kotlin-lsp", "--stdio"], extensions: [".kt", ".kts"] },
1611
1614
  julials: {
1612
1615
  command: ["julia", "--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"],
1613
1616
  extensions: [".jl"]
@@ -527,7 +527,7 @@ function parseDiagnosticsParams(params) {
527
527
  }
528
528
 
529
529
  class LspClientTransport {
530
- constructor(root, server) {
530
+ constructor(root, server, timeouts = {}) {
531
531
  this.root = root;
532
532
  this.server = server;
533
533
  this.proc = null;
@@ -535,6 +535,8 @@ class LspClientTransport {
535
535
  this.stderrBuffer = [];
536
536
  this.processExited = false;
537
537
  this.diagnosticsStore = new Map;
538
+ this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
539
+ this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
538
540
  }
539
541
  pid() {
540
542
  return this.proc?.pid;
@@ -609,13 +611,14 @@ class LspClientTransport {
609
611
  `);
610
612
  throw new LspProcessExitedError(this.server.id, this.root, this.proc?.exitCode ?? null, stderrTail || undefined);
611
613
  }
614
+ const timeoutMs = args[1]?.timeoutMs ?? this.requestTimeoutMs;
612
615
  let timeoutHandle = null;
613
616
  const timeoutPromise = new Promise((_, reject) => {
614
617
  timeoutHandle = setTimeout(() => {
615
618
  const stderrTail = this.stderrBuffer.slice(-5).join(`
616
619
  `);
617
620
  reject(new LspRequestTimeoutError(method, stderrTail || undefined));
618
- }, REQUEST_TIMEOUT_MS);
621
+ }, timeoutMs);
619
622
  });
620
623
  try {
621
624
  const requestPromise = args.length === 0 ? this.connection.sendRequest(method) : this.connection.sendRequest(method, args[0]);
@@ -787,7 +790,7 @@ class LspClientConnection extends LspClientTransport {
787
790
  }
788
791
  },
789
792
  initializationOptions: this.server.initialization
790
- });
793
+ }, { timeoutMs: this.initializeTimeoutMs });
791
794
  await this.sendNotification("initialized");
792
795
  await this.sendNotification("workspace/didChangeConfiguration", {
793
796
  settings: { json: { validate: { enable: true } } }
@@ -1770,7 +1773,7 @@ var BUILTIN_SERVERS = {
1770
1773
  zls: { command: ["zls"], extensions: [".zig", ".zon"] },
1771
1774
  csharp: { command: ["csharp-ls"], extensions: [".cs"] },
1772
1775
  fsharp: { command: ["fsautocomplete"], extensions: [".fs", ".fsi", ".fsx", ".fsscript"] },
1773
- "sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".objc", ".objcpp"] },
1776
+ "sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".m", ".mm"] },
1774
1777
  rust: { command: ["rust-analyzer"], extensions: [".rs"] },
1775
1778
  clangd: {
1776
1779
  command: ["clangd", "--background-index", "--clang-tidy"],
@@ -1808,7 +1811,7 @@ var BUILTIN_SERVERS = {
1808
1811
  command: ["haskell-language-server-wrapper", "--lsp"],
1809
1812
  extensions: [".hs", ".lhs"]
1810
1813
  },
1811
- "kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] },
1814
+ "kotlin-ls": { command: ["kotlin-lsp", "--stdio"], extensions: [".kt", ".kts"] },
1812
1815
  julials: {
1813
1816
  command: ["julia", "--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"],
1814
1817
  extensions: [".jl"]
@@ -55,7 +55,7 @@ export class LspClientConnection extends LspClientTransport {
55
55
  },
56
56
  },
57
57
  initializationOptions: this.server.initialization,
58
- });
58
+ }, { timeoutMs: this.initializeTimeoutMs });
59
59
  await this.sendNotification("initialized");
60
60
  await this.sendNotification("workspace/didChangeConfiguration", {
61
61
  settings: { json: { validate: { enable: true } } },
@@ -97,7 +97,7 @@ export const BUILTIN_SERVERS = {
97
97
  zls: { command: ["zls"], extensions: [".zig", ".zon"] },
98
98
  csharp: { command: ["csharp-ls"], extensions: [".cs"] },
99
99
  fsharp: { command: ["fsautocomplete"], extensions: [".fs", ".fsi", ".fsx", ".fsscript"] },
100
- "sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".objc", ".objcpp"] },
100
+ "sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".m", ".mm"] },
101
101
  rust: { command: ["rust-analyzer"], extensions: [".rs"] },
102
102
  clangd: {
103
103
  command: ["clangd", "--background-index", "--clang-tidy"],
@@ -135,7 +135,7 @@ export const BUILTIN_SERVERS = {
135
135
  command: ["haskell-language-server-wrapper", "--lsp"],
136
136
  extensions: [".hs", ".lhs"],
137
137
  },
138
- "kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] },
138
+ "kotlin-ls": { command: ["kotlin-lsp", "--stdio"], extensions: [".kt", ".kts"] },
139
139
  julials: {
140
140
  command: ["julia", "--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"],
141
141
  extensions: [".jl"],
@@ -1,6 +1,10 @@
1
1
  import { JsonRpcConnection } from "./json-rpc-connection.js";
2
2
  import { type SpawnedProcess } from "./process.js";
3
3
  import type { Diagnostic, ResolvedServer } from "./types.js";
4
+ export interface LspClientTimeoutOptions {
5
+ requestTimeoutMs?: number;
6
+ initializeTimeoutMs?: number;
7
+ }
4
8
  export declare class LspClientTransport {
5
9
  protected readonly root: string;
6
10
  protected readonly server: ResolvedServer;
@@ -9,7 +13,9 @@ export declare class LspClientTransport {
9
13
  protected readonly stderrBuffer: string[];
10
14
  protected processExited: boolean;
11
15
  protected readonly diagnosticsStore: Map<string, Diagnostic[]>;
12
- constructor(root: string, server: ResolvedServer);
16
+ protected readonly requestTimeoutMs: number;
17
+ protected readonly initializeTimeoutMs: number;
18
+ constructor(root: string, server: ResolvedServer, timeouts?: LspClientTimeoutOptions);
13
19
  pid(): number | undefined;
14
20
  command(): string[];
15
21
  start(): Promise<void>;
@@ -17,6 +23,9 @@ export declare class LspClientTransport {
17
23
  private isConnectionClosedError;
18
24
  protected sendRequest<T>(method: string): Promise<T>;
19
25
  protected sendRequest<T>(method: string, params: unknown): Promise<T>;
26
+ protected sendRequest<T>(method: string, params: unknown, options: {
27
+ timeoutMs?: number;
28
+ }): Promise<T>;
20
29
  protected sendNotification(method: string): Promise<void>;
21
30
  protected sendNotification(method: string, params: unknown): Promise<void>;
22
31
  isAlive(): boolean;
@@ -1,5 +1,5 @@
1
1
  import { reportBestEffortCleanupError } from "./cleanup-errors.js";
2
- import { REQUEST_TIMEOUT_MS, STOP_HARD_KILL_TIMEOUT_MS, STOP_SIGKILL_GRACE_MS } from "./constants.js";
2
+ import { INIT_TIMEOUT_MS, REQUEST_TIMEOUT_MS, STOP_HARD_KILL_TIMEOUT_MS, STOP_SIGKILL_GRACE_MS } from "./constants.js";
3
3
  import { LspConnectionClosedError, LspProcessExitedError, LspRequestTimeoutError } from "./errors.js";
4
4
  import { JsonRpcConnection } from "./json-rpc-connection.js";
5
5
  import { spawnProcess } from "./process.js";
@@ -25,7 +25,7 @@ function parseDiagnosticsParams(params) {
25
25
  return { uri: params["uri"], diagnostics };
26
26
  }
27
27
  export class LspClientTransport {
28
- constructor(root, server) {
28
+ constructor(root, server, timeouts = {}) {
29
29
  this.root = root;
30
30
  this.server = server;
31
31
  this.proc = null;
@@ -33,6 +33,8 @@ export class LspClientTransport {
33
33
  this.stderrBuffer = [];
34
34
  this.processExited = false;
35
35
  this.diagnosticsStore = new Map();
36
+ this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
37
+ this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
36
38
  }
37
39
  pid() {
38
40
  return this.proc?.pid;
@@ -106,12 +108,13 @@ export class LspClientTransport {
106
108
  const stderrTail = this.stderrBuffer.slice(-10).join("\n");
107
109
  throw new LspProcessExitedError(this.server.id, this.root, this.proc?.exitCode ?? null, stderrTail || undefined);
108
110
  }
111
+ const timeoutMs = args[1]?.timeoutMs ?? this.requestTimeoutMs;
109
112
  let timeoutHandle = null;
110
113
  const timeoutPromise = new Promise((_, reject) => {
111
114
  timeoutHandle = setTimeout(() => {
112
115
  const stderrTail = this.stderrBuffer.slice(-5).join("\n");
113
116
  reject(new LspRequestTimeoutError(method, stderrTail || undefined));
114
- }, REQUEST_TIMEOUT_MS);
117
+ }, timeoutMs);
115
118
  });
116
119
  try {
117
120
  const requestPromise = args.length === 0
@@ -7,30 +7,29 @@ on:
7
7
  permissions:
8
8
  contents: read
9
9
  issues: write
10
- pull-requests: read
10
+ pull-requests: write
11
11
 
12
12
  jobs:
13
- comment-source-repo:
13
+ close-with-source-guidance:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
- - name: Comment with source repository guidance
16
+ - name: Close PR with source repository guidance
17
17
  env:
18
18
  GH_TOKEN: ${{ github.token }}
19
19
  PR_NUMBER: ${{ github.event.pull_request.number }}
20
+ PR_TITLE: ${{ github.event.pull_request.title }}
20
21
  run: |
21
22
  set -euo pipefail
22
23
 
23
- marker="canonical LazyCodex source lives in"
24
- if gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json comments --jq '.comments[].body' | grep -F "$marker" >/dev/null; then
25
- echo "Source guidance comment already exists."
26
- exit 0
27
- fi
24
+ PR_URL="https://github.com/$GITHUB_REPOSITORY/pull/$PR_NUMBER"
28
25
 
29
26
  body="$(mktemp)"
30
- cat > "$body" <<'MARKDOWN'
31
- Thanks for opening this PR. The canonical LazyCodex source lives in [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent), and the Codex Light implementation is under [`packages/omo-codex`](https://github.com/code-yeongyu/oh-my-openagent/tree/dev/packages/omo-codex).
27
+ cat > "$body" <<MARKDOWN
28
+ Thanks for the PR! Changes to LazyCodex land through [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent) could you open this against [omo-codex](https://github.com/code-yeongyu/oh-my-openagent/tree/dev/packages/omo-codex) over there instead? PRs in this repository can't be merged.
32
29
 
33
- Direct edits in this marketplace repository can be overwritten by the release sync. Please open the implementation PR in `code-yeongyu/oh-my-openagent` and add the `lazycodex` label there so it gets routed faster.
30
+ If you're working with a coding agent, prompt it like this:
31
+
32
+ > I opened $PR_URL ("$PR_TITLE") against code-yeongyu/lazycodex, but changes there land through code-yeongyu/oh-my-openagent, where the Codex implementation lives under packages/omo-codex. Read my original PR, then open an equivalent PR against code-yeongyu/oh-my-openagent. In the new PR body, link the original PR ($PR_URL), explain that it was first opened against lazycodex, and describe in detail what that PR changed and why.
34
33
  MARKDOWN
35
34
 
36
- gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body-file "$body"
35
+ gh pr close "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --comment "$(cat "$body")"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omo",
3
- "version": "4.9.2",
3
+ "version": "4.10.0",
4
4
  "description": "One Codex plugin namespace for Yeongyu's local Codex components.",
5
5
  "author": {
6
6
  "name": "Yeongyu Kim",