oh-my-opencode 5.0.0-beta.2 → 5.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/fallback-lane-policy.d.ts +1 -0
- package/dist/cli/index.js +23057 -20893
- 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 +23093 -20929
- 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/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/{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 +11724 -6355
- 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 +1 -0
- package/dist/shared/normalize-sdk-response.d.ts +1 -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/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 +1 -1
- 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/tui.js +8824 -8906
- package/package.json +38 -35
- package/packages/git-bash-mcp/dist/cli.js +5 -1
- package/packages/git-bash-mcp/package.json +1 -1
- 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 +70 -18
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -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/tools/diagnostics.ts +3 -3
- 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-daemon/dist/cli.js +246 -185
- package/packages/lsp-daemon/dist/client.js +222 -164
- package/packages/lsp-daemon/dist/ensure-daemon.js +1 -0
- package/packages/lsp-daemon/dist/index.js +236 -177
- package/packages/lsp-daemon/dist/version-reap.js +1 -1
- package/packages/lsp-tools-mcp/dist/cli.js +198 -136
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +62 -92
- package/packages/lsp-tools-mcp/dist/mcp.js +200 -138
- package/packages/lsp-tools-mcp/dist/request-context.js +11 -12
- package/packages/lsp-tools-mcp/dist/tools.js +204 -146
- 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 +32 -31
- 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 +224 -81
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +224 -82
- 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 +217 -171
- 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 +57 -42
- 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 +6 -2
- 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 +1 -2
- 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 +2433 -422
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +2437 -426
- 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.js +2 -4
- 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/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/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/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/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/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 +1 -1
- 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-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/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/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-dist/install-local.mjs +2601 -528
- 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/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 +1 -1
- 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/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/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/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
|
@@ -31,22 +31,15 @@ var STOP_SIGKILL_GRACE_MS = 1000;
|
|
|
31
31
|
|
|
32
32
|
// ../lsp-core/src/lsp/errors.ts
|
|
33
33
|
class LspConnectionClosedError extends Error {
|
|
34
|
-
serverId;
|
|
35
|
-
root;
|
|
36
|
-
name = "LspConnectionClosedError";
|
|
37
34
|
constructor(serverId, root, message) {
|
|
38
35
|
super(message ?? `LSP connection closed for ${serverId} at ${root}`);
|
|
39
36
|
this.serverId = serverId;
|
|
40
37
|
this.root = root;
|
|
38
|
+
this.name = "LspConnectionClosedError";
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
class LspProcessExitedError extends Error {
|
|
45
|
-
serverId;
|
|
46
|
-
root;
|
|
47
|
-
exitCode;
|
|
48
|
-
stderrTail;
|
|
49
|
-
name = "LspProcessExitedError";
|
|
50
43
|
constructor(serverId, root, exitCode, stderrTail) {
|
|
51
44
|
const stderrSuffix = stderrTail ? `
|
|
52
45
|
stderr tail: ${stderrTail}` : "";
|
|
@@ -55,46 +48,49 @@ stderr tail: ${stderrTail}` : "";
|
|
|
55
48
|
this.root = root;
|
|
56
49
|
this.exitCode = exitCode;
|
|
57
50
|
this.stderrTail = stderrTail;
|
|
51
|
+
this.name = "LspProcessExitedError";
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
class LspRequestTimeoutError extends Error {
|
|
62
|
-
method;
|
|
63
|
-
stderrTail;
|
|
64
|
-
name = "LspRequestTimeoutError";
|
|
65
56
|
constructor(method, stderrTail) {
|
|
66
57
|
const stderrSuffix = stderrTail ? `
|
|
67
58
|
recent stderr: ${stderrTail}` : "";
|
|
68
59
|
super(`LSP request timeout (method: ${method})${stderrSuffix}`);
|
|
69
60
|
this.method = method;
|
|
70
61
|
this.stderrTail = stderrTail;
|
|
62
|
+
this.name = "LspRequestTimeoutError";
|
|
71
63
|
}
|
|
72
64
|
}
|
|
73
65
|
|
|
74
66
|
class LspInvalidPathError extends Error {
|
|
75
|
-
|
|
67
|
+
constructor() {
|
|
68
|
+
super(...arguments);
|
|
69
|
+
this.name = "LspInvalidPathError";
|
|
70
|
+
}
|
|
76
71
|
}
|
|
77
72
|
|
|
78
73
|
class LspServerLookupError extends Error {
|
|
79
|
-
lookup;
|
|
80
|
-
name = "LspServerLookupError";
|
|
81
74
|
constructor(message, lookup) {
|
|
82
75
|
super(message);
|
|
83
76
|
this.lookup = lookup;
|
|
77
|
+
this.name = "LspServerLookupError";
|
|
84
78
|
}
|
|
85
79
|
}
|
|
86
80
|
|
|
87
81
|
class LspServerInitializingError extends Error {
|
|
88
|
-
originalError;
|
|
89
|
-
name = "LspServerInitializingError";
|
|
90
82
|
constructor(originalError) {
|
|
91
83
|
super(`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`);
|
|
92
84
|
this.originalError = originalError;
|
|
85
|
+
this.name = "LspServerInitializingError";
|
|
93
86
|
}
|
|
94
87
|
}
|
|
95
88
|
|
|
96
89
|
class LspProcessSpawnError extends Error {
|
|
97
|
-
|
|
90
|
+
constructor() {
|
|
91
|
+
super(...arguments);
|
|
92
|
+
this.name = "LspProcessSpawnError";
|
|
93
|
+
}
|
|
98
94
|
}
|
|
99
95
|
function isLspDeadConnectionError(err) {
|
|
100
96
|
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
@@ -110,20 +106,31 @@ var METHOD_NOT_FOUND = -32601;
|
|
|
110
106
|
var INTERNAL_ERROR = -32603;
|
|
111
107
|
|
|
112
108
|
class JsonRpcConnection {
|
|
113
|
-
reader;
|
|
114
|
-
writer;
|
|
115
|
-
pendingRequests = new Map;
|
|
116
|
-
notificationHandlers = new Map;
|
|
117
|
-
requestHandlers = new Map;
|
|
118
|
-
closeHandlers = [];
|
|
119
|
-
errorHandlers = [];
|
|
120
|
-
inputBuffer = Buffer.alloc(0);
|
|
121
|
-
nextRequestId = 1;
|
|
122
|
-
listening = false;
|
|
123
|
-
disposed = false;
|
|
124
109
|
constructor(reader, writer) {
|
|
125
110
|
this.reader = reader;
|
|
126
111
|
this.writer = writer;
|
|
112
|
+
this.pendingRequests = new Map;
|
|
113
|
+
this.notificationHandlers = new Map;
|
|
114
|
+
this.requestHandlers = new Map;
|
|
115
|
+
this.closeHandlers = [];
|
|
116
|
+
this.errorHandlers = [];
|
|
117
|
+
this.inputBuffer = Buffer.alloc(0);
|
|
118
|
+
this.nextRequestId = 1;
|
|
119
|
+
this.listening = false;
|
|
120
|
+
this.disposed = false;
|
|
121
|
+
this.handleData = (chunk) => {
|
|
122
|
+
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
123
|
+
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
124
|
+
this.drainInputBuffer();
|
|
125
|
+
};
|
|
126
|
+
this.handleClose = () => {
|
|
127
|
+
for (const handler of this.closeHandlers) {
|
|
128
|
+
handler();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
this.handleStreamError = (error) => {
|
|
132
|
+
this.emitError(error);
|
|
133
|
+
};
|
|
127
134
|
}
|
|
128
135
|
listen() {
|
|
129
136
|
if (this.listening)
|
|
@@ -244,19 +251,6 @@ class JsonRpcConnection {
|
|
|
244
251
|
this.notificationHandlers.clear();
|
|
245
252
|
this.requestHandlers.clear();
|
|
246
253
|
}
|
|
247
|
-
handleData = (chunk) => {
|
|
248
|
-
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
249
|
-
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
250
|
-
this.drainInputBuffer();
|
|
251
|
-
};
|
|
252
|
-
handleClose = () => {
|
|
253
|
-
for (const handler of this.closeHandlers) {
|
|
254
|
-
handler();
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
handleStreamError = (error) => {
|
|
258
|
-
this.emitError(error);
|
|
259
|
-
};
|
|
260
254
|
drainInputBuffer() {
|
|
261
255
|
while (true) {
|
|
262
256
|
const headerEnd = this.inputBuffer.indexOf(HEADER_SEPARATOR);
|
|
@@ -604,31 +598,25 @@ function isPosition(value) {
|
|
|
604
598
|
|
|
605
599
|
// ../lsp-core/src/lsp/transport.ts
|
|
606
600
|
class LspClientNotStartedError extends Error {
|
|
607
|
-
serverId;
|
|
608
|
-
root;
|
|
609
|
-
name = "LspClientNotStartedError";
|
|
610
601
|
constructor(serverId, root) {
|
|
611
602
|
super("LSP client not started");
|
|
612
603
|
this.serverId = serverId;
|
|
613
604
|
this.root = root;
|
|
605
|
+
this.name = "LspClientNotStartedError";
|
|
614
606
|
}
|
|
615
607
|
}
|
|
616
608
|
|
|
617
609
|
class LspClientTransport {
|
|
618
|
-
root;
|
|
619
|
-
server;
|
|
620
|
-
proc = null;
|
|
621
|
-
connection = null;
|
|
622
|
-
stderrBuffer = [];
|
|
623
|
-
processExited = false;
|
|
624
|
-
diagnosticsStore = new Map;
|
|
625
|
-
requestTimeoutMs;
|
|
626
|
-
initializeTimeoutMs;
|
|
627
|
-
workspaceApplyEditHandler = null;
|
|
628
|
-
diagnosticPullSupported = false;
|
|
629
610
|
constructor(root, server, timeouts = {}) {
|
|
630
611
|
this.root = root;
|
|
631
612
|
this.server = server;
|
|
613
|
+
this.proc = null;
|
|
614
|
+
this.connection = null;
|
|
615
|
+
this.stderrBuffer = [];
|
|
616
|
+
this.processExited = false;
|
|
617
|
+
this.diagnosticsStore = new Map;
|
|
618
|
+
this.workspaceApplyEditHandler = null;
|
|
619
|
+
this.diagnosticPullSupported = false;
|
|
632
620
|
this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
633
621
|
this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
634
622
|
}
|
|
@@ -1135,16 +1123,12 @@ function movedPath(candidate, oldPath, newPath) {
|
|
|
1135
1123
|
}
|
|
1136
1124
|
|
|
1137
1125
|
class WorkspaceDocumentState {
|
|
1138
|
-
sendNotification;
|
|
1139
|
-
clearDiagnostics;
|
|
1140
|
-
openDocuments = new Map;
|
|
1141
|
-
openByUri = new Map;
|
|
1142
|
-
openPromises = new Map;
|
|
1143
|
-
now;
|
|
1144
|
-
versionlessPublishQuiescenceMs;
|
|
1145
1126
|
constructor(sendNotification, clearDiagnostics, options = {}) {
|
|
1146
1127
|
this.sendNotification = sendNotification;
|
|
1147
1128
|
this.clearDiagnostics = clearDiagnostics;
|
|
1129
|
+
this.openDocuments = new Map;
|
|
1130
|
+
this.openByUri = new Map;
|
|
1131
|
+
this.openPromises = new Map;
|
|
1148
1132
|
this.now = options.now ?? (() => Date.now());
|
|
1149
1133
|
this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
|
|
1150
1134
|
}
|
|
@@ -1408,13 +1392,11 @@ import { dirname, isAbsolute, relative as relative2, resolve as resolve2 } from
|
|
|
1408
1392
|
import { fileURLToPath } from "node:url";
|
|
1409
1393
|
|
|
1410
1394
|
class WorkspaceEditPathError extends Error {
|
|
1411
|
-
path;
|
|
1412
|
-
detail;
|
|
1413
|
-
name = "WorkspaceEditPathError";
|
|
1414
1395
|
constructor(path, detail) {
|
|
1415
1396
|
super(`${detail}: ${path}`);
|
|
1416
1397
|
this.path = path;
|
|
1417
1398
|
this.detail = detail;
|
|
1399
|
+
this.name = "WorkspaceEditPathError";
|
|
1418
1400
|
}
|
|
1419
1401
|
}
|
|
1420
1402
|
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
@@ -1706,13 +1688,11 @@ function canonicalFingerprint(operations) {
|
|
|
1706
1688
|
|
|
1707
1689
|
// ../lsp-core/src/lsp/workspace-edit-types.ts
|
|
1708
1690
|
class WorkspaceEditValidationError extends Error {
|
|
1709
|
-
changeIndex;
|
|
1710
|
-
detail;
|
|
1711
|
-
name = "WorkspaceEditValidationError";
|
|
1712
1691
|
constructor(changeIndex, detail) {
|
|
1713
1692
|
super(`change ${changeIndex}: ${detail}`);
|
|
1714
1693
|
this.changeIndex = changeIndex;
|
|
1715
1694
|
this.detail = detail;
|
|
1695
|
+
this.name = "WorkspaceEditValidationError";
|
|
1716
1696
|
}
|
|
1717
1697
|
}
|
|
1718
1698
|
|
|
@@ -2210,10 +2190,9 @@ function simulateDelete(operation, virtual) {
|
|
|
2210
2190
|
import { existsSync as existsSync4, lstatSync as lstatSync3, readdirSync as readdirSync2 } from "node:fs";
|
|
2211
2191
|
import { dirname as dirname3, resolve as resolve4 } from "node:path";
|
|
2212
2192
|
class WorkspaceSnapshotBuilder {
|
|
2213
|
-
workspaceRoot;
|
|
2214
|
-
snapshots = new Map;
|
|
2215
2193
|
constructor(workspaceRoot) {
|
|
2216
2194
|
this.workspaceRoot = workspaceRoot;
|
|
2195
|
+
this.snapshots = new Map;
|
|
2217
2196
|
}
|
|
2218
2197
|
build(operations) {
|
|
2219
2198
|
this.add(this.workspaceRoot, false);
|
|
@@ -2257,8 +2236,10 @@ function snapshotOperations(operations, workspaceRoot) {
|
|
|
2257
2236
|
|
|
2258
2237
|
// ../lsp-core/src/lsp/workspace-edit-plan.ts
|
|
2259
2238
|
class PlanPathIndex {
|
|
2260
|
-
|
|
2261
|
-
|
|
2239
|
+
constructor() {
|
|
2240
|
+
this.firstChangeByPath = new Map;
|
|
2241
|
+
this.reportedPathByCanonical = new Map;
|
|
2242
|
+
}
|
|
2262
2243
|
build(operations) {
|
|
2263
2244
|
for (const operation of operations) {
|
|
2264
2245
|
switch (operation.kind) {
|
|
@@ -2347,14 +2328,11 @@ function isRecord3(value) {
|
|
|
2347
2328
|
}
|
|
2348
2329
|
|
|
2349
2330
|
class WorkspaceMutationController {
|
|
2350
|
-
workspaceRoot;
|
|
2351
|
-
documents;
|
|
2352
|
-
activeLease = null;
|
|
2353
|
-
nextLeaseId = 1;
|
|
2354
|
-
io;
|
|
2355
2331
|
constructor(workspaceRoot, documents) {
|
|
2356
2332
|
this.workspaceRoot = workspaceRoot;
|
|
2357
2333
|
this.documents = documents;
|
|
2334
|
+
this.activeLease = null;
|
|
2335
|
+
this.nextLeaseId = 1;
|
|
2358
2336
|
}
|
|
2359
2337
|
setIo(io) {
|
|
2360
2338
|
this.io = io;
|
|
@@ -2467,12 +2445,9 @@ var DIAGNOSTICS_FRESHNESS_TIMEOUT_MS = 3000;
|
|
|
2467
2445
|
var VERSIONLESS_PUBLISH_QUIESCENCE_MS = 250;
|
|
2468
2446
|
|
|
2469
2447
|
class LspClient extends LspClientConnection {
|
|
2470
|
-
diagnosticPullErrors = [];
|
|
2471
|
-
documents;
|
|
2472
|
-
workspaceMutations;
|
|
2473
|
-
diagnosticsFreshnessTimeoutMs;
|
|
2474
2448
|
constructor(root, server, options = {}) {
|
|
2475
2449
|
super(root, server, options);
|
|
2450
|
+
this.diagnosticPullErrors = [];
|
|
2476
2451
|
this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
|
|
2477
2452
|
this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
|
|
2478
2453
|
versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
|
|
@@ -2772,16 +2747,11 @@ function awaitWithSignal(promise, signal) {
|
|
|
2772
2747
|
}
|
|
2773
2748
|
|
|
2774
2749
|
class LspManager {
|
|
2775
|
-
clients = new Map;
|
|
2776
|
-
reaperHandle = null;
|
|
2777
|
-
signalDisposer = null;
|
|
2778
|
-
disposed = false;
|
|
2779
|
-
idleTimeoutMs;
|
|
2780
|
-
initTimeoutMs;
|
|
2781
|
-
reaperIntervalMs;
|
|
2782
|
-
clientFactory;
|
|
2783
|
-
now;
|
|
2784
2750
|
constructor(options = {}) {
|
|
2751
|
+
this.clients = new Map;
|
|
2752
|
+
this.reaperHandle = null;
|
|
2753
|
+
this.signalDisposer = null;
|
|
2754
|
+
this.disposed = false;
|
|
2785
2755
|
this.idleTimeoutMs = options.idleTimeoutMs ?? IDLE_TIMEOUT_MS;
|
|
2786
2756
|
this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
2787
2757
|
this.reaperIntervalMs = options.reaperIntervalMs ?? REAPER_INTERVAL_MS;
|
|
@@ -3285,7 +3255,11 @@ function createParentWatchdog(config, onDeadParent) {
|
|
|
3285
3255
|
const probeAlive = config.probeAlive ?? isProcessAlive;
|
|
3286
3256
|
let fired = false;
|
|
3287
3257
|
const timer = setInterval(() => {
|
|
3288
|
-
if (fired
|
|
3258
|
+
if (fired)
|
|
3259
|
+
return;
|
|
3260
|
+
const alive = probeAlive(parentPid);
|
|
3261
|
+
config.onPoll?.(alive);
|
|
3262
|
+
if (alive)
|
|
3289
3263
|
return;
|
|
3290
3264
|
fired = true;
|
|
3291
3265
|
onDeadParent(parentPid, pollIntervalMs);
|
|
@@ -3320,8 +3294,8 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
|
|
|
3320
3294
|
};
|
|
3321
3295
|
}
|
|
3322
3296
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
3323
|
-
import { existsSync as
|
|
3324
|
-
import { dirname as
|
|
3297
|
+
import { existsSync as existsSync10, realpathSync as realpathSync5, statSync as statSync3 } from "node:fs";
|
|
3298
|
+
import { basename as basename3, dirname as dirname7, join as join5, resolve as resolve7 } from "node:path";
|
|
3325
3299
|
|
|
3326
3300
|
// ../lsp-core/src/request-context.ts
|
|
3327
3301
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -3330,18 +3304,17 @@ import { homedir } from "node:os";
|
|
|
3330
3304
|
import { basename as basename2, delimiter as delimiter2, dirname as dirname4, isAbsolute as isAbsolute2, join as join2, relative as relative4, resolve as resolve6 } from "node:path";
|
|
3331
3305
|
|
|
3332
3306
|
class LspRequestContextParseError extends Error {
|
|
3333
|
-
code;
|
|
3334
|
-
name = "LspRequestContextParseError";
|
|
3335
3307
|
constructor(code, message) {
|
|
3336
3308
|
super(message);
|
|
3337
3309
|
this.code = code;
|
|
3310
|
+
this.name = "LspRequestContextParseError";
|
|
3338
3311
|
}
|
|
3339
3312
|
}
|
|
3340
3313
|
|
|
3341
3314
|
class LspRequestContextUnavailableError extends Error {
|
|
3342
|
-
name = "LspRequestContextUnavailableError";
|
|
3343
3315
|
constructor() {
|
|
3344
3316
|
super("LSP request context is required. Standalone MCP startup must install one with runWithRequestContext(createStandaloneMcpRequestContext()).");
|
|
3317
|
+
this.name = "LspRequestContextUnavailableError";
|
|
3345
3318
|
}
|
|
3346
3319
|
}
|
|
3347
3320
|
var storage = new AsyncLocalStorage;
|
|
@@ -3502,15 +3475,52 @@ function errorCode(error) {
|
|
|
3502
3475
|
return typeof code === "string" ? code : undefined;
|
|
3503
3476
|
}
|
|
3504
3477
|
|
|
3478
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
3479
|
+
import { existsSync as existsSync6, realpathSync as realpathSync4 } from "node:fs";
|
|
3480
|
+
import { dirname as dirname5, join as join3 } from "node:path";
|
|
3481
|
+
|
|
3482
|
+
// ../lsp-core/src/lsp/workspace-markers.ts
|
|
3483
|
+
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
3484
|
+
|
|
3485
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
3486
|
+
function findWorkspaceRootOutsideContext(directory) {
|
|
3487
|
+
const marked = nearestMarkedAncestor(directory);
|
|
3488
|
+
if (marked !== undefined)
|
|
3489
|
+
return marked;
|
|
3490
|
+
return realpathSync4(nearestExistingAncestor(directory));
|
|
3491
|
+
}
|
|
3492
|
+
function nearestMarkedAncestor(directory) {
|
|
3493
|
+
let current = directory;
|
|
3494
|
+
for (;; ) {
|
|
3495
|
+
if (existsSync6(current) && WORKSPACE_MARKERS.some((marker) => existsSync6(join3(current, marker)))) {
|
|
3496
|
+
return realpathSync4(current);
|
|
3497
|
+
}
|
|
3498
|
+
const parent = dirname5(current);
|
|
3499
|
+
if (parent === current)
|
|
3500
|
+
return;
|
|
3501
|
+
current = parent;
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
function nearestExistingAncestor(directory) {
|
|
3505
|
+
let current = directory;
|
|
3506
|
+
while (!existsSync6(current)) {
|
|
3507
|
+
const parent = dirname5(current);
|
|
3508
|
+
if (parent === current)
|
|
3509
|
+
return current;
|
|
3510
|
+
current = parent;
|
|
3511
|
+
}
|
|
3512
|
+
return current;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3505
3515
|
// ../lsp-core/src/lsp/server-install-state.ts
|
|
3506
|
-
import { existsSync as
|
|
3507
|
-
import { dirname as
|
|
3516
|
+
import { existsSync as existsSync7, mkdirSync, readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
3517
|
+
import { dirname as dirname6 } from "node:path";
|
|
3508
3518
|
function getInstallDecisionsPath() {
|
|
3509
3519
|
return lspRequestContext().installDecisionsPath;
|
|
3510
3520
|
}
|
|
3511
3521
|
function loadInstallDecisions() {
|
|
3512
3522
|
const path = getInstallDecisionsPath();
|
|
3513
|
-
if (!
|
|
3523
|
+
if (!existsSync7(path))
|
|
3514
3524
|
return {};
|
|
3515
3525
|
try {
|
|
3516
3526
|
const parsed = JSON.parse(readFileSync3(path, "utf8"));
|
|
@@ -3532,7 +3542,7 @@ function isInstallDecision(value) {
|
|
|
3532
3542
|
}
|
|
3533
3543
|
function writeInstallDecisions(decisions) {
|
|
3534
3544
|
const path = getInstallDecisionsPath();
|
|
3535
|
-
mkdirSync(
|
|
3545
|
+
mkdirSync(dirname6(path), { recursive: true });
|
|
3536
3546
|
const tmpPath = `${path}.tmp`;
|
|
3537
3547
|
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
3538
3548
|
`, "utf8");
|
|
@@ -3551,7 +3561,7 @@ function isRecord5(value) {
|
|
|
3551
3561
|
}
|
|
3552
3562
|
|
|
3553
3563
|
// ../lsp-core/src/lsp/config-loader.ts
|
|
3554
|
-
import { existsSync as
|
|
3564
|
+
import { existsSync as existsSync8, readFileSync as readFileSync4 } from "node:fs";
|
|
3555
3565
|
|
|
3556
3566
|
// ../lsp-core/src/lsp/server-definitions.ts
|
|
3557
3567
|
var LSP_INSTALL_HINTS = {
|
|
@@ -3708,7 +3718,7 @@ function getUserConfigPath() {
|
|
|
3708
3718
|
return lspRequestContext().userConfigPath;
|
|
3709
3719
|
}
|
|
3710
3720
|
function loadJsonFile(path) {
|
|
3711
|
-
if (!
|
|
3721
|
+
if (!existsSync8(path))
|
|
3712
3722
|
return null;
|
|
3713
3723
|
try {
|
|
3714
3724
|
const parsed = JSON.parse(readFileSync4(path, "utf-8"));
|
|
@@ -3896,8 +3906,8 @@ function getDisabledServerIds() {
|
|
|
3896
3906
|
}
|
|
3897
3907
|
|
|
3898
3908
|
// ../lsp-core/src/lsp/server-installation.ts
|
|
3899
|
-
import { existsSync as
|
|
3900
|
-
import { delimiter as delimiter3, join as
|
|
3909
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
3910
|
+
import { delimiter as delimiter3, join as join4 } from "node:path";
|
|
3901
3911
|
function isServerInstalled(command, _workingDirectory) {
|
|
3902
3912
|
if (command.length === 0)
|
|
3903
3913
|
return false;
|
|
@@ -3905,7 +3915,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
3905
3915
|
if (!cmd)
|
|
3906
3916
|
return false;
|
|
3907
3917
|
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
3908
|
-
if (
|
|
3918
|
+
if (existsSync9(cmd))
|
|
3909
3919
|
return true;
|
|
3910
3920
|
}
|
|
3911
3921
|
const isWindows = process.platform === "win32";
|
|
@@ -3926,7 +3936,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
3926
3936
|
const paths = pathEnv.split(delimiter3);
|
|
3927
3937
|
for (const p of paths) {
|
|
3928
3938
|
for (const suffix of exts) {
|
|
3929
|
-
if (
|
|
3939
|
+
if (existsSync9(join4(p, cmd + suffix))) {
|
|
3930
3940
|
return true;
|
|
3931
3941
|
}
|
|
3932
3942
|
}
|
|
@@ -4022,7 +4032,6 @@ function getAllServers() {
|
|
|
4022
4032
|
}
|
|
4023
4033
|
|
|
4024
4034
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
4025
|
-
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4026
4035
|
function isDirectoryPath(filePath) {
|
|
4027
4036
|
try {
|
|
4028
4037
|
return statSync3(filePath).isDirectory();
|
|
@@ -4031,32 +4040,85 @@ function isDirectoryPath(filePath) {
|
|
|
4031
4040
|
}
|
|
4032
4041
|
}
|
|
4033
4042
|
function findWorkspaceRoot(filePath) {
|
|
4034
|
-
const
|
|
4043
|
+
const cwd = contextCwd();
|
|
4044
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4035
4045
|
let dir = abs;
|
|
4036
4046
|
if (!isDirectoryPath(dir)) {
|
|
4037
|
-
dir =
|
|
4038
|
-
}
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4047
|
+
dir = dirname7(dir);
|
|
4048
|
+
}
|
|
4049
|
+
if (!isPathInside(cwd, abs))
|
|
4050
|
+
return findWorkspaceRootOutsideContext(dir);
|
|
4051
|
+
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4052
|
+
while (isPathInside(cwd, dir)) {
|
|
4053
|
+
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4054
|
+
if (canonicalDir !== undefined) {
|
|
4055
|
+
for (const marker of WORKSPACE_MARKERS) {
|
|
4056
|
+
if (existsSync10(join5(dir, marker))) {
|
|
4057
|
+
return canonicalDir;
|
|
4058
|
+
}
|
|
4044
4059
|
}
|
|
4045
4060
|
}
|
|
4046
|
-
|
|
4047
|
-
|
|
4061
|
+
if (dir === cwd)
|
|
4062
|
+
break;
|
|
4063
|
+
dir = dirname7(dir);
|
|
4048
4064
|
}
|
|
4049
|
-
return
|
|
4065
|
+
return fallbackRoot;
|
|
4050
4066
|
}
|
|
4051
|
-
function
|
|
4067
|
+
function resolveReadablePathInsideContext(filePath) {
|
|
4052
4068
|
const cwd = contextCwd();
|
|
4053
4069
|
const abs = resolve7(cwd, filePath);
|
|
4070
|
+
if (isPathInside(cwd, abs))
|
|
4071
|
+
return abs;
|
|
4072
|
+
const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
|
|
4073
|
+
if (rebased !== undefined)
|
|
4074
|
+
return rebased;
|
|
4075
|
+
return canonicalizeExistingOrNearestAncestor(abs);
|
|
4076
|
+
}
|
|
4077
|
+
function resolvePathInsideContext(filePath) {
|
|
4078
|
+
const cwd = contextCwd();
|
|
4079
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4054
4080
|
const canonical = canonicalizeExistingOrNearestAncestor(abs);
|
|
4055
4081
|
if (!isPathInside(cwd, canonical)) {
|
|
4056
4082
|
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4057
4083
|
}
|
|
4058
4084
|
return canonical;
|
|
4059
4085
|
}
|
|
4086
|
+
function rebaseThroughCanonicalAncestor(path, cwd) {
|
|
4087
|
+
let current = path;
|
|
4088
|
+
const suffix = [];
|
|
4089
|
+
while (true) {
|
|
4090
|
+
if (existsSync10(current)) {
|
|
4091
|
+
const canonical = realpathSync5(current);
|
|
4092
|
+
if (isPathInside(cwd, canonical))
|
|
4093
|
+
return suffix.length === 0 ? canonical : join5(canonical, ...suffix);
|
|
4094
|
+
}
|
|
4095
|
+
const parent = dirname7(current);
|
|
4096
|
+
if (parent === current)
|
|
4097
|
+
return;
|
|
4098
|
+
suffix.unshift(basename3(current));
|
|
4099
|
+
current = parent;
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
function existingDirectoryInsideContext(directory, cwd) {
|
|
4103
|
+
if (!existsSync10(directory))
|
|
4104
|
+
return;
|
|
4105
|
+
const canonical = realpathSync5(directory);
|
|
4106
|
+
if (!statSync3(canonical).isDirectory())
|
|
4107
|
+
return;
|
|
4108
|
+
return isPathInside(cwd, canonical) ? canonical : undefined;
|
|
4109
|
+
}
|
|
4110
|
+
function nearestExistingDirectoryInsideContext(directory, cwd) {
|
|
4111
|
+
let current = directory;
|
|
4112
|
+
while (isPathInside(cwd, current)) {
|
|
4113
|
+
const canonical = existingDirectoryInsideContext(current, cwd);
|
|
4114
|
+
if (canonical !== undefined)
|
|
4115
|
+
return canonical;
|
|
4116
|
+
if (current === cwd)
|
|
4117
|
+
return;
|
|
4118
|
+
current = dirname7(current);
|
|
4119
|
+
}
|
|
4120
|
+
return;
|
|
4121
|
+
}
|
|
4060
4122
|
function formatServerLookupError(result) {
|
|
4061
4123
|
if (result.status === "not_installed") {
|
|
4062
4124
|
return formatNotInstalled(result);
|
|
@@ -4127,7 +4189,7 @@ function formatNotInstalled(result) {
|
|
|
4127
4189
|
].join(`
|
|
4128
4190
|
`);
|
|
4129
4191
|
}
|
|
4130
|
-
var
|
|
4192
|
+
var READ_ONLY_TOOLS = new Set([
|
|
4131
4193
|
"diagnostics",
|
|
4132
4194
|
"definition",
|
|
4133
4195
|
"references",
|
|
@@ -4136,7 +4198,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
|
|
|
4136
4198
|
"prepareRename"
|
|
4137
4199
|
]);
|
|
4138
4200
|
async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
4139
|
-
const absPath = resolvePathInsideContext(filePath);
|
|
4201
|
+
const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
|
|
4140
4202
|
if (isDirectoryPath(absPath)) {
|
|
4141
4203
|
throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
|
|
4142
4204
|
}
|
|
@@ -4151,9 +4213,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4151
4213
|
const acquireAndCall = async (allowRetry) => {
|
|
4152
4214
|
const client = await manager2.getClient(root, server2, options.signal);
|
|
4153
4215
|
try {
|
|
4154
|
-
return await fn(client, root);
|
|
4216
|
+
return await fn(client, root, absPath);
|
|
4155
4217
|
} catch (err) {
|
|
4156
|
-
if (allowRetry &&
|
|
4218
|
+
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
4157
4219
|
manager2.invalidateClient(root, server2.id, client);
|
|
4158
4220
|
return acquireAndCall(false);
|
|
4159
4221
|
}
|
|
@@ -4171,8 +4233,8 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4171
4233
|
}
|
|
4172
4234
|
|
|
4173
4235
|
// ../lsp-core/src/lsp/directory-diagnostics.ts
|
|
4174
|
-
import { existsSync as
|
|
4175
|
-
import { join as
|
|
4236
|
+
import { existsSync as existsSync11, lstatSync as lstatSync4, readdirSync as readdirSync3 } from "node:fs";
|
|
4237
|
+
import { join as join6, resolve as resolve8 } from "node:path";
|
|
4176
4238
|
|
|
4177
4239
|
// ../lsp-core/src/lsp/formatters.ts
|
|
4178
4240
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -4302,7 +4364,7 @@ function collectFilesWithExtension(dir, extension, maxFiles) {
|
|
|
4302
4364
|
for (const entry of entries) {
|
|
4303
4365
|
if (files.length >= maxFiles)
|
|
4304
4366
|
return;
|
|
4305
|
-
const fullPath =
|
|
4367
|
+
const fullPath = join6(currentDir, entry);
|
|
4306
4368
|
let stat;
|
|
4307
4369
|
try {
|
|
4308
4370
|
stat = lstatSync4(fullPath);
|
|
@@ -4328,7 +4390,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4328
4390
|
throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
|
|
4329
4391
|
}
|
|
4330
4392
|
const absDir = resolve8(options.workspaceRoot ?? contextCwd(), directory);
|
|
4331
|
-
if (!
|
|
4393
|
+
if (!existsSync11(absDir)) {
|
|
4332
4394
|
throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
|
|
4333
4395
|
}
|
|
4334
4396
|
const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
|
|
@@ -4415,7 +4477,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4415
4477
|
|
|
4416
4478
|
// ../lsp-core/src/lsp/infer-extension.ts
|
|
4417
4479
|
import { lstatSync as lstatSync5, readdirSync as readdirSync4 } from "node:fs";
|
|
4418
|
-
import { join as
|
|
4480
|
+
import { join as join7 } from "node:path";
|
|
4419
4481
|
var SKIP_DIRECTORIES2 = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
|
|
4420
4482
|
var MAX_SCAN_ENTRIES = 500;
|
|
4421
4483
|
function inferExtensionFromDirectory(directory) {
|
|
@@ -4433,7 +4495,7 @@ function inferExtensionFromDirectory(directory) {
|
|
|
4433
4495
|
for (const entry of entries) {
|
|
4434
4496
|
if (scanned >= MAX_SCAN_ENTRIES)
|
|
4435
4497
|
return;
|
|
4436
|
-
const fullPath =
|
|
4498
|
+
const fullPath = join7(dir, entry);
|
|
4437
4499
|
let stat;
|
|
4438
4500
|
try {
|
|
4439
4501
|
stat = lstatSync5(fullPath);
|
|
@@ -4608,7 +4670,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4608
4670
|
const filePath = requireString(params, "filePath");
|
|
4609
4671
|
const severity = severityFilter(params);
|
|
4610
4672
|
try {
|
|
4611
|
-
const absPath =
|
|
4673
|
+
const absPath = resolveReadablePathInsideContext(filePath);
|
|
4612
4674
|
if (isDirectoryPath(absPath)) {
|
|
4613
4675
|
const extension = inferExtensionFromDirectory(absPath);
|
|
4614
4676
|
if (!extension) {
|
|
@@ -4637,7 +4699,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4637
4699
|
};
|
|
4638
4700
|
return text(output2.output, details2);
|
|
4639
4701
|
}
|
|
4640
|
-
const result = await withLspClient(filePath, async (client) => client.diagnostics(
|
|
4702
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
|
|
4641
4703
|
if (result.transientError) {
|
|
4642
4704
|
const message = result.transientError.message;
|
|
4643
4705
|
const details2 = {
|
|
@@ -4712,7 +4774,7 @@ async function executeLspGotoDefinition(params, signal) {
|
|
|
4712
4774
|
const line = requireNumber(params, "line");
|
|
4713
4775
|
const character = requireNumber(params, "character");
|
|
4714
4776
|
try {
|
|
4715
|
-
const result = await withLspClient(filePath, async (client) => client.definition(
|
|
4777
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
|
|
4716
4778
|
const locations = !result ? [] : Array.isArray(result) ? result : [result];
|
|
4717
4779
|
const details = { filePath, line, character, locations };
|
|
4718
4780
|
if (locations.length === 0)
|
|
@@ -4737,7 +4799,7 @@ async function executeLspFindReferences(params, signal) {
|
|
|
4737
4799
|
const character = requireNumber(params, "character");
|
|
4738
4800
|
const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
|
|
4739
4801
|
try {
|
|
4740
|
-
const result = await withLspClient(filePath, async (client) => client.references(
|
|
4802
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
|
|
4741
4803
|
const references = Array.isArray(result) ? result : [];
|
|
4742
4804
|
const total = references.length;
|
|
4743
4805
|
const truncated = total > DEFAULT_MAX_REFERENCES;
|
|
@@ -4779,7 +4841,7 @@ async function executeLspPrepareRename(params, signal) {
|
|
|
4779
4841
|
const line = requireNumber(params, "line");
|
|
4780
4842
|
const character = requireNumber(params, "character");
|
|
4781
4843
|
try {
|
|
4782
|
-
const result = await withLspClient(filePath, async (client) => client.prepareRename(
|
|
4844
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
|
|
4783
4845
|
const details = { filePath, line, character, result };
|
|
4784
4846
|
return text(formatPrepareRenameResult(result), details);
|
|
4785
4847
|
} catch (error) {
|
|
@@ -4800,7 +4862,7 @@ async function executeLspRename(params, signal) {
|
|
|
4800
4862
|
const character = requireNumber(params, "character");
|
|
4801
4863
|
const newName = requireString(params, "newName");
|
|
4802
4864
|
try {
|
|
4803
|
-
const result = await withLspClient(filePath, async (client) => client.rename(
|
|
4865
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
|
|
4804
4866
|
const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
|
|
4805
4867
|
return text(formatApplyResult(result.apply), details, !result.apply.success);
|
|
4806
4868
|
} catch (error) {
|
|
@@ -4880,7 +4942,7 @@ async function executeLspSymbols(params, signal) {
|
|
|
4880
4942
|
const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
|
|
4881
4943
|
return formatSymbolsResult(filePath, scope, symbols2, limit, query);
|
|
4882
4944
|
}
|
|
4883
|
-
const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(
|
|
4945
|
+
const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
|
|
4884
4946
|
return formatSymbolsResult(filePath, scope, symbols, limit);
|
|
4885
4947
|
} catch (error) {
|
|
4886
4948
|
const query = optionalString(params, "query");
|