oh-my-opencode 4.19.4 → 5.0.0-beta.10

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 (374) hide show
  1. package/.agents/command/publish.md +44 -16
  2. package/.agents/skills/publish/SKILL.md +44 -16
  3. package/.agents/skills/work-with-pr/SKILL.md +37 -23
  4. package/.opencode/command/publish.md +44 -16
  5. package/.opencode/skills/work-with-pr/SKILL.md +37 -23
  6. package/README.ja.md +1 -1
  7. package/README.ko.md +1 -1
  8. package/README.md +18 -6
  9. package/README.ru.md +1 -1
  10. package/README.zh-cn.md +1 -1
  11. package/bin/oh-my-opencode.js +14 -1
  12. package/bin/oh-my-opencode.test.ts +21 -0
  13. package/dist/agents/atlas/agent.d.ts +0 -1
  14. package/dist/agents/sisyphus/grok-4.d.ts +20 -0
  15. package/dist/agents/sisyphus/index.d.ts +2 -0
  16. package/dist/agents/sisyphus-agent-config.d.ts +6 -0
  17. package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
  18. package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
  19. package/dist/agents/types.d.ts +2 -2
  20. package/dist/cli/index.js +1888 -807
  21. package/dist/cli/run/on-complete-hook.d.ts +2 -0
  22. package/dist/cli-node/index.js +1888 -807
  23. package/dist/config/schema/agent-overrides.d.ts +528 -0
  24. package/dist/config/schema/oh-my-opencode-config.d.ts +495 -0
  25. package/dist/features/monitor/batcher.d.ts +3 -1
  26. package/dist/features/monitor/manager-internals.d.ts +1 -0
  27. package/dist/features/monitor/output-injector-types.d.ts +2 -0
  28. package/dist/features/monitor/output-injector.d.ts +6 -0
  29. package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
  30. package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
  31. package/dist/hooks/todo-continuation-enforcer/types.d.ts +1 -0
  32. package/dist/hooks/todo-continuation-enforcer/unrecoverable-request-error.d.ts +9 -0
  33. package/dist/hooks/tool-pair-validator/hook.test-support.d.ts +29 -0
  34. package/dist/hooks/tool-pair-validator/tool-part-ids.d.ts +14 -5
  35. package/dist/hooks/tool-pair-validator/tool-result-repair.d.ts +4 -3
  36. package/dist/hooks/tool-pair-validator/types.d.ts +5 -22
  37. package/dist/index.js +3139 -2232
  38. package/dist/mcp/lsp.d.ts +1 -0
  39. package/dist/oh-my-opencode.schema.json +1466 -131
  40. package/dist/shared/normalize-sdk-response.d.ts +1 -0
  41. package/dist/shared/shell-env.d.ts +1 -1
  42. package/dist/shared/tmux/constants.d.ts +1 -1
  43. package/dist/skills/ast-grep/SOURCE +1 -1
  44. package/dist/skills/ast-grep/install.ps1 +2 -2
  45. package/dist/skills/ast-grep/install.sh +1 -1
  46. package/dist/skills/ast-grep/references/install.md +2 -2
  47. package/dist/skills/ast-grep/tests/smoke.sh +1 -1
  48. package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
  49. package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  50. package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
  51. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  52. package/dist/skills/frontend/SKILL.md +10 -7
  53. package/dist/skills/frontend/references/design/_INDEX.md +1 -0
  54. package/dist/skills/frontend/references/design/stylegallery.md +80 -0
  55. package/dist/skills/start-work/SKILL.md +54 -9
  56. package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  57. package/dist/skills/ultimate-browsing/SKILL.md +2 -2
  58. package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  59. package/dist/skills/ultimate-browsing/engine/__main__.py +8 -1
  60. package/dist/skills/ultimate-browsing/engine/bias_check.py +11 -0
  61. package/dist/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
  62. package/dist/skills/ultimate-browsing/engine/result_schema.py +10 -1
  63. package/dist/skills/ultimate-browsing/engine/surrogate.py +214 -0
  64. package/dist/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
  65. package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
  66. package/dist/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
  67. package/dist/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
  68. package/dist/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
  69. package/dist/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
  70. package/dist/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
  71. package/dist/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
  72. package/dist/skills/ultimate-browsing/engine/validators.py +46 -0
  73. package/dist/skills/ultimate-browsing/engine/waf_detector.py +1 -1
  74. package/dist/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
  75. package/dist/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
  76. package/dist/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
  77. package/dist/skills/ultimate-browsing/references/insane-search/README.md +4 -4
  78. package/dist/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
  79. package/dist/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
  80. package/dist/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
  81. package/dist/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
  82. package/dist/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
  83. package/dist/skills/ulw-plan/SKILL.md +3 -3
  84. package/dist/skills/ulw-plan/references/full-workflow.md +30 -6
  85. package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
  86. package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
  87. package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
  88. package/dist/skills/ulw-research/SKILL.md +15 -10
  89. package/dist/tui.js +477 -36
  90. package/docs/reference/web-terminal-visual-qa.md +1 -1
  91. package/package.json +34 -24
  92. package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
  93. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
  94. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +60 -7
  95. package/packages/lsp-core/src/lsp/client-wrapper.ts +69 -16
  96. package/packages/lsp-core/src/lsp/connection.ts +1 -1
  97. package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
  98. package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
  99. package/packages/lsp-core/src/tools/navigation.ts +4 -2
  100. package/packages/lsp-core/src/tools/rename.ts +4 -2
  101. package/packages/lsp-core/src/tools/symbols.ts +1 -1
  102. package/packages/lsp-daemon/dist/cli.js +108 -40
  103. package/packages/lsp-daemon/dist/client.js +123 -55
  104. package/packages/lsp-daemon/dist/ensure-daemon.d.ts +1 -0
  105. package/packages/lsp-daemon/dist/ensure-daemon.js +18 -5
  106. package/packages/lsp-daemon/dist/index.js +111 -43
  107. package/packages/lsp-tools-mcp/dist/cli.js +77 -23
  108. package/packages/lsp-tools-mcp/dist/lsp/manager.js +1 -1
  109. package/packages/lsp-tools-mcp/dist/mcp.js +77 -23
  110. package/packages/lsp-tools-mcp/dist/tools.js +77 -23
  111. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  112. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +268 -92
  113. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  114. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  115. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +7 -7
  116. package/packages/omo-codex/plugin/components/bootstrap/src/worker.ts +3 -0
  117. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +220 -10
  118. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +220 -10
  119. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  120. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  121. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  122. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  123. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  124. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  125. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  126. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
  127. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  128. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +135 -67
  129. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  130. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  131. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  132. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  133. package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
  134. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
  135. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
  136. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
  137. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
  138. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
  139. package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
  140. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
  141. package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
  142. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
  143. package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +4 -2
  144. package/packages/omo-codex/plugin/components/start-work-continuation/README.md +5 -1
  145. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +2 -1
  146. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +18 -0
  147. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  148. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  149. package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +21 -0
  150. package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +0 -3
  151. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +107 -16
  152. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  153. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  154. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
  155. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +24 -12
  156. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
  157. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  158. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  159. package/packages/omo-codex/plugin/components/ultrawork/CHANGELOG.md +2 -0
  160. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
  161. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
  162. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
  163. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
  164. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-low.toml +1 -1
  165. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +1 -1
  166. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +2 -2
  167. package/packages/omo-codex/plugin/components/ultrawork/directive.md +9 -2
  168. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  169. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  170. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +9 -2
  171. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +3 -3
  172. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +30 -6
  173. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
  174. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
  175. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
  176. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
  177. package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
  178. package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +1 -1
  179. package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +2 -0
  180. package/packages/omo-codex/plugin/components/ulw-loop/README.md +11 -11
  181. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +9 -2
  182. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +1 -1
  183. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
  184. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +9 -9
  185. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +1 -1
  186. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +66 -66
  187. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +4 -4
  188. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +1 -1
  189. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +1 -1
  190. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +1 -1
  191. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +1 -1
  192. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +2 -2
  193. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  194. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  195. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +5 -4
  196. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
  197. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +23 -25
  198. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +1 -1
  199. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +9 -9
  200. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +1 -1
  201. package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +1 -1
  202. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +4 -4
  203. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +1 -1
  204. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +1 -1
  205. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +1 -1
  206. package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +1 -1
  207. package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +2 -2
  208. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
  209. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +2 -2
  210. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +1 -1
  211. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-helpers.test.ts +2 -2
  212. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-kind-guidance.test.ts +1 -1
  213. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
  214. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +2 -5
  215. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +1 -1
  216. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +7 -40
  217. package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +1 -1
  218. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +1 -1
  219. package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +1 -1
  220. package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +1 -1
  221. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
  222. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  223. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  224. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  225. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  226. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  227. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  228. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  229. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  230. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  231. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  232. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  233. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  234. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  235. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  236. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  237. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  238. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  239. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  240. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  241. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  242. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  243. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  244. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  245. package/packages/omo-codex/plugin/package-lock.json +20 -20
  246. package/packages/omo-codex/plugin/package.json +1 -1
  247. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +4 -4
  248. package/packages/omo-codex/plugin/skills/ast-grep/SOURCE +1 -1
  249. package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +2 -2
  250. package/packages/omo-codex/plugin/skills/ast-grep/install.sh +1 -1
  251. package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +2 -2
  252. package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.sh +1 -1
  253. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
  254. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  255. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
  256. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  257. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +10 -7
  258. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
  259. package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
  260. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +54 -9
  261. package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  262. package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +2 -2
  263. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  264. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +8 -1
  265. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/bias_check.py +11 -0
  266. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
  267. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/result_schema.py +10 -1
  268. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/surrogate.py +214 -0
  269. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
  270. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
  271. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
  272. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
  273. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
  274. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
  275. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
  276. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
  277. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/validators.py +46 -0
  278. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_detector.py +1 -1
  279. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
  280. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
  281. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
  282. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +4 -4
  283. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
  284. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
  285. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
  286. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
  287. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
  288. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +9 -2
  289. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +5 -4
  290. package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
  291. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +23 -25
  292. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +3 -3
  293. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +30 -6
  294. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
  295. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
  296. package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
  297. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +15 -10
  298. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
  299. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
  300. package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
  301. package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
  302. package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
  303. package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +12 -12
  304. package/packages/omo-codex/plugin/test/bootstrap-orchestration.test.mjs +36 -4
  305. package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
  306. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
  307. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
  308. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +4 -4
  309. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
  310. package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
  311. package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
  312. package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
  313. package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
  314. package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
  315. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
  316. package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
  317. package/packages/omo-codex/scripts/install-bin-links.test.mjs +56 -2
  318. package/packages/omo-codex/scripts/install-delegated-command.test.mjs +6 -6
  319. package/packages/omo-codex/scripts/install-dist/install-local.mjs +170 -78
  320. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
  321. package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +4 -4
  322. package/packages/omo-codex/scripts/install-local.test.mjs +5 -2
  323. package/packages/shared-skills/index.mjs +19 -1
  324. package/packages/shared-skills/skills/ast-grep/SOURCE +1 -1
  325. package/packages/shared-skills/skills/ast-grep/install.ps1 +2 -2
  326. package/packages/shared-skills/skills/ast-grep/install.sh +1 -1
  327. package/packages/shared-skills/skills/ast-grep/references/install.md +2 -2
  328. package/packages/shared-skills/skills/ast-grep/tests/smoke.sh +1 -1
  329. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
  330. package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
  331. package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
  332. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
  333. package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
  334. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
  335. package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
  336. package/packages/shared-skills/skills/start-work/SKILL.md +54 -9
  337. package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
  338. package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +2 -2
  339. package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
  340. package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +8 -1
  341. package/packages/shared-skills/skills/ultimate-browsing/engine/bias_check.py +11 -0
  342. package/packages/shared-skills/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
  343. package/packages/shared-skills/skills/ultimate-browsing/engine/result_schema.py +10 -1
  344. package/packages/shared-skills/skills/ultimate-browsing/engine/surrogate.py +214 -0
  345. package/packages/shared-skills/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
  346. package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
  347. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
  348. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
  349. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
  350. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
  351. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
  352. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
  353. package/packages/shared-skills/skills/ultimate-browsing/engine/validators.py +46 -0
  354. package/packages/shared-skills/skills/ultimate-browsing/engine/waf_detector.py +1 -1
  355. package/packages/shared-skills/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
  356. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
  357. package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
  358. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +4 -4
  359. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
  360. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
  361. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
  362. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
  363. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
  364. package/packages/shared-skills/skills/ulw-plan/SKILL.md +3 -3
  365. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +30 -6
  366. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
  367. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
  368. package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
  369. package/packages/shared-skills/skills/ulw-research/SKILL.md +15 -10
  370. package/postinstall.mjs +6 -0
  371. package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
  372. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
  373. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
  374. package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
@@ -254,10 +254,10 @@ function errorText(error) {
254
254
 
255
255
  // src/ensure-daemon.ts
256
256
  import { spawn } from "node:child_process";
257
- import { closeSync as closeSync2, mkdirSync as mkdirSync2, openSync as openSync2 } from "node:fs";
257
+ import { closeSync as closeSync2, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync as openSync2, writeSync as writeSync2 } from "node:fs";
258
258
  import { Socket } from "node:net";
259
- import { dirname as dirname3 } from "node:path";
260
- import { execPath } from "node:process";
259
+ import { dirname as dirname3, isAbsolute as isAbsolute3 } from "node:path";
260
+ import { argv0, execPath } from "node:process";
261
261
 
262
262
  // src/ipc-protocol.ts
263
263
  import { randomBytes, timingSafeEqual } from "node:crypto";
@@ -727,15 +727,29 @@ function spawnDaemonProcess(paths) {
727
727
  mkdirSync2(dirname3(paths.log), { recursive: true });
728
728
  const logFd = openSync2(paths.log, "a");
729
729
  try {
730
- const child = spawn(execPath, [paths.cliPath, "daemon"], {
730
+ const child = spawn(resolveDaemonNodeExecutable(), [paths.cliPath, "daemon"], {
731
731
  detached: true,
732
732
  stdio: ["ignore", logFd, logFd]
733
733
  });
734
+ child.once("spawn", () => closeSync2(logFd));
735
+ child.once("error", (error) => {
736
+ writeSync2(logFd, `[lsp-daemon] failed to spawn daemon: ${error.message}
737
+ `);
738
+ closeSync2(logFd);
739
+ });
734
740
  child.unref();
735
- } finally {
741
+ } catch (error) {
736
742
  closeSync2(logFd);
743
+ throw error;
737
744
  }
738
745
  }
746
+ function resolveDaemonNodeExecutable(cachedExecPath = execPath, originalArgv0 = argv0, pathExists = existsSync2) {
747
+ if (pathExists(cachedExecPath))
748
+ return cachedExecPath;
749
+ if (isAbsolute3(originalArgv0) && pathExists(originalArgv0))
750
+ return originalArgv0;
751
+ return "node";
752
+ }
739
753
  function defaultEnsureDaemonDeps() {
740
754
  return {
741
755
  probe: (paths, signal) => probeDaemon(paths, PROBE_TIMEOUT_MS, signal),
@@ -1127,8 +1141,8 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
1127
1141
  };
1128
1142
  }
1129
1143
  // ../lsp-core/src/lsp/client-wrapper.ts
1130
- import { existsSync as existsSync9, statSync as statSync4 } from "node:fs";
1131
- import { dirname as dirname8, join as join4, resolve as resolve7 } from "node:path";
1144
+ import { existsSync as existsSync10, realpathSync as realpathSync4, statSync as statSync4 } from "node:fs";
1145
+ import { basename as basename3, dirname as dirname8, join as join4, resolve as resolve7 } from "node:path";
1132
1146
 
1133
1147
  // ../lsp-core/src/lsp/effective-extension.ts
1134
1148
  import { basename as basename2, extname } from "node:path";
@@ -1559,7 +1573,7 @@ function toError(error) {
1559
1573
 
1560
1574
  // ../lsp-core/src/lsp/process.ts
1561
1575
  import { spawn as spawn2, spawnSync } from "node:child_process";
1562
- import { existsSync as existsSync2, statSync as statSync3 } from "node:fs";
1576
+ import { existsSync as existsSync3, statSync as statSync3 } from "node:fs";
1563
1577
  import { delimiter as delimiter2, join as join2 } from "node:path";
1564
1578
  function isMissingProcessError(error) {
1565
1579
  if (!(error instanceof Error) || !("code" in error))
@@ -1573,7 +1587,7 @@ function reportKillError(context, error) {
1573
1587
  }
1574
1588
  function validateCwd(cwd) {
1575
1589
  try {
1576
- if (!existsSync2(cwd)) {
1590
+ if (!existsSync3(cwd)) {
1577
1591
  return { valid: false, error: `Working directory does not exist: ${cwd}` };
1578
1592
  }
1579
1593
  const stats = statSync3(cwd);
@@ -1661,7 +1675,7 @@ function resolveWindowsCommand(command, env) {
1661
1675
  for (const baseDirectory of baseDirectories) {
1662
1676
  for (const extension of extensions) {
1663
1677
  const candidate = baseDirectory ? join2(baseDirectory, `${command}${extension}`) : `${command}${extension}`;
1664
- if (existsSync2(candidate))
1678
+ if (existsSync3(candidate))
1665
1679
  return candidate;
1666
1680
  }
1667
1681
  }
@@ -2060,7 +2074,7 @@ class LspClientConnection extends LspClientTransport {
2060
2074
  initializationOptions: this.server.initialization
2061
2075
  }, { timeoutMs: this.initializeTimeoutMs });
2062
2076
  this.setDiagnosticPullSupported(supportsDiagnosticPull(result?.capabilities));
2063
- await this.sendNotification("initialized");
2077
+ await this.sendNotification("initialized", {});
2064
2078
  await this.sendNotification("workspace/didChangeConfiguration", {
2065
2079
  settings: { json: { validate: { enable: true } } }
2066
2080
  });
@@ -2530,11 +2544,11 @@ function workspaceApplyEditConcurrentFailureReason(phase) {
2530
2544
  }
2531
2545
 
2532
2546
  // ../lsp-core/src/lsp/workspace-edit-commit.ts
2533
- import { existsSync as existsSync4, lstatSync as lstatSync3, renameSync, rmSync, writeFileSync } from "node:fs";
2547
+ import { existsSync as existsSync5, lstatSync as lstatSync3, renameSync, rmSync, writeFileSync } from "node:fs";
2534
2548
 
2535
2549
  // ../lsp-core/src/lsp/workspace-edit-path.ts
2536
- import { existsSync as existsSync3, lstatSync as lstatSync2, readFileSync as readFileSync3, readdirSync, realpathSync as realpathSync3 } from "node:fs";
2537
- import { dirname as dirname4, isAbsolute as isAbsolute3, relative as relative3, resolve as resolve3 } from "node:path";
2550
+ import { existsSync as existsSync4, lstatSync as lstatSync2, readFileSync as readFileSync3, readdirSync, realpathSync as realpathSync3 } from "node:fs";
2551
+ import { dirname as dirname4, isAbsolute as isAbsolute4, relative as relative3, resolve as resolve3 } from "node:path";
2538
2552
  import { fileURLToPath as fileURLToPath2 } from "node:url";
2539
2553
 
2540
2554
  class WorkspaceEditPathError extends Error {
@@ -2549,11 +2563,11 @@ class WorkspaceEditPathError extends Error {
2549
2563
  }
2550
2564
  function isPathInsideWorkspace(filePath, workspaceRoot) {
2551
2565
  const relativePath = relative3(workspaceRoot, filePath);
2552
- return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute3(relativePath);
2566
+ return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute4(relativePath);
2553
2567
  }
2554
2568
  function canonicalizeMissingPath(filePath) {
2555
2569
  let ancestor = filePath;
2556
- while (!existsSync3(ancestor)) {
2570
+ while (!existsSync4(ancestor)) {
2557
2571
  const parent = dirname4(ancestor);
2558
2572
  if (parent === ancestor)
2559
2573
  throw new WorkspaceEditPathError(filePath, "no existing ancestor");
@@ -2571,7 +2585,7 @@ function canonicalWorkspaceRoot(workspaceRoot) {
2571
2585
  success: true,
2572
2586
  path: canonical,
2573
2587
  requestedPath: resolve3(workspaceRoot),
2574
- followedSymbolicLink: existsSync3(resolve3(workspaceRoot)) && lstatSync2(resolve3(workspaceRoot)).isSymbolicLink()
2588
+ followedSymbolicLink: existsSync4(resolve3(workspaceRoot)) && lstatSync2(resolve3(workspaceRoot)).isSymbolicLink()
2575
2589
  };
2576
2590
  } catch (error) {
2577
2591
  const detail = error instanceof Error ? error.message : String(error);
@@ -2591,7 +2605,7 @@ function uriToCanonicalWorkspacePath(uri, workspaceRoot) {
2591
2605
  return { success: false, error: `non-file URI ${uri}: ${detail}` };
2592
2606
  }
2593
2607
  try {
2594
- const canonical = existsSync3(requestedPath) ? realpathSync3(requestedPath) : canonicalizeMissingPath(requestedPath);
2608
+ const canonical = existsSync4(requestedPath) ? realpathSync3(requestedPath) : canonicalizeMissingPath(requestedPath);
2595
2609
  if (!isPathInsideWorkspace(canonical, workspaceRoot)) {
2596
2610
  return { success: false, error: `${requestedPath}: outside workspace ${workspaceRoot}` };
2597
2611
  }
@@ -2599,7 +2613,7 @@ function uriToCanonicalWorkspacePath(uri, workspaceRoot) {
2599
2613
  success: true,
2600
2614
  path: canonical,
2601
2615
  requestedPath,
2602
- followedSymbolicLink: existsSync3(requestedPath) && lstatSync2(requestedPath).isSymbolicLink()
2616
+ followedSymbolicLink: existsSync4(requestedPath) && lstatSync2(requestedPath).isSymbolicLink()
2603
2617
  };
2604
2618
  } catch (error) {
2605
2619
  const detail = error instanceof Error ? error.message : String(error);
@@ -2607,7 +2621,7 @@ function uriToCanonicalWorkspacePath(uri, workspaceRoot) {
2607
2621
  }
2608
2622
  }
2609
2623
  function snapshotPath(path2, includeChildren) {
2610
- if (!existsSync3(path2))
2624
+ if (!existsSync4(path2))
2611
2625
  return { kind: "missing" };
2612
2626
  const stats = lstatSync2(path2);
2613
2627
  if (stats.isFile())
@@ -2727,7 +2741,7 @@ function commitOperation(context, operation) {
2727
2741
  }
2728
2742
  if (operation.kind === "rename") {
2729
2743
  if (operation.replaceDestination) {
2730
- const targetKind = existsSync4(operation.newPath) && lstatSync3(operation.newPath).isDirectory() ? "directory" : "file";
2744
+ const targetKind = existsSync5(operation.newPath) && lstatSync3(operation.newPath).isDirectory() ? "directory" : "file";
2731
2745
  io.remove(operation.newPath, targetKind === "directory");
2732
2746
  accumulator.mutations.push({ kind: "delete", path: operation.newPath, targetKind });
2733
2747
  addModifiedPath(accumulator.filesModified, reportedPath(plan, operation.newPath));
@@ -3337,7 +3351,7 @@ function simulateDelete(operation, virtual) {
3337
3351
  }
3338
3352
 
3339
3353
  // ../lsp-core/src/lsp/workspace-edit-snapshot.ts
3340
- import { existsSync as existsSync5, lstatSync as lstatSync4, readdirSync as readdirSync2 } from "node:fs";
3354
+ import { existsSync as existsSync6, lstatSync as lstatSync4, readdirSync as readdirSync2 } from "node:fs";
3341
3355
  import { dirname as dirname6, resolve as resolve5 } from "node:path";
3342
3356
  class WorkspaceSnapshotBuilder {
3343
3357
  workspaceRoot;
@@ -3375,7 +3389,7 @@ class WorkspaceSnapshotBuilder {
3375
3389
  break;
3376
3390
  candidate = dirname6(candidate);
3377
3391
  }
3378
- if (!includeChildren || !existsSync5(path2) || !lstatSync4(path2).isDirectory())
3392
+ if (!includeChildren || !existsSync6(path2) || !lstatSync4(path2).isDirectory())
3379
3393
  return;
3380
3394
  for (const child of readdirSync2(path2))
3381
3395
  this.add(resolve5(path2, child), true);
@@ -4144,14 +4158,14 @@ async function disposeDefaultLspManager() {
4144
4158
  }
4145
4159
 
4146
4160
  // ../lsp-core/src/lsp/server-install-state.ts
4147
- import { existsSync as existsSync6, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
4161
+ import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
4148
4162
  import { dirname as dirname7 } from "node:path";
4149
4163
  function getInstallDecisionsPath() {
4150
4164
  return lspRequestContext().installDecisionsPath;
4151
4165
  }
4152
4166
  function loadInstallDecisions() {
4153
4167
  const path2 = getInstallDecisionsPath();
4154
- if (!existsSync6(path2))
4168
+ if (!existsSync7(path2))
4155
4169
  return {};
4156
4170
  try {
4157
4171
  const parsed = JSON.parse(readFileSync4(path2, "utf8"));
@@ -4192,7 +4206,7 @@ function isRecord5(value) {
4192
4206
  }
4193
4207
 
4194
4208
  // ../lsp-core/src/lsp/config-loader.ts
4195
- import { existsSync as existsSync7, readFileSync as readFileSync5 } from "node:fs";
4209
+ import { existsSync as existsSync8, readFileSync as readFileSync5 } from "node:fs";
4196
4210
 
4197
4211
  // ../lsp-core/src/lsp/server-definitions.ts
4198
4212
  var LSP_INSTALL_HINTS = {
@@ -4349,7 +4363,7 @@ function getUserConfigPath() {
4349
4363
  return lspRequestContext().userConfigPath;
4350
4364
  }
4351
4365
  function loadJsonFile(path2) {
4352
- if (!existsSync7(path2))
4366
+ if (!existsSync8(path2))
4353
4367
  return null;
4354
4368
  try {
4355
4369
  const parsed = JSON.parse(readFileSync5(path2, "utf-8"));
@@ -4537,7 +4551,7 @@ function getDisabledServerIds() {
4537
4551
  }
4538
4552
 
4539
4553
  // ../lsp-core/src/lsp/server-installation.ts
4540
- import { existsSync as existsSync8 } from "node:fs";
4554
+ import { existsSync as existsSync9 } from "node:fs";
4541
4555
  import { delimiter as delimiter3, join as join3 } from "node:path";
4542
4556
  function isServerInstalled(command, _workingDirectory) {
4543
4557
  if (command.length === 0)
@@ -4546,7 +4560,7 @@ function isServerInstalled(command, _workingDirectory) {
4546
4560
  if (!cmd)
4547
4561
  return false;
4548
4562
  if (cmd.includes("/") || cmd.includes("\\")) {
4549
- if (existsSync8(cmd))
4563
+ if (existsSync9(cmd))
4550
4564
  return true;
4551
4565
  }
4552
4566
  const isWindows = process.platform === "win32";
@@ -4567,7 +4581,7 @@ function isServerInstalled(command, _workingDirectory) {
4567
4581
  const paths = pathEnv.split(delimiter3);
4568
4582
  for (const p of paths) {
4569
4583
  for (const suffix of exts) {
4570
- if (existsSync8(join3(p, cmd + suffix))) {
4584
+ if (existsSync9(join3(p, cmd + suffix))) {
4571
4585
  return true;
4572
4586
  }
4573
4587
  }
@@ -4672,32 +4686,86 @@ function isDirectoryPath(filePath) {
4672
4686
  }
4673
4687
  }
4674
4688
  function findWorkspaceRoot(filePath) {
4675
- const abs = resolvePathInsideContext(filePath);
4689
+ const cwd = contextCwd();
4690
+ const abs = resolveReadablePathInsideContext(filePath);
4676
4691
  let dir = abs;
4677
4692
  if (!isDirectoryPath(dir)) {
4678
4693
  dir = dirname8(dir);
4679
4694
  }
4680
- let prevDir = "";
4681
- while (dir !== prevDir) {
4682
- for (const marker of WORKSPACE_MARKERS) {
4683
- if (existsSync9(join4(dir, marker))) {
4684
- return dir;
4695
+ const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
4696
+ while (isPathInside(cwd, dir)) {
4697
+ const canonicalDir = existingDirectoryInsideContext(dir, cwd);
4698
+ if (canonicalDir !== undefined) {
4699
+ for (const marker of WORKSPACE_MARKERS) {
4700
+ if (existsSync10(join4(dir, marker))) {
4701
+ return canonicalDir;
4702
+ }
4685
4703
  }
4686
4704
  }
4687
- prevDir = dir;
4705
+ if (dir === cwd)
4706
+ break;
4688
4707
  dir = dirname8(dir);
4689
4708
  }
4690
- return dirname8(abs);
4709
+ return fallbackRoot;
4691
4710
  }
4692
- function resolvePathInsideContext(filePath) {
4711
+ function resolveReadablePathInsideContext(filePath) {
4693
4712
  const cwd = contextCwd();
4694
4713
  const abs = resolve7(cwd, filePath);
4714
+ if (isPathInside(cwd, abs))
4715
+ return abs;
4716
+ const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
4717
+ if (rebased !== undefined)
4718
+ return rebased;
4719
+ const canonical = canonicalizeExistingOrNearestAncestor(abs);
4720
+ if (isPathInside(cwd, canonical))
4721
+ return canonical;
4722
+ throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
4723
+ }
4724
+ function resolvePathInsideContext(filePath) {
4725
+ const cwd = contextCwd();
4726
+ const abs = resolveReadablePathInsideContext(filePath);
4695
4727
  const canonical = canonicalizeExistingOrNearestAncestor(abs);
4696
4728
  if (!isPathInside(cwd, canonical)) {
4697
4729
  throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
4698
4730
  }
4699
4731
  return canonical;
4700
4732
  }
4733
+ function rebaseThroughCanonicalAncestor(path2, cwd) {
4734
+ let current = path2;
4735
+ const suffix = [];
4736
+ while (true) {
4737
+ if (existsSync10(current)) {
4738
+ const canonical = realpathSync4(current);
4739
+ if (isPathInside(cwd, canonical))
4740
+ return suffix.length === 0 ? canonical : join4(canonical, ...suffix);
4741
+ }
4742
+ const parent = dirname8(current);
4743
+ if (parent === current)
4744
+ return;
4745
+ suffix.unshift(basename3(current));
4746
+ current = parent;
4747
+ }
4748
+ }
4749
+ function existingDirectoryInsideContext(directory, cwd) {
4750
+ if (!existsSync10(directory))
4751
+ return;
4752
+ const canonical = realpathSync4(directory);
4753
+ if (!statSync4(canonical).isDirectory())
4754
+ return;
4755
+ return isPathInside(cwd, canonical) ? canonical : undefined;
4756
+ }
4757
+ function nearestExistingDirectoryInsideContext(directory, cwd) {
4758
+ let current = directory;
4759
+ while (isPathInside(cwd, current)) {
4760
+ const canonical = existingDirectoryInsideContext(current, cwd);
4761
+ if (canonical !== undefined)
4762
+ return canonical;
4763
+ if (current === cwd)
4764
+ return;
4765
+ current = dirname8(current);
4766
+ }
4767
+ return;
4768
+ }
4701
4769
  function formatServerLookupError(result) {
4702
4770
  if (result.status === "not_installed") {
4703
4771
  return formatNotInstalled(result);
@@ -4768,7 +4836,7 @@ function formatNotInstalled(result) {
4768
4836
  ].join(`
4769
4837
  `);
4770
4838
  }
4771
- var READ_ONLY_RETRY_TOOLS = new Set([
4839
+ var READ_ONLY_TOOLS = new Set([
4772
4840
  "diagnostics",
4773
4841
  "definition",
4774
4842
  "references",
@@ -4777,7 +4845,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
4777
4845
  "prepareRename"
4778
4846
  ]);
4779
4847
  async function withLspClient(filePath, fn, toolName, options = {}) {
4780
- const absPath = resolvePathInsideContext(filePath);
4848
+ const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
4781
4849
  if (isDirectoryPath(absPath)) {
4782
4850
  throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
4783
4851
  }
@@ -4792,9 +4860,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
4792
4860
  const acquireAndCall = async (allowRetry) => {
4793
4861
  const client = await manager.getClient(root, server2, options.signal);
4794
4862
  try {
4795
- return await fn(client, root);
4863
+ return await fn(client, root, absPath);
4796
4864
  } catch (err) {
4797
- if (allowRetry && READ_ONLY_RETRY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
4865
+ if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
4798
4866
  manager.invalidateClient(root, server2.id, client);
4799
4867
  return acquireAndCall(false);
4800
4868
  }
@@ -4812,7 +4880,7 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
4812
4880
  }
4813
4881
 
4814
4882
  // ../lsp-core/src/lsp/directory-diagnostics.ts
4815
- import { existsSync as existsSync10, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
4883
+ import { existsSync as existsSync11, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
4816
4884
  import { join as join5, resolve as resolve8 } from "node:path";
4817
4885
 
4818
4886
  // ../lsp-core/src/lsp/formatters.ts
@@ -4969,7 +5037,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
4969
5037
  throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
4970
5038
  }
4971
5039
  const absDir = resolve8(options.workspaceRoot ?? contextCwd(), directory);
4972
- if (!existsSync10(absDir)) {
5040
+ if (!existsSync11(absDir)) {
4973
5041
  throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
4974
5042
  }
4975
5043
  const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
@@ -5249,7 +5317,7 @@ async function executeLspDiagnostics(params, signal) {
5249
5317
  const filePath = requireString(params, "filePath");
5250
5318
  const severity = severityFilter(params);
5251
5319
  try {
5252
- const absPath = resolvePathInsideContext(filePath);
5320
+ const absPath = resolveReadablePathInsideContext(filePath);
5253
5321
  if (isDirectoryPath(absPath)) {
5254
5322
  const extension = inferExtensionFromDirectory(absPath);
5255
5323
  if (!extension) {
@@ -5278,7 +5346,7 @@ async function executeLspDiagnostics(params, signal) {
5278
5346
  };
5279
5347
  return text(output2.output, details2);
5280
5348
  }
5281
- const result = await withLspClient(filePath, async (client) => client.diagnostics(filePath, signal), "diagnostics", clientOptions(signal));
5349
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
5282
5350
  if (result.transientError) {
5283
5351
  const message = result.transientError.message;
5284
5352
  const details2 = {
@@ -5353,7 +5421,7 @@ async function executeLspGotoDefinition(params, signal) {
5353
5421
  const line = requireNumber(params, "line");
5354
5422
  const character = requireNumber(params, "character");
5355
5423
  try {
5356
- const result = await withLspClient(filePath, async (client) => client.definition(filePath, line, character, signal), "definition", clientOptions(signal));
5424
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
5357
5425
  const locations = !result ? [] : Array.isArray(result) ? result : [result];
5358
5426
  const details = { filePath, line, character, locations };
5359
5427
  if (locations.length === 0)
@@ -5378,7 +5446,7 @@ async function executeLspFindReferences(params, signal) {
5378
5446
  const character = requireNumber(params, "character");
5379
5447
  const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
5380
5448
  try {
5381
- const result = await withLspClient(filePath, async (client) => client.references(filePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
5449
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
5382
5450
  const references = Array.isArray(result) ? result : [];
5383
5451
  const total = references.length;
5384
5452
  const truncated = total > DEFAULT_MAX_REFERENCES;
@@ -5420,7 +5488,7 @@ async function executeLspPrepareRename(params, signal) {
5420
5488
  const line = requireNumber(params, "line");
5421
5489
  const character = requireNumber(params, "character");
5422
5490
  try {
5423
- const result = await withLspClient(filePath, async (client) => client.prepareRename(filePath, line, character, signal), "prepareRename", clientOptions(signal));
5491
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
5424
5492
  const details = { filePath, line, character, result };
5425
5493
  return text(formatPrepareRenameResult(result), details);
5426
5494
  } catch (error) {
@@ -5441,7 +5509,7 @@ async function executeLspRename(params, signal) {
5441
5509
  const character = requireNumber(params, "character");
5442
5510
  const newName = requireString(params, "newName");
5443
5511
  try {
5444
- const result = await withLspClient(filePath, async (client) => client.rename(filePath, line, character, newName, signal), "rename", clientOptions(signal));
5512
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
5445
5513
  const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
5446
5514
  return text(formatApplyResult(result.apply), details, !result.apply.success);
5447
5515
  } catch (error) {
@@ -5521,7 +5589,7 @@ async function executeLspSymbols(params, signal) {
5521
5589
  const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
5522
5590
  return formatSymbolsResult(filePath, scope, symbols2, limit, query);
5523
5591
  }
5524
- const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(filePath, signal), "documentSymbols", clientOptions(signal));
5592
+ const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
5525
5593
  return formatSymbolsResult(filePath, scope, symbols, limit);
5526
5594
  } catch (error) {
5527
5595
  const query = optionalString(params, "query");
@@ -6014,7 +6082,7 @@ function isRetryableTool(name) {
6014
6082
 
6015
6083
  // src/client.ts
6016
6084
  import { statSync as statSync5 } from "node:fs";
6017
- import { isAbsolute as isAbsolute4 } from "node:path";
6085
+ import { isAbsolute as isAbsolute5 } from "node:path";
6018
6086
  var OMO_LSP_DAEMON_DIR2 = "OMO_LSP_DAEMON_DIR";
6019
6087
  var OMO_LSP_DAEMON_CLI2 = "OMO_LSP_DAEMON_CLI";
6020
6088
  var OMO_LSP_DAEMON_VERSION2 = "OMO_LSP_DAEMON_VERSION";
@@ -6044,12 +6112,12 @@ function resolveDaemonRuntime2(env, defaults) {
6044
6112
  throw new InvalidRuntimeOverrideError2("paired_values_required", `${OMO_LSP_DAEMON_CLI2} and ${OMO_LSP_DAEMON_VERSION2} must be set together`);
6045
6113
  }
6046
6114
  if (!hasCliOverride || !hasVersionOverride) {
6047
- if (!isAbsolute4(defaults.cliPath)) {
6115
+ if (!isAbsolute5(defaults.cliPath)) {
6048
6116
  throw new InvalidRuntimeOverrideError2("packaged_cli_must_be_absolute", "Packaged LSP daemon CLI path must be absolute");
6049
6117
  }
6050
6118
  return { cliPath: defaults.cliPath, version: validateDaemonVersion2(defaults.version) };
6051
6119
  }
6052
- if (!isAbsolute4(cliOverride)) {
6120
+ if (!isAbsolute5(cliOverride)) {
6053
6121
  throw new InvalidRuntimeOverrideError2("cli_must_be_absolute", `${OMO_LSP_DAEMON_CLI2} must be an absolute path to an existing regular file`);
6054
6122
  }
6055
6123
  const stat = statSync5(cliOverride, { throwIfNoEntry: false });
@@ -20,5 +20,6 @@ export declare function ensureDaemonRunning(paths: DaemonPaths, deps?: EnsureDae
20
20
  export declare function probeDaemon(paths: DaemonPaths, timeoutMs?: number, signal?: AbortSignal): Promise<boolean>;
21
21
  export declare function pingDaemon(paths: DaemonPaths, token: string, timeoutMs?: number, signal?: AbortSignal): Promise<OwnerPing | null>;
22
22
  export declare function spawnDaemonProcess(paths: DaemonPaths): void;
23
+ export declare function resolveDaemonNodeExecutable(cachedExecPath?: string, originalArgv0?: string, pathExists?: (path: string) => boolean): string;
23
24
  export declare function resolveDaemonCliPath(env?: NodeJS.ProcessEnv, defaults?: DaemonRuntimeDefaults): string;
24
25
  export declare function defaultEnsureDaemonDeps(): EnsureDaemonDeps;
@@ -1,8 +1,8 @@
1
1
  import { spawn } from "node:child_process";
2
- import { closeSync, mkdirSync, openSync } from "node:fs";
2
+ import { closeSync, existsSync, mkdirSync, openSync, writeSync } from "node:fs";
3
3
  import { Socket } from "node:net";
4
- import { dirname } from "node:path";
5
- import { execPath } from "node:process";
4
+ import { dirname, isAbsolute } from "node:path";
5
+ import { argv0, execPath } from "node:process";
6
6
  import { authEnvelope, readAuthToken } from "./ipc-protocol.js";
7
7
  import { packagedRuntimeDefaults } from "./paths.js";
8
8
  import { resolveDaemonRuntime } from "./runtime-contract.js";
@@ -85,16 +85,29 @@ export function spawnDaemonProcess(paths) {
85
85
  mkdirSync(dirname(paths.log), { recursive: true });
86
86
  const logFd = openSync(paths.log, "a");
87
87
  try {
88
- const child = spawn(execPath, [paths.cliPath, "daemon"], {
88
+ const child = spawn(resolveDaemonNodeExecutable(), [paths.cliPath, "daemon"], {
89
89
  detached: true,
90
90
  stdio: ["ignore", logFd, logFd],
91
91
  });
92
+ child.once("spawn", () => closeSync(logFd));
93
+ child.once("error", (error) => {
94
+ writeSync(logFd, `[lsp-daemon] failed to spawn daemon: ${error.message}\n`);
95
+ closeSync(logFd);
96
+ });
92
97
  child.unref();
93
98
  }
94
- finally {
99
+ catch (error) {
95
100
  closeSync(logFd);
101
+ throw error;
96
102
  }
97
103
  }
104
+ export function resolveDaemonNodeExecutable(cachedExecPath = execPath, originalArgv0 = argv0, pathExists = existsSync) {
105
+ if (pathExists(cachedExecPath))
106
+ return cachedExecPath;
107
+ if (isAbsolute(originalArgv0) && pathExists(originalArgv0))
108
+ return originalArgv0;
109
+ return "node";
110
+ }
98
111
  export function resolveDaemonCliPath(env = process.env, defaults = packagedRuntimeDefaults()) {
99
112
  return resolveDaemonRuntime(env, defaults).cliPath;
100
113
  }