oh-my-opencode 5.0.0-beta.2 → 5.0.0-beta.21

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 (460) hide show
  1. package/.agents/command/publish.md +44 -16
  2. package/.agents/skills/publish/SKILL.md +44 -16
  3. package/.agents/skills/senpi-qa/SKILL.md +80 -0
  4. package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.mjs +65 -0
  5. package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.test.mjs +171 -0
  6. package/.agents/skills/work-with-pr/SKILL.md +37 -23
  7. package/.opencode/command/publish.md +44 -16
  8. package/.opencode/skills/work-with-pr/SKILL.md +37 -23
  9. package/README.ja.md +25 -21
  10. package/README.ko.md +25 -21
  11. package/README.md +38 -23
  12. package/README.ru.md +24 -20
  13. package/README.zh-cn.md +25 -21
  14. package/dist/agents/atlas/agent.d.ts +0 -1
  15. package/dist/agents/sisyphus/grok-4.d.ts +20 -0
  16. package/dist/agents/sisyphus/index.d.ts +2 -0
  17. package/dist/agents/sisyphus-agent-config.d.ts +6 -0
  18. package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
  19. package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
  20. package/dist/agents/types.d.ts +2 -2
  21. package/dist/cli/fallback-lane-policy.d.ts +1 -0
  22. package/dist/cli/index.js +23057 -20893
  23. package/dist/cli/install-codex/install-codex-test-fixtures.d.ts +1 -1
  24. package/dist/cli/run/on-complete-hook.d.ts +2 -0
  25. package/dist/cli/runtime-commands.d.ts +1 -1
  26. package/dist/cli/worktree-sweep/classify.d.ts +16 -0
  27. package/dist/cli/worktree-sweep/format.d.ts +8 -0
  28. package/dist/cli/worktree-sweep/git.d.ts +19 -0
  29. package/dist/cli/worktree-sweep/index.d.ts +7 -0
  30. package/dist/cli/worktree-sweep/options.d.ts +2 -0
  31. package/dist/cli/worktree-sweep/parse-worktree-list.d.ts +8 -0
  32. package/dist/cli/worktree-sweep/sweep.d.ts +2 -0
  33. package/dist/cli/worktree-sweep/types.d.ts +65 -0
  34. package/dist/cli/worktree-sweep/worktree-sweep.d.ts +2 -0
  35. package/dist/cli-node/index.js +23093 -20929
  36. package/dist/config/schema/commands.d.ts +1 -1
  37. package/dist/config/schema/hooks.d.ts +1 -1
  38. package/dist/config/schema/oh-my-opencode-config.d.ts +4 -1
  39. package/dist/config/schema/ulw-execute.d.ts +5 -0
  40. package/dist/config/validate.d.ts +2 -0
  41. package/dist/create-hooks.d.ts +3 -1
  42. package/dist/features/btw-side/btw-command-draft.d.ts +7 -0
  43. package/dist/features/btw-side/context-injector.d.ts +15 -0
  44. package/dist/features/btw-side/index.d.ts +8 -0
  45. package/dist/features/btw-side/metadata.d.ts +15 -0
  46. package/dist/features/btw-side/parent-context-budget.d.ts +9 -0
  47. package/dist/features/btw-side/server-session-registry.d.ts +8 -0
  48. package/dist/features/btw-side/tui-adoption-cache.d.ts +13 -0
  49. package/dist/features/btw-side/tui-adoption-guard.d.ts +5 -0
  50. package/dist/features/btw-side/tui-controller-types.d.ts +68 -0
  51. package/dist/features/btw-side/tui-controller.d.ts +19 -0
  52. package/dist/features/btw-side/tui-escape-return.d.ts +12 -0
  53. package/dist/features/btw-side/tui-keymap.d.ts +17 -0
  54. package/dist/features/btw-side/tui-parent-validator.d.ts +6 -0
  55. package/dist/features/btw-side/tui-picker-options.d.ts +20 -0
  56. package/dist/features/btw-side/tui-picker.d.ts +9 -0
  57. package/dist/features/btw-side/tui-prompt-queue.d.ts +8 -0
  58. package/dist/features/btw-side/tui-session-bridge.d.ts +11 -0
  59. package/dist/features/btw-side/tui-session-catalog.d.ts +35 -0
  60. package/dist/features/btw-side/tui-side-removal.d.ts +11 -0
  61. package/dist/features/btw-side/tui-side-start.d.ts +9 -0
  62. package/dist/features/btw-side/tui-wiring.d.ts +8 -0
  63. package/dist/features/builtin-commands/templates/ulw-execute.d.ts +1 -0
  64. package/dist/features/builtin-commands/types.d.ts +1 -1
  65. package/dist/features/opengateway-provider/index.d.ts +13 -0
  66. package/dist/hooks/atlas/atlas-hook.d.ts +1 -0
  67. package/dist/hooks/atlas/atlas-lifecycle-store.d.ts +50 -0
  68. package/dist/hooks/atlas/event-handler.d.ts +1 -0
  69. package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
  70. package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
  71. package/dist/hooks/atlas/tool-execute-before.d.ts +3 -0
  72. package/dist/hooks/atlas/types.d.ts +1 -0
  73. package/dist/hooks/index.d.ts +1 -1
  74. package/dist/hooks/prometheus-md-only/agent-resolution.d.ts +2 -2
  75. package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +2 -0
  76. package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +1 -0
  77. package/dist/hooks/runtime-fallback/runtime-model-settings.d.ts +6 -0
  78. package/dist/hooks/runtime-fallback/session-status-handler.d.ts +1 -1
  79. package/dist/hooks/runtime-fallback/types.d.ts +3 -1
  80. package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
  81. package/dist/hooks/{start-work → ulw-execute}/context-info-builder.d.ts +1 -1
  82. package/dist/hooks/{start-work → ulw-execute}/index.d.ts +1 -1
  83. package/dist/hooks/ulw-execute/ulw-execute-hook.d.ts +23 -0
  84. package/dist/index.js +11724 -6355
  85. package/dist/oh-my-opencode.schema.json +15 -2
  86. package/dist/plugin/chat-message/types.d.ts +3 -3
  87. package/dist/plugin/chat-message/ulw-execute-message.d.ts +5 -0
  88. package/dist/plugin/event-session-lifecycle.d.ts +1 -0
  89. package/dist/plugin/hooks/create-core-hooks.d.ts +2 -1
  90. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -2
  91. package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
  92. package/dist/plugin/messages-transform.d.ts +1 -0
  93. package/dist/shared/index.d.ts +1 -0
  94. package/dist/shared/normalize-sdk-response.d.ts +1 -0
  95. package/dist/shared/runtime-fallback-retry-marker.d.ts +16 -0
  96. package/dist/shared/shell-env.d.ts +1 -1
  97. package/dist/skills/ast-grep/AGENTS.md +51 -0
  98. package/dist/skills/coding-agent-sessions/AGENTS.md +62 -0
  99. package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
  100. package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  101. package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
  102. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  103. package/dist/skills/frontend/SKILL.md +11 -7
  104. package/dist/skills/frontend/references/design/_INDEX.md +1 -0
  105. package/dist/skills/frontend/references/design/print-paged-media.md +76 -0
  106. package/dist/skills/frontend/references/design/stylegallery.md +80 -0
  107. package/dist/skills/frontend/references/designpowers/README.md +1 -1
  108. package/dist/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
  109. package/dist/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
  110. package/dist/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
  111. package/dist/skills/frontend/references/designpowers/orchestration.md +1 -1
  112. package/dist/skills/frontend/references/designpowers/routing.md +5 -5
  113. package/dist/skills/review-work/SKILL.md +3 -3
  114. package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  115. package/dist/skills/ultimate-browsing/SKILL.md +2 -0
  116. package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  117. package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
  118. package/dist/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
  119. package/dist/skills/{start-work → ulw-execute}/SKILL.md +9 -8
  120. package/dist/skills/ulw-plan/SKILL.md +6 -6
  121. package/dist/skills/ulw-plan/references/full-workflow.md +31 -7
  122. package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
  123. package/dist/skills/ulw-plan/references/intent-unclear.md +5 -5
  124. package/dist/skills/ulw-research/SKILL.md +1 -1
  125. package/dist/skills/visual-qa/AGENTS.md +58 -0
  126. package/dist/skills/visual-qa/SKILL.md +3 -2
  127. package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
  128. package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
  129. package/dist/tools/delegate-task/tool-description.d.ts +3 -1
  130. package/dist/tui.js +8824 -8906
  131. package/package.json +38 -35
  132. package/packages/git-bash-mcp/dist/cli.js +5 -1
  133. package/packages/git-bash-mcp/package.json +1 -1
  134. package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
  135. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
  136. package/packages/lsp-core/src/lsp/client-wrapper-outside-cwd.test.ts +78 -0
  137. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +66 -13
  138. package/packages/lsp-core/src/lsp/client-wrapper.ts +70 -18
  139. package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
  140. package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
  141. package/packages/lsp-core/src/lsp/workspace-markers.ts +1 -0
  142. package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
  143. package/packages/lsp-core/src/tools/navigation.ts +4 -2
  144. package/packages/lsp-core/src/tools/rename.ts +4 -2
  145. package/packages/lsp-core/src/tools/symbols.ts +1 -1
  146. package/packages/lsp-daemon/dist/cli.js +246 -185
  147. package/packages/lsp-daemon/dist/client.js +222 -164
  148. package/packages/lsp-daemon/dist/ensure-daemon.js +1 -0
  149. package/packages/lsp-daemon/dist/index.js +236 -177
  150. package/packages/lsp-daemon/dist/version-reap.js +1 -1
  151. package/packages/lsp-tools-mcp/dist/cli.js +198 -136
  152. package/packages/lsp-tools-mcp/dist/lsp/manager.js +62 -92
  153. package/packages/lsp-tools-mcp/dist/mcp.js +200 -138
  154. package/packages/lsp-tools-mcp/dist/request-context.js +11 -12
  155. package/packages/lsp-tools-mcp/dist/tools.js +204 -146
  156. package/packages/omo-codex/THIRD-PARTY-NOTICES.md +4 -4
  157. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +4 -4
  158. package/packages/omo-codex/plugin/AGENTS.md +47 -0
  159. package/packages/omo-codex/plugin/README.md +1 -1
  160. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +32 -31
  161. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  162. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  163. package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +1 -0
  164. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +224 -81
  165. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +224 -82
  166. package/packages/omo-codex/plugin/components/codegraph/package.json +4 -4
  167. package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +1 -0
  168. package/packages/omo-codex/plugin/components/codegraph/src/session-start-hook-runtime.ts +1 -0
  169. package/packages/omo-codex/plugin/components/comment-checker/AGENTS.md +9 -0
  170. package/packages/omo-codex/plugin/components/comment-checker/biome.json +2 -2
  171. package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +2 -1
  172. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  173. package/packages/omo-codex/plugin/components/comment-checker/package.json +5 -5
  174. package/packages/omo-codex/plugin/components/comment-checker/src/apply-patch.ts +2 -8
  175. package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +1 -2
  176. package/packages/omo-codex/plugin/components/comment-checker/src/request-extractor.ts +1 -1
  177. package/packages/omo-codex/plugin/components/comment-checker/src/runner.ts +1 -0
  178. package/packages/omo-codex/plugin/components/git-bash/AGENTS.md +1 -1
  179. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  180. package/packages/omo-codex/plugin/components/git-bash/package.json +3 -4
  181. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +2 -2
  182. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +1 -5
  183. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +1 -5
  184. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  185. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +5 -5
  186. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +1 -5
  187. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +4 -21
  188. package/packages/omo-codex/plugin/components/lsp/AGENTS.md +30 -15
  189. package/packages/omo-codex/plugin/components/lsp/biome.json +2 -2
  190. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +4 -4
  191. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +217 -171
  192. package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +1 -1
  193. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  194. package/packages/omo-codex/plugin/components/lsp/package.json +5 -5
  195. package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
  196. package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +1 -1
  197. package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +1 -5
  198. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +6 -7
  199. package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +1 -2
  200. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +11 -1
  201. package/packages/omo-codex/plugin/components/rules/AGENTS.md +12 -0
  202. package/packages/omo-codex/plugin/components/rules/biome.json +2 -2
  203. package/packages/omo-codex/plugin/components/rules/dist/cli.js +57 -42
  204. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  205. package/packages/omo-codex/plugin/components/rules/package.json +7 -7
  206. package/packages/omo-codex/plugin/components/rules/src/config.ts +1 -2
  207. package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +1 -2
  208. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +6 -2
  209. package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +1 -4
  210. package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +4 -9
  211. package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
  212. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +17 -25
  213. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
  214. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
  215. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
  216. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
  217. package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
  218. package/packages/omo-codex/plugin/components/rules/test/dynamic-target-fingerprints.test.ts +1 -2
  219. package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +7 -4
  220. package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +2 -3
  221. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +39 -72
  222. package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +1 -2
  223. package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
  224. package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +2 -3
  225. package/packages/omo-codex/plugin/components/rules/test/package-smoke.test.ts +1 -1
  226. package/packages/omo-codex/plugin/components/rules/test/parser.test.ts +1 -2
  227. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +1 -2
  228. package/packages/omo-codex/plugin/components/rules/test/rules-engine-consumption.test.ts +3 -6
  229. package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +1 -2
  230. package/packages/omo-codex/plugin/components/rules/test/sources.test.ts +2 -5
  231. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +2 -17
  232. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  233. package/packages/omo-codex/plugin/components/teammode/package.json +5 -5
  234. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
  235. package/packages/omo-codex/plugin/components/telemetry/AGENTS.md +8 -0
  236. package/packages/omo-codex/plugin/components/telemetry/biome.json +2 -2
  237. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +2433 -422
  238. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +2437 -426
  239. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  240. package/packages/omo-codex/plugin/components/telemetry/package.json +5 -5
  241. package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +1 -4
  242. package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +4 -14
  243. package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +1 -1
  244. package/packages/omo-codex/plugin/components/telemetry/test/diagnostics.test.ts +2 -5
  245. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -0
  246. package/packages/omo-codex/plugin/components/ultrawork/biome.json +2 -2
  247. package/packages/omo-codex/plugin/components/ultrawork/directive.md +13 -1
  248. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  249. package/packages/omo-codex/plugin/components/ultrawork/package.json +5 -5
  250. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +13 -1
  251. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +6 -6
  252. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +31 -7
  253. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
  254. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +5 -5
  255. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +9 -1
  256. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
  257. package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
  258. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/AGENTS.md +5 -4
  259. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/NOTICE +1 -1
  260. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/README.md +5 -5
  261. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/biome.json +2 -2
  262. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/directive.md +6 -6
  263. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/dist/cli.js +12 -12
  264. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +28 -0
  265. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/package.json +12 -12
  266. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/boulder-reader.ts +1 -1
  267. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/cli.ts +1 -1
  268. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/codex-hook.ts +3 -3
  269. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/directive.ts +1 -1
  270. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/index.ts +1 -1
  271. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/boulder-reader.test.ts +3 -3
  272. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/cli.test.ts +1 -4
  273. package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/codex-hook.test.ts +8 -22
  274. package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +16 -0
  275. package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +1 -1
  276. package/packages/omo-codex/plugin/components/ulw-loop/biome.json +2 -2
  277. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +13 -1
  278. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +2 -4
  279. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +1 -1
  280. package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +1 -1
  281. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +3 -3
  282. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  283. package/packages/omo-codex/plugin/components/ulw-loop/package.json +5 -5
  284. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +3 -2
  285. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
  286. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
  287. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +3 -1
  288. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +3 -1
  289. package/packages/omo-codex/plugin/components/ulw-loop/src/paths.ts +1 -1
  290. package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +3 -3
  291. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
  292. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +25 -0
  293. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
  294. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-snapshot.test.ts +18 -0
  295. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
  296. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +5 -37
  297. package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +9 -0
  298. package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +8 -5
  299. package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +1 -1
  300. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
  301. package/packages/omo-codex/plugin/components/ulw-loop/vitest.config.ts +1 -0
  302. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  303. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  304. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  305. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  306. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  307. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  308. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  309. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  310. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  311. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  312. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  313. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  314. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  315. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  316. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  317. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  318. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +17 -0
  319. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  320. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +17 -0
  321. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  322. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  323. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  324. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  325. package/packages/omo-codex/plugin/package-lock.json +681 -395
  326. package/packages/omo-codex/plugin/package.json +2 -2
  327. package/packages/omo-codex/plugin/scripts/AGENTS.md +40 -0
  328. package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +1 -1
  329. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +11 -11
  330. package/packages/omo-codex/plugin/shared/package.json +3 -4
  331. package/packages/omo-codex/plugin/skills/ast-grep/AGENTS.md +51 -0
  332. package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +62 -0
  333. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
  334. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  335. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
  336. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  337. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +11 -7
  338. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
  339. package/packages/omo-codex/plugin/skills/frontend/references/design/print-paged-media.md +76 -0
  340. package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
  341. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +1 -1
  342. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
  343. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
  344. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
  345. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/orchestration.md +1 -1
  346. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/routing.md +5 -5
  347. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +4 -4
  348. package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  349. package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +2 -0
  350. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  351. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
  352. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
  353. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +13 -1
  354. package/packages/omo-codex/plugin/skills/{start-work → ulw-execute}/SKILL.md +12 -11
  355. package/packages/omo-codex/plugin/skills/ulw-execute/agents/openai.yaml +2 -0
  356. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
  357. package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
  358. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
  359. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +6 -6
  360. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +31 -7
  361. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
  362. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +5 -5
  363. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +1 -1
  364. package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +58 -0
  365. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +3 -2
  366. package/packages/omo-codex/plugin/test/AGENTS.md +47 -0
  367. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
  368. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +8 -28
  369. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -1
  370. package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
  371. package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
  372. package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
  373. package/packages/omo-codex/plugin/test/component-bin-names.test.mjs +2 -2
  374. package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +1 -1
  375. package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +2 -2
  376. package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +4 -4
  377. package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
  378. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
  379. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
  380. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +12 -12
  381. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
  382. package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
  383. package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
  384. package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
  385. package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
  386. package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
  387. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
  388. package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
  389. package/packages/omo-codex/scripts/AGENTS.md +36 -0
  390. package/packages/omo-codex/scripts/install-dist/install-local.mjs +2601 -528
  391. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
  392. package/packages/shared-skills/skills/ast-grep/AGENTS.md +51 -0
  393. package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +62 -0
  394. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
  395. package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  396. package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
  397. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  398. package/packages/shared-skills/skills/frontend/SKILL.md +11 -7
  399. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
  400. package/packages/shared-skills/skills/frontend/references/design/print-paged-media.md +76 -0
  401. package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
  402. package/packages/shared-skills/skills/frontend/references/designpowers/README.md +1 -1
  403. package/packages/shared-skills/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
  404. package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
  405. package/packages/shared-skills/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
  406. package/packages/shared-skills/skills/frontend/references/designpowers/orchestration.md +1 -1
  407. package/packages/shared-skills/skills/frontend/references/designpowers/routing.md +5 -5
  408. package/packages/shared-skills/skills/review-work/SKILL.md +3 -3
  409. package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  410. package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +2 -0
  411. package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  412. package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
  413. package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
  414. package/packages/shared-skills/skills/{start-work → ulw-execute}/SKILL.md +9 -8
  415. package/packages/shared-skills/skills/ulw-plan/SKILL.md +6 -6
  416. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +31 -7
  417. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
  418. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +5 -5
  419. package/packages/shared-skills/skills/ulw-research/SKILL.md +1 -1
  420. package/packages/shared-skills/skills/visual-qa/AGENTS.md +58 -0
  421. package/packages/shared-skills/skills/visual-qa/SKILL.md +3 -2
  422. package/script/qa/web-terminal-visual-qa.mjs +2 -0
  423. package/script/qa/xterm-live-terminal.mjs +18 -2
  424. package/dist/config/schema/start-work.d.ts +0 -5
  425. package/dist/features/builtin-commands/templates/start-work.d.ts +0 -1
  426. package/dist/hooks/start-work/start-work-hook.d.ts +0 -23
  427. package/dist/plugin/chat-message/start-work-message.d.ts +0 -5
  428. package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
  429. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +0 -28
  430. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +0 -17
  431. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +0 -17
  432. package/packages/omo-codex/plugin/skills/start-work/agents/openai.yaml +0 -2
  433. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
  434. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
  435. package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
  436. /package/dist/hooks/{start-work → ulw-execute}/context-info-formatters.d.ts +0 -0
  437. /package/dist/hooks/{start-work → ulw-execute}/explicit-plan-context.d.ts +0 -0
  438. /package/dist/hooks/{start-work → ulw-execute}/notepad-scaffold.d.ts +0 -0
  439. /package/dist/hooks/{start-work → ulw-execute}/parse-user-request.d.ts +0 -0
  440. /package/dist/hooks/{start-work → ulw-execute}/plan-discovery-context.d.ts +0 -0
  441. /package/dist/hooks/{start-work → ulw-execute}/plan-selection.d.ts +0 -0
  442. /package/dist/hooks/{start-work → ulw-execute}/session-plan-affinity.d.ts +0 -0
  443. /package/dist/hooks/{start-work → ulw-execute}/work-initializer.d.ts +0 -0
  444. /package/dist/hooks/{start-work → ulw-execute}/worktree-block.d.ts +0 -0
  445. /package/dist/hooks/{start-work → ulw-execute}/worktree-detector.d.ts +0 -0
  446. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/.gitattributes +0 -0
  447. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/CHANGELOG.md +0 -0
  448. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/LICENSE +0 -0
  449. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/plan-checklist.ts +0 -0
  450. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/types.ts +0 -0
  451. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-completed.json +0 -0
  452. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-mixed-platforms.json +0 -0
  453. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-single-codex-work.json +0 -0
  454. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-all-done.md +0 -0
  455. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-scaffold.md +0 -0
  456. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-with-nested-checkboxes.md +0 -0
  457. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-with-unchecked.md +0 -0
  458. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/tsconfig.build.json +0 -0
  459. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/tsconfig.json +0 -0
  460. /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/vitest.config.ts +0 -0
@@ -29,22 +29,15 @@ var STOP_SIGKILL_GRACE_MS = 1000;
29
29
 
30
30
  // ../lsp-core/src/lsp/errors.ts
31
31
  class LspConnectionClosedError extends Error {
32
- serverId;
33
- root;
34
- name = "LspConnectionClosedError";
35
32
  constructor(serverId, root, message) {
36
33
  super(message ?? `LSP connection closed for ${serverId} at ${root}`);
37
34
  this.serverId = serverId;
38
35
  this.root = root;
36
+ this.name = "LspConnectionClosedError";
39
37
  }
40
38
  }
41
39
 
42
40
  class LspProcessExitedError extends Error {
43
- serverId;
44
- root;
45
- exitCode;
46
- stderrTail;
47
- name = "LspProcessExitedError";
48
41
  constructor(serverId, root, exitCode, stderrTail) {
49
42
  const stderrSuffix = stderrTail ? `
50
43
  stderr tail: ${stderrTail}` : "";
@@ -53,46 +46,49 @@ stderr tail: ${stderrTail}` : "";
53
46
  this.root = root;
54
47
  this.exitCode = exitCode;
55
48
  this.stderrTail = stderrTail;
49
+ this.name = "LspProcessExitedError";
56
50
  }
57
51
  }
58
52
 
59
53
  class LspRequestTimeoutError extends Error {
60
- method;
61
- stderrTail;
62
- name = "LspRequestTimeoutError";
63
54
  constructor(method, stderrTail) {
64
55
  const stderrSuffix = stderrTail ? `
65
56
  recent stderr: ${stderrTail}` : "";
66
57
  super(`LSP request timeout (method: ${method})${stderrSuffix}`);
67
58
  this.method = method;
68
59
  this.stderrTail = stderrTail;
60
+ this.name = "LspRequestTimeoutError";
69
61
  }
70
62
  }
71
63
 
72
64
  class LspInvalidPathError extends Error {
73
- name = "LspInvalidPathError";
65
+ constructor() {
66
+ super(...arguments);
67
+ this.name = "LspInvalidPathError";
68
+ }
74
69
  }
75
70
 
76
71
  class LspServerLookupError extends Error {
77
- lookup;
78
- name = "LspServerLookupError";
79
72
  constructor(message, lookup) {
80
73
  super(message);
81
74
  this.lookup = lookup;
75
+ this.name = "LspServerLookupError";
82
76
  }
83
77
  }
84
78
 
85
79
  class LspServerInitializingError extends Error {
86
- originalError;
87
- name = "LspServerInitializingError";
88
80
  constructor(originalError) {
89
81
  super(`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`);
90
82
  this.originalError = originalError;
83
+ this.name = "LspServerInitializingError";
91
84
  }
92
85
  }
93
86
 
94
87
  class LspProcessSpawnError extends Error {
95
- name = "LspProcessSpawnError";
88
+ constructor() {
89
+ super(...arguments);
90
+ this.name = "LspProcessSpawnError";
91
+ }
96
92
  }
97
93
  function isLspDeadConnectionError(err) {
98
94
  return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
@@ -108,20 +104,31 @@ var METHOD_NOT_FOUND = -32601;
108
104
  var INTERNAL_ERROR = -32603;
109
105
 
110
106
  class JsonRpcConnection {
111
- reader;
112
- writer;
113
- pendingRequests = new Map;
114
- notificationHandlers = new Map;
115
- requestHandlers = new Map;
116
- closeHandlers = [];
117
- errorHandlers = [];
118
- inputBuffer = Buffer.alloc(0);
119
- nextRequestId = 1;
120
- listening = false;
121
- disposed = false;
122
107
  constructor(reader, writer) {
123
108
  this.reader = reader;
124
109
  this.writer = writer;
110
+ this.pendingRequests = new Map;
111
+ this.notificationHandlers = new Map;
112
+ this.requestHandlers = new Map;
113
+ this.closeHandlers = [];
114
+ this.errorHandlers = [];
115
+ this.inputBuffer = Buffer.alloc(0);
116
+ this.nextRequestId = 1;
117
+ this.listening = false;
118
+ this.disposed = false;
119
+ this.handleData = (chunk) => {
120
+ const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
121
+ this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
122
+ this.drainInputBuffer();
123
+ };
124
+ this.handleClose = () => {
125
+ for (const handler of this.closeHandlers) {
126
+ handler();
127
+ }
128
+ };
129
+ this.handleStreamError = (error) => {
130
+ this.emitError(error);
131
+ };
125
132
  }
126
133
  listen() {
127
134
  if (this.listening)
@@ -242,19 +249,6 @@ class JsonRpcConnection {
242
249
  this.notificationHandlers.clear();
243
250
  this.requestHandlers.clear();
244
251
  }
245
- handleData = (chunk) => {
246
- const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
247
- this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
248
- this.drainInputBuffer();
249
- };
250
- handleClose = () => {
251
- for (const handler of this.closeHandlers) {
252
- handler();
253
- }
254
- };
255
- handleStreamError = (error) => {
256
- this.emitError(error);
257
- };
258
252
  drainInputBuffer() {
259
253
  while (true) {
260
254
  const headerEnd = this.inputBuffer.indexOf(HEADER_SEPARATOR);
@@ -602,31 +596,25 @@ function isPosition(value) {
602
596
 
603
597
  // ../lsp-core/src/lsp/transport.ts
604
598
  class LspClientNotStartedError extends Error {
605
- serverId;
606
- root;
607
- name = "LspClientNotStartedError";
608
599
  constructor(serverId, root) {
609
600
  super("LSP client not started");
610
601
  this.serverId = serverId;
611
602
  this.root = root;
603
+ this.name = "LspClientNotStartedError";
612
604
  }
613
605
  }
614
606
 
615
607
  class LspClientTransport {
616
- root;
617
- server;
618
- proc = null;
619
- connection = null;
620
- stderrBuffer = [];
621
- processExited = false;
622
- diagnosticsStore = new Map;
623
- requestTimeoutMs;
624
- initializeTimeoutMs;
625
- workspaceApplyEditHandler = null;
626
- diagnosticPullSupported = false;
627
608
  constructor(root, server, timeouts = {}) {
628
609
  this.root = root;
629
610
  this.server = server;
611
+ this.proc = null;
612
+ this.connection = null;
613
+ this.stderrBuffer = [];
614
+ this.processExited = false;
615
+ this.diagnosticsStore = new Map;
616
+ this.workspaceApplyEditHandler = null;
617
+ this.diagnosticPullSupported = false;
630
618
  this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
631
619
  this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
632
620
  }
@@ -1133,16 +1121,12 @@ function movedPath(candidate, oldPath, newPath) {
1133
1121
  }
1134
1122
 
1135
1123
  class WorkspaceDocumentState {
1136
- sendNotification;
1137
- clearDiagnostics;
1138
- openDocuments = new Map;
1139
- openByUri = new Map;
1140
- openPromises = new Map;
1141
- now;
1142
- versionlessPublishQuiescenceMs;
1143
1124
  constructor(sendNotification, clearDiagnostics, options = {}) {
1144
1125
  this.sendNotification = sendNotification;
1145
1126
  this.clearDiagnostics = clearDiagnostics;
1127
+ this.openDocuments = new Map;
1128
+ this.openByUri = new Map;
1129
+ this.openPromises = new Map;
1146
1130
  this.now = options.now ?? (() => Date.now());
1147
1131
  this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
1148
1132
  }
@@ -1406,13 +1390,11 @@ import { dirname, isAbsolute, relative as relative2, resolve as resolve2 } from
1406
1390
  import { fileURLToPath } from "node:url";
1407
1391
 
1408
1392
  class WorkspaceEditPathError extends Error {
1409
- path;
1410
- detail;
1411
- name = "WorkspaceEditPathError";
1412
1393
  constructor(path, detail) {
1413
1394
  super(`${detail}: ${path}`);
1414
1395
  this.path = path;
1415
1396
  this.detail = detail;
1397
+ this.name = "WorkspaceEditPathError";
1416
1398
  }
1417
1399
  }
1418
1400
  function isPathInsideWorkspace(filePath, workspaceRoot) {
@@ -1704,13 +1686,11 @@ function canonicalFingerprint(operations) {
1704
1686
 
1705
1687
  // ../lsp-core/src/lsp/workspace-edit-types.ts
1706
1688
  class WorkspaceEditValidationError extends Error {
1707
- changeIndex;
1708
- detail;
1709
- name = "WorkspaceEditValidationError";
1710
1689
  constructor(changeIndex, detail) {
1711
1690
  super(`change ${changeIndex}: ${detail}`);
1712
1691
  this.changeIndex = changeIndex;
1713
1692
  this.detail = detail;
1693
+ this.name = "WorkspaceEditValidationError";
1714
1694
  }
1715
1695
  }
1716
1696
 
@@ -2208,10 +2188,9 @@ function simulateDelete(operation, virtual) {
2208
2188
  import { existsSync as existsSync4, lstatSync as lstatSync3, readdirSync as readdirSync2 } from "node:fs";
2209
2189
  import { dirname as dirname3, resolve as resolve4 } from "node:path";
2210
2190
  class WorkspaceSnapshotBuilder {
2211
- workspaceRoot;
2212
- snapshots = new Map;
2213
2191
  constructor(workspaceRoot) {
2214
2192
  this.workspaceRoot = workspaceRoot;
2193
+ this.snapshots = new Map;
2215
2194
  }
2216
2195
  build(operations) {
2217
2196
  this.add(this.workspaceRoot, false);
@@ -2255,8 +2234,10 @@ function snapshotOperations(operations, workspaceRoot) {
2255
2234
 
2256
2235
  // ../lsp-core/src/lsp/workspace-edit-plan.ts
2257
2236
  class PlanPathIndex {
2258
- firstChangeByPath = new Map;
2259
- reportedPathByCanonical = new Map;
2237
+ constructor() {
2238
+ this.firstChangeByPath = new Map;
2239
+ this.reportedPathByCanonical = new Map;
2240
+ }
2260
2241
  build(operations) {
2261
2242
  for (const operation of operations) {
2262
2243
  switch (operation.kind) {
@@ -2345,14 +2326,11 @@ function isRecord3(value) {
2345
2326
  }
2346
2327
 
2347
2328
  class WorkspaceMutationController {
2348
- workspaceRoot;
2349
- documents;
2350
- activeLease = null;
2351
- nextLeaseId = 1;
2352
- io;
2353
2329
  constructor(workspaceRoot, documents) {
2354
2330
  this.workspaceRoot = workspaceRoot;
2355
2331
  this.documents = documents;
2332
+ this.activeLease = null;
2333
+ this.nextLeaseId = 1;
2356
2334
  }
2357
2335
  setIo(io) {
2358
2336
  this.io = io;
@@ -2465,12 +2443,9 @@ var DIAGNOSTICS_FRESHNESS_TIMEOUT_MS = 3000;
2465
2443
  var VERSIONLESS_PUBLISH_QUIESCENCE_MS = 250;
2466
2444
 
2467
2445
  class LspClient extends LspClientConnection {
2468
- diagnosticPullErrors = [];
2469
- documents;
2470
- workspaceMutations;
2471
- diagnosticsFreshnessTimeoutMs;
2472
2446
  constructor(root, server, options = {}) {
2473
2447
  super(root, server, options);
2448
+ this.diagnosticPullErrors = [];
2474
2449
  this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
2475
2450
  this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
2476
2451
  versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
@@ -2770,16 +2745,11 @@ function awaitWithSignal(promise, signal) {
2770
2745
  }
2771
2746
 
2772
2747
  class LspManager {
2773
- clients = new Map;
2774
- reaperHandle = null;
2775
- signalDisposer = null;
2776
- disposed = false;
2777
- idleTimeoutMs;
2778
- initTimeoutMs;
2779
- reaperIntervalMs;
2780
- clientFactory;
2781
- now;
2782
2748
  constructor(options = {}) {
2749
+ this.clients = new Map;
2750
+ this.reaperHandle = null;
2751
+ this.signalDisposer = null;
2752
+ this.disposed = false;
2783
2753
  this.idleTimeoutMs = options.idleTimeoutMs ?? IDLE_TIMEOUT_MS;
2784
2754
  this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
2785
2755
  this.reaperIntervalMs = options.reaperIntervalMs ?? REAPER_INTERVAL_MS;
@@ -3013,7 +2983,7 @@ async function disposeDefaultLspManager() {
3013
2983
  // src/daemon-client.ts
3014
2984
  import { connect } from "node:net";
3015
2985
  import { homedir as homedir3 } from "node:os";
3016
- import { join as join7 } from "node:path";
2986
+ import { join as join8 } from "node:path";
3017
2987
 
3018
2988
  // ../lsp-core/src/request-context.ts
3019
2989
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -3022,18 +2992,17 @@ import { homedir } from "node:os";
3022
2992
  import { basename as basename2, delimiter as delimiter2, dirname as dirname4, isAbsolute as isAbsolute2, join as join2, relative as relative4, resolve as resolve6 } from "node:path";
3023
2993
 
3024
2994
  class LspRequestContextParseError extends Error {
3025
- code;
3026
- name = "LspRequestContextParseError";
3027
2995
  constructor(code, message) {
3028
2996
  super(message);
3029
2997
  this.code = code;
2998
+ this.name = "LspRequestContextParseError";
3030
2999
  }
3031
3000
  }
3032
3001
 
3033
3002
  class LspRequestContextUnavailableError extends Error {
3034
- name = "LspRequestContextUnavailableError";
3035
3003
  constructor() {
3036
3004
  super("LSP request context is required. Standalone MCP startup must install one with runWithRequestContext(createStandaloneMcpRequestContext()).");
3005
+ this.name = "LspRequestContextUnavailableError";
3037
3006
  }
3038
3007
  }
3039
3008
  var storage = new AsyncLocalStorage;
@@ -3191,7 +3160,6 @@ function isPlainRecord(value) {
3191
3160
 
3192
3161
  // src/daemon-request-error.ts
3193
3162
  class DaemonRequestError extends Error {
3194
- requestWritten;
3195
3163
  constructor(message, requestWritten) {
3196
3164
  super(message);
3197
3165
  this.name = "DaemonRequestError";
@@ -3214,7 +3182,6 @@ class DaemonRequestCancelledError extends DaemonRequestError {
3214
3182
  }
3215
3183
 
3216
3184
  class DaemonRequestTimedOutError extends DaemonRequestError {
3217
- timeoutMs;
3218
3185
  constructor(requestWritten, timeoutMs) {
3219
3186
  super("daemon request timed out", requestWritten);
3220
3187
  this.name = "DaemonRequestTimedOutError";
@@ -3293,14 +3260,12 @@ var PROTOCOL_ERROR_CODE = -32002;
3293
3260
  var AUTH_TOKEN_BYTES = 32;
3294
3261
 
3295
3262
  class UnsafePrivateDirectoryError extends Error {
3296
- path;
3297
- reason;
3298
- name = "UnsafePrivateDirectoryError";
3299
- code = "unsafe_private_directory";
3300
3263
  constructor(path, reason) {
3301
3264
  super(`unsafe private directory ${path}: ${reason}`);
3302
3265
  this.path = path;
3303
3266
  this.reason = reason;
3267
+ this.name = "UnsafePrivateDirectoryError";
3268
+ this.code = "unsafe_private_directory";
3304
3269
  }
3305
3270
  }
3306
3271
  function authEnvelope(token) {
@@ -3484,20 +3449,18 @@ var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
3484
3449
  var DAEMON_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
3485
3450
 
3486
3451
  class InvalidRuntimeOverrideError extends Error {
3487
- code = "invalid_runtime_override";
3488
- reason;
3489
3452
  constructor(reason, message) {
3490
3453
  super(message);
3454
+ this.code = "invalid_runtime_override";
3491
3455
  this.name = "InvalidRuntimeOverrideError";
3492
3456
  this.reason = reason;
3493
3457
  }
3494
3458
  }
3495
3459
 
3496
3460
  class InvalidDaemonVersionError extends Error {
3497
- code = "invalid_daemon_version";
3498
- version;
3499
3461
  constructor(version) {
3500
3462
  super("LSP daemon version must match [A-Za-z0-9][A-Za-z0-9._+-]{0,127}");
3463
+ this.code = "invalid_daemon_version";
3501
3464
  this.name = "InvalidDaemonVersionError";
3502
3465
  this.version = version;
3503
3466
  }
@@ -3543,10 +3506,9 @@ var requireFromHere = createRequire(import.meta.url);
3543
3506
  var MAX_SOCKET_PATH_LENGTH = 100;
3544
3507
 
3545
3508
  class InvalidDaemonDirectoryError extends Error {
3546
- code = "invalid_daemon_directory";
3547
- directory;
3548
3509
  constructor(directory) {
3549
3510
  super(`${OMO_LSP_DAEMON_DIR} must be an absolute path`);
3511
+ this.code = "invalid_daemon_directory";
3550
3512
  this.name = "InvalidDaemonDirectoryError";
3551
3513
  this.directory = directory;
3552
3514
  }
@@ -3741,7 +3703,8 @@ function spawnDaemonProcess(paths) {
3741
3703
  try {
3742
3704
  const child = spawn2(resolveDaemonNodeExecutable(), [paths.cliPath, "daemon"], {
3743
3705
  detached: true,
3744
- stdio: ["ignore", logFd, logFd]
3706
+ stdio: ["ignore", logFd, logFd],
3707
+ windowsHide: true
3745
3708
  });
3746
3709
  child.once("spawn", () => closeSync2(logFd));
3747
3710
  child.once("error", (error) => {
@@ -4118,7 +4081,11 @@ function createParentWatchdog(config, onDeadParent) {
4118
4081
  const probeAlive = config.probeAlive ?? isProcessAlive;
4119
4082
  let fired = false;
4120
4083
  const timer = setInterval(() => {
4121
- if (fired || probeAlive(parentPid))
4084
+ if (fired)
4085
+ return;
4086
+ const alive = probeAlive(parentPid);
4087
+ config.onPoll?.(alive);
4088
+ if (alive)
4122
4089
  return;
4123
4090
  fired = true;
4124
4091
  onDeadParent(parentPid, pollIntervalMs);
@@ -4153,18 +4120,55 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
4153
4120
  };
4154
4121
  }
4155
4122
  // ../lsp-core/src/lsp/client-wrapper.ts
4156
- import { existsSync as existsSync10, statSync as statSync4 } from "node:fs";
4157
- import { dirname as dirname8, join as join4, resolve as resolve7 } from "node:path";
4123
+ import { existsSync as existsSync11, realpathSync as realpathSync5, statSync as statSync4 } from "node:fs";
4124
+ import { basename as basename3, dirname as dirname9, join as join5, resolve as resolve7 } from "node:path";
4125
+
4126
+ // ../lsp-core/src/lsp/outside-context-workspace.ts
4127
+ import { existsSync as existsSync7, realpathSync as realpathSync4 } from "node:fs";
4128
+ import { dirname as dirname7, join as join3 } from "node:path";
4129
+
4130
+ // ../lsp-core/src/lsp/workspace-markers.ts
4131
+ var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
4132
+
4133
+ // ../lsp-core/src/lsp/outside-context-workspace.ts
4134
+ function findWorkspaceRootOutsideContext(directory) {
4135
+ const marked = nearestMarkedAncestor(directory);
4136
+ if (marked !== undefined)
4137
+ return marked;
4138
+ return realpathSync4(nearestExistingAncestor(directory));
4139
+ }
4140
+ function nearestMarkedAncestor(directory) {
4141
+ let current = directory;
4142
+ for (;; ) {
4143
+ if (existsSync7(current) && WORKSPACE_MARKERS.some((marker) => existsSync7(join3(current, marker)))) {
4144
+ return realpathSync4(current);
4145
+ }
4146
+ const parent = dirname7(current);
4147
+ if (parent === current)
4148
+ return;
4149
+ current = parent;
4150
+ }
4151
+ }
4152
+ function nearestExistingAncestor(directory) {
4153
+ let current = directory;
4154
+ while (!existsSync7(current)) {
4155
+ const parent = dirname7(current);
4156
+ if (parent === current)
4157
+ return current;
4158
+ current = parent;
4159
+ }
4160
+ return current;
4161
+ }
4158
4162
 
4159
4163
  // ../lsp-core/src/lsp/server-install-state.ts
4160
- import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
4161
- import { dirname as dirname7 } from "node:path";
4164
+ import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
4165
+ import { dirname as dirname8 } from "node:path";
4162
4166
  function getInstallDecisionsPath() {
4163
4167
  return lspRequestContext().installDecisionsPath;
4164
4168
  }
4165
4169
  function loadInstallDecisions() {
4166
4170
  const path2 = getInstallDecisionsPath();
4167
- if (!existsSync7(path2))
4171
+ if (!existsSync8(path2))
4168
4172
  return {};
4169
4173
  try {
4170
4174
  const parsed = JSON.parse(readFileSync4(path2, "utf8"));
@@ -4186,7 +4190,7 @@ function isInstallDecision(value) {
4186
4190
  }
4187
4191
  function writeInstallDecisions(decisions) {
4188
4192
  const path2 = getInstallDecisionsPath();
4189
- mkdirSync3(dirname7(path2), { recursive: true });
4193
+ mkdirSync3(dirname8(path2), { recursive: true });
4190
4194
  const tmpPath = `${path2}.tmp`;
4191
4195
  writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
4192
4196
  `, "utf8");
@@ -4205,7 +4209,7 @@ function isRecord5(value) {
4205
4209
  }
4206
4210
 
4207
4211
  // ../lsp-core/src/lsp/config-loader.ts
4208
- import { existsSync as existsSync8, readFileSync as readFileSync5 } from "node:fs";
4212
+ import { existsSync as existsSync9, readFileSync as readFileSync5 } from "node:fs";
4209
4213
 
4210
4214
  // ../lsp-core/src/lsp/server-definitions.ts
4211
4215
  var LSP_INSTALL_HINTS = {
@@ -4362,7 +4366,7 @@ function getUserConfigPath() {
4362
4366
  return lspRequestContext().userConfigPath;
4363
4367
  }
4364
4368
  function loadJsonFile(path2) {
4365
- if (!existsSync8(path2))
4369
+ if (!existsSync9(path2))
4366
4370
  return null;
4367
4371
  try {
4368
4372
  const parsed = JSON.parse(readFileSync5(path2, "utf-8"));
@@ -4550,8 +4554,8 @@ function getDisabledServerIds() {
4550
4554
  }
4551
4555
 
4552
4556
  // ../lsp-core/src/lsp/server-installation.ts
4553
- import { existsSync as existsSync9 } from "node:fs";
4554
- import { delimiter as delimiter3, join as join3 } from "node:path";
4557
+ import { existsSync as existsSync10 } from "node:fs";
4558
+ import { delimiter as delimiter3, join as join4 } from "node:path";
4555
4559
  function isServerInstalled(command, _workingDirectory) {
4556
4560
  if (command.length === 0)
4557
4561
  return false;
@@ -4559,7 +4563,7 @@ function isServerInstalled(command, _workingDirectory) {
4559
4563
  if (!cmd)
4560
4564
  return false;
4561
4565
  if (cmd.includes("/") || cmd.includes("\\")) {
4562
- if (existsSync9(cmd))
4566
+ if (existsSync10(cmd))
4563
4567
  return true;
4564
4568
  }
4565
4569
  const isWindows = process.platform === "win32";
@@ -4580,7 +4584,7 @@ function isServerInstalled(command, _workingDirectory) {
4580
4584
  const paths = pathEnv.split(delimiter3);
4581
4585
  for (const p of paths) {
4582
4586
  for (const suffix of exts) {
4583
- if (existsSync9(join3(p, cmd + suffix))) {
4587
+ if (existsSync10(join4(p, cmd + suffix))) {
4584
4588
  return true;
4585
4589
  }
4586
4590
  }
@@ -4676,7 +4680,6 @@ function getAllServers() {
4676
4680
  }
4677
4681
 
4678
4682
  // ../lsp-core/src/lsp/client-wrapper.ts
4679
- var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
4680
4683
  function isDirectoryPath(filePath) {
4681
4684
  try {
4682
4685
  return statSync4(filePath).isDirectory();
@@ -4685,32 +4688,85 @@ function isDirectoryPath(filePath) {
4685
4688
  }
4686
4689
  }
4687
4690
  function findWorkspaceRoot(filePath) {
4688
- const abs = resolvePathInsideContext(filePath);
4691
+ const cwd = contextCwd();
4692
+ const abs = resolveReadablePathInsideContext(filePath);
4689
4693
  let dir = abs;
4690
4694
  if (!isDirectoryPath(dir)) {
4691
- dir = dirname8(dir);
4692
- }
4693
- let prevDir = "";
4694
- while (dir !== prevDir) {
4695
- for (const marker of WORKSPACE_MARKERS) {
4696
- if (existsSync10(join4(dir, marker))) {
4697
- return dir;
4695
+ dir = dirname9(dir);
4696
+ }
4697
+ if (!isPathInside(cwd, abs))
4698
+ return findWorkspaceRootOutsideContext(dir);
4699
+ const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
4700
+ while (isPathInside(cwd, dir)) {
4701
+ const canonicalDir = existingDirectoryInsideContext(dir, cwd);
4702
+ if (canonicalDir !== undefined) {
4703
+ for (const marker of WORKSPACE_MARKERS) {
4704
+ if (existsSync11(join5(dir, marker))) {
4705
+ return canonicalDir;
4706
+ }
4698
4707
  }
4699
4708
  }
4700
- prevDir = dir;
4701
- dir = dirname8(dir);
4709
+ if (dir === cwd)
4710
+ break;
4711
+ dir = dirname9(dir);
4702
4712
  }
4703
- return dirname8(abs);
4713
+ return fallbackRoot;
4704
4714
  }
4705
- function resolvePathInsideContext(filePath) {
4715
+ function resolveReadablePathInsideContext(filePath) {
4706
4716
  const cwd = contextCwd();
4707
4717
  const abs = resolve7(cwd, filePath);
4718
+ if (isPathInside(cwd, abs))
4719
+ return abs;
4720
+ const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
4721
+ if (rebased !== undefined)
4722
+ return rebased;
4723
+ return canonicalizeExistingOrNearestAncestor(abs);
4724
+ }
4725
+ function resolvePathInsideContext(filePath) {
4726
+ const cwd = contextCwd();
4727
+ const abs = resolveReadablePathInsideContext(filePath);
4708
4728
  const canonical = canonicalizeExistingOrNearestAncestor(abs);
4709
4729
  if (!isPathInside(cwd, canonical)) {
4710
4730
  throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
4711
4731
  }
4712
4732
  return canonical;
4713
4733
  }
4734
+ function rebaseThroughCanonicalAncestor(path2, cwd) {
4735
+ let current = path2;
4736
+ const suffix = [];
4737
+ while (true) {
4738
+ if (existsSync11(current)) {
4739
+ const canonical = realpathSync5(current);
4740
+ if (isPathInside(cwd, canonical))
4741
+ return suffix.length === 0 ? canonical : join5(canonical, ...suffix);
4742
+ }
4743
+ const parent = dirname9(current);
4744
+ if (parent === current)
4745
+ return;
4746
+ suffix.unshift(basename3(current));
4747
+ current = parent;
4748
+ }
4749
+ }
4750
+ function existingDirectoryInsideContext(directory, cwd) {
4751
+ if (!existsSync11(directory))
4752
+ return;
4753
+ const canonical = realpathSync5(directory);
4754
+ if (!statSync4(canonical).isDirectory())
4755
+ return;
4756
+ return isPathInside(cwd, canonical) ? canonical : undefined;
4757
+ }
4758
+ function nearestExistingDirectoryInsideContext(directory, cwd) {
4759
+ let current = directory;
4760
+ while (isPathInside(cwd, current)) {
4761
+ const canonical = existingDirectoryInsideContext(current, cwd);
4762
+ if (canonical !== undefined)
4763
+ return canonical;
4764
+ if (current === cwd)
4765
+ return;
4766
+ current = dirname9(current);
4767
+ }
4768
+ return;
4769
+ }
4714
4770
  function formatServerLookupError(result) {
4715
4771
  if (result.status === "not_installed") {
4716
4772
  return formatNotInstalled(result);
@@ -4781,7 +4837,7 @@ function formatNotInstalled(result) {
4781
4837
  ].join(`
4782
4838
  `);
4783
4839
  }
4784
- var READ_ONLY_RETRY_TOOLS = new Set([
4840
+ var READ_ONLY_TOOLS = new Set([
4785
4841
  "diagnostics",
4786
4842
  "definition",
4787
4843
  "references",
@@ -4790,7 +4846,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
4790
4846
  "prepareRename"
4791
4847
  ]);
4792
4848
  async function withLspClient(filePath, fn, toolName, options = {}) {
4793
- const absPath = resolvePathInsideContext(filePath);
4849
+ const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
4794
4850
  if (isDirectoryPath(absPath)) {
4795
4851
  throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
4796
4852
  }
@@ -4805,9 +4861,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
4805
4861
  const acquireAndCall = async (allowRetry) => {
4806
4862
  const client = await manager.getClient(root, server2, options.signal);
4807
4863
  try {
4808
- return await fn(client, root);
4864
+ return await fn(client, root, absPath);
4809
4865
  } catch (err) {
4810
- if (allowRetry && READ_ONLY_RETRY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
4866
+ if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
4811
4867
  manager.invalidateClient(root, server2.id, client);
4812
4868
  return acquireAndCall(false);
4813
4869
  }
@@ -4825,8 +4881,8 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
4825
4881
  }
4826
4882
 
4827
4883
  // ../lsp-core/src/lsp/directory-diagnostics.ts
4828
- import { existsSync as existsSync11, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
4829
- import { join as join5, resolve as resolve8 } from "node:path";
4884
+ import { existsSync as existsSync12, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
4885
+ import { join as join6, resolve as resolve8 } from "node:path";
4830
4886
 
4831
4887
  // ../lsp-core/src/lsp/formatters.ts
4832
4888
  import { fileURLToPath as fileURLToPath3 } from "node:url";
@@ -4956,7 +5012,7 @@ function collectFilesWithExtension(dir, extension, maxFiles) {
4956
5012
  for (const entry of entries) {
4957
5013
  if (files.length >= maxFiles)
4958
5014
  return;
4959
- const fullPath = join5(currentDir, entry);
5015
+ const fullPath = join6(currentDir, entry);
4960
5016
  let stat;
4961
5017
  try {
4962
5018
  stat = lstatSync5(fullPath);
@@ -4982,7 +5038,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
4982
5038
  throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
4983
5039
  }
4984
5040
  const absDir = resolve8(options.workspaceRoot ?? contextCwd(), directory);
4985
- if (!existsSync11(absDir)) {
5041
+ if (!existsSync12(absDir)) {
4986
5042
  throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
4987
5043
  }
4988
5044
  const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
@@ -5069,7 +5125,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
5069
5125
 
5070
5126
  // ../lsp-core/src/lsp/infer-extension.ts
5071
5127
  import { lstatSync as lstatSync6, readdirSync as readdirSync4 } from "node:fs";
5072
- import { join as join6 } from "node:path";
5128
+ import { join as join7 } from "node:path";
5073
5129
  var SKIP_DIRECTORIES2 = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
5074
5130
  var MAX_SCAN_ENTRIES = 500;
5075
5131
  function inferExtensionFromDirectory(directory) {
@@ -5087,7 +5143,7 @@ function inferExtensionFromDirectory(directory) {
5087
5143
  for (const entry of entries) {
5088
5144
  if (scanned >= MAX_SCAN_ENTRIES)
5089
5145
  return;
5090
- const fullPath = join6(dir, entry);
5146
+ const fullPath = join7(dir, entry);
5091
5147
  let stat;
5092
5148
  try {
5093
5149
  stat = lstatSync6(fullPath);
@@ -5262,7 +5318,7 @@ async function executeLspDiagnostics(params, signal) {
5262
5318
  const filePath = requireString(params, "filePath");
5263
5319
  const severity = severityFilter(params);
5264
5320
  try {
5265
- const absPath = resolvePathInsideContext(filePath);
5321
+ const absPath = resolveReadablePathInsideContext(filePath);
5266
5322
  if (isDirectoryPath(absPath)) {
5267
5323
  const extension = inferExtensionFromDirectory(absPath);
5268
5324
  if (!extension) {
@@ -5291,7 +5347,7 @@ async function executeLspDiagnostics(params, signal) {
5291
5347
  };
5292
5348
  return text(output2.output, details2);
5293
5349
  }
5294
- const result = await withLspClient(filePath, async (client) => client.diagnostics(filePath, signal), "diagnostics", clientOptions(signal));
5350
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
5295
5351
  if (result.transientError) {
5296
5352
  const message = result.transientError.message;
5297
5353
  const details2 = {
@@ -5366,7 +5422,7 @@ async function executeLspGotoDefinition(params, signal) {
5366
5422
  const line = requireNumber(params, "line");
5367
5423
  const character = requireNumber(params, "character");
5368
5424
  try {
5369
- const result = await withLspClient(filePath, async (client) => client.definition(filePath, line, character, signal), "definition", clientOptions(signal));
5425
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
5370
5426
  const locations = !result ? [] : Array.isArray(result) ? result : [result];
5371
5427
  const details = { filePath, line, character, locations };
5372
5428
  if (locations.length === 0)
@@ -5391,7 +5447,7 @@ async function executeLspFindReferences(params, signal) {
5391
5447
  const character = requireNumber(params, "character");
5392
5448
  const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
5393
5449
  try {
5394
- const result = await withLspClient(filePath, async (client) => client.references(filePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
5450
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
5395
5451
  const references = Array.isArray(result) ? result : [];
5396
5452
  const total = references.length;
5397
5453
  const truncated = total > DEFAULT_MAX_REFERENCES;
@@ -5433,7 +5489,7 @@ async function executeLspPrepareRename(params, signal) {
5433
5489
  const line = requireNumber(params, "line");
5434
5490
  const character = requireNumber(params, "character");
5435
5491
  try {
5436
- const result = await withLspClient(filePath, async (client) => client.prepareRename(filePath, line, character, signal), "prepareRename", clientOptions(signal));
5492
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
5437
5493
  const details = { filePath, line, character, result };
5438
5494
  return text(formatPrepareRenameResult(result), details);
5439
5495
  } catch (error) {
@@ -5454,7 +5510,7 @@ async function executeLspRename(params, signal) {
5454
5510
  const character = requireNumber(params, "character");
5455
5511
  const newName = requireString(params, "newName");
5456
5512
  try {
5457
- const result = await withLspClient(filePath, async (client) => client.rename(filePath, line, character, newName, signal), "rename", clientOptions(signal));
5513
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
5458
5514
  const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
5459
5515
  return text(formatApplyResult(result.apply), details, !result.apply.success);
5460
5516
  } catch (error) {
@@ -5534,7 +5590,7 @@ async function executeLspSymbols(params, signal) {
5534
5590
  const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
5535
5591
  return formatSymbolsResult(filePath, scope, symbols2, limit, query);
5536
5592
  }
5537
- const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(filePath, signal), "documentSymbols", clientOptions(signal));
5593
+ const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
5538
5594
  return formatSymbolsResult(filePath, scope, symbols, limit);
5539
5595
  } catch (error) {
5540
5596
  const query = optionalString(params, "query");
@@ -5770,7 +5826,10 @@ function requestedProtocolVersion(params) {
5770
5826
  var CONTEXT_KEY = "_context";
5771
5827
 
5772
5828
  class InvalidDaemonRequestError extends Error {
5773
- name = "InvalidDaemonRequestError";
5829
+ constructor() {
5830
+ super(...arguments);
5831
+ this.name = "InvalidDaemonRequestError";
5832
+ }
5774
5833
  }
5775
5834
  function extractRequestContext(raw) {
5776
5835
  if (!isPlainRecord(raw) || raw["method"] !== "tools/call")
@@ -5891,9 +5950,9 @@ function currentRequestContext(env = process.env) {
5891
5950
  const home = env["HOME"] ?? homedir3();
5892
5951
  return parseLspRequestContext({
5893
5952
  cwd,
5894
- projectConfigPaths: [join7(cwd, ".codex", "lsp-client.json")],
5895
- userConfigPath: join7(home, ".codex", "lsp-client.json"),
5896
- installDecisionsPath: join7(home, ".codex", "lsp-install-decisions.json"),
5953
+ projectConfigPaths: [join8(cwd, ".codex", "lsp-client.json")],
5954
+ userConfigPath: join8(home, ".codex", "lsp-client.json"),
5955
+ installDecisionsPath: join8(home, ".codex", "lsp-install-decisions.json"),
5897
5956
  capabilities: { installDecisionTool: true }
5898
5957
  });
5899
5958
  }
@@ -6025,8 +6084,8 @@ function isRetryableTool(name) {
6025
6084
  return name !== "rename" && name !== "lsp_rename";
6026
6085
  }
6027
6086
  // src/proxy.ts
6028
- import { existsSync as existsSync12, realpathSync as realpathSync4 } from "node:fs";
6029
- import { basename as basename3, delimiter as delimiter4, dirname as dirname9, isAbsolute as isAbsolute5 } from "node:path";
6087
+ import { existsSync as existsSync13, realpathSync as realpathSync6 } from "node:fs";
6088
+ import { basename as basename4, delimiter as delimiter4, dirname as dirname10, isAbsolute as isAbsolute5 } from "node:path";
6030
6089
  var DEFAULT_STARTUP_TIMEOUT_MS = 1e4;
6031
6090
  async function runMcpStdioProxy(options = {}) {
6032
6091
  const input = options.input ?? process.stdin;
@@ -6149,34 +6208,34 @@ function canonicalizePathList(value) {
6149
6208
  return value.split(delimiter4).map((entry) => canonicalizePath(entry) ?? entry).join(delimiter4);
6150
6209
  }
6151
6210
  function canonicalizePath(value) {
6152
- if (value === undefined || !isAbsolute5(value) || !existsSync12(value))
6211
+ if (value === undefined || !isAbsolute5(value) || !existsSync13(value))
6153
6212
  return value;
6154
- return realpathSync4(value);
6213
+ return realpathSync6(value);
6155
6214
  }
6156
6215
  function projectRootFromOpenCodeConfigPath(path2) {
6157
- if (basename3(path2) !== "lsp.json" && basename3(path2) !== "lsp-client.json")
6216
+ if (basename4(path2) !== "lsp.json" && basename4(path2) !== "lsp-client.json")
6158
6217
  return;
6159
- const configDir = dirname9(path2);
6160
- const configDirName = basename3(configDir);
6218
+ const configDir = dirname10(path2);
6219
+ const configDirName = basename4(configDir);
6161
6220
  if (configDirName !== ".opencode" && configDirName !== ".omo")
6162
6221
  return;
6163
- return dirname9(configDir);
6222
+ return dirname10(configDir);
6164
6223
  }
6165
6224
  export {
6166
- validateDaemonVersion,
6167
- runMcpStdioProxy,
6168
- resolveDaemonRuntime,
6169
- probeDaemon,
6170
- ensureDaemonRunning,
6171
- disposeDefaultLspManager,
6172
- daemonPaths,
6173
- currentRequestContext,
6174
- callToolViaDaemon,
6175
- callDiagnosticsViaDaemon,
6176
- OMO_LSP_DAEMON_VERSION,
6177
- OMO_LSP_DAEMON_DIR,
6178
- OMO_LSP_DAEMON_CLI,
6179
- InvalidRuntimeOverrideError,
6225
+ InvalidDaemonDirectoryError,
6180
6226
  InvalidDaemonVersionError,
6181
- InvalidDaemonDirectoryError
6227
+ InvalidRuntimeOverrideError,
6228
+ OMO_LSP_DAEMON_CLI,
6229
+ OMO_LSP_DAEMON_DIR,
6230
+ OMO_LSP_DAEMON_VERSION,
6231
+ callDiagnosticsViaDaemon,
6232
+ callToolViaDaemon,
6233
+ currentRequestContext,
6234
+ daemonPaths,
6235
+ disposeDefaultLspManager,
6236
+ ensureDaemonRunning,
6237
+ probeDaemon,
6238
+ resolveDaemonRuntime,
6239
+ runMcpStdioProxy,
6240
+ validateDaemonVersion
6182
6241
  };