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
@@ -175,6 +175,7 @@ async function runJsonRpcStdioServer(config) {
175
175
  const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
176
176
  isClosed = true;
177
177
  config.onIdleTimeout?.();
178
+ config.input.destroy();
178
179
  });
179
180
  const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
180
181
  isClosed = true;
@@ -564,6 +565,16 @@ class LspProcessSpawnError extends Error {
564
565
  this.name = "LspProcessSpawnError";
565
566
  }
566
567
  }
568
+
569
+ class LspClientRespawnBudgetExceededError extends Error {
570
+ constructor(serverId, root, retryLimit) {
571
+ super(`LSP server ${serverId} at ${root} failed to stay alive; respawn budget exhausted ` + `(${retryLimit} consecutive dead generations). Retrying after the cooldown may succeed.`);
572
+ this.serverId = serverId;
573
+ this.root = root;
574
+ this.retryLimit = retryLimit;
575
+ this.name = "LspClientRespawnBudgetExceededError";
576
+ }
577
+ }
567
578
  function isLspDeadConnectionError(err) {
568
579
  return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
569
580
  }
@@ -585,6 +596,13 @@ import { pathToFileURL as pathToFileURL3 } from "node:url";
585
596
  // ../lsp-core/src/lsp/connection.ts
586
597
  import { pathToFileURL } from "node:url";
587
598
 
599
+ // ../lsp-core/src/lsp/timer-provider.ts
600
+ var realTimerProvider = {
601
+ now: () => Date.now(),
602
+ setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
603
+ clearTimeout: (handle) => clearTimeout(handle)
604
+ };
605
+
588
606
  // ../lsp-core/src/lsp/constants.ts
589
607
  var DEFAULT_MAX_REFERENCES = 200;
590
608
  var DEFAULT_MAX_SYMBOLS = 200;
@@ -597,6 +615,8 @@ var MAX_RESIDENT_CLIENTS = 6;
597
615
  var REAPER_INTERVAL_MS = 60000;
598
616
  var STOP_HARD_KILL_TIMEOUT_MS = 5000;
599
617
  var STOP_SIGKILL_GRACE_MS = 1000;
618
+ var CLIENT_RESPAWN_RETRY_LIMIT = 2;
619
+ var CLIENT_RESPAWN_COOLDOWN_MS = 60000;
600
620
 
601
621
  // ../lsp-core/src/lsp/json-rpc-connection.ts
602
622
  var HEADER_SEPARATOR2 = `\r
@@ -1122,6 +1142,7 @@ class LspClientTransport {
1122
1142
  this.documentFormattingSupported = false;
1123
1143
  this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
1124
1144
  this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
1145
+ this.timerProvider = timeouts.timerProvider ?? realTimerProvider;
1125
1146
  }
1126
1147
  pid() {
1127
1148
  return this.proc?.pid;
@@ -1222,7 +1243,7 @@ class LspClientTransport {
1222
1243
  const options = args[1];
1223
1244
  const timeoutMs = options?.timeoutMs ?? this.requestTimeoutMs;
1224
1245
  const timeoutController = new AbortController;
1225
- const timeoutHandle = setTimeout(() => {
1246
+ const timeoutHandle = this.timerProvider.setTimeout(() => {
1226
1247
  const stderrTail = this.stderrBuffer.slice(-5).join(`
1227
1248
  `);
1228
1249
  timeoutController.abort(new LspRequestTimeoutError(method, stderrTail || undefined));
@@ -1241,7 +1262,7 @@ class LspClientTransport {
1241
1262
  }
1242
1263
  throw error;
1243
1264
  } finally {
1244
- clearTimeout(timeoutHandle);
1265
+ this.timerProvider.clearTimeout(timeoutHandle);
1245
1266
  combinedSignal.dispose();
1246
1267
  }
1247
1268
  }
@@ -1622,6 +1643,17 @@ function canonicalPath(filePath) {
1622
1643
  return absolute;
1623
1644
  }
1624
1645
  }
1646
+ function normalizeDocumentUri(uri) {
1647
+ let decoded = uri;
1648
+ try {
1649
+ decoded = decodeURIComponent(uri);
1650
+ } catch {
1651
+ decoded = uri;
1652
+ }
1653
+ if (process.platform !== "win32")
1654
+ return decoded;
1655
+ return decoded.replace(/^(file:\/\/\/)([a-z]):/, (_match, prefix, drive) => `${prefix}${drive.toUpperCase()}:`);
1656
+ }
1625
1657
  function isSameOrDescendant(candidate, parent) {
1626
1658
  const suffix = relative2(parent, candidate);
1627
1659
  return suffix === "" || !suffix.startsWith("..") && suffix !== "..";
@@ -1638,7 +1670,12 @@ class WorkspaceDocumentState {
1638
1670
  this.openDocuments = new Map;
1639
1671
  this.openByUri = new Map;
1640
1672
  this.openPromises = new Map;
1641
- this.now = options.now ?? (() => Date.now());
1673
+ this.timerProvider = options.timerProvider ?? {
1674
+ now: options.now ?? (() => Date.now()),
1675
+ setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
1676
+ clearTimeout: (handle) => clearTimeout(handle)
1677
+ };
1678
+ this.now = () => this.timerProvider.now();
1642
1679
  this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
1643
1680
  }
1644
1681
  async openFile(filePath) {
@@ -1660,7 +1697,7 @@ class WorkspaceDocumentState {
1660
1697
  return this.openDocuments.get(canonicalPath(filePath))?.version;
1661
1698
  }
1662
1699
  getStoredDiagnostics(uri) {
1663
- const state = this.openByUri.get(uri);
1700
+ const state = this.openByUri.get(normalizeDocumentUri(uri));
1664
1701
  if (!state)
1665
1702
  return [];
1666
1703
  return state.lastPublish?.diagnostics ?? state.pullCache?.diagnostics ?? [];
@@ -1682,13 +1719,13 @@ class WorkspaceDocumentState {
1682
1719
  return state !== undefined && state.uri === snapshot.uri && state.version === snapshot.version && state.generation === snapshot.documentGeneration;
1683
1720
  }
1684
1721
  getPullCache(snapshot) {
1685
- const state = this.openByUri.get(snapshot.uri);
1722
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1686
1723
  if (!state?.pullCache || state.pullCache.documentVersion !== snapshot.version)
1687
1724
  return null;
1688
1725
  return state.pullCache;
1689
1726
  }
1690
1727
  recordPullDiagnostics(snapshot, report) {
1691
- const state = this.openByUri.get(snapshot.uri);
1728
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1692
1729
  if (!state)
1693
1730
  return;
1694
1731
  state.pullCache = {
@@ -1698,7 +1735,7 @@ class WorkspaceDocumentState {
1698
1735
  };
1699
1736
  }
1700
1737
  recordPublishedDiagnostics(params) {
1701
- const state = this.openByUri.get(params.uri);
1738
+ const state = this.openByUri.get(normalizeDocumentUri(params.uri));
1702
1739
  if (!state)
1703
1740
  return;
1704
1741
  state.publishGeneration += 1;
@@ -1712,7 +1749,7 @@ class WorkspaceDocumentState {
1712
1749
  this.notifyWaiters(state);
1713
1750
  }
1714
1751
  resolvePushDiagnostics(snapshot) {
1715
- const state = this.openByUri.get(snapshot.uri);
1752
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1716
1753
  if (!state?.lastPublish)
1717
1754
  return { status: "missing" };
1718
1755
  const publish = state.lastPublish;
@@ -1726,7 +1763,7 @@ class WorkspaceDocumentState {
1726
1763
  return waitMs === 0 ? { status: "ready", diagnostics: publish.diagnostics } : { status: "wait", waitMs };
1727
1764
  }
1728
1765
  waitForDiagnosticsActivity(snapshot, timeoutMs) {
1729
- const state = this.openByUri.get(snapshot.uri);
1766
+ const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
1730
1767
  if (!state || timeoutMs <= 0)
1731
1768
  return Promise.resolve();
1732
1769
  return new Promise((resolveActivity) => {
@@ -1735,11 +1772,11 @@ class WorkspaceDocumentState {
1735
1772
  if (settled)
1736
1773
  return;
1737
1774
  settled = true;
1738
- clearTimeout(timer);
1775
+ this.timerProvider.clearTimeout(timer);
1739
1776
  state.waiters.delete(finish);
1740
1777
  resolveActivity();
1741
1778
  };
1742
- const timer = setTimeout(finish, timeoutMs);
1779
+ const timer = this.timerProvider.setTimeout(finish, timeoutMs);
1743
1780
  if (typeof timer.unref === "function")
1744
1781
  timer.unref();
1745
1782
  state.waiters.add(finish);
@@ -1847,7 +1884,7 @@ class WorkspaceDocumentState {
1847
1884
  waiters: new Set
1848
1885
  };
1849
1886
  this.openDocuments.set(path, state);
1850
- this.openByUri.set(state.uri, state);
1887
+ this.openByUri.set(normalizeDocumentUri(state.uri), state);
1851
1888
  this.notifyWaiters(state);
1852
1889
  await this.sendNotification("textDocument/didOpen", {
1853
1890
  textDocument: { uri: state.uri, languageId: state.languageId, version: state.version, text }
@@ -1872,7 +1909,7 @@ class WorkspaceDocumentState {
1872
1909
  }
1873
1910
  async closeDocument(state) {
1874
1911
  this.openDocuments.delete(state.path);
1875
- this.openByUri.delete(state.uri);
1912
+ this.openByUri.delete(normalizeDocumentUri(state.uri));
1876
1913
  this.clearDiagnostics(state.uri);
1877
1914
  this.notifyWaiters(state);
1878
1915
  await this.sendNotification("textDocument/didClose", { textDocument: { uri: state.uri } });
@@ -2959,6 +2996,7 @@ class LspClient extends LspClientConnection {
2959
2996
  this.diagnosticPullErrors = [];
2960
2997
  this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
2961
2998
  this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
2999
+ timerProvider: this.timerProvider,
2962
3000
  versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
2963
3001
  });
2964
3002
  this.workspaceMutations = new WorkspaceMutationController(root, this.documents);
@@ -3062,7 +3100,7 @@ class LspClient extends LspClientConnection {
3062
3100
  const absPath = this.resolveWorkspacePath(filePath);
3063
3101
  const uri = pathToFileURL3(absPath).href;
3064
3102
  await this.openFile(absPath);
3065
- const deadlineAt = Date.now() + this.diagnosticsFreshnessTimeoutMs;
3103
+ const deadlineAt = this.timerProvider.now() + this.diagnosticsFreshnessTimeoutMs;
3066
3104
  for (;; ) {
3067
3105
  signal?.throwIfAborted();
3068
3106
  const snapshot = this.documents.captureDiagnosticSnapshot(absPath);
@@ -3075,7 +3113,7 @@ class LspClient extends LspClientConnection {
3075
3113
  if (!pushFallbackOnly) {
3076
3114
  const cached = this.documents.getPullCache(snapshot);
3077
3115
  try {
3078
- const remainingMs2 = deadlineAt - Date.now();
3116
+ const remainingMs2 = deadlineAt - this.timerProvider.now();
3079
3117
  if (remainingMs2 <= 0)
3080
3118
  return this.freshnessTimeout(absPath);
3081
3119
  const result = await this.sendRequest("textDocument/diagnostic", {
@@ -3110,7 +3148,7 @@ class LspClient extends LspClientConnection {
3110
3148
  }
3111
3149
  if (!pushFallbackOnly)
3112
3150
  continue;
3113
- const remainingMs = deadlineAt - Date.now();
3151
+ const remainingMs = deadlineAt - this.timerProvider.now();
3114
3152
  if (remainingMs <= 0) {
3115
3153
  if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
3116
3154
  const cached = this.documents.getPullCache(snapshot);
@@ -3270,6 +3308,8 @@ function awaitWithSignal(promise, signal) {
3270
3308
  class LspManager {
3271
3309
  constructor(options = {}) {
3272
3310
  this.clients = new Map;
3311
+ this.pendingStops = new Map;
3312
+ this.respawnBudgets = new Map;
3273
3313
  this.reaperHandle = null;
3274
3314
  this.signalDisposer = null;
3275
3315
  this.disposed = false;
@@ -3295,17 +3335,52 @@ class LspManager {
3295
3335
  getKey(root, serverId) {
3296
3336
  return `${root}::${serverId}`;
3297
3337
  }
3338
+ tombstoneStop(key, client) {
3339
+ const stop = stopClientBestEffort(client);
3340
+ this.pendingStops.set(key, stop);
3341
+ stop.finally(() => {
3342
+ if (this.pendingStops.get(key) === stop) {
3343
+ this.pendingStops.delete(key);
3344
+ }
3345
+ });
3346
+ return stop;
3347
+ }
3348
+ recordDeadGeneration(key) {
3349
+ let budget = this.respawnBudgets.get(key);
3350
+ if (budget === undefined) {
3351
+ budget = { deadGenerations: 0, exhaustedAt: null };
3352
+ this.respawnBudgets.set(key, budget);
3353
+ }
3354
+ budget.deadGenerations += 1;
3355
+ }
3356
+ markHealthyGeneration(key) {
3357
+ this.respawnBudgets.delete(key);
3358
+ }
3359
+ ensureRespawnAllowed(key, root, serverId) {
3360
+ const budget = this.respawnBudgets.get(key);
3361
+ if (budget === undefined || budget.deadGenerations < CLIENT_RESPAWN_RETRY_LIMIT)
3362
+ return;
3363
+ if (budget.exhaustedAt === null) {
3364
+ budget.exhaustedAt = this.now();
3365
+ throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
3366
+ }
3367
+ if (this.now() - budget.exhaustedAt < CLIENT_RESPAWN_COOLDOWN_MS) {
3368
+ throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
3369
+ }
3370
+ budget.deadGenerations = 0;
3371
+ budget.exhaustedAt = null;
3372
+ }
3298
3373
  reapStale() {
3299
3374
  const t = this.now();
3300
3375
  for (const [key, managed] of this.clients) {
3301
3376
  if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
3302
- stopClientBestEffort(managed.client);
3303
3377
  this.clients.delete(key);
3378
+ this.tombstoneStop(key, managed.client);
3304
3379
  continue;
3305
3380
  }
3306
3381
  if (!managed.isInitializing && managed.refCount === 0 && managed.pendingWaiters === 0 && t - managed.lastUsedAt > this.idleTimeoutMs) {
3307
- stopClientBestEffort(managed.client);
3308
3382
  this.clients.delete(key);
3383
+ this.tombstoneStop(key, managed.client);
3309
3384
  }
3310
3385
  }
3311
3386
  }
@@ -3315,7 +3390,7 @@ class LspManager {
3315
3390
  if (!victim)
3316
3391
  return;
3317
3392
  this.clients.delete(victim.key);
3318
- stopClientBestEffort(victim.managed.client);
3393
+ this.tombstoneStop(victim.key, victim.managed.client);
3319
3394
  }
3320
3395
  }
3321
3396
  leastRecentlyUsedIdleClient() {
@@ -3332,7 +3407,7 @@ class LspManager {
3332
3407
  async tryDeleteIfOrphaned(key, managed) {
3333
3408
  if (managed.refCount === 0 && managed.pendingWaiters === 0 && !managed.isInitializing && this.clients.get(key) === managed) {
3334
3409
  this.clients.delete(key);
3335
- await stopClientBestEffort(managed.client);
3410
+ await this.tombstoneStop(key, managed.client);
3336
3411
  }
3337
3412
  }
3338
3413
  async getClient(root, server2, signal) {
@@ -3341,12 +3416,22 @@ class LspManager {
3341
3416
  }
3342
3417
  signal?.throwIfAborted();
3343
3418
  const key = this.getKey(root, server2.id);
3419
+ for (;; ) {
3420
+ const pendingStop = this.pendingStops.get(key);
3421
+ if (pendingStop === undefined)
3422
+ break;
3423
+ await awaitWithSignal(pendingStop, signal);
3424
+ signal?.throwIfAborted();
3425
+ }
3426
+ if (this.disposed) {
3427
+ throw new Error("LspManager has been disposed");
3428
+ }
3344
3429
  let managed = this.clients.get(key);
3345
3430
  if (managed) {
3346
3431
  const t = this.now();
3347
3432
  if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
3348
- await stopClientBestEffort(managed.client);
3349
3433
  this.clients.delete(key);
3434
+ await this.tombstoneStop(key, managed.client);
3350
3435
  managed = undefined;
3351
3436
  }
3352
3437
  }
@@ -3367,15 +3452,20 @@ class LspManager {
3367
3452
  signal.throwIfAborted();
3368
3453
  }
3369
3454
  if (!managed.client.isAlive()) {
3370
- await stopClientBestEffort(managed.client);
3371
- this.clients.delete(key);
3455
+ this.recordDeadGeneration(key);
3456
+ if (this.clients.get(key) === managed) {
3457
+ this.clients.delete(key);
3458
+ }
3459
+ await this.tombstoneStop(key, managed.client);
3372
3460
  return this.getClient(root, server2, signal);
3373
3461
  }
3462
+ this.markHealthyGeneration(key);
3374
3463
  managed.refCount++;
3375
3464
  managed.lastUsedAt = this.now();
3376
3465
  return managed.client;
3377
3466
  }
3378
3467
  this.evictForAdmission();
3468
+ this.ensureRespawnAllowed(key, root, server2.id);
3379
3469
  const client = this.clientFactory(root, server2);
3380
3470
  const initStartedAt = this.now();
3381
3471
  const initPromise = (async () => {
@@ -3399,7 +3489,7 @@ class LspManager {
3399
3489
  if (this.clients.get(key) === newManaged) {
3400
3490
  this.clients.delete(key);
3401
3491
  }
3402
- await stopClientBestEffort(client);
3492
+ await this.tombstoneStop(key, client);
3403
3493
  throw err;
3404
3494
  }
3405
3495
  newManaged.pendingWaiters--;
@@ -3410,6 +3500,15 @@ class LspManager {
3410
3500
  await this.tryDeleteIfOrphaned(key, newManaged);
3411
3501
  signal.throwIfAborted();
3412
3502
  }
3503
+ if (!client.isAlive()) {
3504
+ this.recordDeadGeneration(key);
3505
+ if (this.clients.get(key) === newManaged) {
3506
+ this.clients.delete(key);
3507
+ }
3508
+ await this.tombstoneStop(key, client);
3509
+ return this.getClient(root, server2, signal);
3510
+ }
3511
+ this.markHealthyGeneration(key);
3413
3512
  newManaged.refCount++;
3414
3513
  newManaged.lastUsedAt = this.now();
3415
3514
  return client;
@@ -3430,15 +3529,20 @@ class LspManager {
3430
3529
  if (client && managed.client !== client)
3431
3530
  return;
3432
3531
  this.clients.delete(key);
3433
- stopClientBestEffort(managed.client);
3532
+ this.tombstoneStop(key, managed.client);
3434
3533
  }
3435
3534
  warmupClient(root, server2) {
3436
3535
  if (this.disposed)
3437
3536
  return;
3438
3537
  const key = this.getKey(root, server2.id);
3439
- if (this.clients.has(key))
3538
+ if (this.clients.has(key) || this.pendingStops.has(key))
3440
3539
  return;
3441
3540
  this.evictForAdmission();
3541
+ try {
3542
+ this.ensureRespawnAllowed(key, root, server2.id);
3543
+ } catch {
3544
+ return;
3545
+ }
3442
3546
  const client = this.clientFactory(root, server2);
3443
3547
  const initStartedAt = this.now();
3444
3548
  const initPromise = (async () => {
@@ -3464,7 +3568,7 @@ class LspManager {
3464
3568
  if (this.clients.get(key) === managed) {
3465
3569
  this.clients.delete(key);
3466
3570
  }
3467
- stopClientBestEffort(client);
3571
+ this.tombstoneStop(key, client);
3468
3572
  });
3469
3573
  }
3470
3574
  isServerInitializing(root, serverId) {
@@ -3508,8 +3612,11 @@ class LspManager {
3508
3612
  for (const managed of this.clients.values()) {
3509
3613
  stopPromises.push(stopClientBestEffort(managed.client));
3510
3614
  }
3615
+ const tombstonedStops = [...this.pendingStops.values()];
3511
3616
  this.clients.clear();
3512
- await Promise.allSettled(stopPromises);
3617
+ this.respawnBudgets.clear();
3618
+ await Promise.allSettled([...stopPromises, ...tombstonedStops]);
3619
+ this.pendingStops.clear();
3513
3620
  }
3514
3621
  }
3515
3622
  var _defaultInstance = null;
@@ -3532,7 +3639,16 @@ import { existsSync as existsSync6, realpathSync as realpathSync4 } from "node:f
3532
3639
  import { dirname as dirname5, join as join3 } from "node:path";
3533
3640
 
3534
3641
  // ../lsp-core/src/lsp/workspace-markers.ts
3535
- var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
3642
+ var GIT_WORKSPACE_MARKER = ".git";
3643
+ var PROJECT_WORKSPACE_MARKERS = [
3644
+ "package.json",
3645
+ "pyproject.toml",
3646
+ "Cargo.toml",
3647
+ "go.mod",
3648
+ "pom.xml",
3649
+ "build.gradle"
3650
+ ];
3651
+ var WORKSPACE_MARKERS = [GIT_WORKSPACE_MARKER, ...PROJECT_WORKSPACE_MARKERS];
3536
3652
 
3537
3653
  // ../lsp-core/src/lsp/outside-context-workspace.ts
3538
3654
  function findWorkspaceRootOutsideContext(directory) {
@@ -4221,20 +4337,25 @@ function findWorkspaceRoot(filePath) {
4221
4337
  if (!isPathInside(cwd, abs))
4222
4338
  return findWorkspaceRootOutsideContext(dir);
4223
4339
  const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
4340
+ let nearestPackageRoot;
4224
4341
  while (isPathInside(cwd, dir)) {
4225
4342
  const canonicalDir = existingDirectoryInsideContext(dir, cwd);
4226
4343
  if (canonicalDir !== undefined) {
4227
- for (const marker of WORKSPACE_MARKERS) {
4228
- if (existsSync10(join5(dir, marker))) {
4229
- return canonicalDir;
4230
- }
4344
+ if (existsSync10(join5(dir, GIT_WORKSPACE_MARKER))) {
4345
+ return canonicalDir;
4346
+ }
4347
+ if (nearestPackageRoot === undefined && hasProjectWorkspaceMarker(dir)) {
4348
+ nearestPackageRoot = canonicalDir;
4231
4349
  }
4232
4350
  }
4233
4351
  if (dir === cwd)
4234
4352
  break;
4235
4353
  dir = dirname8(dir);
4236
4354
  }
4237
- return fallbackRoot;
4355
+ return nearestPackageRoot ?? fallbackRoot;
4356
+ }
4357
+ function hasProjectWorkspaceMarker(directory) {
4358
+ return PROJECT_WORKSPACE_MARKERS.some((marker) => existsSync10(join5(directory, marker)));
4238
4359
  }
4239
4360
  function resolveReadablePathInsideContext(filePath) {
4240
4361
  const cwd = contextCwd();