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
@@ -306,8 +306,8 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
306
306
  };
307
307
  }
308
308
  // ../lsp-core/src/lsp/client-wrapper.ts
309
- import { existsSync as existsSync9, statSync as statSync3 } from "node:fs";
310
- import { dirname as dirname6, join as join4, resolve as resolve7 } from "node:path";
309
+ import { existsSync as existsSync9, realpathSync as realpathSync4, statSync as statSync3 } from "node:fs";
310
+ import { basename as basename3, dirname as dirname6, join as join4, resolve as resolve7 } from "node:path";
311
311
 
312
312
  // ../lsp-core/src/request-context.ts
313
313
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1418,7 +1418,7 @@ class LspClientConnection extends LspClientTransport {
1418
1418
  initializationOptions: this.server.initialization
1419
1419
  }, { timeoutMs: this.initializeTimeoutMs });
1420
1420
  this.setDiagnosticPullSupported(supportsDiagnosticPull(result?.capabilities));
1421
- await this.sendNotification("initialized");
1421
+ await this.sendNotification("initialized", {});
1422
1422
  await this.sendNotification("workspace/didChangeConfiguration", {
1423
1423
  settings: { json: { validate: { enable: true } } }
1424
1424
  });
@@ -4030,32 +4030,86 @@ function isDirectoryPath(filePath) {
4030
4030
  }
4031
4031
  }
4032
4032
  function findWorkspaceRoot(filePath) {
4033
- const abs = resolvePathInsideContext(filePath);
4033
+ const cwd = contextCwd();
4034
+ const abs = resolveReadablePathInsideContext(filePath);
4034
4035
  let dir = abs;
4035
4036
  if (!isDirectoryPath(dir)) {
4036
4037
  dir = dirname6(dir);
4037
4038
  }
4038
- let prevDir = "";
4039
- while (dir !== prevDir) {
4040
- for (const marker of WORKSPACE_MARKERS) {
4041
- if (existsSync9(join4(dir, marker))) {
4042
- return dir;
4039
+ const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
4040
+ while (isPathInside(cwd, dir)) {
4041
+ const canonicalDir = existingDirectoryInsideContext(dir, cwd);
4042
+ if (canonicalDir !== undefined) {
4043
+ for (const marker of WORKSPACE_MARKERS) {
4044
+ if (existsSync9(join4(dir, marker))) {
4045
+ return canonicalDir;
4046
+ }
4043
4047
  }
4044
4048
  }
4045
- prevDir = dir;
4049
+ if (dir === cwd)
4050
+ break;
4046
4051
  dir = dirname6(dir);
4047
4052
  }
4048
- return dirname6(abs);
4053
+ return fallbackRoot;
4049
4054
  }
4050
- function resolvePathInsideContext(filePath) {
4055
+ function resolveReadablePathInsideContext(filePath) {
4051
4056
  const cwd = contextCwd();
4052
4057
  const abs = resolve7(cwd, filePath);
4058
+ if (isPathInside(cwd, abs))
4059
+ return abs;
4060
+ const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
4061
+ if (rebased !== undefined)
4062
+ return rebased;
4063
+ const canonical = canonicalizeExistingOrNearestAncestor(abs);
4064
+ if (isPathInside(cwd, canonical))
4065
+ return canonical;
4066
+ throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
4067
+ }
4068
+ function resolvePathInsideContext(filePath) {
4069
+ const cwd = contextCwd();
4070
+ const abs = resolveReadablePathInsideContext(filePath);
4053
4071
  const canonical = canonicalizeExistingOrNearestAncestor(abs);
4054
4072
  if (!isPathInside(cwd, canonical)) {
4055
4073
  throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
4056
4074
  }
4057
4075
  return canonical;
4058
4076
  }
4077
+ function rebaseThroughCanonicalAncestor(path, cwd) {
4078
+ let current = path;
4079
+ const suffix = [];
4080
+ while (true) {
4081
+ if (existsSync9(current)) {
4082
+ const canonical = realpathSync4(current);
4083
+ if (isPathInside(cwd, canonical))
4084
+ return suffix.length === 0 ? canonical : join4(canonical, ...suffix);
4085
+ }
4086
+ const parent = dirname6(current);
4087
+ if (parent === current)
4088
+ return;
4089
+ suffix.unshift(basename3(current));
4090
+ current = parent;
4091
+ }
4092
+ }
4093
+ function existingDirectoryInsideContext(directory, cwd) {
4094
+ if (!existsSync9(directory))
4095
+ return;
4096
+ const canonical = realpathSync4(directory);
4097
+ if (!statSync3(canonical).isDirectory())
4098
+ return;
4099
+ return isPathInside(cwd, canonical) ? canonical : undefined;
4100
+ }
4101
+ function nearestExistingDirectoryInsideContext(directory, cwd) {
4102
+ let current = directory;
4103
+ while (isPathInside(cwd, current)) {
4104
+ const canonical = existingDirectoryInsideContext(current, cwd);
4105
+ if (canonical !== undefined)
4106
+ return canonical;
4107
+ if (current === cwd)
4108
+ return;
4109
+ current = dirname6(current);
4110
+ }
4111
+ return;
4112
+ }
4059
4113
  function formatServerLookupError(result) {
4060
4114
  if (result.status === "not_installed") {
4061
4115
  return formatNotInstalled(result);
@@ -4126,7 +4180,7 @@ function formatNotInstalled(result) {
4126
4180
  ].join(`
4127
4181
  `);
4128
4182
  }
4129
- var READ_ONLY_RETRY_TOOLS = new Set([
4183
+ var READ_ONLY_TOOLS = new Set([
4130
4184
  "diagnostics",
4131
4185
  "definition",
4132
4186
  "references",
@@ -4135,7 +4189,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
4135
4189
  "prepareRename"
4136
4190
  ]);
4137
4191
  async function withLspClient(filePath, fn, toolName, options = {}) {
4138
- const absPath = resolvePathInsideContext(filePath);
4192
+ const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
4139
4193
  if (isDirectoryPath(absPath)) {
4140
4194
  throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
4141
4195
  }
@@ -4150,9 +4204,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
4150
4204
  const acquireAndCall = async (allowRetry) => {
4151
4205
  const client = await manager.getClient(root, server2, options.signal);
4152
4206
  try {
4153
- return await fn(client, root);
4207
+ return await fn(client, root, absPath);
4154
4208
  } catch (err) {
4155
- if (allowRetry && READ_ONLY_RETRY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
4209
+ if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
4156
4210
  manager.invalidateClient(root, server2.id, client);
4157
4211
  return acquireAndCall(false);
4158
4212
  }
@@ -4607,7 +4661,7 @@ async function executeLspDiagnostics(params, signal) {
4607
4661
  const filePath = requireString(params, "filePath");
4608
4662
  const severity = severityFilter(params);
4609
4663
  try {
4610
- const absPath = resolvePathInsideContext(filePath);
4664
+ const absPath = resolveReadablePathInsideContext(filePath);
4611
4665
  if (isDirectoryPath(absPath)) {
4612
4666
  const extension = inferExtensionFromDirectory(absPath);
4613
4667
  if (!extension) {
@@ -4636,7 +4690,7 @@ async function executeLspDiagnostics(params, signal) {
4636
4690
  };
4637
4691
  return text(output2.output, details2);
4638
4692
  }
4639
- const result = await withLspClient(filePath, async (client) => client.diagnostics(filePath, signal), "diagnostics", clientOptions(signal));
4693
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
4640
4694
  if (result.transientError) {
4641
4695
  const message = result.transientError.message;
4642
4696
  const details2 = {
@@ -4711,7 +4765,7 @@ async function executeLspGotoDefinition(params, signal) {
4711
4765
  const line = requireNumber(params, "line");
4712
4766
  const character = requireNumber(params, "character");
4713
4767
  try {
4714
- const result = await withLspClient(filePath, async (client) => client.definition(filePath, line, character, signal), "definition", clientOptions(signal));
4768
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
4715
4769
  const locations = !result ? [] : Array.isArray(result) ? result : [result];
4716
4770
  const details = { filePath, line, character, locations };
4717
4771
  if (locations.length === 0)
@@ -4736,7 +4790,7 @@ async function executeLspFindReferences(params, signal) {
4736
4790
  const character = requireNumber(params, "character");
4737
4791
  const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
4738
4792
  try {
4739
- const result = await withLspClient(filePath, async (client) => client.references(filePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
4793
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
4740
4794
  const references = Array.isArray(result) ? result : [];
4741
4795
  const total = references.length;
4742
4796
  const truncated = total > DEFAULT_MAX_REFERENCES;
@@ -4778,7 +4832,7 @@ async function executeLspPrepareRename(params, signal) {
4778
4832
  const line = requireNumber(params, "line");
4779
4833
  const character = requireNumber(params, "character");
4780
4834
  try {
4781
- const result = await withLspClient(filePath, async (client) => client.prepareRename(filePath, line, character, signal), "prepareRename", clientOptions(signal));
4835
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
4782
4836
  const details = { filePath, line, character, result };
4783
4837
  return text(formatPrepareRenameResult(result), details);
4784
4838
  } catch (error) {
@@ -4799,7 +4853,7 @@ async function executeLspRename(params, signal) {
4799
4853
  const character = requireNumber(params, "character");
4800
4854
  const newName = requireString(params, "newName");
4801
4855
  try {
4802
- const result = await withLspClient(filePath, async (client) => client.rename(filePath, line, character, newName, signal), "rename", clientOptions(signal));
4856
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
4803
4857
  const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
4804
4858
  return text(formatApplyResult(result.apply), details, !result.apply.success);
4805
4859
  } catch (error) {
@@ -4879,7 +4933,7 @@ async function executeLspSymbols(params, signal) {
4879
4933
  const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
4880
4934
  return formatSymbolsResult(filePath, scope, symbols2, limit, query);
4881
4935
  }
4882
- const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(filePath, signal), "documentSymbols", clientOptions(signal));
4936
+ const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
4883
4937
  return formatSymbolsResult(filePath, scope, symbols, limit);
4884
4938
  } catch (error) {
4885
4939
  const query = optionalString(params, "query");
@@ -1,6 +1,6 @@
1
1
  // ../lsp-core/src/lsp/client-wrapper.ts
2
- import { existsSync as existsSync9, statSync as statSync3 } from "node:fs";
3
- import { dirname as dirname6, join as join4, resolve as resolve7 } from "node:path";
2
+ import { existsSync as existsSync9, realpathSync as realpathSync4, statSync as statSync3 } from "node:fs";
3
+ import { basename as basename3, dirname as dirname6, join as join4, resolve as resolve7 } from "node:path";
4
4
 
5
5
  // ../lsp-core/src/request-context.ts
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1111,7 +1111,7 @@ class LspClientConnection extends LspClientTransport {
1111
1111
  initializationOptions: this.server.initialization
1112
1112
  }, { timeoutMs: this.initializeTimeoutMs });
1113
1113
  this.setDiagnosticPullSupported(supportsDiagnosticPull(result?.capabilities));
1114
- await this.sendNotification("initialized");
1114
+ await this.sendNotification("initialized", {});
1115
1115
  await this.sendNotification("workspace/didChangeConfiguration", {
1116
1116
  settings: { json: { validate: { enable: true } } }
1117
1117
  });
@@ -3723,32 +3723,86 @@ function isDirectoryPath(filePath) {
3723
3723
  }
3724
3724
  }
3725
3725
  function findWorkspaceRoot(filePath) {
3726
- const abs = resolvePathInsideContext(filePath);
3726
+ const cwd = contextCwd();
3727
+ const abs = resolveReadablePathInsideContext(filePath);
3727
3728
  let dir = abs;
3728
3729
  if (!isDirectoryPath(dir)) {
3729
3730
  dir = dirname6(dir);
3730
3731
  }
3731
- let prevDir = "";
3732
- while (dir !== prevDir) {
3733
- for (const marker of WORKSPACE_MARKERS) {
3734
- if (existsSync9(join4(dir, marker))) {
3735
- return dir;
3732
+ const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
3733
+ while (isPathInside(cwd, dir)) {
3734
+ const canonicalDir = existingDirectoryInsideContext(dir, cwd);
3735
+ if (canonicalDir !== undefined) {
3736
+ for (const marker of WORKSPACE_MARKERS) {
3737
+ if (existsSync9(join4(dir, marker))) {
3738
+ return canonicalDir;
3739
+ }
3736
3740
  }
3737
3741
  }
3738
- prevDir = dir;
3742
+ if (dir === cwd)
3743
+ break;
3739
3744
  dir = dirname6(dir);
3740
3745
  }
3741
- return dirname6(abs);
3746
+ return fallbackRoot;
3742
3747
  }
3743
- function resolvePathInsideContext(filePath) {
3748
+ function resolveReadablePathInsideContext(filePath) {
3744
3749
  const cwd = contextCwd();
3745
3750
  const abs = resolve7(cwd, filePath);
3751
+ if (isPathInside(cwd, abs))
3752
+ return abs;
3753
+ const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
3754
+ if (rebased !== undefined)
3755
+ return rebased;
3756
+ const canonical = canonicalizeExistingOrNearestAncestor(abs);
3757
+ if (isPathInside(cwd, canonical))
3758
+ return canonical;
3759
+ throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
3760
+ }
3761
+ function resolvePathInsideContext(filePath) {
3762
+ const cwd = contextCwd();
3763
+ const abs = resolveReadablePathInsideContext(filePath);
3746
3764
  const canonical = canonicalizeExistingOrNearestAncestor(abs);
3747
3765
  if (!isPathInside(cwd, canonical)) {
3748
3766
  throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
3749
3767
  }
3750
3768
  return canonical;
3751
3769
  }
3770
+ function rebaseThroughCanonicalAncestor(path, cwd) {
3771
+ let current = path;
3772
+ const suffix = [];
3773
+ while (true) {
3774
+ if (existsSync9(current)) {
3775
+ const canonical = realpathSync4(current);
3776
+ if (isPathInside(cwd, canonical))
3777
+ return suffix.length === 0 ? canonical : join4(canonical, ...suffix);
3778
+ }
3779
+ const parent = dirname6(current);
3780
+ if (parent === current)
3781
+ return;
3782
+ suffix.unshift(basename3(current));
3783
+ current = parent;
3784
+ }
3785
+ }
3786
+ function existingDirectoryInsideContext(directory, cwd) {
3787
+ if (!existsSync9(directory))
3788
+ return;
3789
+ const canonical = realpathSync4(directory);
3790
+ if (!statSync3(canonical).isDirectory())
3791
+ return;
3792
+ return isPathInside(cwd, canonical) ? canonical : undefined;
3793
+ }
3794
+ function nearestExistingDirectoryInsideContext(directory, cwd) {
3795
+ let current = directory;
3796
+ while (isPathInside(cwd, current)) {
3797
+ const canonical = existingDirectoryInsideContext(current, cwd);
3798
+ if (canonical !== undefined)
3799
+ return canonical;
3800
+ if (current === cwd)
3801
+ return;
3802
+ current = dirname6(current);
3803
+ }
3804
+ return;
3805
+ }
3752
3806
  function formatServerLookupError(result) {
3753
3807
  if (result.status === "not_installed") {
3754
3808
  return formatNotInstalled(result);
@@ -3819,7 +3873,7 @@ function formatNotInstalled(result) {
3819
3873
  ].join(`
3820
3874
  `);
3821
3875
  }
3822
- var READ_ONLY_RETRY_TOOLS = new Set([
3876
+ var READ_ONLY_TOOLS = new Set([
3823
3877
  "diagnostics",
3824
3878
  "definition",
3825
3879
  "references",
@@ -3828,7 +3882,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
3828
3882
  "prepareRename"
3829
3883
  ]);
3830
3884
  async function withLspClient(filePath, fn, toolName, options = {}) {
3831
- const absPath = resolvePathInsideContext(filePath);
3885
+ const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
3832
3886
  if (isDirectoryPath(absPath)) {
3833
3887
  throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
3834
3888
  }
@@ -3843,9 +3897,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
3843
3897
  const acquireAndCall = async (allowRetry) => {
3844
3898
  const client = await manager.getClient(root, server, options.signal);
3845
3899
  try {
3846
- return await fn(client, root);
3900
+ return await fn(client, root, absPath);
3847
3901
  } catch (err) {
3848
- if (allowRetry && READ_ONLY_RETRY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
3902
+ if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
3849
3903
  manager.invalidateClient(root, server.id, client);
3850
3904
  return acquireAndCall(false);
3851
3905
  }
@@ -4300,7 +4354,7 @@ async function executeLspDiagnostics(params, signal) {
4300
4354
  const filePath = requireString(params, "filePath");
4301
4355
  const severity = severityFilter(params);
4302
4356
  try {
4303
- const absPath = resolvePathInsideContext(filePath);
4357
+ const absPath = resolveReadablePathInsideContext(filePath);
4304
4358
  if (isDirectoryPath(absPath)) {
4305
4359
  const extension = inferExtensionFromDirectory(absPath);
4306
4360
  if (!extension) {
@@ -4329,7 +4383,7 @@ async function executeLspDiagnostics(params, signal) {
4329
4383
  };
4330
4384
  return text(output2.output, details2);
4331
4385
  }
4332
- const result = await withLspClient(filePath, async (client) => client.diagnostics(filePath, signal), "diagnostics", clientOptions(signal));
4386
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
4333
4387
  if (result.transientError) {
4334
4388
  const message = result.transientError.message;
4335
4389
  const details2 = {
@@ -4404,7 +4458,7 @@ async function executeLspGotoDefinition(params, signal) {
4404
4458
  const line = requireNumber(params, "line");
4405
4459
  const character = requireNumber(params, "character");
4406
4460
  try {
4407
- const result = await withLspClient(filePath, async (client) => client.definition(filePath, line, character, signal), "definition", clientOptions(signal));
4461
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
4408
4462
  const locations = !result ? [] : Array.isArray(result) ? result : [result];
4409
4463
  const details = { filePath, line, character, locations };
4410
4464
  if (locations.length === 0)
@@ -4429,7 +4483,7 @@ async function executeLspFindReferences(params, signal) {
4429
4483
  const character = requireNumber(params, "character");
4430
4484
  const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
4431
4485
  try {
4432
- const result = await withLspClient(filePath, async (client) => client.references(filePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
4486
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
4433
4487
  const references = Array.isArray(result) ? result : [];
4434
4488
  const total = references.length;
4435
4489
  const truncated = total > DEFAULT_MAX_REFERENCES;
@@ -4471,7 +4525,7 @@ async function executeLspPrepareRename(params, signal) {
4471
4525
  const line = requireNumber(params, "line");
4472
4526
  const character = requireNumber(params, "character");
4473
4527
  try {
4474
- const result = await withLspClient(filePath, async (client) => client.prepareRename(filePath, line, character, signal), "prepareRename", clientOptions(signal));
4528
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
4475
4529
  const details = { filePath, line, character, result };
4476
4530
  return text(formatPrepareRenameResult(result), details);
4477
4531
  } catch (error) {
@@ -4492,7 +4546,7 @@ async function executeLspRename(params, signal) {
4492
4546
  const character = requireNumber(params, "character");
4493
4547
  const newName = requireString(params, "newName");
4494
4548
  try {
4495
- const result = await withLspClient(filePath, async (client) => client.rename(filePath, line, character, newName, signal), "rename", clientOptions(signal));
4549
+ const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
4496
4550
  const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
4497
4551
  return text(formatApplyResult(result.apply), details, !result.apply.success);
4498
4552
  } catch (error) {
@@ -4572,7 +4626,7 @@ async function executeLspSymbols(params, signal) {
4572
4626
  const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
4573
4627
  return formatSymbolsResult(filePath, scope, symbols2, limit, query);
4574
4628
  }
4575
- const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(filePath, signal), "documentSymbols", clientOptions(signal));
4629
+ const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
4576
4630
  return formatSymbolsResult(filePath, scope, symbols, limit);
4577
4631
  } catch (error) {
4578
4632
  const query = optionalString(params, "query");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omo",
3
- "version": "4.19.4",
3
+ "version": "5.0.0-beta.10",
4
4
  "description": "One Codex plugin namespace for Yeongyu's local Codex components.",
5
5
  "author": {
6
6
  "name": "Yeongyu Kim",