oh-my-opencode 5.0.0-beta.3 → 5.0.0-beta.30
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.
- package/.agents/command/publish.md +44 -16
- package/.agents/skills/publish/SKILL.md +44 -16
- package/.agents/skills/senpi-qa/SKILL.md +80 -0
- package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.mjs +65 -0
- package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.test.mjs +171 -0
- package/.agents/skills/work-with-pr/SKILL.md +37 -23
- package/.opencode/command/publish.md +44 -16
- package/.opencode/skills/work-with-pr/SKILL.md +37 -23
- package/README.ja.md +25 -21
- package/README.ko.md +25 -21
- package/README.md +38 -23
- package/README.ru.md +24 -20
- package/README.zh-cn.md +25 -21
- package/dist/agents/atlas/agent.d.ts +0 -1
- package/dist/agents/sisyphus/grok-4.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +2 -0
- package/dist/agents/sisyphus-agent-config.d.ts +6 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/config-manager/parse-opencode-config-file.d.ts +2 -1
- package/dist/cli/doctor/checks/system-plugin.d.ts +4 -3
- package/dist/cli/fallback-lane-policy.d.ts +1 -0
- package/dist/cli/index.js +22572 -20322
- package/dist/cli/install-codex/install-codex-test-fixtures.d.ts +1 -1
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli/runtime-commands.d.ts +1 -1
- package/dist/cli/worktree-sweep/classify.d.ts +16 -0
- package/dist/cli/worktree-sweep/format.d.ts +8 -0
- package/dist/cli/worktree-sweep/git.d.ts +19 -0
- package/dist/cli/worktree-sweep/index.d.ts +7 -0
- package/dist/cli/worktree-sweep/options.d.ts +2 -0
- package/dist/cli/worktree-sweep/parse-worktree-list.d.ts +8 -0
- package/dist/cli/worktree-sweep/sweep.d.ts +2 -0
- package/dist/cli/worktree-sweep/types.d.ts +65 -0
- package/dist/cli/worktree-sweep/worktree-sweep.d.ts +2 -0
- package/dist/cli-node/index.js +22190 -19917
- package/dist/config/schema/commands.d.ts +1 -1
- package/dist/config/schema/hooks.d.ts +1 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +4 -1
- package/dist/config/schema/ulw-execute.d.ts +5 -0
- package/dist/config/validate.d.ts +2 -0
- package/dist/create-hooks.d.ts +3 -1
- package/dist/features/btw-side/btw-command-draft.d.ts +7 -0
- package/dist/features/btw-side/context-injector.d.ts +15 -0
- package/dist/features/btw-side/index.d.ts +8 -0
- package/dist/features/btw-side/metadata.d.ts +15 -0
- package/dist/features/btw-side/parent-context-budget.d.ts +9 -0
- package/dist/features/btw-side/server-session-registry.d.ts +8 -0
- package/dist/features/btw-side/tui-adoption-cache.d.ts +13 -0
- package/dist/features/btw-side/tui-adoption-guard.d.ts +5 -0
- package/dist/features/btw-side/tui-controller-types.d.ts +68 -0
- package/dist/features/btw-side/tui-controller.d.ts +19 -0
- package/dist/features/btw-side/tui-escape-return.d.ts +12 -0
- package/dist/features/btw-side/tui-keymap.d.ts +17 -0
- package/dist/features/btw-side/tui-parent-validator.d.ts +6 -0
- package/dist/features/btw-side/tui-picker-options.d.ts +20 -0
- package/dist/features/btw-side/tui-picker.d.ts +9 -0
- package/dist/features/btw-side/tui-prompt-queue.d.ts +8 -0
- package/dist/features/btw-side/tui-session-bridge.d.ts +11 -0
- package/dist/features/btw-side/tui-session-catalog.d.ts +35 -0
- package/dist/features/btw-side/tui-side-removal.d.ts +11 -0
- package/dist/features/btw-side/tui-side-start.d.ts +9 -0
- package/dist/features/btw-side/tui-wiring.d.ts +8 -0
- package/dist/features/builtin-commands/templates/ulw-execute.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/opengateway-provider/index.d.ts +13 -0
- package/dist/features/team-mode/tools/messaging-fallback-wake.d.ts +15 -0
- package/dist/hooks/atlas/atlas-hook.d.ts +1 -0
- package/dist/hooks/atlas/atlas-lifecycle-store.d.ts +50 -0
- package/dist/hooks/atlas/event-handler.d.ts +1 -0
- package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
- package/dist/hooks/atlas/tool-execute-before.d.ts +3 -0
- package/dist/hooks/atlas/types.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/prometheus-md-only/agent-resolution.d.ts +2 -2
- package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +2 -0
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +1 -0
- package/dist/hooks/runtime-fallback/runtime-model-settings.d.ts +6 -0
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +1 -1
- package/dist/hooks/runtime-fallback/types.d.ts +3 -1
- package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +1 -0
- package/dist/hooks/{start-work → ulw-execute}/context-info-builder.d.ts +1 -1
- package/dist/hooks/{start-work → ulw-execute}/index.d.ts +1 -1
- package/dist/hooks/ulw-execute/ulw-execute-hook.d.ts +23 -0
- package/dist/index.js +12573 -6957
- package/dist/oh-my-opencode.schema.json +15 -2
- package/dist/plugin/chat-message/types.d.ts +3 -3
- package/dist/plugin/chat-message/ulw-execute-message.d.ts +5 -0
- package/dist/plugin/event-session-lifecycle.d.ts +1 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
- package/dist/plugin/messages-transform.d.ts +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/legacy-plugin-warning.d.ts +2 -1
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/shared/plugin-entry-migrator.d.ts +4 -3
- package/dist/shared/plugin-entry-shape.d.ts +6 -0
- package/dist/shared/runtime-fallback-retry-marker.d.ts +16 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/skills/ast-grep/AGENTS.md +51 -0
- package/dist/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/dist/skills/data-scientist/SKILL.md +99 -239
- package/dist/skills/data-scientist/references/execution-surfaces.md +91 -0
- package/dist/skills/data-scientist/references/placement.md +74 -0
- package/dist/skills/data-scientist/references/polars-lane.md +95 -0
- package/dist/skills/data-scientist/references/uv-setup.md +1 -1
- package/dist/skills/data-scientist/references/visualization.md +64 -0
- package/dist/skills/data-scientist/scripts/ensure-js-deps.sh +28 -0
- package/dist/skills/data-scientist/scripts/ensure-py-deps.sh +37 -0
- package/dist/skills/debugging/SKILL.md +2 -0
- package/dist/skills/debugging/references/methodology/00-setup.md +12 -0
- package/dist/skills/debugging/references/methodology/02-investigate.md +21 -0
- package/dist/skills/debugging/references/runtimes/go.md +15 -1
- package/dist/skills/debugging/references/runtimes/native-binary.md +38 -0
- package/dist/skills/debugging/references/runtimes/node.md +25 -0
- package/dist/skills/debugging/references/runtimes/python.md +13 -0
- package/dist/skills/debugging/references/runtimes/rust.md +41 -0
- package/dist/skills/debugging/references/scripts/dap.mjs +267 -0
- package/dist/skills/debugging/references/scripts/dap.test.ts +86 -0
- package/dist/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
- package/dist/skills/debugging/references/tools/dap.md +103 -0
- package/dist/skills/debugging/references/tools/frida.md +193 -0
- package/dist/skills/frontend/SKILL.md +11 -7
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/print-paged-media.md +76 -0
- package/dist/skills/frontend/references/design/stylegallery.md +80 -0
- package/dist/skills/frontend/references/designpowers/README.md +1 -1
- package/dist/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
- package/dist/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
- package/dist/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
- package/dist/skills/frontend/references/designpowers/orchestration.md +1 -1
- package/dist/skills/frontend/references/designpowers/routing.md +5 -5
- package/dist/skills/review-work/SKILL.md +3 -3
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/dist/skills/ultimate-browsing/SKILL.md +2 -0
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/dist/skills/{start-work → ulw-execute}/SKILL.md +9 -8
- package/dist/skills/ulw-plan/SKILL.md +6 -6
- package/dist/skills/ulw-plan/references/full-workflow.md +31 -7
- package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
- package/dist/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/dist/skills/ulw-research/SKILL.md +4 -2
- package/dist/skills/visual-qa/AGENTS.md +58 -0
- package/dist/skills/visual-qa/SKILL.md +3 -2
- package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
- package/dist/tools/delegate-task/tool-description.d.ts +3 -1
- package/dist/tools/delegate-task/types.d.ts +3 -0
- package/dist/tui.d.ts +12 -0
- package/dist/tui.js +11480 -11512
- package/package.json +42 -36
- package/packages/git-bash-mcp/dist/cli.js +5 -1
- package/packages/git-bash-mcp/package.json +1 -1
- package/packages/lsp-core/src/index.ts +1 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
- package/packages/lsp-core/src/lsp/client-wrapper-outside-cwd.test.ts +78 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +66 -13
- package/packages/lsp-core/src/lsp/client-wrapper.ts +95 -23
- package/packages/lsp-core/src/lsp/client.ts +26 -0
- package/packages/lsp-core/src/lsp/connection.ts +16 -0
- package/packages/lsp-core/src/lsp/constants.ts +1 -0
- package/packages/lsp-core/src/lsp/format-document.test.ts +143 -0
- package/packages/lsp-core/src/lsp/format-document.ts +90 -0
- package/packages/lsp-core/src/lsp/manager-max-clients.test.ts +151 -0
- package/packages/lsp-core/src/lsp/manager.ts +34 -1
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
- package/packages/lsp-core/src/lsp/server-definitions.ts +29 -0
- package/packages/lsp-core/src/lsp/server-installation.test.ts +376 -0
- package/packages/lsp-core/src/lsp/server-installation.ts +200 -27
- package/packages/lsp-core/src/lsp/server-resolution-local-binary.test.ts +170 -0
- package/packages/lsp-core/src/lsp/server-resolution.ts +18 -5
- package/packages/lsp-core/src/lsp/transport.ts +9 -0
- package/packages/lsp-core/src/lsp/types.ts +8 -0
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/lsp/workspace-markers.ts +1 -0
- package/packages/lsp-core/src/request-context.test.ts +29 -0
- package/packages/lsp-core/src/request-context.ts +1 -1
- package/packages/lsp-core/src/tool-surface.test.ts +13 -1
- package/packages/lsp-core/src/tools/definitions.ts +14 -0
- package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
- package/packages/lsp-core/src/tools/format.test.ts +56 -0
- package/packages/lsp-core/src/tools/format.ts +56 -0
- package/packages/lsp-core/src/tools/index.ts +1 -0
- package/packages/lsp-core/src/tools/navigation.ts +4 -2
- package/packages/lsp-core/src/tools/rename.ts +4 -2
- package/packages/lsp-core/src/tools/symbols.ts +1 -1
- package/packages/lsp-core/src/tools/types.ts +10 -0
- package/packages/lsp-daemon/dist/cli.js +645 -296
- package/packages/lsp-daemon/dist/client.d.ts +10 -0
- package/packages/lsp-daemon/dist/client.js +605 -253
- package/packages/lsp-daemon/dist/daemon-client.d.ts +1 -0
- package/packages/lsp-daemon/dist/daemon-client.js +3 -0
- package/packages/lsp-daemon/dist/ensure-daemon.js +1 -0
- package/packages/lsp-daemon/dist/index.js +609 -262
- package/packages/lsp-daemon/dist/version-reap.js +1 -1
- package/packages/lsp-daemon/package.json +1 -1
- package/packages/lsp-tools-mcp/dist/cli.js +564 -217
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +115 -92
- package/packages/lsp-tools-mcp/dist/mcp.js +566 -219
- package/packages/lsp-tools-mcp/dist/request-context.js +12 -13
- package/packages/lsp-tools-mcp/dist/tools.js +571 -227
- package/packages/omo-codex/THIRD-PARTY-NOTICES.md +4 -4
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +4 -4
- package/packages/omo-codex/plugin/AGENTS.md +47 -0
- package/packages/omo-codex/plugin/README.md +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +34 -33
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +293 -116
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +245 -84
- package/packages/omo-codex/plugin/components/codegraph/package.json +4 -4
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-hook-runtime.ts +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/AGENTS.md +9 -0
- package/packages/omo-codex/plugin/components/comment-checker/biome.json +2 -2
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +2 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +5 -5
- package/packages/omo-codex/plugin/components/comment-checker/src/apply-patch.ts +2 -8
- package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +1 -2
- package/packages/omo-codex/plugin/components/comment-checker/src/request-extractor.ts +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/src/runner.ts +1 -0
- package/packages/omo-codex/plugin/components/git-bash/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +3 -4
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +2 -2
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +5 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +4 -21
- package/packages/omo-codex/plugin/components/lsp/AGENTS.md +30 -15
- package/packages/omo-codex/plugin/components/lsp/biome.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +4 -4
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +596 -267
- package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +1 -1
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +5 -5
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +1 -5
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +6 -7
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +1 -2
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +11 -1
- package/packages/omo-codex/plugin/components/rules/AGENTS.md +12 -0
- package/packages/omo-codex/plugin/components/rules/biome.json +2 -2
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +60 -45
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +7 -7
- package/packages/omo-codex/plugin/components/rules/src/config.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +9 -5
- package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +1 -4
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +4 -9
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +17 -25
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
- package/packages/omo-codex/plugin/components/rules/test/dynamic-target-fingerprints.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +7 -4
- package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +39 -72
- package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/package-smoke.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/parser.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +5 -6
- package/packages/omo-codex/plugin/components/rules/test/rules-engine-consumption.test.ts +3 -6
- package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/sources.test.ts +2 -5
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +2 -17
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +5 -5
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
- package/packages/omo-codex/plugin/components/telemetry/AGENTS.md +8 -0
- package/packages/omo-codex/plugin/components/telemetry/biome.json +2 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +2463 -437
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +2467 -441
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +5 -5
- package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +1 -4
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +4 -14
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +1 -1
- package/packages/omo-codex/plugin/components/telemetry/test/diagnostics.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -0
- package/packages/omo-codex/plugin/components/ultrawork/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +13 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +5 -5
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +13 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +6 -6
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +31 -7
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +9 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
- package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/AGENTS.md +5 -4
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/NOTICE +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/README.md +5 -5
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/biome.json +2 -2
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/directive.md +6 -6
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/dist/cli.js +12 -12
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +28 -0
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/package.json +12 -12
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/boulder-reader.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/codex-hook.ts +3 -3
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/directive.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/index.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/boulder-reader.test.ts +3 -3
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/cli.test.ts +1 -4
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/codex-hook.test.ts +8 -22
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +13 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +11 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +24 -14
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +13 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +3 -5
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/paths.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +25 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +26 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-snapshot.test.ts +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +5 -37
- package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +8 -5
- package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
- package/packages/omo-codex/plugin/components/ulw-loop/vitest.config.ts +1 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +17 -0
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +17 -0
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/model-catalog.json +3 -3
- package/packages/omo-codex/plugin/package-lock.json +681 -395
- package/packages/omo-codex/plugin/package.json +2 -2
- package/packages/omo-codex/plugin/scripts/AGENTS.md +40 -0
- package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +1 -1
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +3 -3
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +11 -11
- package/packages/omo-codex/plugin/shared/package.json +3 -4
- package/packages/omo-codex/plugin/skills/ast-grep/AGENTS.md +51 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/omo-codex/plugin/skills/data-scientist/SKILL.md +99 -239
- package/packages/omo-codex/plugin/skills/data-scientist/references/execution-surfaces.md +91 -0
- package/packages/omo-codex/plugin/skills/data-scientist/references/placement.md +74 -0
- package/packages/omo-codex/plugin/skills/data-scientist/references/polars-lane.md +95 -0
- package/packages/omo-codex/plugin/skills/data-scientist/references/uv-setup.md +1 -1
- package/packages/omo-codex/plugin/skills/data-scientist/references/visualization.md +64 -0
- package/packages/omo-codex/plugin/skills/data-scientist/scripts/ensure-js-deps.sh +28 -0
- package/packages/omo-codex/plugin/skills/data-scientist/scripts/ensure-py-deps.sh +37 -0
- package/packages/omo-codex/plugin/skills/debugging/SKILL.md +2 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/00-setup.md +12 -0
- package/packages/omo-codex/plugin/skills/debugging/references/methodology/02-investigate.md +21 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/go.md +15 -1
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/native-binary.md +38 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/node.md +25 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/python.md +13 -0
- package/packages/omo-codex/plugin/skills/debugging/references/runtimes/rust.md +41 -0
- package/packages/omo-codex/plugin/skills/debugging/references/scripts/dap.mjs +267 -0
- package/packages/omo-codex/plugin/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
- package/packages/omo-codex/plugin/skills/debugging/references/tools/dap.md +103 -0
- package/packages/omo-codex/plugin/skills/debugging/references/tools/frida.md +193 -0
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +11 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/print-paged-media.md +76 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/orchestration.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/routing.md +5 -5
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +2 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +13 -1
- package/packages/omo-codex/plugin/skills/{start-work → ulw-execute}/SKILL.md +12 -11
- package/packages/omo-codex/plugin/skills/ulw-execute/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +6 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +31 -7
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +4 -2
- package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +58 -0
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +3 -2
- package/packages/omo-codex/plugin/test/AGENTS.md +47 -0
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +8 -28
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +2 -2
- package/packages/omo-codex/plugin/test/component-bin-names.test.mjs +2 -2
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +2 -2
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +4 -4
- package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +8 -8
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +12 -12
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
- package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
- package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
- package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
- package/packages/omo-codex/scripts/AGENTS.md +36 -0
- package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +2 -2
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2637 -549
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/shared-skills/skills/ast-grep/AGENTS.md +51 -0
- package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/shared-skills/skills/data-scientist/SKILL.md +99 -239
- package/packages/shared-skills/skills/data-scientist/references/execution-surfaces.md +91 -0
- package/packages/shared-skills/skills/data-scientist/references/placement.md +74 -0
- package/packages/shared-skills/skills/data-scientist/references/polars-lane.md +95 -0
- package/packages/shared-skills/skills/data-scientist/references/uv-setup.md +1 -1
- package/packages/shared-skills/skills/data-scientist/references/visualization.md +64 -0
- package/packages/shared-skills/skills/data-scientist/scripts/ensure-js-deps.sh +28 -0
- package/packages/shared-skills/skills/data-scientist/scripts/ensure-py-deps.sh +37 -0
- package/packages/shared-skills/skills/debugging/SKILL.md +2 -0
- package/packages/shared-skills/skills/debugging/references/methodology/00-setup.md +12 -0
- package/packages/shared-skills/skills/debugging/references/methodology/02-investigate.md +21 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/go.md +15 -1
- package/packages/shared-skills/skills/debugging/references/runtimes/native-binary.md +38 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/node.md +25 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/python.md +13 -0
- package/packages/shared-skills/skills/debugging/references/runtimes/rust.md +41 -0
- package/packages/shared-skills/skills/debugging/references/scripts/dap.mjs +267 -0
- package/packages/shared-skills/skills/debugging/references/scripts/dap.test.ts +86 -0
- package/packages/shared-skills/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
- package/packages/shared-skills/skills/debugging/references/tools/dap.md +103 -0
- package/packages/shared-skills/skills/debugging/references/tools/frida.md +193 -0
- package/packages/shared-skills/skills/frontend/SKILL.md +11 -7
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/print-paged-media.md +76 -0
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/README.md +1 -1
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
- package/packages/shared-skills/skills/frontend/references/designpowers/orchestration.md +1 -1
- package/packages/shared-skills/skills/frontend/references/designpowers/routing.md +5 -5
- package/packages/shared-skills/skills/review-work/SKILL.md +3 -3
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +2 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/shared-skills/skills/{start-work → ulw-execute}/SKILL.md +9 -8
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +6 -6
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +31 -7
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/packages/shared-skills/skills/ulw-research/SKILL.md +4 -2
- package/packages/shared-skills/skills/visual-qa/AGENTS.md +58 -0
- package/packages/shared-skills/skills/visual-qa/SKILL.md +3 -2
- package/script/qa/web-terminal-visual-qa.mjs +2 -0
- package/script/qa/xterm-live-terminal.mjs +18 -2
- package/dist/config/schema/start-work.d.ts +0 -5
- package/dist/features/builtin-commands/templates/start-work.d.ts +0 -1
- package/dist/hooks/start-work/start-work-hook.d.ts +0 -23
- package/dist/plugin/chat-message/start-work-message.d.ts +0 -5
- package/dist/skills/data-scientist/references/common-scenarios.md +0 -176
- package/dist/skills/data-scientist/references/execution-templates.md +0 -197
- package/dist/skills/data-scientist/references/integration-patterns.md +0 -153
- package/dist/skills/data-scientist/references/performance-benchmarks.md +0 -37
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +0 -28
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +0 -17
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +0 -17
- package/packages/omo-codex/plugin/skills/data-scientist/references/common-scenarios.md +0 -176
- package/packages/omo-codex/plugin/skills/data-scientist/references/execution-templates.md +0 -197
- package/packages/omo-codex/plugin/skills/data-scientist/references/integration-patterns.md +0 -153
- package/packages/omo-codex/plugin/skills/data-scientist/references/performance-benchmarks.md +0 -37
- package/packages/omo-codex/plugin/skills/start-work/agents/openai.yaml +0 -2
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
- package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
- package/packages/shared-skills/skills/data-scientist/references/common-scenarios.md +0 -176
- package/packages/shared-skills/skills/data-scientist/references/execution-templates.md +0 -197
- package/packages/shared-skills/skills/data-scientist/references/integration-patterns.md +0 -153
- package/packages/shared-skills/skills/data-scientist/references/performance-benchmarks.md +0 -37
- /package/dist/hooks/{start-work → ulw-execute}/context-info-formatters.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/explicit-plan-context.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/notepad-scaffold.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/parse-user-request.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/plan-discovery-context.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/plan-selection.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/session-plan-affinity.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/work-initializer.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/worktree-block.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/worktree-detector.d.ts +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/.gitattributes +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/CHANGELOG.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/LICENSE +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/plan-checklist.ts +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/types.ts +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-completed.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-mixed-platforms.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-single-codex-work.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-all-done.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-scaffold.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-with-nested-checkboxes.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-with-unchecked.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/tsconfig.build.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/tsconfig.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/vitest.config.ts +0 -0
|
@@ -271,7 +271,11 @@ function createParentWatchdog(config, onDeadParent) {
|
|
|
271
271
|
const probeAlive = config.probeAlive ?? isProcessAlive;
|
|
272
272
|
let fired = false;
|
|
273
273
|
const timer = setInterval(() => {
|
|
274
|
-
if (fired
|
|
274
|
+
if (fired)
|
|
275
|
+
return;
|
|
276
|
+
const alive = probeAlive(parentPid);
|
|
277
|
+
config.onPoll?.(alive);
|
|
278
|
+
if (alive)
|
|
275
279
|
return;
|
|
276
280
|
fired = true;
|
|
277
281
|
onDeadParent(parentPid, pollIntervalMs);
|
|
@@ -306,8 +310,8 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
|
|
|
306
310
|
};
|
|
307
311
|
}
|
|
308
312
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
309
|
-
import { existsSync as
|
|
310
|
-
import { dirname as
|
|
313
|
+
import { existsSync as existsSync10, realpathSync as realpathSync5, statSync as statSync3 } from "node:fs";
|
|
314
|
+
import { basename as basename3, dirname as dirname8, join as join5, resolve as resolve8 } from "node:path";
|
|
311
315
|
|
|
312
316
|
// ../lsp-core/src/request-context.ts
|
|
313
317
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -316,18 +320,17 @@ import { homedir } from "node:os";
|
|
|
316
320
|
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
317
321
|
|
|
318
322
|
class LspRequestContextParseError extends Error {
|
|
319
|
-
code;
|
|
320
|
-
name = "LspRequestContextParseError";
|
|
321
323
|
constructor(code, message) {
|
|
322
324
|
super(message);
|
|
323
325
|
this.code = code;
|
|
326
|
+
this.name = "LspRequestContextParseError";
|
|
324
327
|
}
|
|
325
328
|
}
|
|
326
329
|
|
|
327
330
|
class LspRequestContextUnavailableError extends Error {
|
|
328
|
-
name = "LspRequestContextUnavailableError";
|
|
329
331
|
constructor() {
|
|
330
332
|
super("LSP request context is required. Standalone MCP startup must install one with runWithRequestContext(createStandaloneMcpRequestContext()).");
|
|
333
|
+
this.name = "LspRequestContextUnavailableError";
|
|
331
334
|
}
|
|
332
335
|
}
|
|
333
336
|
var storage = new AsyncLocalStorage;
|
|
@@ -357,7 +360,7 @@ function contextEnv(key) {
|
|
|
357
360
|
}
|
|
358
361
|
function createStandaloneMcpRequestContext(input = {}) {
|
|
359
362
|
const env = input.env ?? process.env;
|
|
360
|
-
const cwd = canonicalCwd(input.cwd ?? process.cwd());
|
|
363
|
+
const cwd = canonicalCwd(input.cwd ?? env["LSP_TOOLS_MCP_CWD"] ?? process.cwd());
|
|
361
364
|
const home = input.homeDir ?? homedir();
|
|
362
365
|
const projectConfigPaths = translateProjectConfigEnv(env["LSP_TOOLS_MCP_PROJECT_CONFIG"], cwd);
|
|
363
366
|
const userConfigPath = translateHomeConfigEnv(env["LSP_TOOLS_MCP_USER_CONFIG"], home, ".codex/lsp-client.json");
|
|
@@ -500,22 +503,15 @@ function effectiveExtension(filePath) {
|
|
|
500
503
|
|
|
501
504
|
// ../lsp-core/src/lsp/errors.ts
|
|
502
505
|
class LspConnectionClosedError extends Error {
|
|
503
|
-
serverId;
|
|
504
|
-
root;
|
|
505
|
-
name = "LspConnectionClosedError";
|
|
506
506
|
constructor(serverId, root, message) {
|
|
507
507
|
super(message ?? `LSP connection closed for ${serverId} at ${root}`);
|
|
508
508
|
this.serverId = serverId;
|
|
509
509
|
this.root = root;
|
|
510
|
+
this.name = "LspConnectionClosedError";
|
|
510
511
|
}
|
|
511
512
|
}
|
|
512
513
|
|
|
513
514
|
class LspProcessExitedError extends Error {
|
|
514
|
-
serverId;
|
|
515
|
-
root;
|
|
516
|
-
exitCode;
|
|
517
|
-
stderrTail;
|
|
518
|
-
name = "LspProcessExitedError";
|
|
519
515
|
constructor(serverId, root, exitCode, stderrTail) {
|
|
520
516
|
const stderrSuffix = stderrTail ? `
|
|
521
517
|
stderr tail: ${stderrTail}` : "";
|
|
@@ -524,46 +520,49 @@ stderr tail: ${stderrTail}` : "";
|
|
|
524
520
|
this.root = root;
|
|
525
521
|
this.exitCode = exitCode;
|
|
526
522
|
this.stderrTail = stderrTail;
|
|
523
|
+
this.name = "LspProcessExitedError";
|
|
527
524
|
}
|
|
528
525
|
}
|
|
529
526
|
|
|
530
527
|
class LspRequestTimeoutError extends Error {
|
|
531
|
-
method;
|
|
532
|
-
stderrTail;
|
|
533
|
-
name = "LspRequestTimeoutError";
|
|
534
528
|
constructor(method, stderrTail) {
|
|
535
529
|
const stderrSuffix = stderrTail ? `
|
|
536
530
|
recent stderr: ${stderrTail}` : "";
|
|
537
531
|
super(`LSP request timeout (method: ${method})${stderrSuffix}`);
|
|
538
532
|
this.method = method;
|
|
539
533
|
this.stderrTail = stderrTail;
|
|
534
|
+
this.name = "LspRequestTimeoutError";
|
|
540
535
|
}
|
|
541
536
|
}
|
|
542
537
|
|
|
543
538
|
class LspInvalidPathError extends Error {
|
|
544
|
-
|
|
539
|
+
constructor() {
|
|
540
|
+
super(...arguments);
|
|
541
|
+
this.name = "LspInvalidPathError";
|
|
542
|
+
}
|
|
545
543
|
}
|
|
546
544
|
|
|
547
545
|
class LspServerLookupError extends Error {
|
|
548
|
-
lookup;
|
|
549
|
-
name = "LspServerLookupError";
|
|
550
546
|
constructor(message, lookup) {
|
|
551
547
|
super(message);
|
|
552
548
|
this.lookup = lookup;
|
|
549
|
+
this.name = "LspServerLookupError";
|
|
553
550
|
}
|
|
554
551
|
}
|
|
555
552
|
|
|
556
553
|
class LspServerInitializingError extends Error {
|
|
557
|
-
originalError;
|
|
558
|
-
name = "LspServerInitializingError";
|
|
559
554
|
constructor(originalError) {
|
|
560
555
|
super(`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`);
|
|
561
556
|
this.originalError = originalError;
|
|
557
|
+
this.name = "LspServerInitializingError";
|
|
562
558
|
}
|
|
563
559
|
}
|
|
564
560
|
|
|
565
561
|
class LspProcessSpawnError extends Error {
|
|
566
|
-
|
|
562
|
+
constructor() {
|
|
563
|
+
super(...arguments);
|
|
564
|
+
this.name = "LspProcessSpawnError";
|
|
565
|
+
}
|
|
567
566
|
}
|
|
568
567
|
function isLspDeadConnectionError(err) {
|
|
569
568
|
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
@@ -594,6 +593,7 @@ var DEFAULT_MAX_DIRECTORY_FILES = 50;
|
|
|
594
593
|
var REQUEST_TIMEOUT_MS = 15000;
|
|
595
594
|
var INIT_TIMEOUT_MS = 60000;
|
|
596
595
|
var IDLE_TIMEOUT_MS = 5 * 60000;
|
|
596
|
+
var MAX_RESIDENT_CLIENTS = 6;
|
|
597
597
|
var REAPER_INTERVAL_MS = 60000;
|
|
598
598
|
var STOP_HARD_KILL_TIMEOUT_MS = 5000;
|
|
599
599
|
var STOP_SIGKILL_GRACE_MS = 1000;
|
|
@@ -608,20 +608,31 @@ var METHOD_NOT_FOUND = -32601;
|
|
|
608
608
|
var INTERNAL_ERROR = -32603;
|
|
609
609
|
|
|
610
610
|
class JsonRpcConnection {
|
|
611
|
-
reader;
|
|
612
|
-
writer;
|
|
613
|
-
pendingRequests = new Map;
|
|
614
|
-
notificationHandlers = new Map;
|
|
615
|
-
requestHandlers = new Map;
|
|
616
|
-
closeHandlers = [];
|
|
617
|
-
errorHandlers = [];
|
|
618
|
-
inputBuffer = Buffer.alloc(0);
|
|
619
|
-
nextRequestId = 1;
|
|
620
|
-
listening = false;
|
|
621
|
-
disposed = false;
|
|
622
611
|
constructor(reader, writer) {
|
|
623
612
|
this.reader = reader;
|
|
624
613
|
this.writer = writer;
|
|
614
|
+
this.pendingRequests = new Map;
|
|
615
|
+
this.notificationHandlers = new Map;
|
|
616
|
+
this.requestHandlers = new Map;
|
|
617
|
+
this.closeHandlers = [];
|
|
618
|
+
this.errorHandlers = [];
|
|
619
|
+
this.inputBuffer = Buffer.alloc(0);
|
|
620
|
+
this.nextRequestId = 1;
|
|
621
|
+
this.listening = false;
|
|
622
|
+
this.disposed = false;
|
|
623
|
+
this.handleData = (chunk) => {
|
|
624
|
+
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
625
|
+
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
626
|
+
this.drainInputBuffer();
|
|
627
|
+
};
|
|
628
|
+
this.handleClose = () => {
|
|
629
|
+
for (const handler of this.closeHandlers) {
|
|
630
|
+
handler();
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
this.handleStreamError = (error) => {
|
|
634
|
+
this.emitError(error);
|
|
635
|
+
};
|
|
625
636
|
}
|
|
626
637
|
listen() {
|
|
627
638
|
if (this.listening)
|
|
@@ -742,19 +753,6 @@ class JsonRpcConnection {
|
|
|
742
753
|
this.notificationHandlers.clear();
|
|
743
754
|
this.requestHandlers.clear();
|
|
744
755
|
}
|
|
745
|
-
handleData = (chunk) => {
|
|
746
|
-
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
747
|
-
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
748
|
-
this.drainInputBuffer();
|
|
749
|
-
};
|
|
750
|
-
handleClose = () => {
|
|
751
|
-
for (const handler of this.closeHandlers) {
|
|
752
|
-
handler();
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
handleStreamError = (error) => {
|
|
756
|
-
this.emitError(error);
|
|
757
|
-
};
|
|
758
756
|
drainInputBuffer() {
|
|
759
757
|
while (true) {
|
|
760
758
|
const headerEnd = this.inputBuffer.indexOf(HEADER_SEPARATOR2);
|
|
@@ -1102,31 +1100,26 @@ function isPosition(value) {
|
|
|
1102
1100
|
|
|
1103
1101
|
// ../lsp-core/src/lsp/transport.ts
|
|
1104
1102
|
class LspClientNotStartedError extends Error {
|
|
1105
|
-
serverId;
|
|
1106
|
-
root;
|
|
1107
|
-
name = "LspClientNotStartedError";
|
|
1108
1103
|
constructor(serverId, root) {
|
|
1109
1104
|
super("LSP client not started");
|
|
1110
1105
|
this.serverId = serverId;
|
|
1111
1106
|
this.root = root;
|
|
1107
|
+
this.name = "LspClientNotStartedError";
|
|
1112
1108
|
}
|
|
1113
1109
|
}
|
|
1114
1110
|
|
|
1115
1111
|
class LspClientTransport {
|
|
1116
|
-
root;
|
|
1117
|
-
server;
|
|
1118
|
-
proc = null;
|
|
1119
|
-
connection = null;
|
|
1120
|
-
stderrBuffer = [];
|
|
1121
|
-
processExited = false;
|
|
1122
|
-
diagnosticsStore = new Map;
|
|
1123
|
-
requestTimeoutMs;
|
|
1124
|
-
initializeTimeoutMs;
|
|
1125
|
-
workspaceApplyEditHandler = null;
|
|
1126
|
-
diagnosticPullSupported = false;
|
|
1127
1112
|
constructor(root, server2, timeouts = {}) {
|
|
1128
1113
|
this.root = root;
|
|
1129
1114
|
this.server = server2;
|
|
1115
|
+
this.proc = null;
|
|
1116
|
+
this.connection = null;
|
|
1117
|
+
this.stderrBuffer = [];
|
|
1118
|
+
this.processExited = false;
|
|
1119
|
+
this.diagnosticsStore = new Map;
|
|
1120
|
+
this.workspaceApplyEditHandler = null;
|
|
1121
|
+
this.diagnosticPullSupported = false;
|
|
1122
|
+
this.documentFormattingSupported = false;
|
|
1130
1123
|
this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
1131
1124
|
this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
1132
1125
|
}
|
|
@@ -1148,6 +1141,12 @@ class LspClientTransport {
|
|
|
1148
1141
|
isDiagnosticPullSupported() {
|
|
1149
1142
|
return this.diagnosticPullSupported;
|
|
1150
1143
|
}
|
|
1144
|
+
setDocumentFormattingSupported(supported) {
|
|
1145
|
+
this.documentFormattingSupported = supported;
|
|
1146
|
+
}
|
|
1147
|
+
isDocumentFormattingSupported() {
|
|
1148
|
+
return this.documentFormattingSupported;
|
|
1149
|
+
}
|
|
1151
1150
|
handlePublishDiagnostics(params) {
|
|
1152
1151
|
this.diagnosticsStore.set(params.uri, [...params.diagnostics]);
|
|
1153
1152
|
}
|
|
@@ -1361,6 +1360,14 @@ function supportsDiagnosticPull(capabilities) {
|
|
|
1361
1360
|
return false;
|
|
1362
1361
|
return Object.hasOwn(capabilities, "diagnosticProvider");
|
|
1363
1362
|
}
|
|
1363
|
+
function supportsDocumentFormatting(capabilities) {
|
|
1364
|
+
if (capabilities === undefined)
|
|
1365
|
+
return false;
|
|
1366
|
+
const provider = capabilities.documentFormattingProvider;
|
|
1367
|
+
if (provider === undefined || provider === null || provider === false)
|
|
1368
|
+
return false;
|
|
1369
|
+
return provider === true || typeof provider === "object";
|
|
1370
|
+
}
|
|
1364
1371
|
|
|
1365
1372
|
class LspClientConnection extends LspClientTransport {
|
|
1366
1373
|
async initialize() {
|
|
@@ -1377,6 +1384,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
1377
1384
|
references: {},
|
|
1378
1385
|
documentSymbol: { hierarchicalDocumentSymbolSupport: true },
|
|
1379
1386
|
publishDiagnostics: {},
|
|
1387
|
+
formatting: { dynamicRegistration: false },
|
|
1380
1388
|
rename: {
|
|
1381
1389
|
prepareSupport: true,
|
|
1382
1390
|
prepareSupportDefaultBehavior: 1
|
|
@@ -1418,6 +1426,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
1418
1426
|
initializationOptions: this.server.initialization
|
|
1419
1427
|
}, { timeoutMs: this.initializeTimeoutMs });
|
|
1420
1428
|
this.setDiagnosticPullSupported(supportsDiagnosticPull(result?.capabilities));
|
|
1429
|
+
this.setDocumentFormattingSupported(supportsDocumentFormatting(result?.capabilities));
|
|
1421
1430
|
await this.sendNotification("initialized", {});
|
|
1422
1431
|
await this.sendNotification("workspace/didChangeConfiguration", {
|
|
1423
1432
|
settings: { json: { validate: { enable: true } } }
|
|
@@ -1623,16 +1632,12 @@ function movedPath(candidate, oldPath, newPath) {
|
|
|
1623
1632
|
}
|
|
1624
1633
|
|
|
1625
1634
|
class WorkspaceDocumentState {
|
|
1626
|
-
sendNotification;
|
|
1627
|
-
clearDiagnostics;
|
|
1628
|
-
openDocuments = new Map;
|
|
1629
|
-
openByUri = new Map;
|
|
1630
|
-
openPromises = new Map;
|
|
1631
|
-
now;
|
|
1632
|
-
versionlessPublishQuiescenceMs;
|
|
1633
1635
|
constructor(sendNotification, clearDiagnostics, options = {}) {
|
|
1634
1636
|
this.sendNotification = sendNotification;
|
|
1635
1637
|
this.clearDiagnostics = clearDiagnostics;
|
|
1638
|
+
this.openDocuments = new Map;
|
|
1639
|
+
this.openByUri = new Map;
|
|
1640
|
+
this.openPromises = new Map;
|
|
1636
1641
|
this.now = options.now ?? (() => Date.now());
|
|
1637
1642
|
this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
|
|
1638
1643
|
}
|
|
@@ -1896,13 +1901,11 @@ import { dirname as dirname2, isAbsolute as isAbsolute2, relative as relative3,
|
|
|
1896
1901
|
import { fileURLToPath } from "node:url";
|
|
1897
1902
|
|
|
1898
1903
|
class WorkspaceEditPathError extends Error {
|
|
1899
|
-
path;
|
|
1900
|
-
detail;
|
|
1901
|
-
name = "WorkspaceEditPathError";
|
|
1902
1904
|
constructor(path, detail) {
|
|
1903
1905
|
super(`${detail}: ${path}`);
|
|
1904
1906
|
this.path = path;
|
|
1905
1907
|
this.detail = detail;
|
|
1908
|
+
this.name = "WorkspaceEditPathError";
|
|
1906
1909
|
}
|
|
1907
1910
|
}
|
|
1908
1911
|
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
@@ -2194,13 +2197,11 @@ function canonicalFingerprint(operations) {
|
|
|
2194
2197
|
|
|
2195
2198
|
// ../lsp-core/src/lsp/workspace-edit-types.ts
|
|
2196
2199
|
class WorkspaceEditValidationError extends Error {
|
|
2197
|
-
changeIndex;
|
|
2198
|
-
detail;
|
|
2199
|
-
name = "WorkspaceEditValidationError";
|
|
2200
2200
|
constructor(changeIndex, detail) {
|
|
2201
2201
|
super(`change ${changeIndex}: ${detail}`);
|
|
2202
2202
|
this.changeIndex = changeIndex;
|
|
2203
2203
|
this.detail = detail;
|
|
2204
|
+
this.name = "WorkspaceEditValidationError";
|
|
2204
2205
|
}
|
|
2205
2206
|
}
|
|
2206
2207
|
|
|
@@ -2698,10 +2699,9 @@ function simulateDelete(operation, virtual) {
|
|
|
2698
2699
|
import { existsSync as existsSync5, lstatSync as lstatSync3, readdirSync as readdirSync2 } from "node:fs";
|
|
2699
2700
|
import { dirname as dirname4, resolve as resolve5 } from "node:path";
|
|
2700
2701
|
class WorkspaceSnapshotBuilder {
|
|
2701
|
-
workspaceRoot;
|
|
2702
|
-
snapshots = new Map;
|
|
2703
2702
|
constructor(workspaceRoot) {
|
|
2704
2703
|
this.workspaceRoot = workspaceRoot;
|
|
2704
|
+
this.snapshots = new Map;
|
|
2705
2705
|
}
|
|
2706
2706
|
build(operations) {
|
|
2707
2707
|
this.add(this.workspaceRoot, false);
|
|
@@ -2745,8 +2745,10 @@ function snapshotOperations(operations, workspaceRoot) {
|
|
|
2745
2745
|
|
|
2746
2746
|
// ../lsp-core/src/lsp/workspace-edit-plan.ts
|
|
2747
2747
|
class PlanPathIndex {
|
|
2748
|
-
|
|
2749
|
-
|
|
2748
|
+
constructor() {
|
|
2749
|
+
this.firstChangeByPath = new Map;
|
|
2750
|
+
this.reportedPathByCanonical = new Map;
|
|
2751
|
+
}
|
|
2750
2752
|
build(operations) {
|
|
2751
2753
|
for (const operation of operations) {
|
|
2752
2754
|
switch (operation.kind) {
|
|
@@ -2835,14 +2837,11 @@ function isRecord4(value) {
|
|
|
2835
2837
|
}
|
|
2836
2838
|
|
|
2837
2839
|
class WorkspaceMutationController {
|
|
2838
|
-
workspaceRoot;
|
|
2839
|
-
documents;
|
|
2840
|
-
activeLease = null;
|
|
2841
|
-
nextLeaseId = 1;
|
|
2842
|
-
io;
|
|
2843
2840
|
constructor(workspaceRoot, documents) {
|
|
2844
2841
|
this.workspaceRoot = workspaceRoot;
|
|
2845
2842
|
this.documents = documents;
|
|
2843
|
+
this.activeLease = null;
|
|
2844
|
+
this.nextLeaseId = 1;
|
|
2846
2845
|
}
|
|
2847
2846
|
setIo(io) {
|
|
2848
2847
|
this.io = io;
|
|
@@ -2955,12 +2954,9 @@ var DIAGNOSTICS_FRESHNESS_TIMEOUT_MS = 3000;
|
|
|
2955
2954
|
var VERSIONLESS_PUBLISH_QUIESCENCE_MS = 250;
|
|
2956
2955
|
|
|
2957
2956
|
class LspClient extends LspClientConnection {
|
|
2958
|
-
diagnosticPullErrors = [];
|
|
2959
|
-
documents;
|
|
2960
|
-
workspaceMutations;
|
|
2961
|
-
diagnosticsFreshnessTimeoutMs;
|
|
2962
2957
|
constructor(root, server2, options = {}) {
|
|
2963
2958
|
super(root, server2, options);
|
|
2959
|
+
this.diagnosticPullErrors = [];
|
|
2964
2960
|
this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
|
|
2965
2961
|
this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
|
|
2966
2962
|
versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
|
|
@@ -3015,6 +3011,18 @@ class LspClient extends LspClientConnection {
|
|
|
3015
3011
|
textDocument: { uri: pathToFileURL3(absPath).href }
|
|
3016
3012
|
}, options);
|
|
3017
3013
|
}
|
|
3014
|
+
async formatDocument(filePath, options, signal) {
|
|
3015
|
+
if (!this.isDocumentFormattingSupported())
|
|
3016
|
+
return null;
|
|
3017
|
+
const absPath = this.resolveWorkspacePath(filePath);
|
|
3018
|
+
await this.openFile(absPath);
|
|
3019
|
+
const requestOptions = signal === undefined ? {} : { signal };
|
|
3020
|
+
const edits = await this.sendRequest("textDocument/formatting", {
|
|
3021
|
+
textDocument: { uri: pathToFileURL3(absPath).href },
|
|
3022
|
+
options
|
|
3023
|
+
}, requestOptions);
|
|
3024
|
+
return edits ?? [];
|
|
3025
|
+
}
|
|
3018
3026
|
async workspaceSymbols(query, signal) {
|
|
3019
3027
|
const options = signal === undefined ? {} : { signal };
|
|
3020
3028
|
return this.sendRequest("workspace/symbol", { query }, options);
|
|
@@ -3260,18 +3268,14 @@ function awaitWithSignal(promise, signal) {
|
|
|
3260
3268
|
}
|
|
3261
3269
|
|
|
3262
3270
|
class LspManager {
|
|
3263
|
-
clients = new Map;
|
|
3264
|
-
reaperHandle = null;
|
|
3265
|
-
signalDisposer = null;
|
|
3266
|
-
disposed = false;
|
|
3267
|
-
idleTimeoutMs;
|
|
3268
|
-
initTimeoutMs;
|
|
3269
|
-
reaperIntervalMs;
|
|
3270
|
-
clientFactory;
|
|
3271
|
-
now;
|
|
3272
3271
|
constructor(options = {}) {
|
|
3272
|
+
this.clients = new Map;
|
|
3273
|
+
this.reaperHandle = null;
|
|
3274
|
+
this.signalDisposer = null;
|
|
3275
|
+
this.disposed = false;
|
|
3273
3276
|
this.idleTimeoutMs = options.idleTimeoutMs ?? IDLE_TIMEOUT_MS;
|
|
3274
3277
|
this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
3278
|
+
this.maxResidentClients = options.maxResidentClients ?? MAX_RESIDENT_CLIENTS;
|
|
3275
3279
|
this.reaperIntervalMs = options.reaperIntervalMs ?? REAPER_INTERVAL_MS;
|
|
3276
3280
|
this.clientFactory = options.clientFactory ?? ((root, server2) => new LspClient(root, server2));
|
|
3277
3281
|
this.now = options.now ?? (() => Date.now());
|
|
@@ -3305,6 +3309,26 @@ class LspManager {
|
|
|
3305
3309
|
}
|
|
3306
3310
|
}
|
|
3307
3311
|
}
|
|
3312
|
+
evictForAdmission() {
|
|
3313
|
+
while (this.clients.size >= this.maxResidentClients) {
|
|
3314
|
+
const victim = this.leastRecentlyUsedIdleClient();
|
|
3315
|
+
if (!victim)
|
|
3316
|
+
return;
|
|
3317
|
+
this.clients.delete(victim.key);
|
|
3318
|
+
stopClientBestEffort(victim.managed.client);
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
leastRecentlyUsedIdleClient() {
|
|
3322
|
+
let candidate = null;
|
|
3323
|
+
for (const [key, managed] of this.clients) {
|
|
3324
|
+
if (managed.refCount > 0 || managed.pendingWaiters > 0 || managed.isInitializing)
|
|
3325
|
+
continue;
|
|
3326
|
+
if (candidate === null || managed.lastUsedAt < candidate.managed.lastUsedAt) {
|
|
3327
|
+
candidate = { key, managed };
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
return candidate;
|
|
3331
|
+
}
|
|
3308
3332
|
async tryDeleteIfOrphaned(key, managed) {
|
|
3309
3333
|
if (managed.refCount === 0 && managed.pendingWaiters === 0 && !managed.isInitializing && this.clients.get(key) === managed) {
|
|
3310
3334
|
this.clients.delete(key);
|
|
@@ -3351,6 +3375,7 @@ class LspManager {
|
|
|
3351
3375
|
managed.lastUsedAt = this.now();
|
|
3352
3376
|
return managed.client;
|
|
3353
3377
|
}
|
|
3378
|
+
this.evictForAdmission();
|
|
3354
3379
|
const client = this.clientFactory(root, server2);
|
|
3355
3380
|
const initStartedAt = this.now();
|
|
3356
3381
|
const initPromise = (async () => {
|
|
@@ -3413,6 +3438,7 @@ class LspManager {
|
|
|
3413
3438
|
const key = this.getKey(root, server2.id);
|
|
3414
3439
|
if (this.clients.has(key))
|
|
3415
3440
|
return;
|
|
3441
|
+
this.evictForAdmission();
|
|
3416
3442
|
const client = this.clientFactory(root, server2);
|
|
3417
3443
|
const initStartedAt = this.now();
|
|
3418
3444
|
const initPromise = (async () => {
|
|
@@ -3501,57 +3527,43 @@ async function disposeDefaultLspManager() {
|
|
|
3501
3527
|
}
|
|
3502
3528
|
}
|
|
3503
3529
|
|
|
3504
|
-
// ../lsp-core/src/lsp/
|
|
3505
|
-
import { existsSync as existsSync6,
|
|
3506
|
-
import { dirname as dirname5 } from "node:path";
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3530
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
3531
|
+
import { existsSync as existsSync6, realpathSync as realpathSync4 } from "node:fs";
|
|
3532
|
+
import { dirname as dirname5, join as join3 } from "node:path";
|
|
3533
|
+
|
|
3534
|
+
// ../lsp-core/src/lsp/workspace-markers.ts
|
|
3535
|
+
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
3536
|
+
|
|
3537
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
3538
|
+
function findWorkspaceRootOutsideContext(directory) {
|
|
3539
|
+
const marked = nearestMarkedAncestor(directory);
|
|
3540
|
+
if (marked !== undefined)
|
|
3541
|
+
return marked;
|
|
3542
|
+
return realpathSync4(nearestExistingAncestor(directory));
|
|
3543
|
+
}
|
|
3544
|
+
function nearestMarkedAncestor(directory) {
|
|
3545
|
+
let current = directory;
|
|
3546
|
+
for (;; ) {
|
|
3547
|
+
if (existsSync6(current) && WORKSPACE_MARKERS.some((marker) => existsSync6(join3(current, marker)))) {
|
|
3548
|
+
return realpathSync4(current);
|
|
3549
|
+
}
|
|
3550
|
+
const parent = dirname5(current);
|
|
3551
|
+
if (parent === current)
|
|
3552
|
+
return;
|
|
3553
|
+
current = parent;
|
|
3519
3554
|
}
|
|
3520
3555
|
}
|
|
3521
|
-
function
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
}
|
|
3529
|
-
|
|
3530
|
-
return value === "declined" || value === "allowed";
|
|
3531
|
-
}
|
|
3532
|
-
function writeInstallDecisions(decisions) {
|
|
3533
|
-
const path = getInstallDecisionsPath();
|
|
3534
|
-
mkdirSync(dirname5(path), { recursive: true });
|
|
3535
|
-
const tmpPath = `${path}.tmp`;
|
|
3536
|
-
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
3537
|
-
`, "utf8");
|
|
3538
|
-
renameSync2(tmpPath, path);
|
|
3539
|
-
}
|
|
3540
|
-
function isInstallDecisions(value) {
|
|
3541
|
-
return isRecord5(value) && Object.values(value).every(isInstallDecisionRecord);
|
|
3542
|
-
}
|
|
3543
|
-
function isInstallDecisionRecord(value) {
|
|
3544
|
-
if (!isRecord5(value))
|
|
3545
|
-
return false;
|
|
3546
|
-
return isInstallDecision(value["decision"]) && typeof value["decidedAt"] === "string";
|
|
3547
|
-
}
|
|
3548
|
-
function isRecord5(value) {
|
|
3549
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3556
|
+
function nearestExistingAncestor(directory) {
|
|
3557
|
+
let current = directory;
|
|
3558
|
+
while (!existsSync6(current)) {
|
|
3559
|
+
const parent = dirname5(current);
|
|
3560
|
+
if (parent === current)
|
|
3561
|
+
return current;
|
|
3562
|
+
current = parent;
|
|
3563
|
+
}
|
|
3564
|
+
return current;
|
|
3550
3565
|
}
|
|
3551
3566
|
|
|
3552
|
-
// ../lsp-core/src/lsp/config-loader.ts
|
|
3553
|
-
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
3554
|
-
|
|
3555
3567
|
// ../lsp-core/src/lsp/server-definitions.ts
|
|
3556
3568
|
var LSP_INSTALL_HINTS = {
|
|
3557
3569
|
typescript: "npm install -g typescript-language-server typescript",
|
|
@@ -3597,6 +3609,26 @@ var LSP_INSTALL_HINTS = {
|
|
|
3597
3609
|
julials: `julia -e 'using Pkg; Pkg.add("LanguageServer")'`,
|
|
3598
3610
|
razor: "Razor runs through the Roslyn language server (cohosting). " + "Install: dotnet tool install -g roslyn-language-server --prerelease (requires v5.8.0+). See https://github.com/dotnet/razor"
|
|
3599
3611
|
};
|
|
3612
|
+
var LSP_LOCAL_INSTALL_HINTS = {
|
|
3613
|
+
typescript: "bun add -d typescript-language-server typescript",
|
|
3614
|
+
vue: "bun add -d @vue/language-server",
|
|
3615
|
+
eslint: "bun add -d vscode-langservers-extracted",
|
|
3616
|
+
oxlint: "bun add -d oxlint",
|
|
3617
|
+
biome: "bun add -d @biomejs/biome",
|
|
3618
|
+
svelte: "bun add -d svelte-language-server",
|
|
3619
|
+
astro: "bun add -d @astrojs/language-server",
|
|
3620
|
+
bash: "bun add -d bash-language-server",
|
|
3621
|
+
"bash-ls": "bun add -d bash-language-server",
|
|
3622
|
+
"yaml-ls": "bun add -d yaml-language-server",
|
|
3623
|
+
php: "bun add -d intelephense",
|
|
3624
|
+
prisma: "bun add -d prisma",
|
|
3625
|
+
dockerfile: "bun add -d dockerfile-language-server-nodejs",
|
|
3626
|
+
pyright: "uv add --dev pyright",
|
|
3627
|
+
basedpyright: "uv add --dev basedpyright",
|
|
3628
|
+
ruff: "uv add --dev ruff",
|
|
3629
|
+
ty: "uv add --dev ty",
|
|
3630
|
+
"ruby-lsp": "bundle add ruby-lsp --group development"
|
|
3631
|
+
};
|
|
3600
3632
|
var BUILTIN_SERVERS = {
|
|
3601
3633
|
typescript: {
|
|
3602
3634
|
command: ["typescript-language-server", "--stdio"],
|
|
@@ -3699,7 +3731,56 @@ var BUILTIN_SERVERS = {
|
|
|
3699
3731
|
}
|
|
3700
3732
|
};
|
|
3701
3733
|
|
|
3734
|
+
// ../lsp-core/src/lsp/server-install-state.ts
|
|
3735
|
+
import { existsSync as existsSync7, mkdirSync, readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
3736
|
+
import { dirname as dirname6 } from "node:path";
|
|
3737
|
+
function getInstallDecisionsPath() {
|
|
3738
|
+
return lspRequestContext().installDecisionsPath;
|
|
3739
|
+
}
|
|
3740
|
+
function loadInstallDecisions() {
|
|
3741
|
+
const path = getInstallDecisionsPath();
|
|
3742
|
+
if (!existsSync7(path))
|
|
3743
|
+
return {};
|
|
3744
|
+
try {
|
|
3745
|
+
const parsed = JSON.parse(readFileSync3(path, "utf8"));
|
|
3746
|
+
return isInstallDecisions(parsed) ? parsed : {};
|
|
3747
|
+
} catch {
|
|
3748
|
+
return {};
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
function loadInstallDecision(serverId) {
|
|
3752
|
+
return loadInstallDecisions()[serverId];
|
|
3753
|
+
}
|
|
3754
|
+
function recordInstallDecision(serverId, decision, decidedAt = new Date().toISOString()) {
|
|
3755
|
+
const decisions = loadInstallDecisions();
|
|
3756
|
+
decisions[serverId] = { decision, decidedAt };
|
|
3757
|
+
writeInstallDecisions(decisions);
|
|
3758
|
+
}
|
|
3759
|
+
function isInstallDecision(value) {
|
|
3760
|
+
return value === "declined" || value === "allowed";
|
|
3761
|
+
}
|
|
3762
|
+
function writeInstallDecisions(decisions) {
|
|
3763
|
+
const path = getInstallDecisionsPath();
|
|
3764
|
+
mkdirSync(dirname6(path), { recursive: true });
|
|
3765
|
+
const tmpPath = `${path}.tmp`;
|
|
3766
|
+
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
3767
|
+
`, "utf8");
|
|
3768
|
+
renameSync2(tmpPath, path);
|
|
3769
|
+
}
|
|
3770
|
+
function isInstallDecisions(value) {
|
|
3771
|
+
return isRecord5(value) && Object.values(value).every(isInstallDecisionRecord);
|
|
3772
|
+
}
|
|
3773
|
+
function isInstallDecisionRecord(value) {
|
|
3774
|
+
if (!isRecord5(value))
|
|
3775
|
+
return false;
|
|
3776
|
+
return isInstallDecision(value["decision"]) && typeof value["decidedAt"] === "string";
|
|
3777
|
+
}
|
|
3778
|
+
function isRecord5(value) {
|
|
3779
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3702
3782
|
// ../lsp-core/src/lsp/config-loader.ts
|
|
3783
|
+
import { existsSync as existsSync8, readFileSync as readFileSync4 } from "node:fs";
|
|
3703
3784
|
function getProjectConfigPaths() {
|
|
3704
3785
|
return lspRequestContext().projectConfigPaths;
|
|
3705
3786
|
}
|
|
@@ -3707,7 +3788,7 @@ function getUserConfigPath() {
|
|
|
3707
3788
|
return lspRequestContext().userConfigPath;
|
|
3708
3789
|
}
|
|
3709
3790
|
function loadJsonFile(path) {
|
|
3710
|
-
if (!
|
|
3791
|
+
if (!existsSync8(path))
|
|
3711
3792
|
return null;
|
|
3712
3793
|
try {
|
|
3713
3794
|
const parsed = JSON.parse(readFileSync4(path, "utf-8"));
|
|
@@ -3895,54 +3976,155 @@ function getDisabledServerIds() {
|
|
|
3895
3976
|
}
|
|
3896
3977
|
|
|
3897
3978
|
// ../lsp-core/src/lsp/server-installation.ts
|
|
3898
|
-
import { existsSync as
|
|
3899
|
-
import { delimiter as delimiter3, join as
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3979
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
3980
|
+
import { delimiter as delimiter3, dirname as dirname7, isAbsolute as isAbsolute3, join as join4, resolve as resolve7 } from "node:path";
|
|
3981
|
+
var LOCAL_BIN_RULES = [
|
|
3982
|
+
{
|
|
3983
|
+
markers: ["package.json", "bun.lock", "bun.lockb", "package-lock.json", "yarn.lock", "pnpm-lock.yaml"],
|
|
3984
|
+
binDirs: [join4("node_modules", ".bin")]
|
|
3985
|
+
},
|
|
3986
|
+
{
|
|
3987
|
+
markers: [
|
|
3988
|
+
"pyproject.toml",
|
|
3989
|
+
"ty.toml",
|
|
3990
|
+
"requirements.txt",
|
|
3991
|
+
"setup.py",
|
|
3992
|
+
"setup.cfg",
|
|
3993
|
+
"Pipfile",
|
|
3994
|
+
"pyrightconfig.json",
|
|
3995
|
+
"ruff.toml",
|
|
3996
|
+
".ruff.toml"
|
|
3997
|
+
],
|
|
3998
|
+
binDirs: [
|
|
3999
|
+
join4(".venv", "bin"),
|
|
4000
|
+
join4(".venv", "Scripts"),
|
|
4001
|
+
join4("venv", "bin"),
|
|
4002
|
+
join4("venv", "Scripts"),
|
|
4003
|
+
join4(".env", "bin"),
|
|
4004
|
+
join4(".env", "Scripts")
|
|
4005
|
+
]
|
|
4006
|
+
},
|
|
4007
|
+
{
|
|
4008
|
+
markers: ["Gemfile", "Gemfile.lock"],
|
|
4009
|
+
binDirs: [join4("vendor", "bundle", "bin"), "bin"]
|
|
4010
|
+
},
|
|
4011
|
+
{
|
|
4012
|
+
markers: ["go.mod", "go.sum", "go.work"],
|
|
4013
|
+
binDirs: ["bin"]
|
|
4014
|
+
}
|
|
4015
|
+
];
|
|
4016
|
+
var resolutionCache = new Map;
|
|
4017
|
+
var probeCount = 0;
|
|
4018
|
+
function probe(path) {
|
|
4019
|
+
probeCount += 1;
|
|
4020
|
+
return existsSync9(path);
|
|
4021
|
+
}
|
|
4022
|
+
function executableSuffixes(platform, pathExt) {
|
|
4023
|
+
if (platform !== "win32")
|
|
4024
|
+
return [""];
|
|
4025
|
+
const configured = pathExt ?? process.env["PATHEXT"] ?? "";
|
|
4026
|
+
const systemExts = configured.split(";").filter((entry) => entry.length > 0).map((entry) => entry.toLowerCase());
|
|
4027
|
+
return [...new Set(["", ...systemExts, ".exe", ".cmd", ".bat", ".ps1"])];
|
|
4028
|
+
}
|
|
4029
|
+
function probeWithSuffixes(directory, command, suffixes) {
|
|
4030
|
+
for (const suffix of suffixes) {
|
|
4031
|
+
const candidate = join4(directory, command + suffix);
|
|
4032
|
+
if (probe(candidate))
|
|
4033
|
+
return candidate;
|
|
3909
4034
|
}
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
4035
|
+
return null;
|
|
4036
|
+
}
|
|
4037
|
+
function resolveLocal(command, workingDirectory, suffixes, stopAt) {
|
|
4038
|
+
const boundary = stopAt === undefined ? undefined : resolve7(stopAt);
|
|
4039
|
+
let current = resolve7(workingDirectory);
|
|
4040
|
+
while (true) {
|
|
4041
|
+
for (const rule of LOCAL_BIN_RULES) {
|
|
4042
|
+
if (!rule.markers.some((marker) => probe(join4(current, marker))))
|
|
4043
|
+
continue;
|
|
4044
|
+
for (const binDir of rule.binDirs) {
|
|
4045
|
+
const found = probeWithSuffixes(join4(current, binDir), command, suffixes);
|
|
4046
|
+
if (found !== null)
|
|
4047
|
+
return found;
|
|
4048
|
+
}
|
|
3919
4049
|
}
|
|
4050
|
+
if (probe(join4(current, ".git")))
|
|
4051
|
+
return null;
|
|
4052
|
+
if (boundary !== undefined && current === boundary)
|
|
4053
|
+
return null;
|
|
4054
|
+
const parent = dirname7(current);
|
|
4055
|
+
if (parent === current)
|
|
4056
|
+
return null;
|
|
4057
|
+
current = parent;
|
|
3920
4058
|
}
|
|
3921
|
-
|
|
3922
|
-
|
|
4059
|
+
}
|
|
4060
|
+
function resolveFromPath(command, suffixes, platform, pathEnvOverride) {
|
|
4061
|
+
let pathEnv = pathEnvOverride ?? process.env["PATH"] ?? "";
|
|
4062
|
+
if (platform === "win32" && !pathEnv) {
|
|
3923
4063
|
pathEnv = process.env["Path"] ?? "";
|
|
3924
4064
|
}
|
|
3925
|
-
const
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
}
|
|
4065
|
+
for (const entry of pathEnv.split(delimiter3)) {
|
|
4066
|
+
if (entry.length === 0)
|
|
4067
|
+
continue;
|
|
4068
|
+
const found = probeWithSuffixes(entry, command, suffixes);
|
|
4069
|
+
if (found !== null)
|
|
4070
|
+
return found;
|
|
3932
4071
|
}
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
4072
|
+
return null;
|
|
4073
|
+
}
|
|
4074
|
+
function resolveServerBinary(command, workingDirectory, options = {}) {
|
|
4075
|
+
if (command.length === 0)
|
|
4076
|
+
return null;
|
|
4077
|
+
const [cmd] = command;
|
|
4078
|
+
if (cmd === undefined || cmd.length === 0)
|
|
4079
|
+
return null;
|
|
4080
|
+
const platform = options.platform ?? process.platform;
|
|
4081
|
+
const suffixes = executableSuffixes(platform, options.pathExt);
|
|
4082
|
+
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
4083
|
+
const explicit = isAbsolute3(cmd) ? cmd : resolve7(workingDirectory ?? process.cwd(), cmd);
|
|
4084
|
+
return probe(explicit) ? explicit : null;
|
|
4085
|
+
}
|
|
4086
|
+
const cacheKey = JSON.stringify([
|
|
4087
|
+
workingDirectory ?? "",
|
|
4088
|
+
cmd,
|
|
4089
|
+
platform,
|
|
4090
|
+
options.stopAt ?? "",
|
|
4091
|
+
options.pathExt ?? "",
|
|
4092
|
+
options.pathEnv ?? process.env["PATH"] ?? ""
|
|
4093
|
+
]);
|
|
4094
|
+
const cached = resolutionCache.get(cacheKey);
|
|
4095
|
+
if (cached !== undefined)
|
|
4096
|
+
return cached;
|
|
4097
|
+
let resolved = null;
|
|
4098
|
+
if (workingDirectory !== undefined && workingDirectory.length > 0) {
|
|
4099
|
+
resolved = resolveLocal(cmd, workingDirectory, suffixes, options.stopAt);
|
|
4100
|
+
}
|
|
4101
|
+
resolved ??= resolveFromPath(cmd, suffixes, platform, options.pathEnv);
|
|
4102
|
+
if (resolved === null && cmd === "node")
|
|
4103
|
+
resolved = cmd;
|
|
4104
|
+
resolutionCache.set(cacheKey, resolved);
|
|
4105
|
+
return resolved;
|
|
4106
|
+
}
|
|
4107
|
+
function isServerInstalled(command, workingDirectory, options = {}) {
|
|
4108
|
+
if (command.length === 0)
|
|
4109
|
+
return false;
|
|
4110
|
+
return resolveServerBinary(command, workingDirectory, options) !== null;
|
|
3936
4111
|
}
|
|
3937
4112
|
|
|
3938
4113
|
// ../lsp-core/src/lsp/server-resolution.ts
|
|
4114
|
+
function withResolvedCommand(command, binaryPath) {
|
|
4115
|
+
return [binaryPath, ...command.slice(1)];
|
|
4116
|
+
}
|
|
3939
4117
|
function findServerForExtension(ext) {
|
|
3940
4118
|
const servers = getMergedServers();
|
|
4119
|
+
const workingDirectory = contextCwd();
|
|
3941
4120
|
for (const server2 of servers) {
|
|
3942
|
-
if (server2.extensions.includes(ext)
|
|
4121
|
+
if (!server2.extensions.includes(ext))
|
|
4122
|
+
continue;
|
|
4123
|
+
const binaryPath = resolveServerBinary(server2.command, workingDirectory);
|
|
4124
|
+
if (binaryPath !== null) {
|
|
3943
4125
|
const resolvedServer = {
|
|
3944
4126
|
id: server2.id,
|
|
3945
|
-
command: server2.command,
|
|
4127
|
+
command: withResolvedCommand(server2.command, binaryPath),
|
|
3946
4128
|
extensions: server2.extensions,
|
|
3947
4129
|
priority: server2.priority
|
|
3948
4130
|
};
|
|
@@ -3989,6 +4171,7 @@ function findServerForExtension(ext) {
|
|
|
3989
4171
|
function getAllServers() {
|
|
3990
4172
|
const servers = getMergedServers();
|
|
3991
4173
|
const disabled = getDisabledServerIds();
|
|
4174
|
+
const workingDirectory = contextCwd();
|
|
3992
4175
|
const result = [];
|
|
3993
4176
|
const seen = new Set;
|
|
3994
4177
|
for (const server2 of servers) {
|
|
@@ -3996,7 +4179,7 @@ function getAllServers() {
|
|
|
3996
4179
|
continue;
|
|
3997
4180
|
result.push({
|
|
3998
4181
|
id: server2.id,
|
|
3999
|
-
installed: isServerInstalled(server2.command),
|
|
4182
|
+
installed: isServerInstalled(server2.command, workingDirectory),
|
|
4000
4183
|
extensions: server2.extensions,
|
|
4001
4184
|
disabled: false,
|
|
4002
4185
|
source: server2.source,
|
|
@@ -4010,7 +4193,7 @@ function getAllServers() {
|
|
|
4010
4193
|
const builtin = BUILTIN_SERVERS[id];
|
|
4011
4194
|
result.push({
|
|
4012
4195
|
id,
|
|
4013
|
-
installed: builtin ? isServerInstalled(builtin.command) : false,
|
|
4196
|
+
installed: builtin ? isServerInstalled(builtin.command, workingDirectory) : false,
|
|
4014
4197
|
extensions: builtin?.extensions ?? [],
|
|
4015
4198
|
disabled: true,
|
|
4016
4199
|
source: "disabled",
|
|
@@ -4021,7 +4204,6 @@ function getAllServers() {
|
|
|
4021
4204
|
}
|
|
4022
4205
|
|
|
4023
4206
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
4024
|
-
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4025
4207
|
function isDirectoryPath(filePath) {
|
|
4026
4208
|
try {
|
|
4027
4209
|
return statSync3(filePath).isDirectory();
|
|
@@ -4030,32 +4212,85 @@ function isDirectoryPath(filePath) {
|
|
|
4030
4212
|
}
|
|
4031
4213
|
}
|
|
4032
4214
|
function findWorkspaceRoot(filePath) {
|
|
4033
|
-
const
|
|
4215
|
+
const cwd = contextCwd();
|
|
4216
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4034
4217
|
let dir = abs;
|
|
4035
4218
|
if (!isDirectoryPath(dir)) {
|
|
4036
|
-
dir =
|
|
4037
|
-
}
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4219
|
+
dir = dirname8(dir);
|
|
4220
|
+
}
|
|
4221
|
+
if (!isPathInside(cwd, abs))
|
|
4222
|
+
return findWorkspaceRootOutsideContext(dir);
|
|
4223
|
+
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4224
|
+
while (isPathInside(cwd, dir)) {
|
|
4225
|
+
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4226
|
+
if (canonicalDir !== undefined) {
|
|
4227
|
+
for (const marker of WORKSPACE_MARKERS) {
|
|
4228
|
+
if (existsSync10(join5(dir, marker))) {
|
|
4229
|
+
return canonicalDir;
|
|
4230
|
+
}
|
|
4043
4231
|
}
|
|
4044
4232
|
}
|
|
4045
|
-
|
|
4046
|
-
|
|
4233
|
+
if (dir === cwd)
|
|
4234
|
+
break;
|
|
4235
|
+
dir = dirname8(dir);
|
|
4047
4236
|
}
|
|
4048
|
-
return
|
|
4237
|
+
return fallbackRoot;
|
|
4238
|
+
}
|
|
4239
|
+
function resolveReadablePathInsideContext(filePath) {
|
|
4240
|
+
const cwd = contextCwd();
|
|
4241
|
+
const abs = resolve8(cwd, filePath);
|
|
4242
|
+
if (isPathInside(cwd, abs))
|
|
4243
|
+
return abs;
|
|
4244
|
+
const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
|
|
4245
|
+
if (rebased !== undefined)
|
|
4246
|
+
return rebased;
|
|
4247
|
+
return canonicalizeExistingOrNearestAncestor(abs);
|
|
4049
4248
|
}
|
|
4050
4249
|
function resolvePathInsideContext(filePath) {
|
|
4051
4250
|
const cwd = contextCwd();
|
|
4052
|
-
const abs =
|
|
4251
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4053
4252
|
const canonical = canonicalizeExistingOrNearestAncestor(abs);
|
|
4054
4253
|
if (!isPathInside(cwd, canonical)) {
|
|
4055
4254
|
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4056
4255
|
}
|
|
4057
4256
|
return canonical;
|
|
4058
4257
|
}
|
|
4258
|
+
function rebaseThroughCanonicalAncestor(path, cwd) {
|
|
4259
|
+
let current = path;
|
|
4260
|
+
const suffix = [];
|
|
4261
|
+
while (true) {
|
|
4262
|
+
if (existsSync10(current)) {
|
|
4263
|
+
const canonical = realpathSync5(current);
|
|
4264
|
+
if (isPathInside(cwd, canonical))
|
|
4265
|
+
return suffix.length === 0 ? canonical : join5(canonical, ...suffix);
|
|
4266
|
+
}
|
|
4267
|
+
const parent = dirname8(current);
|
|
4268
|
+
if (parent === current)
|
|
4269
|
+
return;
|
|
4270
|
+
suffix.unshift(basename3(current));
|
|
4271
|
+
current = parent;
|
|
4272
|
+
}
|
|
4273
|
+
}
|
|
4274
|
+
function existingDirectoryInsideContext(directory, cwd) {
|
|
4275
|
+
if (!existsSync10(directory))
|
|
4276
|
+
return;
|
|
4277
|
+
const canonical = realpathSync5(directory);
|
|
4278
|
+
if (!statSync3(canonical).isDirectory())
|
|
4279
|
+
return;
|
|
4280
|
+
return isPathInside(cwd, canonical) ? canonical : undefined;
|
|
4281
|
+
}
|
|
4282
|
+
function nearestExistingDirectoryInsideContext(directory, cwd) {
|
|
4283
|
+
let current = directory;
|
|
4284
|
+
while (isPathInside(cwd, current)) {
|
|
4285
|
+
const canonical = existingDirectoryInsideContext(current, cwd);
|
|
4286
|
+
if (canonical !== undefined)
|
|
4287
|
+
return canonical;
|
|
4288
|
+
if (current === cwd)
|
|
4289
|
+
return;
|
|
4290
|
+
current = dirname8(current);
|
|
4291
|
+
}
|
|
4292
|
+
return;
|
|
4293
|
+
}
|
|
4059
4294
|
function formatServerLookupError(result) {
|
|
4060
4295
|
if (result.status === "not_installed") {
|
|
4061
4296
|
return formatNotInstalled(result);
|
|
@@ -4079,6 +4314,19 @@ function formatServerLookupError(result) {
|
|
|
4079
4314
|
].join(`
|
|
4080
4315
|
`);
|
|
4081
4316
|
}
|
|
4317
|
+
function formatInstallOptions(serverId, installHint) {
|
|
4318
|
+
const localHint = LSP_LOCAL_INSTALL_HINTS[serverId];
|
|
4319
|
+
if (localHint === undefined) {
|
|
4320
|
+
return ["To install, run:", ` ${installHint}`];
|
|
4321
|
+
}
|
|
4322
|
+
return [
|
|
4323
|
+
"To install in THIS repository (preferred — no global install needed):",
|
|
4324
|
+
` ${localHint}`,
|
|
4325
|
+
"",
|
|
4326
|
+
"Or install it globally:",
|
|
4327
|
+
` ${installHint}`
|
|
4328
|
+
];
|
|
4329
|
+
}
|
|
4082
4330
|
function formatNotInstalled(result) {
|
|
4083
4331
|
const { server: server2, installHint } = result;
|
|
4084
4332
|
const extensions = server2.extensions.join(", ");
|
|
@@ -4093,19 +4341,19 @@ function formatNotInstalled(result) {
|
|
|
4093
4341
|
`Command not found: ${server2.command[0]}`,
|
|
4094
4342
|
""
|
|
4095
4343
|
];
|
|
4344
|
+
const installOptions = formatInstallOptions(server2.id, installHint);
|
|
4096
4345
|
if (decision === "allowed") {
|
|
4097
4346
|
return [
|
|
4098
4347
|
...header,
|
|
4099
4348
|
"The user has pre-authorized LSP installation. Run the install command, then retry this tool:",
|
|
4100
|
-
|
|
4349
|
+
...installOptions.slice(1)
|
|
4101
4350
|
].join(`
|
|
4102
4351
|
`);
|
|
4103
4352
|
}
|
|
4104
4353
|
if (!context.capabilities.installDecisionTool) {
|
|
4105
4354
|
return [
|
|
4106
4355
|
...header,
|
|
4107
|
-
|
|
4108
|
-
` ${installHint}`,
|
|
4356
|
+
...installOptions,
|
|
4109
4357
|
"",
|
|
4110
4358
|
"ACTION REQUIRED — ASK THE USER whether to install this LSP server.",
|
|
4111
4359
|
"Install-decision recording is unavailable in this harness; proceed without LSP if the user declines."
|
|
@@ -4114,8 +4362,7 @@ function formatNotInstalled(result) {
|
|
|
4114
4362
|
}
|
|
4115
4363
|
return [
|
|
4116
4364
|
...header,
|
|
4117
|
-
|
|
4118
|
-
` ${installHint}`,
|
|
4365
|
+
...installOptions,
|
|
4119
4366
|
"",
|
|
4120
4367
|
"ACTION REQUIRED — ASK THE USER whether to install this LSP server.",
|
|
4121
4368
|
"- If the user agrees: run the install command above, then retry this tool.",
|
|
@@ -4126,7 +4373,7 @@ function formatNotInstalled(result) {
|
|
|
4126
4373
|
].join(`
|
|
4127
4374
|
`);
|
|
4128
4375
|
}
|
|
4129
|
-
var
|
|
4376
|
+
var READ_ONLY_TOOLS = new Set([
|
|
4130
4377
|
"diagnostics",
|
|
4131
4378
|
"definition",
|
|
4132
4379
|
"references",
|
|
@@ -4135,7 +4382,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
|
|
|
4135
4382
|
"prepareRename"
|
|
4136
4383
|
]);
|
|
4137
4384
|
async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
4138
|
-
const absPath = resolvePathInsideContext(filePath);
|
|
4385
|
+
const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
|
|
4139
4386
|
if (isDirectoryPath(absPath)) {
|
|
4140
4387
|
throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
|
|
4141
4388
|
}
|
|
@@ -4150,9 +4397,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4150
4397
|
const acquireAndCall = async (allowRetry) => {
|
|
4151
4398
|
const client = await manager.getClient(root, server2, options.signal);
|
|
4152
4399
|
try {
|
|
4153
|
-
return await fn(client, root);
|
|
4400
|
+
return await fn(client, root, absPath);
|
|
4154
4401
|
} catch (err) {
|
|
4155
|
-
if (allowRetry &&
|
|
4402
|
+
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
4156
4403
|
manager.invalidateClient(root, server2.id, client);
|
|
4157
4404
|
return acquireAndCall(false);
|
|
4158
4405
|
}
|
|
@@ -4170,8 +4417,8 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4170
4417
|
}
|
|
4171
4418
|
|
|
4172
4419
|
// ../lsp-core/src/lsp/directory-diagnostics.ts
|
|
4173
|
-
import { existsSync as
|
|
4174
|
-
import { join as
|
|
4420
|
+
import { existsSync as existsSync11, lstatSync as lstatSync4, readdirSync as readdirSync3 } from "node:fs";
|
|
4421
|
+
import { join as join6, resolve as resolve9 } from "node:path";
|
|
4175
4422
|
|
|
4176
4423
|
// ../lsp-core/src/lsp/formatters.ts
|
|
4177
4424
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -4301,7 +4548,7 @@ function collectFilesWithExtension(dir, extension, maxFiles) {
|
|
|
4301
4548
|
for (const entry of entries) {
|
|
4302
4549
|
if (files.length >= maxFiles)
|
|
4303
4550
|
return;
|
|
4304
|
-
const fullPath =
|
|
4551
|
+
const fullPath = join6(currentDir, entry);
|
|
4305
4552
|
let stat;
|
|
4306
4553
|
try {
|
|
4307
4554
|
stat = lstatSync4(fullPath);
|
|
@@ -4326,8 +4573,8 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4326
4573
|
if (!extension.startsWith(".")) {
|
|
4327
4574
|
throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
|
|
4328
4575
|
}
|
|
4329
|
-
const absDir =
|
|
4330
|
-
if (!
|
|
4576
|
+
const absDir = resolve9(options.workspaceRoot ?? contextCwd(), directory);
|
|
4577
|
+
if (!existsSync11(absDir)) {
|
|
4331
4578
|
throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
|
|
4332
4579
|
}
|
|
4333
4580
|
const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
|
|
@@ -4414,7 +4661,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4414
4661
|
|
|
4415
4662
|
// ../lsp-core/src/lsp/infer-extension.ts
|
|
4416
4663
|
import { lstatSync as lstatSync5, readdirSync as readdirSync4 } from "node:fs";
|
|
4417
|
-
import { join as
|
|
4664
|
+
import { join as join7 } from "node:path";
|
|
4418
4665
|
var SKIP_DIRECTORIES2 = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
|
|
4419
4666
|
var MAX_SCAN_ENTRIES = 500;
|
|
4420
4667
|
function inferExtensionFromDirectory(directory) {
|
|
@@ -4432,7 +4679,7 @@ function inferExtensionFromDirectory(directory) {
|
|
|
4432
4679
|
for (const entry of entries) {
|
|
4433
4680
|
if (scanned >= MAX_SCAN_ENTRIES)
|
|
4434
4681
|
return;
|
|
4435
|
-
const fullPath =
|
|
4682
|
+
const fullPath = join7(dir, entry);
|
|
4436
4683
|
let stat;
|
|
4437
4684
|
try {
|
|
4438
4685
|
stat = lstatSync5(fullPath);
|
|
@@ -4607,7 +4854,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4607
4854
|
const filePath = requireString(params, "filePath");
|
|
4608
4855
|
const severity = severityFilter(params);
|
|
4609
4856
|
try {
|
|
4610
|
-
const absPath =
|
|
4857
|
+
const absPath = resolveReadablePathInsideContext(filePath);
|
|
4611
4858
|
if (isDirectoryPath(absPath)) {
|
|
4612
4859
|
const extension = inferExtensionFromDirectory(absPath);
|
|
4613
4860
|
if (!extension) {
|
|
@@ -4636,7 +4883,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4636
4883
|
};
|
|
4637
4884
|
return text(output2.output, details2);
|
|
4638
4885
|
}
|
|
4639
|
-
const result = await withLspClient(filePath, async (client) => client.diagnostics(
|
|
4886
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
|
|
4640
4887
|
if (result.transientError) {
|
|
4641
4888
|
const message = result.transientError.message;
|
|
4642
4889
|
const details2 = {
|
|
@@ -4683,6 +4930,96 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4683
4930
|
throw error;
|
|
4684
4931
|
}
|
|
4685
4932
|
}
|
|
4933
|
+
// ../lsp-core/src/lsp/format-document.ts
|
|
4934
|
+
import { readFileSync as readFileSync5, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync3 } from "node:fs";
|
|
4935
|
+
var DEFAULT_FORMATTING_OPTIONS = {
|
|
4936
|
+
tabSize: 4,
|
|
4937
|
+
insertSpaces: false,
|
|
4938
|
+
trimTrailingWhitespace: true,
|
|
4939
|
+
insertFinalNewline: true,
|
|
4940
|
+
trimFinalNewlines: true
|
|
4941
|
+
};
|
|
4942
|
+
var UNCHANGED = { status: "unchanged", linesAdded: 0, linesRemoved: 0 };
|
|
4943
|
+
async function formatDocumentWithClient(client, filePath, options = {}) {
|
|
4944
|
+
const edits = await client.formatDocument(filePath, options.formattingOptions ?? DEFAULT_FORMATTING_OPTIONS, options.signal);
|
|
4945
|
+
if (edits === null)
|
|
4946
|
+
return { status: "unavailable", reason: "capability_not_advertised" };
|
|
4947
|
+
if (edits.length === 0)
|
|
4948
|
+
return UNCHANGED;
|
|
4949
|
+
const before = readFileSync5(filePath, "utf-8");
|
|
4950
|
+
const normalized = normalizeTextEdits(before, edits, 0);
|
|
4951
|
+
if (normalized.text === before)
|
|
4952
|
+
return UNCHANGED;
|
|
4953
|
+
writeAtomically(filePath, normalized.text);
|
|
4954
|
+
await client.openFile(filePath);
|
|
4955
|
+
return {
|
|
4956
|
+
status: "formatted",
|
|
4957
|
+
...lineDelta(normalized.edits)
|
|
4958
|
+
};
|
|
4959
|
+
}
|
|
4960
|
+
function lineDelta(edits) {
|
|
4961
|
+
let linesAdded = 0;
|
|
4962
|
+
let linesRemoved = 0;
|
|
4963
|
+
for (const edit of edits) {
|
|
4964
|
+
linesRemoved += edit.range.end.line - edit.range.start.line + 1;
|
|
4965
|
+
linesAdded += edit.newText.split(`
|
|
4966
|
+
`).length;
|
|
4967
|
+
}
|
|
4968
|
+
return { linesAdded, linesRemoved };
|
|
4969
|
+
}
|
|
4970
|
+
function writeAtomically(filePath, content) {
|
|
4971
|
+
const tempPath = `${filePath}.omo-format.tmp`;
|
|
4972
|
+
writeFileSync3(tempPath, content, "utf-8");
|
|
4973
|
+
try {
|
|
4974
|
+
renameSync3(tempPath, filePath);
|
|
4975
|
+
} catch (error) {
|
|
4976
|
+
try {
|
|
4977
|
+
unlinkSync(tempPath);
|
|
4978
|
+
} catch {}
|
|
4979
|
+
throw error;
|
|
4980
|
+
}
|
|
4981
|
+
}
|
|
4982
|
+
|
|
4983
|
+
// ../lsp-core/src/tools/format.ts
|
|
4984
|
+
async function executeLspFormat(params, signal) {
|
|
4985
|
+
const filePath = requireString(params, "filePath");
|
|
4986
|
+
try {
|
|
4987
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => formatDocumentWithClient(client, resolvedFilePath, signal === undefined ? {} : { signal }), "format", clientOptions(signal));
|
|
4988
|
+
return text(describeResult(filePath, result), formatDetails(filePath, result));
|
|
4989
|
+
} catch (error) {
|
|
4990
|
+
const missingDependency = missingDependencyResult(error, {
|
|
4991
|
+
filePath,
|
|
4992
|
+
status: "unavailable",
|
|
4993
|
+
reason: "server_unavailable",
|
|
4994
|
+
linesAdded: 0,
|
|
4995
|
+
linesRemoved: 0
|
|
4996
|
+
});
|
|
4997
|
+
if (missingDependency)
|
|
4998
|
+
return missingDependency;
|
|
4999
|
+
throw error;
|
|
5000
|
+
}
|
|
5001
|
+
}
|
|
5002
|
+
function formatDetails(filePath, result) {
|
|
5003
|
+
if (result.status === "unavailable") {
|
|
5004
|
+
return { filePath, status: "unavailable", reason: result.reason, linesAdded: 0, linesRemoved: 0 };
|
|
5005
|
+
}
|
|
5006
|
+
return {
|
|
5007
|
+
filePath,
|
|
5008
|
+
status: result.status,
|
|
5009
|
+
linesAdded: result.linesAdded,
|
|
5010
|
+
linesRemoved: result.linesRemoved
|
|
5011
|
+
};
|
|
5012
|
+
}
|
|
5013
|
+
function describeResult(filePath, result) {
|
|
5014
|
+
if (result.status === "unavailable") {
|
|
5015
|
+
return `Formatting unavailable for ${filePath}: the language server does not advertise documentFormattingProvider.`;
|
|
5016
|
+
}
|
|
5017
|
+
if (result.status === "unchanged") {
|
|
5018
|
+
return `Already formatted: ${filePath}`;
|
|
5019
|
+
}
|
|
5020
|
+
return `Formatted ${filePath} (+${result.linesAdded}/-${result.linesRemoved} lines)`;
|
|
5021
|
+
}
|
|
5022
|
+
|
|
4686
5023
|
// ../lsp-core/src/tools/install-decision.ts
|
|
4687
5024
|
async function executeLspInstallDecision(params) {
|
|
4688
5025
|
const serverId = requireString(params, "server_id");
|
|
@@ -4711,7 +5048,7 @@ async function executeLspGotoDefinition(params, signal) {
|
|
|
4711
5048
|
const line = requireNumber(params, "line");
|
|
4712
5049
|
const character = requireNumber(params, "character");
|
|
4713
5050
|
try {
|
|
4714
|
-
const result = await withLspClient(filePath, async (client) => client.definition(
|
|
5051
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
|
|
4715
5052
|
const locations = !result ? [] : Array.isArray(result) ? result : [result];
|
|
4716
5053
|
const details = { filePath, line, character, locations };
|
|
4717
5054
|
if (locations.length === 0)
|
|
@@ -4736,7 +5073,7 @@ async function executeLspFindReferences(params, signal) {
|
|
|
4736
5073
|
const character = requireNumber(params, "character");
|
|
4737
5074
|
const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
|
|
4738
5075
|
try {
|
|
4739
|
-
const result = await withLspClient(filePath, async (client) => client.references(
|
|
5076
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
|
|
4740
5077
|
const references = Array.isArray(result) ? result : [];
|
|
4741
5078
|
const total = references.length;
|
|
4742
5079
|
const truncated = total > DEFAULT_MAX_REFERENCES;
|
|
@@ -4778,7 +5115,7 @@ async function executeLspPrepareRename(params, signal) {
|
|
|
4778
5115
|
const line = requireNumber(params, "line");
|
|
4779
5116
|
const character = requireNumber(params, "character");
|
|
4780
5117
|
try {
|
|
4781
|
-
const result = await withLspClient(filePath, async (client) => client.prepareRename(
|
|
5118
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
|
|
4782
5119
|
const details = { filePath, line, character, result };
|
|
4783
5120
|
return text(formatPrepareRenameResult(result), details);
|
|
4784
5121
|
} catch (error) {
|
|
@@ -4799,7 +5136,7 @@ async function executeLspRename(params, signal) {
|
|
|
4799
5136
|
const character = requireNumber(params, "character");
|
|
4800
5137
|
const newName = requireString(params, "newName");
|
|
4801
5138
|
try {
|
|
4802
|
-
const result = await withLspClient(filePath, async (client) => client.rename(
|
|
5139
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
|
|
4803
5140
|
const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
|
|
4804
5141
|
return text(formatApplyResult(result.apply), details, !result.apply.success);
|
|
4805
5142
|
} catch (error) {
|
|
@@ -4879,7 +5216,7 @@ async function executeLspSymbols(params, signal) {
|
|
|
4879
5216
|
const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
|
|
4880
5217
|
return formatSymbolsResult(filePath, scope, symbols2, limit, query);
|
|
4881
5218
|
}
|
|
4882
|
-
const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(
|
|
5219
|
+
const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
|
|
4883
5220
|
return formatSymbolsResult(filePath, scope, symbols, limit);
|
|
4884
5221
|
} catch (error) {
|
|
4885
5222
|
const query = optionalString(params, "query");
|
|
@@ -5015,6 +5352,16 @@ var LSP_MCP_TOOLS = [
|
|
|
5015
5352
|
}, ["filePath", "line", "character", "newName"]),
|
|
5016
5353
|
execute: executeLspRename
|
|
5017
5354
|
},
|
|
5355
|
+
{
|
|
5356
|
+
name: "format",
|
|
5357
|
+
aliases: ["lsp_format"],
|
|
5358
|
+
title: "LSP Format",
|
|
5359
|
+
description: "Format a source file with its language server and write the returned edits to disk.",
|
|
5360
|
+
inputSchema: objectSchema({
|
|
5361
|
+
filePath: { type: "string", description: "Source file path to format." }
|
|
5362
|
+
}, ["filePath"]),
|
|
5363
|
+
execute: executeLspFormat
|
|
5364
|
+
},
|
|
5018
5365
|
{
|
|
5019
5366
|
name: "install_decision",
|
|
5020
5367
|
aliases: ["lsp_install_decision"],
|
|
@@ -5122,6 +5469,6 @@ function requestedProtocolVersion(params) {
|
|
|
5122
5469
|
return params["protocolVersion"];
|
|
5123
5470
|
}
|
|
5124
5471
|
export {
|
|
5125
|
-
|
|
5126
|
-
|
|
5472
|
+
handleLspMcpRequest,
|
|
5473
|
+
runMcpStdioServer
|
|
5127
5474
|
};
|