oh-my-opencode 5.0.0-beta.30 → 5.0.0-beta.32

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 (278) hide show
  1. package/dist/cli/index.js +178 -37
  2. package/dist/cli-node/index.js +178 -37
  3. package/dist/config/schema/background-task.d.ts +1 -0
  4. package/dist/config/schema/oh-my-opencode-config.d.ts +1 -0
  5. package/dist/features/background-agent/constants.d.ts +0 -7
  6. package/dist/features/background-agent/manager.d.ts +2 -1
  7. package/dist/features/background-agent/parent-wake-dispatched-tracker.d.ts +0 -1
  8. package/dist/features/background-agent/parent-wake-notifier-types.d.ts +1 -1
  9. package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -1
  10. package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -1
  11. package/dist/features/background-agent/subagent-spawn-limits.d.ts +8 -0
  12. package/dist/features/monitor/manager-internals.d.ts +1 -1
  13. package/dist/features/monitor/output-injector-types.d.ts +1 -1
  14. package/dist/features/task-toast-manager/manager.d.ts +0 -24
  15. package/dist/features/team-mode/tools/messaging-live-delivery-recipient.d.ts +1 -0
  16. package/dist/features/team-mode/tools/messaging-runtime.d.ts +1 -0
  17. package/dist/hooks/anthropic-context-window-limit-recovery/message-storage-directory.d.ts +0 -3
  18. package/dist/hooks/anthropic-context-window-limit-recovery/state.d.ts +1 -0
  19. package/dist/hooks/anthropic-context-window-limit-recovery/storage/empty-messages.d.ts +0 -1
  20. package/dist/hooks/anthropic-context-window-limit-recovery/tool-result-storage.d.ts +11 -0
  21. package/dist/hooks/claude-code-hooks/session-hook-state.d.ts +1 -0
  22. package/dist/hooks/claude-code-hooks/stop.d.ts +2 -0
  23. package/dist/hooks/claude-code-hooks/todo.d.ts +0 -1
  24. package/dist/hooks/claude-code-hooks/transcript.d.ts +2 -0
  25. package/dist/hooks/fsync-skip-warning/index.d.ts +4 -0
  26. package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +1 -0
  27. package/dist/hooks/hashline-edit-diff-enhancer/pending-captures.d.ts +13 -0
  28. package/dist/hooks/keyword-detector/hook.d.ts +7 -0
  29. package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +0 -1
  30. package/dist/hooks/model-fallback/hook.d.ts +1 -1
  31. package/dist/index.js +681 -273
  32. package/dist/oh-my-opencode.schema.json +5 -0
  33. package/dist/plugin-dispose.d.ts +3 -0
  34. package/dist/shared/agent-tool-restrictions.d.ts +0 -1
  35. package/dist/skills/ultimate-browsing/references/insane-search/README.md +9 -2
  36. package/dist/tools/delegate-task/sync-session-cleanup.d.ts +3 -0
  37. package/dist/tools/delegate-task/sync-session-poller.d.ts +1 -0
  38. package/dist/tools/delegate-task/types.d.ts +1 -0
  39. package/dist/tools/session-manager/directory-filter.d.ts +2 -0
  40. package/dist/tui.js +148 -9
  41. package/package.json +16 -15
  42. package/packages/git-bash-mcp/dist/cli.js +1 -0
  43. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +47 -19
  44. package/packages/lsp-core/src/lsp/client-diagnostics-pull-timeout.test.ts +64 -0
  45. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +97 -0
  46. package/packages/lsp-core/src/lsp/client-wrapper.ts +21 -6
  47. package/packages/lsp-core/src/lsp/client.ts +6 -3
  48. package/packages/lsp-core/src/lsp/constants.ts +5 -0
  49. package/packages/lsp-core/src/lsp/controlled-clock-test-support.ts +61 -0
  50. package/packages/lsp-core/src/lsp/errors.ts +15 -0
  51. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +10 -3
  52. package/packages/lsp-core/src/lsp/manager-lifecycle.test.ts +262 -0
  53. package/packages/lsp-core/src/lsp/manager.ts +106 -13
  54. package/packages/lsp-core/src/lsp/timer-provider.ts +13 -0
  55. package/packages/lsp-core/src/lsp/transport-request-timeout.test.ts +73 -0
  56. package/packages/lsp-core/src/lsp/transport.ts +7 -2
  57. package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +84 -1
  58. package/packages/lsp-core/src/lsp/workspace-document-state.ts +30 -11
  59. package/packages/lsp-core/src/lsp/workspace-markers.ts +18 -1
  60. package/packages/lsp-core/src/mcp.ts +3 -0
  61. package/packages/lsp-core/src/tools/parameters.test.ts +51 -0
  62. package/packages/lsp-daemon/dist/cli.js +155 -34
  63. package/packages/lsp-daemon/dist/client.js +155 -34
  64. package/packages/lsp-daemon/dist/index.js +155 -34
  65. package/packages/lsp-daemon/dist/proxy.js +3 -0
  66. package/packages/lsp-tools-mcp/dist/cli.js +155 -34
  67. package/packages/lsp-tools-mcp/dist/lsp/manager.js +134 -28
  68. package/packages/lsp-tools-mcp/dist/mcp.js +155 -34
  69. package/packages/lsp-tools-mcp/dist/tools.js +154 -34
  70. package/packages/lsp-tools-mcp/package.json +1 -1
  71. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  72. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  73. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  74. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +17 -2
  75. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +17 -2
  76. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  77. package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +12 -0
  78. package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable-idle.test.ts +47 -0
  79. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  80. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  81. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  82. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  83. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  84. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  85. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  86. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +152 -34
  87. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  88. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  89. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  90. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  91. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  92. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  93. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  94. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  95. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -4
  96. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +489 -4
  97. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  98. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -2
  99. package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +30 -14
  100. package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +4 -0
  101. package/packages/omo-codex/plugin/components/ultrawork/src/directive.ts +5 -2
  102. package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +14 -8
  103. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +12 -1
  104. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +2 -2
  105. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  106. package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +5 -2
  107. package/packages/omo-codex/plugin/components/ulw-loop/README.md +1 -0
  108. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +9 -0
  109. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +14 -0
  110. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +10 -1
  111. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.d.ts +8 -0
  112. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.js +113 -0
  113. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +9 -5
  114. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +2 -1
  115. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
  116. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +1 -0
  117. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +2 -0
  118. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +856 -347
  119. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +2 -0
  120. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +27 -6
  121. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +13 -0
  122. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +14 -0
  123. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +17 -9
  124. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +17 -2
  125. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.d.ts +13 -0
  126. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.js +19 -0
  127. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.d.ts +2 -0
  128. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.js +53 -0
  129. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.d.ts +9 -0
  130. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.js +85 -0
  131. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +1 -1
  132. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +4 -2
  133. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +41 -102
  134. package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +4 -2
  135. package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.js +185 -14
  136. package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.d.ts +6 -0
  137. package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.js +33 -0
  138. package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.d.ts +18 -0
  139. package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.js +65 -0
  140. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  141. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  142. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +17 -0
  143. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +7 -0
  144. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +25 -1
  145. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-template.ts +127 -0
  146. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +10 -12
  147. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +2 -1
  148. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +1 -0
  149. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +2 -0
  150. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +34 -5
  151. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +23 -0
  152. package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +19 -9
  153. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +18 -3
  154. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-missing-recovery.ts +27 -0
  155. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-aggregate.ts +57 -0
  156. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-artifacts.ts +103 -0
  157. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +1 -1
  158. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +54 -123
  159. package/packages/omo-codex/plugin/components/ulw-loop/src/review-blockers.ts +4 -2
  160. package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-guard.ts +187 -12
  161. package/packages/omo-codex/plugin/components/ulw-loop/src/status-next-actions.ts +36 -0
  162. package/packages/omo-codex/plugin/components/ulw-loop/src/surface.ts +95 -0
  163. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +107 -1
  164. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-template.test.ts +92 -0
  165. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-status-next-actions.test.ts +183 -0
  166. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +35 -0
  167. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +7 -3
  168. package/packages/omo-codex/plugin/components/ulw-loop/test/guided-recovery.test.ts +105 -0
  169. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate.test.ts +101 -0
  170. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +46 -2
  171. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-senpi-surface.test.ts +131 -0
  172. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +5 -0
  173. package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-guard.test.ts +318 -1
  174. package/packages/omo-codex/plugin/components/ulw-loop/test/surface.test.ts +74 -0
  175. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +9 -3
  176. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  177. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  178. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  179. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  180. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  181. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  182. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  183. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  184. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  185. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  186. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  187. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  188. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  189. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  190. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  191. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  192. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  193. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  194. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +1 -1
  195. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  196. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  197. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  198. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  199. package/packages/omo-codex/plugin/package-lock.json +13 -13
  200. package/packages/omo-codex/plugin/package.json +1 -1
  201. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +31 -2
  202. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +9 -2
  203. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +17 -0
  204. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +11 -1
  205. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +13 -0
  206. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +5 -2
  207. package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
  208. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +9 -2
  209. package/dist/features/builtin-skills/index.d.ts +0 -1
  210. package/dist/features/builtin-skills/skill-file-loader.d.ts +0 -1
  211. package/dist/features/builtin-skills/skills/agent-browser-skill.d.ts +0 -1
  212. package/dist/features/builtin-skills/skills/agent-browser-template.d.ts +0 -1
  213. package/dist/features/builtin-skills/skills/debugging.d.ts +0 -1
  214. package/dist/features/builtin-skills/skills/dev-browser.d.ts +0 -1
  215. package/dist/features/builtin-skills/skills/frontend.d.ts +0 -1
  216. package/dist/features/builtin-skills/skills/git-master-sections/commit-atomic-planning.d.ts +0 -1
  217. package/dist/features/builtin-skills/skills/git-master-sections/commit-context-analysis.d.ts +0 -1
  218. package/dist/features/builtin-skills/skills/git-master-sections/commit-execution-verification.d.ts +0 -1
  219. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +0 -1
  220. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +0 -1
  221. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +0 -1
  222. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +0 -1
  223. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +0 -1
  224. package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +0 -1
  225. package/dist/features/builtin-skills/skills/git-master.d.ts +0 -1
  226. package/dist/features/builtin-skills/skills/index.d.ts +0 -1
  227. package/dist/features/builtin-skills/skills/init-deep.d.ts +0 -1
  228. package/dist/features/builtin-skills/skills/playwright-cli.d.ts +0 -1
  229. package/dist/features/builtin-skills/skills/playwright-mcp-skill.d.ts +0 -1
  230. package/dist/features/builtin-skills/skills/playwright.d.ts +0 -1
  231. package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +0 -1
  232. package/dist/features/builtin-skills/skills/review-work.d.ts +0 -1
  233. package/dist/features/builtin-skills/skills/security-research.d.ts +0 -1
  234. package/dist/features/builtin-skills/skills/security-review.d.ts +0 -1
  235. package/dist/features/builtin-skills/skills/team-mode.d.ts +0 -1
  236. package/dist/features/builtin-skills/skills/visual-qa.d.ts +0 -1
  237. package/dist/features/builtin-skills/skills.d.ts +0 -1
  238. package/dist/features/builtin-skills/types.d.ts +0 -1
  239. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +0 -1
  240. package/dist/features/claude-code-plugin-loader/command-loader.d.ts +0 -1
  241. package/dist/features/claude-code-plugin-loader/discovery-core.d.ts +0 -1
  242. package/dist/features/claude-code-plugin-loader/discovery-paths.d.ts +0 -1
  243. package/dist/features/claude-code-plugin-loader/discovery.d.ts +0 -1
  244. package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +0 -1
  245. package/dist/features/claude-code-plugin-loader/index.d.ts +0 -1
  246. package/dist/features/claude-code-plugin-loader/install-path-resolver.d.ts +0 -1
  247. package/dist/features/claude-code-plugin-loader/installed-plugin-database.d.ts +0 -1
  248. package/dist/features/claude-code-plugin-loader/loaded-plugin.d.ts +0 -1
  249. package/dist/features/claude-code-plugin-loader/loader.d.ts +0 -1
  250. package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +0 -1
  251. package/dist/features/claude-code-plugin-loader/plugin-key.d.ts +0 -1
  252. package/dist/features/claude-code-plugin-loader/plugin-manifest.d.ts +0 -1
  253. package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
  254. package/dist/features/claude-code-plugin-loader/plugin-settings.d.ts +0 -1
  255. package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +0 -1
  256. package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +0 -1
  257. package/dist/features/claude-code-plugin-loader/types.d.ts +0 -1
  258. package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +0 -11
  259. package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +0 -7
  260. package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +0 -1
  261. package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +0 -1
  262. package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +0 -1
  263. package/dist/shared/prompt-async-gate/queue.d.ts +0 -1
  264. package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +0 -1
  265. package/dist/shared/prompt-async-gate/reservations.d.ts +0 -1
  266. package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +0 -1
  267. package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +0 -1
  268. package/dist/shared/prompt-async-gate/timing.d.ts +0 -1
  269. package/dist/shared/prompt-async-gate/types.d.ts +0 -1
  270. package/dist/tools/call-omo-agent/message-storage-directory.d.ts +0 -1
  271. package/dist/tools/delegate-task/model-string-parser.d.ts +0 -1
  272. package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts +0 -1
  273. package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts +0 -1
  274. package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts +0 -1
  275. package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.d.ts +0 -1
  276. package/packages/lsp-tools-mcp/dist/missing-dependency-result.d.ts +0 -1
  277. package/packages/omo-codex/plugin/components/ultrawork/directive.md +0 -483
  278. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +0 -490
@@ -17,6 +17,13 @@ import { pathToFileURL as pathToFileURL3 } from "node:url";
17
17
  // ../lsp-core/src/lsp/connection.ts
18
18
  import { pathToFileURL } from "node:url";
19
19
 
20
+ // ../lsp-core/src/lsp/timer-provider.ts
21
+ var realTimerProvider = {
22
+ now: () => Date.now(),
23
+ setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
24
+ clearTimeout: (handle) => clearTimeout(handle)
25
+ };
26
+
20
27
  // ../lsp-core/src/lsp/constants.ts
21
28
  var DEFAULT_MAX_REFERENCES = 200;
22
29
  var DEFAULT_MAX_SYMBOLS = 200;
@@ -29,6 +36,8 @@ var MAX_RESIDENT_CLIENTS = 6;
29
36
  var REAPER_INTERVAL_MS = 60000;
30
37
  var STOP_HARD_KILL_TIMEOUT_MS = 5000;
31
38
  var STOP_SIGKILL_GRACE_MS = 1000;
39
+ var CLIENT_RESPAWN_RETRY_LIMIT = 2;
40
+ var CLIENT_RESPAWN_COOLDOWN_MS = 60000;
32
41
 
33
42
  // ../lsp-core/src/lsp/errors.ts
34
43
  class LspConnectionClosedError extends Error {
@@ -93,6 +102,16 @@ class LspProcessSpawnError extends Error {
93
102
  this.name = "LspProcessSpawnError";
94
103
  }
95
104
  }
105
+
106
+ class LspClientRespawnBudgetExceededError extends Error {
107
+ constructor(serverId, root, retryLimit) {
108
+ super(`LSP server ${serverId} at ${root} failed to stay alive; respawn budget exhausted ` + `(${retryLimit} consecutive dead generations). Retrying after the cooldown may succeed.`);
109
+ this.serverId = serverId;
110
+ this.root = root;
111
+ this.retryLimit = retryLimit;
112
+ this.name = "LspClientRespawnBudgetExceededError";
113
+ }
114
+ }
96
115
  function isLspDeadConnectionError(err) {
97
116
  return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
98
117
  }
@@ -621,6 +640,7 @@ class LspClientTransport {
621
640
  this.documentFormattingSupported = false;
622
641
  this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
623
642
  this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
643
+ this.timerProvider = timeouts.timerProvider ?? realTimerProvider;
624
644
  }
625
645
  pid() {
626
646
  return this.proc?.pid;
@@ -721,7 +741,7 @@ class LspClientTransport {
721
741
  const options = args[1];
722
742
  const timeoutMs = options?.timeoutMs ?? this.requestTimeoutMs;
723
743
  const timeoutController = new AbortController;
724
- const timeoutHandle = setTimeout(() => {
744
+ const timeoutHandle = this.timerProvider.setTimeout(() => {
725
745
  const stderrTail = this.stderrBuffer.slice(-5).join(`
726
746
  `);
727
747
  timeoutController.abort(new LspRequestTimeoutError(method, stderrTail || undefined));
@@ -740,7 +760,7 @@ class LspClientTransport {
740
760
  }
741
761
  throw error;
742
762
  } finally {
743
- clearTimeout(timeoutHandle);
763
+ this.timerProvider.clearTimeout(timeoutHandle);
744
764
  combinedSignal.dispose();
745
765
  }
746
766
  }
@@ -1131,6 +1151,17 @@ function canonicalPath(filePath) {
1131
1151
  return absolute;
1132
1152
  }
1133
1153
  }
1154
+ function normalizeDocumentUri(uri) {
1155
+ let decoded = uri;
1156
+ try {
1157
+ decoded = decodeURIComponent(uri);
1158
+ } catch {
1159
+ decoded = uri;
1160
+ }
1161
+ if (process.platform !== "win32")
1162
+ return decoded;
1163
+ return decoded.replace(/^(file:\/\/\/)([a-z]):/, (_match, prefix, drive) => `${prefix}${drive.toUpperCase()}:`);
1164
+ }
1134
1165
  function isSameOrDescendant(candidate, parent) {
1135
1166
  const suffix = relative(parent, candidate);
1136
1167
  return suffix === "" || !suffix.startsWith("..") && suffix !== "..";
@@ -1147,7 +1178,12 @@ class WorkspaceDocumentState {
1147
1178
  this.openDocuments = new Map;
1148
1179
  this.openByUri = new Map;
1149
1180
  this.openPromises = new Map;
1150
- this.now = options.now ?? (() => Date.now());
1181
+ this.timerProvider = options.timerProvider ?? {
1182
+ now: options.now ?? (() => Date.now()),
1183
+ setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
1184
+ clearTimeout: (handle) => clearTimeout(handle)
1185
+ };
1186
+ this.now = () => this.timerProvider.now();
1151
1187
  this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
1152
1188
  }
1153
1189
  async openFile(filePath) {
@@ -1169,7 +1205,7 @@ class WorkspaceDocumentState {
1169
1205
  return this.openDocuments.get(canonicalPath(filePath))?.version;
1170
1206
  }
1171
1207
  getStoredDiagnostics(uri) {
1172
- const state = this.openByUri.get(uri);
1208
+ const state = this.openByUri.get(normalizeDocumentUri(uri));
1173
1209
  if (!state)
1174
1210
  return [];
1175
1211
  return state.lastPublish?.diagnostics ?? state.pullCache?.diagnostics ?? [];
@@ -1191,13 +1227,13 @@ class WorkspaceDocumentState {
1191
1227
  return state !== undefined && state.uri === snapshot.uri && state.version === snapshot.version && state.generation === snapshot.documentGeneration;
1192
1228
  }
1193
1229
  getPullCache(snapshot) {
1194
- const state = this.openByUri.get(snapshot.uri);
1230
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1195
1231
  if (!state?.pullCache || state.pullCache.documentVersion !== snapshot.version)
1196
1232
  return null;
1197
1233
  return state.pullCache;
1198
1234
  }
1199
1235
  recordPullDiagnostics(snapshot, report) {
1200
- const state = this.openByUri.get(snapshot.uri);
1236
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1201
1237
  if (!state)
1202
1238
  return;
1203
1239
  state.pullCache = {
@@ -1207,7 +1243,7 @@ class WorkspaceDocumentState {
1207
1243
  };
1208
1244
  }
1209
1245
  recordPublishedDiagnostics(params) {
1210
- const state = this.openByUri.get(params.uri);
1246
+ const state = this.openByUri.get(normalizeDocumentUri(params.uri));
1211
1247
  if (!state)
1212
1248
  return;
1213
1249
  state.publishGeneration += 1;
@@ -1221,7 +1257,7 @@ class WorkspaceDocumentState {
1221
1257
  this.notifyWaiters(state);
1222
1258
  }
1223
1259
  resolvePushDiagnostics(snapshot) {
1224
- const state = this.openByUri.get(snapshot.uri);
1260
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1225
1261
  if (!state?.lastPublish)
1226
1262
  return { status: "missing" };
1227
1263
  const publish = state.lastPublish;
@@ -1235,7 +1271,7 @@ class WorkspaceDocumentState {
1235
1271
  return waitMs === 0 ? { status: "ready", diagnostics: publish.diagnostics } : { status: "wait", waitMs };
1236
1272
  }
1237
1273
  waitForDiagnosticsActivity(snapshot, timeoutMs) {
1238
- const state = this.openByUri.get(snapshot.uri);
1274
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1239
1275
  if (!state || timeoutMs <= 0)
1240
1276
  return Promise.resolve();
1241
1277
  return new Promise((resolveActivity) => {
@@ -1244,11 +1280,11 @@ class WorkspaceDocumentState {
1244
1280
  if (settled)
1245
1281
  return;
1246
1282
  settled = true;
1247
- clearTimeout(timer);
1283
+ this.timerProvider.clearTimeout(timer);
1248
1284
  state.waiters.delete(finish);
1249
1285
  resolveActivity();
1250
1286
  };
1251
- const timer = setTimeout(finish, timeoutMs);
1287
+ const timer = this.timerProvider.setTimeout(finish, timeoutMs);
1252
1288
  if (typeof timer.unref === "function")
1253
1289
  timer.unref();
1254
1290
  state.waiters.add(finish);
@@ -1356,7 +1392,7 @@ class WorkspaceDocumentState {
1356
1392
  waiters: new Set
1357
1393
  };
1358
1394
  this.openDocuments.set(path, state);
1359
- this.openByUri.set(state.uri, state);
1395
+ this.openByUri.set(normalizeDocumentUri(state.uri), state);
1360
1396
  this.notifyWaiters(state);
1361
1397
  await this.sendNotification("textDocument/didOpen", {
1362
1398
  textDocument: { uri: state.uri, languageId: state.languageId, version: state.version, text }
@@ -1381,7 +1417,7 @@ class WorkspaceDocumentState {
1381
1417
  }
1382
1418
  async closeDocument(state) {
1383
1419
  this.openDocuments.delete(state.path);
1384
- this.openByUri.delete(state.uri);
1420
+ this.openByUri.delete(normalizeDocumentUri(state.uri));
1385
1421
  this.clearDiagnostics(state.uri);
1386
1422
  this.notifyWaiters(state);
1387
1423
  await this.sendNotification("textDocument/didClose", { textDocument: { uri: state.uri } });
@@ -2468,6 +2504,7 @@ class LspClient extends LspClientConnection {
2468
2504
  this.diagnosticPullErrors = [];
2469
2505
  this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
2470
2506
  this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
2507
+ timerProvider: this.timerProvider,
2471
2508
  versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
2472
2509
  });
2473
2510
  this.workspaceMutations = new WorkspaceMutationController(root, this.documents);
@@ -2571,7 +2608,7 @@ class LspClient extends LspClientConnection {
2571
2608
  const absPath = this.resolveWorkspacePath(filePath);
2572
2609
  const uri = pathToFileURL3(absPath).href;
2573
2610
  await this.openFile(absPath);
2574
- const deadlineAt = Date.now() + this.diagnosticsFreshnessTimeoutMs;
2611
+ const deadlineAt = this.timerProvider.now() + this.diagnosticsFreshnessTimeoutMs;
2575
2612
  for (;; ) {
2576
2613
  signal?.throwIfAborted();
2577
2614
  const snapshot = this.documents.captureDiagnosticSnapshot(absPath);
@@ -2584,7 +2621,7 @@ class LspClient extends LspClientConnection {
2584
2621
  if (!pushFallbackOnly) {
2585
2622
  const cached = this.documents.getPullCache(snapshot);
2586
2623
  try {
2587
- const remainingMs2 = deadlineAt - Date.now();
2624
+ const remainingMs2 = deadlineAt - this.timerProvider.now();
2588
2625
  if (remainingMs2 <= 0)
2589
2626
  return this.freshnessTimeout(absPath);
2590
2627
  const result = await this.sendRequest("textDocument/diagnostic", {
@@ -2619,7 +2656,7 @@ class LspClient extends LspClientConnection {
2619
2656
  }
2620
2657
  if (!pushFallbackOnly)
2621
2658
  continue;
2622
- const remainingMs = deadlineAt - Date.now();
2659
+ const remainingMs = deadlineAt - this.timerProvider.now();
2623
2660
  if (remainingMs <= 0) {
2624
2661
  if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
2625
2662
  const cached = this.documents.getPullCache(snapshot);
@@ -2779,6 +2816,8 @@ function awaitWithSignal(promise, signal) {
2779
2816
  class LspManager {
2780
2817
  constructor(options = {}) {
2781
2818
  this.clients = new Map;
2819
+ this.pendingStops = new Map;
2820
+ this.respawnBudgets = new Map;
2782
2821
  this.reaperHandle = null;
2783
2822
  this.signalDisposer = null;
2784
2823
  this.disposed = false;
@@ -2804,17 +2843,52 @@ class LspManager {
2804
2843
  getKey(root, serverId) {
2805
2844
  return `${root}::${serverId}`;
2806
2845
  }
2846
+ tombstoneStop(key, client) {
2847
+ const stop = stopClientBestEffort(client);
2848
+ this.pendingStops.set(key, stop);
2849
+ stop.finally(() => {
2850
+ if (this.pendingStops.get(key) === stop) {
2851
+ this.pendingStops.delete(key);
2852
+ }
2853
+ });
2854
+ return stop;
2855
+ }
2856
+ recordDeadGeneration(key) {
2857
+ let budget = this.respawnBudgets.get(key);
2858
+ if (budget === undefined) {
2859
+ budget = { deadGenerations: 0, exhaustedAt: null };
2860
+ this.respawnBudgets.set(key, budget);
2861
+ }
2862
+ budget.deadGenerations += 1;
2863
+ }
2864
+ markHealthyGeneration(key) {
2865
+ this.respawnBudgets.delete(key);
2866
+ }
2867
+ ensureRespawnAllowed(key, root, serverId) {
2868
+ const budget = this.respawnBudgets.get(key);
2869
+ if (budget === undefined || budget.deadGenerations < CLIENT_RESPAWN_RETRY_LIMIT)
2870
+ return;
2871
+ if (budget.exhaustedAt === null) {
2872
+ budget.exhaustedAt = this.now();
2873
+ throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
2874
+ }
2875
+ if (this.now() - budget.exhaustedAt < CLIENT_RESPAWN_COOLDOWN_MS) {
2876
+ throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
2877
+ }
2878
+ budget.deadGenerations = 0;
2879
+ budget.exhaustedAt = null;
2880
+ }
2807
2881
  reapStale() {
2808
2882
  const t = this.now();
2809
2883
  for (const [key, managed] of this.clients) {
2810
2884
  if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
2811
- stopClientBestEffort(managed.client);
2812
2885
  this.clients.delete(key);
2886
+ this.tombstoneStop(key, managed.client);
2813
2887
  continue;
2814
2888
  }
2815
2889
  if (!managed.isInitializing && managed.refCount === 0 && managed.pendingWaiters === 0 && t - managed.lastUsedAt > this.idleTimeoutMs) {
2816
- stopClientBestEffort(managed.client);
2817
2890
  this.clients.delete(key);
2891
+ this.tombstoneStop(key, managed.client);
2818
2892
  }
2819
2893
  }
2820
2894
  }
@@ -2824,7 +2898,7 @@ class LspManager {
2824
2898
  if (!victim)
2825
2899
  return;
2826
2900
  this.clients.delete(victim.key);
2827
- stopClientBestEffort(victim.managed.client);
2901
+ this.tombstoneStop(victim.key, victim.managed.client);
2828
2902
  }
2829
2903
  }
2830
2904
  leastRecentlyUsedIdleClient() {
@@ -2841,7 +2915,7 @@ class LspManager {
2841
2915
  async tryDeleteIfOrphaned(key, managed) {
2842
2916
  if (managed.refCount === 0 && managed.pendingWaiters === 0 && !managed.isInitializing && this.clients.get(key) === managed) {
2843
2917
  this.clients.delete(key);
2844
- await stopClientBestEffort(managed.client);
2918
+ await this.tombstoneStop(key, managed.client);
2845
2919
  }
2846
2920
  }
2847
2921
  async getClient(root, server, signal) {
@@ -2850,12 +2924,22 @@ class LspManager {
2850
2924
  }
2851
2925
  signal?.throwIfAborted();
2852
2926
  const key = this.getKey(root, server.id);
2927
+ for (;; ) {
2928
+ const pendingStop = this.pendingStops.get(key);
2929
+ if (pendingStop === undefined)
2930
+ break;
2931
+ await awaitWithSignal(pendingStop, signal);
2932
+ signal?.throwIfAborted();
2933
+ }
2934
+ if (this.disposed) {
2935
+ throw new Error("LspManager has been disposed");
2936
+ }
2853
2937
  let managed = this.clients.get(key);
2854
2938
  if (managed) {
2855
2939
  const t = this.now();
2856
2940
  if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
2857
- await stopClientBestEffort(managed.client);
2858
2941
  this.clients.delete(key);
2942
+ await this.tombstoneStop(key, managed.client);
2859
2943
  managed = undefined;
2860
2944
  }
2861
2945
  }
@@ -2876,15 +2960,20 @@ class LspManager {
2876
2960
  signal.throwIfAborted();
2877
2961
  }
2878
2962
  if (!managed.client.isAlive()) {
2879
- await stopClientBestEffort(managed.client);
2880
- this.clients.delete(key);
2963
+ this.recordDeadGeneration(key);
2964
+ if (this.clients.get(key) === managed) {
2965
+ this.clients.delete(key);
2966
+ }
2967
+ await this.tombstoneStop(key, managed.client);
2881
2968
  return this.getClient(root, server, signal);
2882
2969
  }
2970
+ this.markHealthyGeneration(key);
2883
2971
  managed.refCount++;
2884
2972
  managed.lastUsedAt = this.now();
2885
2973
  return managed.client;
2886
2974
  }
2887
2975
  this.evictForAdmission();
2976
+ this.ensureRespawnAllowed(key, root, server.id);
2888
2977
  const client = this.clientFactory(root, server);
2889
2978
  const initStartedAt = this.now();
2890
2979
  const initPromise = (async () => {
@@ -2908,7 +2997,7 @@ class LspManager {
2908
2997
  if (this.clients.get(key) === newManaged) {
2909
2998
  this.clients.delete(key);
2910
2999
  }
2911
- await stopClientBestEffort(client);
3000
+ await this.tombstoneStop(key, client);
2912
3001
  throw err;
2913
3002
  }
2914
3003
  newManaged.pendingWaiters--;
@@ -2919,6 +3008,15 @@ class LspManager {
2919
3008
  await this.tryDeleteIfOrphaned(key, newManaged);
2920
3009
  signal.throwIfAborted();
2921
3010
  }
3011
+ if (!client.isAlive()) {
3012
+ this.recordDeadGeneration(key);
3013
+ if (this.clients.get(key) === newManaged) {
3014
+ this.clients.delete(key);
3015
+ }
3016
+ await this.tombstoneStop(key, client);
3017
+ return this.getClient(root, server, signal);
3018
+ }
3019
+ this.markHealthyGeneration(key);
2922
3020
  newManaged.refCount++;
2923
3021
  newManaged.lastUsedAt = this.now();
2924
3022
  return client;
@@ -2939,15 +3037,20 @@ class LspManager {
2939
3037
  if (client && managed.client !== client)
2940
3038
  return;
2941
3039
  this.clients.delete(key);
2942
- stopClientBestEffort(managed.client);
3040
+ this.tombstoneStop(key, managed.client);
2943
3041
  }
2944
3042
  warmupClient(root, server) {
2945
3043
  if (this.disposed)
2946
3044
  return;
2947
3045
  const key = this.getKey(root, server.id);
2948
- if (this.clients.has(key))
3046
+ if (this.clients.has(key) || this.pendingStops.has(key))
2949
3047
  return;
2950
3048
  this.evictForAdmission();
3049
+ try {
3050
+ this.ensureRespawnAllowed(key, root, server.id);
3051
+ } catch {
3052
+ return;
3053
+ }
2951
3054
  const client = this.clientFactory(root, server);
2952
3055
  const initStartedAt = this.now();
2953
3056
  const initPromise = (async () => {
@@ -2973,7 +3076,7 @@ class LspManager {
2973
3076
  if (this.clients.get(key) === managed) {
2974
3077
  this.clients.delete(key);
2975
3078
  }
2976
- stopClientBestEffort(client);
3079
+ this.tombstoneStop(key, client);
2977
3080
  });
2978
3081
  }
2979
3082
  isServerInitializing(root, serverId) {
@@ -3017,8 +3120,11 @@ class LspManager {
3017
3120
  for (const managed of this.clients.values()) {
3018
3121
  stopPromises.push(stopClientBestEffort(managed.client));
3019
3122
  }
3123
+ const tombstonedStops = [...this.pendingStops.values()];
3020
3124
  this.clients.clear();
3021
- await Promise.allSettled(stopPromises);
3125
+ this.respawnBudgets.clear();
3126
+ await Promise.allSettled([...stopPromises, ...tombstonedStops]);
3127
+ this.pendingStops.clear();
3022
3128
  }
3023
3129
  }
3024
3130
  var _defaultInstance = null;
@@ -3212,6 +3318,7 @@ async function runJsonRpcStdioServer(config) {
3212
3318
  const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
3213
3319
  isClosed = true;
3214
3320
  config.onIdleTimeout?.();
3321
+ config.input.destroy();
3215
3322
  });
3216
3323
  const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
3217
3324
  isClosed = true;
@@ -3533,7 +3640,16 @@ import { existsSync as existsSync6, realpathSync as realpathSync4 } from "node:f
3533
3640
  import { dirname as dirname5, join as join3 } from "node:path";
3534
3641
 
3535
3642
  // ../lsp-core/src/lsp/workspace-markers.ts
3536
- var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
3643
+ var GIT_WORKSPACE_MARKER = ".git";
3644
+ var PROJECT_WORKSPACE_MARKERS = [
3645
+ "package.json",
3646
+ "pyproject.toml",
3647
+ "Cargo.toml",
3648
+ "go.mod",
3649
+ "pom.xml",
3650
+ "build.gradle"
3651
+ ];
3652
+ var WORKSPACE_MARKERS = [GIT_WORKSPACE_MARKER, ...PROJECT_WORKSPACE_MARKERS];
3537
3653
 
3538
3654
  // ../lsp-core/src/lsp/outside-context-workspace.ts
3539
3655
  function findWorkspaceRootOutsideContext(directory) {
@@ -4222,20 +4338,25 @@ function findWorkspaceRoot(filePath) {
4222
4338
  if (!isPathInside(cwd, abs))
4223
4339
  return findWorkspaceRootOutsideContext(dir);
4224
4340
  const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
4341
+ let nearestPackageRoot;
4225
4342
  while (isPathInside(cwd, dir)) {
4226
4343
  const canonicalDir = existingDirectoryInsideContext(dir, cwd);
4227
4344
  if (canonicalDir !== undefined) {
4228
- for (const marker of WORKSPACE_MARKERS) {
4229
- if (existsSync10(join5(dir, marker))) {
4230
- return canonicalDir;
4231
- }
4345
+ if (existsSync10(join5(dir, GIT_WORKSPACE_MARKER))) {
4346
+ return canonicalDir;
4347
+ }
4348
+ if (nearestPackageRoot === undefined && hasProjectWorkspaceMarker(dir)) {
4349
+ nearestPackageRoot = canonicalDir;
4232
4350
  }
4233
4351
  }
4234
4352
  if (dir === cwd)
4235
4353
  break;
4236
4354
  dir = dirname8(dir);
4237
4355
  }
4238
- return fallbackRoot;
4356
+ return nearestPackageRoot ?? fallbackRoot;
4357
+ }
4358
+ function hasProjectWorkspaceMarker(directory) {
4359
+ return PROJECT_WORKSPACE_MARKERS.some((marker) => existsSync10(join5(directory, marker)));
4239
4360
  }
4240
4361
  function resolveReadablePathInsideContext(filePath) {
4241
4362
  const cwd = contextCwd();