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
|
@@ -8,11 +8,13 @@ import { argv, execPath as execPath2, stderr } from "node:process";
|
|
|
8
8
|
import { stdin as processStdin } from "node:process";
|
|
9
9
|
|
|
10
10
|
// src/codex-hook.ts
|
|
11
|
-
import { readFileSync as
|
|
11
|
+
import { readFileSync as readFileSync10, realpathSync as realpathSync8 } from "node:fs";
|
|
12
12
|
import { homedir as homedir3 } from "node:os";
|
|
13
|
-
import { join as
|
|
13
|
+
import { join as join12, resolve as resolve12 } from "node:path";
|
|
14
14
|
|
|
15
15
|
// ../../../../lsp-daemon/dist/client.js
|
|
16
|
+
import { statSync as statSync5 } from "node:fs";
|
|
17
|
+
import { isAbsolute as isAbsolute6 } from "node:path";
|
|
16
18
|
import { connect } from "node:net";
|
|
17
19
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
18
20
|
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
@@ -42,8 +44,8 @@ import * as path from "node:path";
|
|
|
42
44
|
import { fileURLToPath } from "node:url";
|
|
43
45
|
import { statSync as statSync2 } from "node:fs";
|
|
44
46
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
45
|
-
import { existsSync as
|
|
46
|
-
import { dirname as
|
|
47
|
+
import { existsSync as existsSync11, realpathSync as realpathSync5, statSync as statSync4 } from "node:fs";
|
|
48
|
+
import { basename as basename3, dirname as dirname10, join as join5, resolve as resolve8 } from "node:path";
|
|
47
49
|
import { basename as basename2, extname } from "node:path";
|
|
48
50
|
import { resolve as resolve6 } from "node:path";
|
|
49
51
|
import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
@@ -62,32 +64,32 @@ import { createHash as createHash2 } from "node:crypto";
|
|
|
62
64
|
import { dirname as dirname5, relative as relative4, resolve as resolve4 } from "node:path";
|
|
63
65
|
import { existsSync as existsSync6, lstatSync as lstatSync4, readdirSync as readdirSync2 } from "node:fs";
|
|
64
66
|
import { dirname as dirname6, resolve as resolve5 } from "node:path";
|
|
65
|
-
import { existsSync as existsSync7,
|
|
66
|
-
import { dirname as dirname7 } from "node:path";
|
|
67
|
-
import { existsSync as existsSync8, readFileSync as
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import { existsSync as
|
|
71
|
-
import { join as
|
|
67
|
+
import { existsSync as existsSync7, realpathSync as realpathSync4 } from "node:fs";
|
|
68
|
+
import { dirname as dirname7, join as join3 } from "node:path";
|
|
69
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
70
|
+
import { dirname as dirname8 } from "node:path";
|
|
71
|
+
import { existsSync as existsSync9, readFileSync as readFileSync5 } from "node:fs";
|
|
72
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
73
|
+
import { delimiter as delimiter3, dirname as dirname9, isAbsolute as isAbsolute5, join as join4, resolve as resolve7 } from "node:path";
|
|
74
|
+
import { existsSync as existsSync12, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
|
|
75
|
+
import { join as join6, resolve as resolve9 } from "node:path";
|
|
72
76
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
73
77
|
import { lstatSync as lstatSync6, readdirSync as readdirSync4 } from "node:fs";
|
|
74
|
-
import { join as
|
|
75
|
-
import {
|
|
76
|
-
import { isAbsolute as isAbsolute5 } from "node:path";
|
|
78
|
+
import { join as join7 } from "node:path";
|
|
79
|
+
import { readFileSync as readFileSync6, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
77
80
|
|
|
78
81
|
class LspRequestContextParseError extends Error {
|
|
79
|
-
code;
|
|
80
|
-
name = "LspRequestContextParseError";
|
|
81
82
|
constructor(code, message) {
|
|
82
83
|
super(message);
|
|
83
84
|
this.code = code;
|
|
85
|
+
this.name = "LspRequestContextParseError";
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
class LspRequestContextUnavailableError extends Error {
|
|
88
|
-
name = "LspRequestContextUnavailableError";
|
|
89
90
|
constructor() {
|
|
90
91
|
super("LSP request context is required. Standalone MCP startup must install one with runWithRequestContext(createStandaloneMcpRequestContext()).");
|
|
92
|
+
this.name = "LspRequestContextUnavailableError";
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
var storage = new AsyncLocalStorage;
|
|
@@ -214,7 +216,6 @@ function isPlainRecord(value) {
|
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
class DaemonRequestError extends Error {
|
|
217
|
-
requestWritten;
|
|
218
219
|
constructor(message, requestWritten) {
|
|
219
220
|
super(message);
|
|
220
221
|
this.name = "DaemonRequestError";
|
|
@@ -237,7 +238,6 @@ class DaemonRequestCancelledError extends DaemonRequestError {
|
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
class DaemonRequestTimedOutError extends DaemonRequestError {
|
|
240
|
-
timeoutMs;
|
|
241
241
|
constructor(requestWritten, timeoutMs) {
|
|
242
242
|
super("daemon request timed out", requestWritten);
|
|
243
243
|
this.name = "DaemonRequestTimedOutError";
|
|
@@ -314,20 +314,18 @@ var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
|
|
|
314
314
|
var DAEMON_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
315
315
|
|
|
316
316
|
class InvalidRuntimeOverrideError extends Error {
|
|
317
|
-
code = "invalid_runtime_override";
|
|
318
|
-
reason;
|
|
319
317
|
constructor(reason, message) {
|
|
320
318
|
super(message);
|
|
319
|
+
this.code = "invalid_runtime_override";
|
|
321
320
|
this.name = "InvalidRuntimeOverrideError";
|
|
322
321
|
this.reason = reason;
|
|
323
322
|
}
|
|
324
323
|
}
|
|
325
324
|
|
|
326
325
|
class InvalidDaemonVersionError extends Error {
|
|
327
|
-
code = "invalid_daemon_version";
|
|
328
|
-
version;
|
|
329
326
|
constructor(version) {
|
|
330
327
|
super("LSP daemon version must match [A-Za-z0-9][A-Za-z0-9._+-]{0,127}");
|
|
328
|
+
this.code = "invalid_daemon_version";
|
|
331
329
|
this.name = "InvalidDaemonVersionError";
|
|
332
330
|
this.version = version;
|
|
333
331
|
}
|
|
@@ -371,10 +369,9 @@ var requireFromHere = createRequire(import.meta.url);
|
|
|
371
369
|
var MAX_SOCKET_PATH_LENGTH = 100;
|
|
372
370
|
|
|
373
371
|
class InvalidDaemonDirectoryError extends Error {
|
|
374
|
-
code = "invalid_daemon_directory";
|
|
375
|
-
directory;
|
|
376
372
|
constructor(directory) {
|
|
377
373
|
super(`${OMO_LSP_DAEMON_DIR} must be an absolute path`);
|
|
374
|
+
this.code = "invalid_daemon_directory";
|
|
378
375
|
this.name = "InvalidDaemonDirectoryError";
|
|
379
376
|
this.directory = directory;
|
|
380
377
|
}
|
|
@@ -565,7 +562,8 @@ function spawnDaemonProcess(paths) {
|
|
|
565
562
|
try {
|
|
566
563
|
const child = spawn(resolveDaemonNodeExecutable(), [paths.cliPath, "daemon"], {
|
|
567
564
|
detached: true,
|
|
568
|
-
stdio: ["ignore", logFd, logFd]
|
|
565
|
+
stdio: ["ignore", logFd, logFd],
|
|
566
|
+
windowsHide: true
|
|
569
567
|
});
|
|
570
568
|
child.once("spawn", () => closeSync2(logFd));
|
|
571
569
|
child.once("error", (error) => {
|
|
@@ -686,22 +684,15 @@ function effectiveExtension(filePath) {
|
|
|
686
684
|
}
|
|
687
685
|
|
|
688
686
|
class LspConnectionClosedError extends Error {
|
|
689
|
-
serverId;
|
|
690
|
-
root;
|
|
691
|
-
name = "LspConnectionClosedError";
|
|
692
687
|
constructor(serverId, root, message) {
|
|
693
688
|
super(message ?? `LSP connection closed for ${serverId} at ${root}`);
|
|
694
689
|
this.serverId = serverId;
|
|
695
690
|
this.root = root;
|
|
691
|
+
this.name = "LspConnectionClosedError";
|
|
696
692
|
}
|
|
697
693
|
}
|
|
698
694
|
|
|
699
695
|
class LspProcessExitedError extends Error {
|
|
700
|
-
serverId;
|
|
701
|
-
root;
|
|
702
|
-
exitCode;
|
|
703
|
-
stderrTail;
|
|
704
|
-
name = "LspProcessExitedError";
|
|
705
696
|
constructor(serverId, root, exitCode, stderrTail) {
|
|
706
697
|
const stderrSuffix = stderrTail ? `
|
|
707
698
|
stderr tail: ${stderrTail}` : "";
|
|
@@ -710,46 +701,49 @@ stderr tail: ${stderrTail}` : "";
|
|
|
710
701
|
this.root = root;
|
|
711
702
|
this.exitCode = exitCode;
|
|
712
703
|
this.stderrTail = stderrTail;
|
|
704
|
+
this.name = "LspProcessExitedError";
|
|
713
705
|
}
|
|
714
706
|
}
|
|
715
707
|
|
|
716
708
|
class LspRequestTimeoutError extends Error {
|
|
717
|
-
method;
|
|
718
|
-
stderrTail;
|
|
719
|
-
name = "LspRequestTimeoutError";
|
|
720
709
|
constructor(method, stderrTail) {
|
|
721
710
|
const stderrSuffix = stderrTail ? `
|
|
722
711
|
recent stderr: ${stderrTail}` : "";
|
|
723
712
|
super(`LSP request timeout (method: ${method})${stderrSuffix}`);
|
|
724
713
|
this.method = method;
|
|
725
714
|
this.stderrTail = stderrTail;
|
|
715
|
+
this.name = "LspRequestTimeoutError";
|
|
726
716
|
}
|
|
727
717
|
}
|
|
728
718
|
|
|
729
719
|
class LspInvalidPathError extends Error {
|
|
730
|
-
|
|
720
|
+
constructor() {
|
|
721
|
+
super(...arguments);
|
|
722
|
+
this.name = "LspInvalidPathError";
|
|
723
|
+
}
|
|
731
724
|
}
|
|
732
725
|
|
|
733
726
|
class LspServerLookupError extends Error {
|
|
734
|
-
lookup;
|
|
735
|
-
name = "LspServerLookupError";
|
|
736
727
|
constructor(message, lookup) {
|
|
737
728
|
super(message);
|
|
738
729
|
this.lookup = lookup;
|
|
730
|
+
this.name = "LspServerLookupError";
|
|
739
731
|
}
|
|
740
732
|
}
|
|
741
733
|
|
|
742
734
|
class LspServerInitializingError extends Error {
|
|
743
|
-
originalError;
|
|
744
|
-
name = "LspServerInitializingError";
|
|
745
735
|
constructor(originalError) {
|
|
746
736
|
super(`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`);
|
|
747
737
|
this.originalError = originalError;
|
|
738
|
+
this.name = "LspServerInitializingError";
|
|
748
739
|
}
|
|
749
740
|
}
|
|
750
741
|
|
|
751
742
|
class LspProcessSpawnError extends Error {
|
|
752
|
-
|
|
743
|
+
constructor() {
|
|
744
|
+
super(...arguments);
|
|
745
|
+
this.name = "LspProcessSpawnError";
|
|
746
|
+
}
|
|
753
747
|
}
|
|
754
748
|
function isLspDeadConnectionError(err) {
|
|
755
749
|
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
@@ -769,6 +763,7 @@ var DEFAULT_MAX_DIRECTORY_FILES = 50;
|
|
|
769
763
|
var REQUEST_TIMEOUT_MS = 15000;
|
|
770
764
|
var INIT_TIMEOUT_MS = 60000;
|
|
771
765
|
var IDLE_TIMEOUT_MS = 5 * 60000;
|
|
766
|
+
var MAX_RESIDENT_CLIENTS = 6;
|
|
772
767
|
var REAPER_INTERVAL_MS = 60000;
|
|
773
768
|
var STOP_HARD_KILL_TIMEOUT_MS = 5000;
|
|
774
769
|
var STOP_SIGKILL_GRACE_MS = 1000;
|
|
@@ -781,20 +776,31 @@ var METHOD_NOT_FOUND = -32601;
|
|
|
781
776
|
var INTERNAL_ERROR = -32603;
|
|
782
777
|
|
|
783
778
|
class JsonRpcConnection {
|
|
784
|
-
reader;
|
|
785
|
-
writer;
|
|
786
|
-
pendingRequests = new Map;
|
|
787
|
-
notificationHandlers = new Map;
|
|
788
|
-
requestHandlers = new Map;
|
|
789
|
-
closeHandlers = [];
|
|
790
|
-
errorHandlers = [];
|
|
791
|
-
inputBuffer = Buffer.alloc(0);
|
|
792
|
-
nextRequestId = 1;
|
|
793
|
-
listening = false;
|
|
794
|
-
disposed = false;
|
|
795
779
|
constructor(reader, writer) {
|
|
796
780
|
this.reader = reader;
|
|
797
781
|
this.writer = writer;
|
|
782
|
+
this.pendingRequests = new Map;
|
|
783
|
+
this.notificationHandlers = new Map;
|
|
784
|
+
this.requestHandlers = new Map;
|
|
785
|
+
this.closeHandlers = [];
|
|
786
|
+
this.errorHandlers = [];
|
|
787
|
+
this.inputBuffer = Buffer.alloc(0);
|
|
788
|
+
this.nextRequestId = 1;
|
|
789
|
+
this.listening = false;
|
|
790
|
+
this.disposed = false;
|
|
791
|
+
this.handleData = (chunk) => {
|
|
792
|
+
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
793
|
+
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
794
|
+
this.drainInputBuffer();
|
|
795
|
+
};
|
|
796
|
+
this.handleClose = () => {
|
|
797
|
+
for (const handler of this.closeHandlers) {
|
|
798
|
+
handler();
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
this.handleStreamError = (error) => {
|
|
802
|
+
this.emitError(error);
|
|
803
|
+
};
|
|
798
804
|
}
|
|
799
805
|
listen() {
|
|
800
806
|
if (this.listening)
|
|
@@ -915,19 +921,6 @@ class JsonRpcConnection {
|
|
|
915
921
|
this.notificationHandlers.clear();
|
|
916
922
|
this.requestHandlers.clear();
|
|
917
923
|
}
|
|
918
|
-
handleData = (chunk) => {
|
|
919
|
-
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
920
|
-
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
921
|
-
this.drainInputBuffer();
|
|
922
|
-
};
|
|
923
|
-
handleClose = () => {
|
|
924
|
-
for (const handler of this.closeHandlers) {
|
|
925
|
-
handler();
|
|
926
|
-
}
|
|
927
|
-
};
|
|
928
|
-
handleStreamError = (error) => {
|
|
929
|
-
this.emitError(error);
|
|
930
|
-
};
|
|
931
924
|
drainInputBuffer() {
|
|
932
925
|
while (true) {
|
|
933
926
|
const headerEnd = this.inputBuffer.indexOf(HEADER_SEPARATOR2);
|
|
@@ -1267,31 +1260,26 @@ function isPosition(value) {
|
|
|
1267
1260
|
}
|
|
1268
1261
|
|
|
1269
1262
|
class LspClientNotStartedError extends Error {
|
|
1270
|
-
serverId;
|
|
1271
|
-
root;
|
|
1272
|
-
name = "LspClientNotStartedError";
|
|
1273
1263
|
constructor(serverId, root) {
|
|
1274
1264
|
super("LSP client not started");
|
|
1275
1265
|
this.serverId = serverId;
|
|
1276
1266
|
this.root = root;
|
|
1267
|
+
this.name = "LspClientNotStartedError";
|
|
1277
1268
|
}
|
|
1278
1269
|
}
|
|
1279
1270
|
|
|
1280
1271
|
class LspClientTransport {
|
|
1281
|
-
root;
|
|
1282
|
-
server;
|
|
1283
|
-
proc = null;
|
|
1284
|
-
connection = null;
|
|
1285
|
-
stderrBuffer = [];
|
|
1286
|
-
processExited = false;
|
|
1287
|
-
diagnosticsStore = new Map;
|
|
1288
|
-
requestTimeoutMs;
|
|
1289
|
-
initializeTimeoutMs;
|
|
1290
|
-
workspaceApplyEditHandler = null;
|
|
1291
|
-
diagnosticPullSupported = false;
|
|
1292
1272
|
constructor(root, server2, timeouts = {}) {
|
|
1293
1273
|
this.root = root;
|
|
1294
1274
|
this.server = server2;
|
|
1275
|
+
this.proc = null;
|
|
1276
|
+
this.connection = null;
|
|
1277
|
+
this.stderrBuffer = [];
|
|
1278
|
+
this.processExited = false;
|
|
1279
|
+
this.diagnosticsStore = new Map;
|
|
1280
|
+
this.workspaceApplyEditHandler = null;
|
|
1281
|
+
this.diagnosticPullSupported = false;
|
|
1282
|
+
this.documentFormattingSupported = false;
|
|
1295
1283
|
this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
1296
1284
|
this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
1297
1285
|
}
|
|
@@ -1313,6 +1301,12 @@ class LspClientTransport {
|
|
|
1313
1301
|
isDiagnosticPullSupported() {
|
|
1314
1302
|
return this.diagnosticPullSupported;
|
|
1315
1303
|
}
|
|
1304
|
+
setDocumentFormattingSupported(supported) {
|
|
1305
|
+
this.documentFormattingSupported = supported;
|
|
1306
|
+
}
|
|
1307
|
+
isDocumentFormattingSupported() {
|
|
1308
|
+
return this.documentFormattingSupported;
|
|
1309
|
+
}
|
|
1316
1310
|
handlePublishDiagnostics(params) {
|
|
1317
1311
|
this.diagnosticsStore.set(params.uri, [...params.diagnostics]);
|
|
1318
1312
|
}
|
|
@@ -1524,6 +1518,14 @@ function supportsDiagnosticPull(capabilities) {
|
|
|
1524
1518
|
return false;
|
|
1525
1519
|
return Object.hasOwn(capabilities, "diagnosticProvider");
|
|
1526
1520
|
}
|
|
1521
|
+
function supportsDocumentFormatting(capabilities) {
|
|
1522
|
+
if (capabilities === undefined)
|
|
1523
|
+
return false;
|
|
1524
|
+
const provider = capabilities.documentFormattingProvider;
|
|
1525
|
+
if (provider === undefined || provider === null || provider === false)
|
|
1526
|
+
return false;
|
|
1527
|
+
return provider === true || typeof provider === "object";
|
|
1528
|
+
}
|
|
1527
1529
|
|
|
1528
1530
|
class LspClientConnection extends LspClientTransport {
|
|
1529
1531
|
async initialize() {
|
|
@@ -1540,6 +1542,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
1540
1542
|
references: {},
|
|
1541
1543
|
documentSymbol: { hierarchicalDocumentSymbolSupport: true },
|
|
1542
1544
|
publishDiagnostics: {},
|
|
1545
|
+
formatting: { dynamicRegistration: false },
|
|
1543
1546
|
rename: {
|
|
1544
1547
|
prepareSupport: true,
|
|
1545
1548
|
prepareSupportDefaultBehavior: 1
|
|
@@ -1581,6 +1584,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
1581
1584
|
initializationOptions: this.server.initialization
|
|
1582
1585
|
}, { timeoutMs: this.initializeTimeoutMs });
|
|
1583
1586
|
this.setDiagnosticPullSupported(supportsDiagnosticPull(result?.capabilities));
|
|
1587
|
+
this.setDocumentFormattingSupported(supportsDocumentFormatting(result?.capabilities));
|
|
1584
1588
|
await this.sendNotification("initialized", {});
|
|
1585
1589
|
await this.sendNotification("workspace/didChangeConfiguration", {
|
|
1586
1590
|
settings: { json: { validate: { enable: true } } }
|
|
@@ -1777,16 +1781,12 @@ function movedPath(candidate, oldPath, newPath) {
|
|
|
1777
1781
|
}
|
|
1778
1782
|
|
|
1779
1783
|
class WorkspaceDocumentState {
|
|
1780
|
-
sendNotification;
|
|
1781
|
-
clearDiagnostics;
|
|
1782
|
-
openDocuments = new Map;
|
|
1783
|
-
openByUri = new Map;
|
|
1784
|
-
openPromises = new Map;
|
|
1785
|
-
now;
|
|
1786
|
-
versionlessPublishQuiescenceMs;
|
|
1787
1784
|
constructor(sendNotification, clearDiagnostics, options = {}) {
|
|
1788
1785
|
this.sendNotification = sendNotification;
|
|
1789
1786
|
this.clearDiagnostics = clearDiagnostics;
|
|
1787
|
+
this.openDocuments = new Map;
|
|
1788
|
+
this.openByUri = new Map;
|
|
1789
|
+
this.openPromises = new Map;
|
|
1790
1790
|
this.now = options.now ?? (() => Date.now());
|
|
1791
1791
|
this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
|
|
1792
1792
|
}
|
|
@@ -2040,13 +2040,11 @@ function workspaceApplyEditConcurrentFailureReason(phase) {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
|
|
2042
2042
|
class WorkspaceEditPathError extends Error {
|
|
2043
|
-
path;
|
|
2044
|
-
detail;
|
|
2045
|
-
name = "WorkspaceEditPathError";
|
|
2046
2043
|
constructor(path2, detail) {
|
|
2047
2044
|
super(`${detail}: ${path2}`);
|
|
2048
2045
|
this.path = path2;
|
|
2049
2046
|
this.detail = detail;
|
|
2047
|
+
this.name = "WorkspaceEditPathError";
|
|
2050
2048
|
}
|
|
2051
2049
|
}
|
|
2052
2050
|
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
@@ -2332,13 +2330,11 @@ function canonicalFingerprint(operations) {
|
|
|
2332
2330
|
}
|
|
2333
2331
|
|
|
2334
2332
|
class WorkspaceEditValidationError extends Error {
|
|
2335
|
-
changeIndex;
|
|
2336
|
-
detail;
|
|
2337
|
-
name = "WorkspaceEditValidationError";
|
|
2338
2333
|
constructor(changeIndex, detail) {
|
|
2339
2334
|
super(`change ${changeIndex}: ${detail}`);
|
|
2340
2335
|
this.changeIndex = changeIndex;
|
|
2341
2336
|
this.detail = detail;
|
|
2337
|
+
this.name = "WorkspaceEditValidationError";
|
|
2342
2338
|
}
|
|
2343
2339
|
}
|
|
2344
2340
|
function isRecord3(value) {
|
|
@@ -2820,10 +2816,9 @@ function simulateDelete(operation, virtual) {
|
|
|
2820
2816
|
}
|
|
2821
2817
|
|
|
2822
2818
|
class WorkspaceSnapshotBuilder {
|
|
2823
|
-
workspaceRoot;
|
|
2824
|
-
snapshots = new Map;
|
|
2825
2819
|
constructor(workspaceRoot) {
|
|
2826
2820
|
this.workspaceRoot = workspaceRoot;
|
|
2821
|
+
this.snapshots = new Map;
|
|
2827
2822
|
}
|
|
2828
2823
|
build(operations) {
|
|
2829
2824
|
this.add(this.workspaceRoot, false);
|
|
@@ -2866,8 +2861,10 @@ function snapshotOperations(operations, workspaceRoot) {
|
|
|
2866
2861
|
}
|
|
2867
2862
|
|
|
2868
2863
|
class PlanPathIndex {
|
|
2869
|
-
|
|
2870
|
-
|
|
2864
|
+
constructor() {
|
|
2865
|
+
this.firstChangeByPath = new Map;
|
|
2866
|
+
this.reportedPathByCanonical = new Map;
|
|
2867
|
+
}
|
|
2871
2868
|
build(operations) {
|
|
2872
2869
|
for (const operation of operations) {
|
|
2873
2870
|
switch (operation.kind) {
|
|
@@ -2954,14 +2951,11 @@ function isRecord4(value) {
|
|
|
2954
2951
|
}
|
|
2955
2952
|
|
|
2956
2953
|
class WorkspaceMutationController {
|
|
2957
|
-
workspaceRoot;
|
|
2958
|
-
documents;
|
|
2959
|
-
activeLease = null;
|
|
2960
|
-
nextLeaseId = 1;
|
|
2961
|
-
io;
|
|
2962
2954
|
constructor(workspaceRoot, documents) {
|
|
2963
2955
|
this.workspaceRoot = workspaceRoot;
|
|
2964
2956
|
this.documents = documents;
|
|
2957
|
+
this.activeLease = null;
|
|
2958
|
+
this.nextLeaseId = 1;
|
|
2965
2959
|
}
|
|
2966
2960
|
setIo(io) {
|
|
2967
2961
|
this.io = io;
|
|
@@ -3072,12 +3066,9 @@ var DIAGNOSTICS_FRESHNESS_TIMEOUT_MS = 3000;
|
|
|
3072
3066
|
var VERSIONLESS_PUBLISH_QUIESCENCE_MS = 250;
|
|
3073
3067
|
|
|
3074
3068
|
class LspClient extends LspClientConnection {
|
|
3075
|
-
diagnosticPullErrors = [];
|
|
3076
|
-
documents;
|
|
3077
|
-
workspaceMutations;
|
|
3078
|
-
diagnosticsFreshnessTimeoutMs;
|
|
3079
3069
|
constructor(root, server2, options = {}) {
|
|
3080
3070
|
super(root, server2, options);
|
|
3071
|
+
this.diagnosticPullErrors = [];
|
|
3081
3072
|
this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
|
|
3082
3073
|
this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
|
|
3083
3074
|
versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
|
|
@@ -3132,6 +3123,18 @@ class LspClient extends LspClientConnection {
|
|
|
3132
3123
|
textDocument: { uri: pathToFileURL3(absPath).href }
|
|
3133
3124
|
}, options);
|
|
3134
3125
|
}
|
|
3126
|
+
async formatDocument(filePath, options, signal) {
|
|
3127
|
+
if (!this.isDocumentFormattingSupported())
|
|
3128
|
+
return null;
|
|
3129
|
+
const absPath = this.resolveWorkspacePath(filePath);
|
|
3130
|
+
await this.openFile(absPath);
|
|
3131
|
+
const requestOptions = signal === undefined ? {} : { signal };
|
|
3132
|
+
const edits = await this.sendRequest("textDocument/formatting", {
|
|
3133
|
+
textDocument: { uri: pathToFileURL3(absPath).href },
|
|
3134
|
+
options
|
|
3135
|
+
}, requestOptions);
|
|
3136
|
+
return edits ?? [];
|
|
3137
|
+
}
|
|
3135
3138
|
async workspaceSymbols(query, signal) {
|
|
3136
3139
|
const options = signal === undefined ? {} : { signal };
|
|
3137
3140
|
return this.sendRequest("workspace/symbol", { query }, options);
|
|
@@ -3373,18 +3376,14 @@ function awaitWithSignal2(promise, signal) {
|
|
|
3373
3376
|
}
|
|
3374
3377
|
|
|
3375
3378
|
class LspManager {
|
|
3376
|
-
clients = new Map;
|
|
3377
|
-
reaperHandle = null;
|
|
3378
|
-
signalDisposer = null;
|
|
3379
|
-
disposed = false;
|
|
3380
|
-
idleTimeoutMs;
|
|
3381
|
-
initTimeoutMs;
|
|
3382
|
-
reaperIntervalMs;
|
|
3383
|
-
clientFactory;
|
|
3384
|
-
now;
|
|
3385
3379
|
constructor(options = {}) {
|
|
3380
|
+
this.clients = new Map;
|
|
3381
|
+
this.reaperHandle = null;
|
|
3382
|
+
this.signalDisposer = null;
|
|
3383
|
+
this.disposed = false;
|
|
3386
3384
|
this.idleTimeoutMs = options.idleTimeoutMs ?? IDLE_TIMEOUT_MS;
|
|
3387
3385
|
this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
3386
|
+
this.maxResidentClients = options.maxResidentClients ?? MAX_RESIDENT_CLIENTS;
|
|
3388
3387
|
this.reaperIntervalMs = options.reaperIntervalMs ?? REAPER_INTERVAL_MS;
|
|
3389
3388
|
this.clientFactory = options.clientFactory ?? ((root, server2) => new LspClient(root, server2));
|
|
3390
3389
|
this.now = options.now ?? (() => Date.now());
|
|
@@ -3418,6 +3417,26 @@ class LspManager {
|
|
|
3418
3417
|
}
|
|
3419
3418
|
}
|
|
3420
3419
|
}
|
|
3420
|
+
evictForAdmission() {
|
|
3421
|
+
while (this.clients.size >= this.maxResidentClients) {
|
|
3422
|
+
const victim = this.leastRecentlyUsedIdleClient();
|
|
3423
|
+
if (!victim)
|
|
3424
|
+
return;
|
|
3425
|
+
this.clients.delete(victim.key);
|
|
3426
|
+
stopClientBestEffort(victim.managed.client);
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
leastRecentlyUsedIdleClient() {
|
|
3430
|
+
let candidate = null;
|
|
3431
|
+
for (const [key, managed] of this.clients) {
|
|
3432
|
+
if (managed.refCount > 0 || managed.pendingWaiters > 0 || managed.isInitializing)
|
|
3433
|
+
continue;
|
|
3434
|
+
if (candidate === null || managed.lastUsedAt < candidate.managed.lastUsedAt) {
|
|
3435
|
+
candidate = { key, managed };
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
return candidate;
|
|
3439
|
+
}
|
|
3421
3440
|
async tryDeleteIfOrphaned(key, managed) {
|
|
3422
3441
|
if (managed.refCount === 0 && managed.pendingWaiters === 0 && !managed.isInitializing && this.clients.get(key) === managed) {
|
|
3423
3442
|
this.clients.delete(key);
|
|
@@ -3464,6 +3483,7 @@ class LspManager {
|
|
|
3464
3483
|
managed.lastUsedAt = this.now();
|
|
3465
3484
|
return managed.client;
|
|
3466
3485
|
}
|
|
3486
|
+
this.evictForAdmission();
|
|
3467
3487
|
const client = this.clientFactory(root, server2);
|
|
3468
3488
|
const initStartedAt = this.now();
|
|
3469
3489
|
const initPromise = (async () => {
|
|
@@ -3526,6 +3546,7 @@ class LspManager {
|
|
|
3526
3546
|
const key = this.getKey(root, server2.id);
|
|
3527
3547
|
if (this.clients.has(key))
|
|
3528
3548
|
return;
|
|
3549
|
+
this.evictForAdmission();
|
|
3529
3550
|
const client = this.clientFactory(root, server2);
|
|
3530
3551
|
const initStartedAt = this.now();
|
|
3531
3552
|
const initPromise = (async () => {
|
|
@@ -3606,49 +3627,34 @@ function getLspManager() {
|
|
|
3606
3627
|
}
|
|
3607
3628
|
return _defaultInstance;
|
|
3608
3629
|
}
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3630
|
+
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
3631
|
+
function findWorkspaceRootOutsideContext(directory) {
|
|
3632
|
+
const marked = nearestMarkedAncestor(directory);
|
|
3633
|
+
if (marked !== undefined)
|
|
3634
|
+
return marked;
|
|
3635
|
+
return realpathSync4(nearestExistingAncestor(directory));
|
|
3636
|
+
}
|
|
3637
|
+
function nearestMarkedAncestor(directory) {
|
|
3638
|
+
let current = directory;
|
|
3639
|
+
for (;; ) {
|
|
3640
|
+
if (existsSync7(current) && WORKSPACE_MARKERS.some((marker) => existsSync7(join3(current, marker)))) {
|
|
3641
|
+
return realpathSync4(current);
|
|
3642
|
+
}
|
|
3643
|
+
const parent = dirname7(current);
|
|
3644
|
+
if (parent === current)
|
|
3645
|
+
return;
|
|
3646
|
+
current = parent;
|
|
3621
3647
|
}
|
|
3622
3648
|
}
|
|
3623
|
-
function
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
}
|
|
3631
|
-
|
|
3632
|
-
return value === "declined" || value === "allowed";
|
|
3633
|
-
}
|
|
3634
|
-
function writeInstallDecisions(decisions) {
|
|
3635
|
-
const path2 = getInstallDecisionsPath();
|
|
3636
|
-
mkdirSync3(dirname7(path2), { recursive: true });
|
|
3637
|
-
const tmpPath = `${path2}.tmp`;
|
|
3638
|
-
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
3639
|
-
`, "utf8");
|
|
3640
|
-
renameSync2(tmpPath, path2);
|
|
3641
|
-
}
|
|
3642
|
-
function isInstallDecisions(value) {
|
|
3643
|
-
return isRecord5(value) && Object.values(value).every(isInstallDecisionRecord);
|
|
3644
|
-
}
|
|
3645
|
-
function isInstallDecisionRecord(value) {
|
|
3646
|
-
if (!isRecord5(value))
|
|
3647
|
-
return false;
|
|
3648
|
-
return isInstallDecision(value["decision"]) && typeof value["decidedAt"] === "string";
|
|
3649
|
-
}
|
|
3650
|
-
function isRecord5(value) {
|
|
3651
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3649
|
+
function nearestExistingAncestor(directory) {
|
|
3650
|
+
let current = directory;
|
|
3651
|
+
while (!existsSync7(current)) {
|
|
3652
|
+
const parent = dirname7(current);
|
|
3653
|
+
if (parent === current)
|
|
3654
|
+
return current;
|
|
3655
|
+
current = parent;
|
|
3656
|
+
}
|
|
3657
|
+
return current;
|
|
3652
3658
|
}
|
|
3653
3659
|
var LSP_INSTALL_HINTS = {
|
|
3654
3660
|
typescript: "npm install -g typescript-language-server typescript",
|
|
@@ -3694,6 +3700,26 @@ var LSP_INSTALL_HINTS = {
|
|
|
3694
3700
|
julials: `julia -e 'using Pkg; Pkg.add("LanguageServer")'`,
|
|
3695
3701
|
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"
|
|
3696
3702
|
};
|
|
3703
|
+
var LSP_LOCAL_INSTALL_HINTS = {
|
|
3704
|
+
typescript: "bun add -d typescript-language-server typescript",
|
|
3705
|
+
vue: "bun add -d @vue/language-server",
|
|
3706
|
+
eslint: "bun add -d vscode-langservers-extracted",
|
|
3707
|
+
oxlint: "bun add -d oxlint",
|
|
3708
|
+
biome: "bun add -d @biomejs/biome",
|
|
3709
|
+
svelte: "bun add -d svelte-language-server",
|
|
3710
|
+
astro: "bun add -d @astrojs/language-server",
|
|
3711
|
+
bash: "bun add -d bash-language-server",
|
|
3712
|
+
"bash-ls": "bun add -d bash-language-server",
|
|
3713
|
+
"yaml-ls": "bun add -d yaml-language-server",
|
|
3714
|
+
php: "bun add -d intelephense",
|
|
3715
|
+
prisma: "bun add -d prisma",
|
|
3716
|
+
dockerfile: "bun add -d dockerfile-language-server-nodejs",
|
|
3717
|
+
pyright: "uv add --dev pyright",
|
|
3718
|
+
basedpyright: "uv add --dev basedpyright",
|
|
3719
|
+
ruff: "uv add --dev ruff",
|
|
3720
|
+
ty: "uv add --dev ty",
|
|
3721
|
+
"ruby-lsp": "bundle add ruby-lsp --group development"
|
|
3722
|
+
};
|
|
3697
3723
|
var BUILTIN_SERVERS = {
|
|
3698
3724
|
typescript: {
|
|
3699
3725
|
command: ["typescript-language-server", "--stdio"],
|
|
@@ -3795,6 +3821,50 @@ var BUILTIN_SERVERS = {
|
|
|
3795
3821
|
extensions: [".razor", ".cshtml"]
|
|
3796
3822
|
}
|
|
3797
3823
|
};
|
|
3824
|
+
function getInstallDecisionsPath() {
|
|
3825
|
+
return lspRequestContext().installDecisionsPath;
|
|
3826
|
+
}
|
|
3827
|
+
function loadInstallDecisions() {
|
|
3828
|
+
const path2 = getInstallDecisionsPath();
|
|
3829
|
+
if (!existsSync8(path2))
|
|
3830
|
+
return {};
|
|
3831
|
+
try {
|
|
3832
|
+
const parsed = JSON.parse(readFileSync4(path2, "utf8"));
|
|
3833
|
+
return isInstallDecisions(parsed) ? parsed : {};
|
|
3834
|
+
} catch {
|
|
3835
|
+
return {};
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3838
|
+
function loadInstallDecision(serverId) {
|
|
3839
|
+
return loadInstallDecisions()[serverId];
|
|
3840
|
+
}
|
|
3841
|
+
function recordInstallDecision(serverId, decision, decidedAt = new Date().toISOString()) {
|
|
3842
|
+
const decisions = loadInstallDecisions();
|
|
3843
|
+
decisions[serverId] = { decision, decidedAt };
|
|
3844
|
+
writeInstallDecisions(decisions);
|
|
3845
|
+
}
|
|
3846
|
+
function isInstallDecision(value) {
|
|
3847
|
+
return value === "declined" || value === "allowed";
|
|
3848
|
+
}
|
|
3849
|
+
function writeInstallDecisions(decisions) {
|
|
3850
|
+
const path2 = getInstallDecisionsPath();
|
|
3851
|
+
mkdirSync3(dirname8(path2), { recursive: true });
|
|
3852
|
+
const tmpPath = `${path2}.tmp`;
|
|
3853
|
+
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
3854
|
+
`, "utf8");
|
|
3855
|
+
renameSync2(tmpPath, path2);
|
|
3856
|
+
}
|
|
3857
|
+
function isInstallDecisions(value) {
|
|
3858
|
+
return isRecord5(value) && Object.values(value).every(isInstallDecisionRecord);
|
|
3859
|
+
}
|
|
3860
|
+
function isInstallDecisionRecord(value) {
|
|
3861
|
+
if (!isRecord5(value))
|
|
3862
|
+
return false;
|
|
3863
|
+
return isInstallDecision(value["decision"]) && typeof value["decidedAt"] === "string";
|
|
3864
|
+
}
|
|
3865
|
+
function isRecord5(value) {
|
|
3866
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3867
|
+
}
|
|
3798
3868
|
function getProjectConfigPaths() {
|
|
3799
3869
|
return lspRequestContext().projectConfigPaths;
|
|
3800
3870
|
}
|
|
@@ -3802,7 +3872,7 @@ function getUserConfigPath() {
|
|
|
3802
3872
|
return lspRequestContext().userConfigPath;
|
|
3803
3873
|
}
|
|
3804
3874
|
function loadJsonFile(path2) {
|
|
3805
|
-
if (!
|
|
3875
|
+
if (!existsSync9(path2))
|
|
3806
3876
|
return null;
|
|
3807
3877
|
try {
|
|
3808
3878
|
const parsed = JSON.parse(readFileSync5(path2, "utf-8"));
|
|
@@ -3988,50 +4058,151 @@ function getDisabledServerIds() {
|
|
|
3988
4058
|
}
|
|
3989
4059
|
return disabled;
|
|
3990
4060
|
}
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4061
|
+
var LOCAL_BIN_RULES = [
|
|
4062
|
+
{
|
|
4063
|
+
markers: ["package.json", "bun.lock", "bun.lockb", "package-lock.json", "yarn.lock", "pnpm-lock.yaml"],
|
|
4064
|
+
binDirs: [join4("node_modules", ".bin")]
|
|
4065
|
+
},
|
|
4066
|
+
{
|
|
4067
|
+
markers: [
|
|
4068
|
+
"pyproject.toml",
|
|
4069
|
+
"ty.toml",
|
|
4070
|
+
"requirements.txt",
|
|
4071
|
+
"setup.py",
|
|
4072
|
+
"setup.cfg",
|
|
4073
|
+
"Pipfile",
|
|
4074
|
+
"pyrightconfig.json",
|
|
4075
|
+
"ruff.toml",
|
|
4076
|
+
".ruff.toml"
|
|
4077
|
+
],
|
|
4078
|
+
binDirs: [
|
|
4079
|
+
join4(".venv", "bin"),
|
|
4080
|
+
join4(".venv", "Scripts"),
|
|
4081
|
+
join4("venv", "bin"),
|
|
4082
|
+
join4("venv", "Scripts"),
|
|
4083
|
+
join4(".env", "bin"),
|
|
4084
|
+
join4(".env", "Scripts")
|
|
4085
|
+
]
|
|
4086
|
+
},
|
|
4087
|
+
{
|
|
4088
|
+
markers: ["Gemfile", "Gemfile.lock"],
|
|
4089
|
+
binDirs: [join4("vendor", "bundle", "bin"), "bin"]
|
|
4090
|
+
},
|
|
4091
|
+
{
|
|
4092
|
+
markers: ["go.mod", "go.sum", "go.work"],
|
|
4093
|
+
binDirs: ["bin"]
|
|
4000
4094
|
}
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4095
|
+
];
|
|
4096
|
+
var resolutionCache = new Map;
|
|
4097
|
+
var probeCount = 0;
|
|
4098
|
+
function probe(path2) {
|
|
4099
|
+
probeCount += 1;
|
|
4100
|
+
return existsSync10(path2);
|
|
4101
|
+
}
|
|
4102
|
+
function executableSuffixes(platform, pathExt) {
|
|
4103
|
+
if (platform !== "win32")
|
|
4104
|
+
return [""];
|
|
4105
|
+
const configured = pathExt ?? process.env["PATHEXT"] ?? "";
|
|
4106
|
+
const systemExts = configured.split(";").filter((entry) => entry.length > 0).map((entry) => entry.toLowerCase());
|
|
4107
|
+
return [...new Set(["", ...systemExts, ".exe", ".cmd", ".bat", ".ps1"])];
|
|
4108
|
+
}
|
|
4109
|
+
function probeWithSuffixes(directory, command, suffixes) {
|
|
4110
|
+
for (const suffix of suffixes) {
|
|
4111
|
+
const candidate = join4(directory, command + suffix);
|
|
4112
|
+
if (probe(candidate))
|
|
4113
|
+
return candidate;
|
|
4114
|
+
}
|
|
4115
|
+
return null;
|
|
4116
|
+
}
|
|
4117
|
+
function resolveLocal(command, workingDirectory, suffixes, stopAt) {
|
|
4118
|
+
const boundary = stopAt === undefined ? undefined : resolve7(stopAt);
|
|
4119
|
+
let current = resolve7(workingDirectory);
|
|
4120
|
+
while (true) {
|
|
4121
|
+
for (const rule of LOCAL_BIN_RULES) {
|
|
4122
|
+
if (!rule.markers.some((marker) => probe(join4(current, marker))))
|
|
4123
|
+
continue;
|
|
4124
|
+
for (const binDir of rule.binDirs) {
|
|
4125
|
+
const found = probeWithSuffixes(join4(current, binDir), command, suffixes);
|
|
4126
|
+
if (found !== null)
|
|
4127
|
+
return found;
|
|
4128
|
+
}
|
|
4010
4129
|
}
|
|
4130
|
+
if (probe(join4(current, ".git")))
|
|
4131
|
+
return null;
|
|
4132
|
+
if (boundary !== undefined && current === boundary)
|
|
4133
|
+
return null;
|
|
4134
|
+
const parent = dirname9(current);
|
|
4135
|
+
if (parent === current)
|
|
4136
|
+
return null;
|
|
4137
|
+
current = parent;
|
|
4011
4138
|
}
|
|
4012
|
-
|
|
4013
|
-
|
|
4139
|
+
}
|
|
4140
|
+
function resolveFromPath(command, suffixes, platform, pathEnvOverride) {
|
|
4141
|
+
let pathEnv = pathEnvOverride ?? process.env["PATH"] ?? "";
|
|
4142
|
+
if (platform === "win32" && !pathEnv) {
|
|
4014
4143
|
pathEnv = process.env["Path"] ?? "";
|
|
4015
4144
|
}
|
|
4016
|
-
const
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
}
|
|
4145
|
+
for (const entry of pathEnv.split(delimiter3)) {
|
|
4146
|
+
if (entry.length === 0)
|
|
4147
|
+
continue;
|
|
4148
|
+
const found = probeWithSuffixes(entry, command, suffixes);
|
|
4149
|
+
if (found !== null)
|
|
4150
|
+
return found;
|
|
4023
4151
|
}
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4152
|
+
return null;
|
|
4153
|
+
}
|
|
4154
|
+
function resolveServerBinary(command, workingDirectory, options = {}) {
|
|
4155
|
+
if (command.length === 0)
|
|
4156
|
+
return null;
|
|
4157
|
+
const [cmd] = command;
|
|
4158
|
+
if (cmd === undefined || cmd.length === 0)
|
|
4159
|
+
return null;
|
|
4160
|
+
const platform = options.platform ?? process.platform;
|
|
4161
|
+
const suffixes = executableSuffixes(platform, options.pathExt);
|
|
4162
|
+
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
4163
|
+
const explicit = isAbsolute5(cmd) ? cmd : resolve7(workingDirectory ?? process.cwd(), cmd);
|
|
4164
|
+
return probe(explicit) ? explicit : null;
|
|
4165
|
+
}
|
|
4166
|
+
const cacheKey = JSON.stringify([
|
|
4167
|
+
workingDirectory ?? "",
|
|
4168
|
+
cmd,
|
|
4169
|
+
platform,
|
|
4170
|
+
options.stopAt ?? "",
|
|
4171
|
+
options.pathExt ?? "",
|
|
4172
|
+
options.pathEnv ?? process.env["PATH"] ?? ""
|
|
4173
|
+
]);
|
|
4174
|
+
const cached = resolutionCache.get(cacheKey);
|
|
4175
|
+
if (cached !== undefined)
|
|
4176
|
+
return cached;
|
|
4177
|
+
let resolved = null;
|
|
4178
|
+
if (workingDirectory !== undefined && workingDirectory.length > 0) {
|
|
4179
|
+
resolved = resolveLocal(cmd, workingDirectory, suffixes, options.stopAt);
|
|
4180
|
+
}
|
|
4181
|
+
resolved ??= resolveFromPath(cmd, suffixes, platform, options.pathEnv);
|
|
4182
|
+
if (resolved === null && cmd === "node")
|
|
4183
|
+
resolved = cmd;
|
|
4184
|
+
resolutionCache.set(cacheKey, resolved);
|
|
4185
|
+
return resolved;
|
|
4186
|
+
}
|
|
4187
|
+
function isServerInstalled(command, workingDirectory, options = {}) {
|
|
4188
|
+
if (command.length === 0)
|
|
4189
|
+
return false;
|
|
4190
|
+
return resolveServerBinary(command, workingDirectory, options) !== null;
|
|
4191
|
+
}
|
|
4192
|
+
function withResolvedCommand(command, binaryPath) {
|
|
4193
|
+
return [binaryPath, ...command.slice(1)];
|
|
4027
4194
|
}
|
|
4028
4195
|
function findServerForExtension(ext) {
|
|
4029
4196
|
const servers = getMergedServers();
|
|
4197
|
+
const workingDirectory = contextCwd();
|
|
4030
4198
|
for (const server2 of servers) {
|
|
4031
|
-
if (server2.extensions.includes(ext)
|
|
4199
|
+
if (!server2.extensions.includes(ext))
|
|
4200
|
+
continue;
|
|
4201
|
+
const binaryPath = resolveServerBinary(server2.command, workingDirectory);
|
|
4202
|
+
if (binaryPath !== null) {
|
|
4032
4203
|
const resolvedServer = {
|
|
4033
4204
|
id: server2.id,
|
|
4034
|
-
command: server2.command,
|
|
4205
|
+
command: withResolvedCommand(server2.command, binaryPath),
|
|
4035
4206
|
extensions: server2.extensions,
|
|
4036
4207
|
priority: server2.priority
|
|
4037
4208
|
};
|
|
@@ -4078,6 +4249,7 @@ function findServerForExtension(ext) {
|
|
|
4078
4249
|
function getAllServers() {
|
|
4079
4250
|
const servers = getMergedServers();
|
|
4080
4251
|
const disabled = getDisabledServerIds();
|
|
4252
|
+
const workingDirectory = contextCwd();
|
|
4081
4253
|
const result = [];
|
|
4082
4254
|
const seen = new Set;
|
|
4083
4255
|
for (const server2 of servers) {
|
|
@@ -4085,7 +4257,7 @@ function getAllServers() {
|
|
|
4085
4257
|
continue;
|
|
4086
4258
|
result.push({
|
|
4087
4259
|
id: server2.id,
|
|
4088
|
-
installed: isServerInstalled(server2.command),
|
|
4260
|
+
installed: isServerInstalled(server2.command, workingDirectory),
|
|
4089
4261
|
extensions: server2.extensions,
|
|
4090
4262
|
disabled: false,
|
|
4091
4263
|
source: server2.source,
|
|
@@ -4099,7 +4271,7 @@ function getAllServers() {
|
|
|
4099
4271
|
const builtin = BUILTIN_SERVERS[id];
|
|
4100
4272
|
result.push({
|
|
4101
4273
|
id,
|
|
4102
|
-
installed: builtin ? isServerInstalled(builtin.command) : false,
|
|
4274
|
+
installed: builtin ? isServerInstalled(builtin.command, workingDirectory) : false,
|
|
4103
4275
|
extensions: builtin?.extensions ?? [],
|
|
4104
4276
|
disabled: true,
|
|
4105
4277
|
source: "disabled",
|
|
@@ -4108,7 +4280,6 @@ function getAllServers() {
|
|
|
4108
4280
|
}
|
|
4109
4281
|
return result;
|
|
4110
4282
|
}
|
|
4111
|
-
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4112
4283
|
function isDirectoryPath(filePath) {
|
|
4113
4284
|
try {
|
|
4114
4285
|
return statSync4(filePath).isDirectory();
|
|
@@ -4117,32 +4288,85 @@ function isDirectoryPath(filePath) {
|
|
|
4117
4288
|
}
|
|
4118
4289
|
}
|
|
4119
4290
|
function findWorkspaceRoot(filePath) {
|
|
4120
|
-
const
|
|
4291
|
+
const cwd = contextCwd();
|
|
4292
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4121
4293
|
let dir = abs;
|
|
4122
4294
|
if (!isDirectoryPath(dir)) {
|
|
4123
|
-
dir =
|
|
4124
|
-
}
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4295
|
+
dir = dirname10(dir);
|
|
4296
|
+
}
|
|
4297
|
+
if (!isPathInside(cwd, abs))
|
|
4298
|
+
return findWorkspaceRootOutsideContext(dir);
|
|
4299
|
+
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4300
|
+
while (isPathInside(cwd, dir)) {
|
|
4301
|
+
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4302
|
+
if (canonicalDir !== undefined) {
|
|
4303
|
+
for (const marker of WORKSPACE_MARKERS) {
|
|
4304
|
+
if (existsSync11(join5(dir, marker))) {
|
|
4305
|
+
return canonicalDir;
|
|
4306
|
+
}
|
|
4130
4307
|
}
|
|
4131
4308
|
}
|
|
4132
|
-
|
|
4133
|
-
|
|
4309
|
+
if (dir === cwd)
|
|
4310
|
+
break;
|
|
4311
|
+
dir = dirname10(dir);
|
|
4134
4312
|
}
|
|
4135
|
-
return
|
|
4313
|
+
return fallbackRoot;
|
|
4314
|
+
}
|
|
4315
|
+
function resolveReadablePathInsideContext(filePath) {
|
|
4316
|
+
const cwd = contextCwd();
|
|
4317
|
+
const abs = resolve8(cwd, filePath);
|
|
4318
|
+
if (isPathInside(cwd, abs))
|
|
4319
|
+
return abs;
|
|
4320
|
+
const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
|
|
4321
|
+
if (rebased !== undefined)
|
|
4322
|
+
return rebased;
|
|
4323
|
+
return canonicalizeExistingOrNearestAncestor(abs);
|
|
4136
4324
|
}
|
|
4137
4325
|
function resolvePathInsideContext(filePath) {
|
|
4138
4326
|
const cwd = contextCwd();
|
|
4139
|
-
const abs =
|
|
4327
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4140
4328
|
const canonical = canonicalizeExistingOrNearestAncestor(abs);
|
|
4141
4329
|
if (!isPathInside(cwd, canonical)) {
|
|
4142
4330
|
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4143
4331
|
}
|
|
4144
4332
|
return canonical;
|
|
4145
4333
|
}
|
|
4334
|
+
function rebaseThroughCanonicalAncestor(path2, cwd) {
|
|
4335
|
+
let current = path2;
|
|
4336
|
+
const suffix = [];
|
|
4337
|
+
while (true) {
|
|
4338
|
+
if (existsSync11(current)) {
|
|
4339
|
+
const canonical = realpathSync5(current);
|
|
4340
|
+
if (isPathInside(cwd, canonical))
|
|
4341
|
+
return suffix.length === 0 ? canonical : join5(canonical, ...suffix);
|
|
4342
|
+
}
|
|
4343
|
+
const parent = dirname10(current);
|
|
4344
|
+
if (parent === current)
|
|
4345
|
+
return;
|
|
4346
|
+
suffix.unshift(basename3(current));
|
|
4347
|
+
current = parent;
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4350
|
+
function existingDirectoryInsideContext(directory, cwd) {
|
|
4351
|
+
if (!existsSync11(directory))
|
|
4352
|
+
return;
|
|
4353
|
+
const canonical = realpathSync5(directory);
|
|
4354
|
+
if (!statSync4(canonical).isDirectory())
|
|
4355
|
+
return;
|
|
4356
|
+
return isPathInside(cwd, canonical) ? canonical : undefined;
|
|
4357
|
+
}
|
|
4358
|
+
function nearestExistingDirectoryInsideContext(directory, cwd) {
|
|
4359
|
+
let current = directory;
|
|
4360
|
+
while (isPathInside(cwd, current)) {
|
|
4361
|
+
const canonical = existingDirectoryInsideContext(current, cwd);
|
|
4362
|
+
if (canonical !== undefined)
|
|
4363
|
+
return canonical;
|
|
4364
|
+
if (current === cwd)
|
|
4365
|
+
return;
|
|
4366
|
+
current = dirname10(current);
|
|
4367
|
+
}
|
|
4368
|
+
return;
|
|
4369
|
+
}
|
|
4146
4370
|
function formatServerLookupError(result) {
|
|
4147
4371
|
if (result.status === "not_installed") {
|
|
4148
4372
|
return formatNotInstalled(result);
|
|
@@ -4166,6 +4390,19 @@ function formatServerLookupError(result) {
|
|
|
4166
4390
|
].join(`
|
|
4167
4391
|
`);
|
|
4168
4392
|
}
|
|
4393
|
+
function formatInstallOptions(serverId, installHint) {
|
|
4394
|
+
const localHint = LSP_LOCAL_INSTALL_HINTS[serverId];
|
|
4395
|
+
if (localHint === undefined) {
|
|
4396
|
+
return ["To install, run:", ` ${installHint}`];
|
|
4397
|
+
}
|
|
4398
|
+
return [
|
|
4399
|
+
"To install in THIS repository (preferred — no global install needed):",
|
|
4400
|
+
` ${localHint}`,
|
|
4401
|
+
"",
|
|
4402
|
+
"Or install it globally:",
|
|
4403
|
+
` ${installHint}`
|
|
4404
|
+
];
|
|
4405
|
+
}
|
|
4169
4406
|
function formatNotInstalled(result) {
|
|
4170
4407
|
const { server: server2, installHint } = result;
|
|
4171
4408
|
const extensions = server2.extensions.join(", ");
|
|
@@ -4180,19 +4417,19 @@ function formatNotInstalled(result) {
|
|
|
4180
4417
|
`Command not found: ${server2.command[0]}`,
|
|
4181
4418
|
""
|
|
4182
4419
|
];
|
|
4420
|
+
const installOptions = formatInstallOptions(server2.id, installHint);
|
|
4183
4421
|
if (decision === "allowed") {
|
|
4184
4422
|
return [
|
|
4185
4423
|
...header,
|
|
4186
4424
|
"The user has pre-authorized LSP installation. Run the install command, then retry this tool:",
|
|
4187
|
-
|
|
4425
|
+
...installOptions.slice(1)
|
|
4188
4426
|
].join(`
|
|
4189
4427
|
`);
|
|
4190
4428
|
}
|
|
4191
4429
|
if (!context.capabilities.installDecisionTool) {
|
|
4192
4430
|
return [
|
|
4193
4431
|
...header,
|
|
4194
|
-
|
|
4195
|
-
` ${installHint}`,
|
|
4432
|
+
...installOptions,
|
|
4196
4433
|
"",
|
|
4197
4434
|
"ACTION REQUIRED — ASK THE USER whether to install this LSP server.",
|
|
4198
4435
|
"Install-decision recording is unavailable in this harness; proceed without LSP if the user declines."
|
|
@@ -4201,8 +4438,7 @@ function formatNotInstalled(result) {
|
|
|
4201
4438
|
}
|
|
4202
4439
|
return [
|
|
4203
4440
|
...header,
|
|
4204
|
-
|
|
4205
|
-
` ${installHint}`,
|
|
4441
|
+
...installOptions,
|
|
4206
4442
|
"",
|
|
4207
4443
|
"ACTION REQUIRED — ASK THE USER whether to install this LSP server.",
|
|
4208
4444
|
"- If the user agrees: run the install command above, then retry this tool.",
|
|
@@ -4213,7 +4449,7 @@ function formatNotInstalled(result) {
|
|
|
4213
4449
|
].join(`
|
|
4214
4450
|
`);
|
|
4215
4451
|
}
|
|
4216
|
-
var
|
|
4452
|
+
var READ_ONLY_TOOLS = new Set([
|
|
4217
4453
|
"diagnostics",
|
|
4218
4454
|
"definition",
|
|
4219
4455
|
"references",
|
|
@@ -4222,7 +4458,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
|
|
|
4222
4458
|
"prepareRename"
|
|
4223
4459
|
]);
|
|
4224
4460
|
async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
4225
|
-
const absPath = resolvePathInsideContext(filePath);
|
|
4461
|
+
const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
|
|
4226
4462
|
if (isDirectoryPath(absPath)) {
|
|
4227
4463
|
throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
|
|
4228
4464
|
}
|
|
@@ -4237,9 +4473,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4237
4473
|
const acquireAndCall = async (allowRetry) => {
|
|
4238
4474
|
const client = await manager.getClient(root, server2, options.signal);
|
|
4239
4475
|
try {
|
|
4240
|
-
return await fn(client, root);
|
|
4476
|
+
return await fn(client, root, absPath);
|
|
4241
4477
|
} catch (err) {
|
|
4242
|
-
if (allowRetry &&
|
|
4478
|
+
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
4243
4479
|
manager.invalidateClient(root, server2.id, client);
|
|
4244
4480
|
return acquireAndCall(false);
|
|
4245
4481
|
}
|
|
@@ -4379,7 +4615,7 @@ function collectFilesWithExtension(dir, extension, maxFiles) {
|
|
|
4379
4615
|
for (const entry of entries) {
|
|
4380
4616
|
if (files.length >= maxFiles)
|
|
4381
4617
|
return;
|
|
4382
|
-
const fullPath =
|
|
4618
|
+
const fullPath = join6(currentDir, entry);
|
|
4383
4619
|
let stat;
|
|
4384
4620
|
try {
|
|
4385
4621
|
stat = lstatSync5(fullPath);
|
|
@@ -4404,8 +4640,8 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4404
4640
|
if (!extension.startsWith(".")) {
|
|
4405
4641
|
throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
|
|
4406
4642
|
}
|
|
4407
|
-
const absDir =
|
|
4408
|
-
if (!
|
|
4643
|
+
const absDir = resolve9(options.workspaceRoot ?? contextCwd(), directory);
|
|
4644
|
+
if (!existsSync12(absDir)) {
|
|
4409
4645
|
throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
|
|
4410
4646
|
}
|
|
4411
4647
|
const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
|
|
@@ -4506,7 +4742,7 @@ function inferExtensionFromDirectory(directory) {
|
|
|
4506
4742
|
for (const entry of entries) {
|
|
4507
4743
|
if (scanned >= MAX_SCAN_ENTRIES)
|
|
4508
4744
|
return;
|
|
4509
|
-
const fullPath =
|
|
4745
|
+
const fullPath = join7(dir, entry);
|
|
4510
4746
|
let stat;
|
|
4511
4747
|
try {
|
|
4512
4748
|
stat = lstatSync6(fullPath);
|
|
@@ -4669,7 +4905,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4669
4905
|
const filePath = requireString(params, "filePath");
|
|
4670
4906
|
const severity = severityFilter(params);
|
|
4671
4907
|
try {
|
|
4672
|
-
const absPath =
|
|
4908
|
+
const absPath = resolveReadablePathInsideContext(filePath);
|
|
4673
4909
|
if (isDirectoryPath(absPath)) {
|
|
4674
4910
|
const extension = inferExtensionFromDirectory(absPath);
|
|
4675
4911
|
if (!extension) {
|
|
@@ -4698,7 +4934,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4698
4934
|
};
|
|
4699
4935
|
return text(output2.output, details2);
|
|
4700
4936
|
}
|
|
4701
|
-
const result = await withLspClient(filePath, async (client) => client.diagnostics(
|
|
4937
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
|
|
4702
4938
|
if (result.transientError) {
|
|
4703
4939
|
const message = result.transientError.message;
|
|
4704
4940
|
const details2 = {
|
|
@@ -4745,6 +4981,91 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4745
4981
|
throw error;
|
|
4746
4982
|
}
|
|
4747
4983
|
}
|
|
4984
|
+
var DEFAULT_FORMATTING_OPTIONS = {
|
|
4985
|
+
tabSize: 4,
|
|
4986
|
+
insertSpaces: false,
|
|
4987
|
+
trimTrailingWhitespace: true,
|
|
4988
|
+
insertFinalNewline: true,
|
|
4989
|
+
trimFinalNewlines: true
|
|
4990
|
+
};
|
|
4991
|
+
var UNCHANGED = { status: "unchanged", linesAdded: 0, linesRemoved: 0 };
|
|
4992
|
+
async function formatDocumentWithClient(client, filePath, options = {}) {
|
|
4993
|
+
const edits = await client.formatDocument(filePath, options.formattingOptions ?? DEFAULT_FORMATTING_OPTIONS, options.signal);
|
|
4994
|
+
if (edits === null)
|
|
4995
|
+
return { status: "unavailable", reason: "capability_not_advertised" };
|
|
4996
|
+
if (edits.length === 0)
|
|
4997
|
+
return UNCHANGED;
|
|
4998
|
+
const before = readFileSync6(filePath, "utf-8");
|
|
4999
|
+
const normalized = normalizeTextEdits(before, edits, 0);
|
|
5000
|
+
if (normalized.text === before)
|
|
5001
|
+
return UNCHANGED;
|
|
5002
|
+
writeAtomically(filePath, normalized.text);
|
|
5003
|
+
await client.openFile(filePath);
|
|
5004
|
+
return {
|
|
5005
|
+
status: "formatted",
|
|
5006
|
+
...lineDelta(normalized.edits)
|
|
5007
|
+
};
|
|
5008
|
+
}
|
|
5009
|
+
function lineDelta(edits) {
|
|
5010
|
+
let linesAdded = 0;
|
|
5011
|
+
let linesRemoved = 0;
|
|
5012
|
+
for (const edit of edits) {
|
|
5013
|
+
linesRemoved += edit.range.end.line - edit.range.start.line + 1;
|
|
5014
|
+
linesAdded += edit.newText.split(`
|
|
5015
|
+
`).length;
|
|
5016
|
+
}
|
|
5017
|
+
return { linesAdded, linesRemoved };
|
|
5018
|
+
}
|
|
5019
|
+
function writeAtomically(filePath, content) {
|
|
5020
|
+
const tempPath = `${filePath}.omo-format.tmp`;
|
|
5021
|
+
writeFileSync3(tempPath, content, "utf-8");
|
|
5022
|
+
try {
|
|
5023
|
+
renameSync3(tempPath, filePath);
|
|
5024
|
+
} catch (error) {
|
|
5025
|
+
try {
|
|
5026
|
+
unlinkSync2(tempPath);
|
|
5027
|
+
} catch {}
|
|
5028
|
+
throw error;
|
|
5029
|
+
}
|
|
5030
|
+
}
|
|
5031
|
+
async function executeLspFormat(params, signal) {
|
|
5032
|
+
const filePath = requireString(params, "filePath");
|
|
5033
|
+
try {
|
|
5034
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => formatDocumentWithClient(client, resolvedFilePath, signal === undefined ? {} : { signal }), "format", clientOptions(signal));
|
|
5035
|
+
return text(describeResult(filePath, result), formatDetails(filePath, result));
|
|
5036
|
+
} catch (error) {
|
|
5037
|
+
const missingDependency = missingDependencyResult(error, {
|
|
5038
|
+
filePath,
|
|
5039
|
+
status: "unavailable",
|
|
5040
|
+
reason: "server_unavailable",
|
|
5041
|
+
linesAdded: 0,
|
|
5042
|
+
linesRemoved: 0
|
|
5043
|
+
});
|
|
5044
|
+
if (missingDependency)
|
|
5045
|
+
return missingDependency;
|
|
5046
|
+
throw error;
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
function formatDetails(filePath, result) {
|
|
5050
|
+
if (result.status === "unavailable") {
|
|
5051
|
+
return { filePath, status: "unavailable", reason: result.reason, linesAdded: 0, linesRemoved: 0 };
|
|
5052
|
+
}
|
|
5053
|
+
return {
|
|
5054
|
+
filePath,
|
|
5055
|
+
status: result.status,
|
|
5056
|
+
linesAdded: result.linesAdded,
|
|
5057
|
+
linesRemoved: result.linesRemoved
|
|
5058
|
+
};
|
|
5059
|
+
}
|
|
5060
|
+
function describeResult(filePath, result) {
|
|
5061
|
+
if (result.status === "unavailable") {
|
|
5062
|
+
return `Formatting unavailable for ${filePath}: the language server does not advertise documentFormattingProvider.`;
|
|
5063
|
+
}
|
|
5064
|
+
if (result.status === "unchanged") {
|
|
5065
|
+
return `Already formatted: ${filePath}`;
|
|
5066
|
+
}
|
|
5067
|
+
return `Formatted ${filePath} (+${result.linesAdded}/-${result.linesRemoved} lines)`;
|
|
5068
|
+
}
|
|
4748
5069
|
async function executeLspInstallDecision(params) {
|
|
4749
5070
|
const serverId = requireString(params, "server_id");
|
|
4750
5071
|
const decision = params["decision"];
|
|
@@ -4770,7 +5091,7 @@ async function executeLspGotoDefinition(params, signal) {
|
|
|
4770
5091
|
const line = requireNumber(params, "line");
|
|
4771
5092
|
const character = requireNumber(params, "character");
|
|
4772
5093
|
try {
|
|
4773
|
-
const result = await withLspClient(filePath, async (client) => client.definition(
|
|
5094
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
|
|
4774
5095
|
const locations = !result ? [] : Array.isArray(result) ? result : [result];
|
|
4775
5096
|
const details = { filePath, line, character, locations };
|
|
4776
5097
|
if (locations.length === 0)
|
|
@@ -4795,7 +5116,7 @@ async function executeLspFindReferences(params, signal) {
|
|
|
4795
5116
|
const character = requireNumber(params, "character");
|
|
4796
5117
|
const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
|
|
4797
5118
|
try {
|
|
4798
|
-
const result = await withLspClient(filePath, async (client) => client.references(
|
|
5119
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
|
|
4799
5120
|
const references = Array.isArray(result) ? result : [];
|
|
4800
5121
|
const total = references.length;
|
|
4801
5122
|
const truncated = total > DEFAULT_MAX_REFERENCES;
|
|
@@ -4835,7 +5156,7 @@ async function executeLspPrepareRename(params, signal) {
|
|
|
4835
5156
|
const line = requireNumber(params, "line");
|
|
4836
5157
|
const character = requireNumber(params, "character");
|
|
4837
5158
|
try {
|
|
4838
|
-
const result = await withLspClient(filePath, async (client) => client.prepareRename(
|
|
5159
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
|
|
4839
5160
|
const details = { filePath, line, character, result };
|
|
4840
5161
|
return text(formatPrepareRenameResult(result), details);
|
|
4841
5162
|
} catch (error) {
|
|
@@ -4856,7 +5177,7 @@ async function executeLspRename(params, signal) {
|
|
|
4856
5177
|
const character = requireNumber(params, "character");
|
|
4857
5178
|
const newName = requireString(params, "newName");
|
|
4858
5179
|
try {
|
|
4859
|
-
const result = await withLspClient(filePath, async (client) => client.rename(
|
|
5180
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
|
|
4860
5181
|
const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
|
|
4861
5182
|
return text(formatApplyResult(result.apply), details, !result.apply.success);
|
|
4862
5183
|
} catch (error) {
|
|
@@ -4930,7 +5251,7 @@ async function executeLspSymbols(params, signal) {
|
|
|
4930
5251
|
const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
|
|
4931
5252
|
return formatSymbolsResult(filePath, scope, symbols2, limit, query);
|
|
4932
5253
|
}
|
|
4933
|
-
const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(
|
|
5254
|
+
const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
|
|
4934
5255
|
return formatSymbolsResult(filePath, scope, symbols, limit);
|
|
4935
5256
|
} catch (error) {
|
|
4936
5257
|
const query = optionalString(params, "query");
|
|
@@ -5064,6 +5385,16 @@ var LSP_MCP_TOOLS = [
|
|
|
5064
5385
|
}, ["filePath", "line", "character", "newName"]),
|
|
5065
5386
|
execute: executeLspRename
|
|
5066
5387
|
},
|
|
5388
|
+
{
|
|
5389
|
+
name: "format",
|
|
5390
|
+
aliases: ["lsp_format"],
|
|
5391
|
+
title: "LSP Format",
|
|
5392
|
+
description: "Format a source file with its language server and write the returned edits to disk.",
|
|
5393
|
+
inputSchema: objectSchema({
|
|
5394
|
+
filePath: { type: "string", description: "Source file path to format." }
|
|
5395
|
+
}, ["filePath"]),
|
|
5396
|
+
execute: executeLspFormat
|
|
5397
|
+
},
|
|
5067
5398
|
{
|
|
5068
5399
|
name: "install_decision",
|
|
5069
5400
|
aliases: ["lsp_install_decision"],
|
|
@@ -5130,7 +5461,7 @@ function withContext(args, context) {
|
|
|
5130
5461
|
function ensureDaemonAvailable(paths, ensure, signal) {
|
|
5131
5462
|
if (!signal)
|
|
5132
5463
|
return ensure(paths);
|
|
5133
|
-
return new Promise((
|
|
5464
|
+
return new Promise((resolve10, reject) => {
|
|
5134
5465
|
let settled = false;
|
|
5135
5466
|
const finish = (run) => {
|
|
5136
5467
|
if (settled)
|
|
@@ -5145,11 +5476,11 @@ function ensureDaemonAvailable(paths, ensure, signal) {
|
|
|
5145
5476
|
return;
|
|
5146
5477
|
}
|
|
5147
5478
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
5148
|
-
Promise.resolve().then(() => ensure(paths, signal)).then(() => finish(() =>
|
|
5479
|
+
Promise.resolve().then(() => ensure(paths, signal)).then(() => finish(() => resolve10()), (error) => finish(() => reject(signal.aborted ? new DaemonRequestCancelledError(false) : error)));
|
|
5149
5480
|
});
|
|
5150
5481
|
}
|
|
5151
5482
|
function sendToolCall(paths, token, name, args, options) {
|
|
5152
|
-
return new Promise((
|
|
5483
|
+
return new Promise((resolve10, reject) => {
|
|
5153
5484
|
const socket = connect(paths.socket);
|
|
5154
5485
|
const requestId = allocateProxyRequestId();
|
|
5155
5486
|
let settled = false;
|
|
@@ -5202,7 +5533,7 @@ function sendToolCall(paths, token, name, args, options) {
|
|
|
5202
5533
|
}
|
|
5203
5534
|
const result = toToolResult(message, requestId);
|
|
5204
5535
|
if (result)
|
|
5205
|
-
finish(() =>
|
|
5536
|
+
finish(() => resolve10(result));
|
|
5206
5537
|
else
|
|
5207
5538
|
finish(() => reject(new DaemonRequestError("invalid daemon response", requestWritten)));
|
|
5208
5539
|
});
|
|
@@ -5251,10 +5582,9 @@ var OMO_LSP_DAEMON_VERSION2 = "OMO_LSP_DAEMON_VERSION";
|
|
|
5251
5582
|
var DAEMON_VERSION_PATTERN2 = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
5252
5583
|
|
|
5253
5584
|
class InvalidRuntimeOverrideError2 extends Error {
|
|
5254
|
-
code = "invalid_runtime_override";
|
|
5255
|
-
reason;
|
|
5256
5585
|
constructor(reason, message) {
|
|
5257
5586
|
super(message);
|
|
5587
|
+
this.code = "invalid_runtime_override";
|
|
5258
5588
|
this.name = "InvalidRuntimeOverrideError";
|
|
5259
5589
|
this.reason = reason;
|
|
5260
5590
|
}
|
|
@@ -5274,12 +5604,12 @@ function resolveDaemonRuntime2(env, defaults) {
|
|
|
5274
5604
|
throw new InvalidRuntimeOverrideError2("paired_values_required", `${OMO_LSP_DAEMON_CLI2} and ${OMO_LSP_DAEMON_VERSION2} must be set together`);
|
|
5275
5605
|
}
|
|
5276
5606
|
if (!hasCliOverride || !hasVersionOverride) {
|
|
5277
|
-
if (!
|
|
5607
|
+
if (!isAbsolute6(defaults.cliPath)) {
|
|
5278
5608
|
throw new InvalidRuntimeOverrideError2("packaged_cli_must_be_absolute", "Packaged LSP daemon CLI path must be absolute");
|
|
5279
5609
|
}
|
|
5280
5610
|
return { cliPath: defaults.cliPath, version: validateDaemonVersion2(defaults.version) };
|
|
5281
5611
|
}
|
|
5282
|
-
if (!
|
|
5612
|
+
if (!isAbsolute6(cliOverride)) {
|
|
5283
5613
|
throw new InvalidRuntimeOverrideError2("cli_must_be_absolute", `${OMO_LSP_DAEMON_CLI2} must be an absolute path to an existing regular file`);
|
|
5284
5614
|
}
|
|
5285
5615
|
const stat = statSync5(cliOverride, { throwIfNoEntry: false });
|
|
@@ -5400,15 +5730,14 @@ function extensionKey(filePath) {
|
|
|
5400
5730
|
}
|
|
5401
5731
|
// ../../../../lsp-core/src/request-context.ts
|
|
5402
5732
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
5403
|
-
import { existsSync as
|
|
5404
|
-
import { basename as
|
|
5733
|
+
import { existsSync as existsSync13, realpathSync as realpathSync6, statSync as statSync6 } from "node:fs";
|
|
5734
|
+
import { basename as basename4, delimiter as delimiter4, dirname as dirname2, isAbsolute as isAbsolute7, join as join8, relative as relative5, resolve as resolve10 } from "node:path";
|
|
5405
5735
|
|
|
5406
5736
|
class LspRequestContextParseError2 extends Error {
|
|
5407
|
-
code;
|
|
5408
|
-
name = "LspRequestContextParseError";
|
|
5409
5737
|
constructor(code, message) {
|
|
5410
5738
|
super(message);
|
|
5411
5739
|
this.code = code;
|
|
5740
|
+
this.name = "LspRequestContextParseError";
|
|
5412
5741
|
}
|
|
5413
5742
|
}
|
|
5414
5743
|
var storage2 = new AsyncLocalStorage2;
|
|
@@ -5443,26 +5772,26 @@ function parseLspRequestContext2(value) {
|
|
|
5443
5772
|
};
|
|
5444
5773
|
}
|
|
5445
5774
|
function canonicalCwd2(cwd) {
|
|
5446
|
-
const resolved =
|
|
5447
|
-
if (!
|
|
5775
|
+
const resolved = resolve10(cwd);
|
|
5776
|
+
if (!existsSync13(resolved) || !statSync6(resolved).isDirectory()) {
|
|
5448
5777
|
throw new LspRequestContextParseError2("invalid_cwd", `LSP request cwd must be an existing directory: ${cwd}`);
|
|
5449
5778
|
}
|
|
5450
|
-
return
|
|
5779
|
+
return realpathSync6(resolved);
|
|
5451
5780
|
}
|
|
5452
5781
|
function canonicalizeExistingOrNearestAncestor2(path2) {
|
|
5453
|
-
let current =
|
|
5782
|
+
let current = resolve10(path2);
|
|
5454
5783
|
const suffix = [];
|
|
5455
5784
|
while (true) {
|
|
5456
5785
|
try {
|
|
5457
|
-
const existing =
|
|
5458
|
-
return suffix.length === 0 ? existing :
|
|
5786
|
+
const existing = realpathSync6(current);
|
|
5787
|
+
return suffix.length === 0 ? existing : join8(existing, ...suffix);
|
|
5459
5788
|
} catch (error) {
|
|
5460
5789
|
if (!isMissingPathError2(error))
|
|
5461
5790
|
throw error;
|
|
5462
5791
|
const parent = dirname2(current);
|
|
5463
5792
|
if (parent === current)
|
|
5464
5793
|
throw error;
|
|
5465
|
-
suffix.unshift(
|
|
5794
|
+
suffix.unshift(basename4(current));
|
|
5466
5795
|
current = parent;
|
|
5467
5796
|
}
|
|
5468
5797
|
}
|
|
@@ -5493,14 +5822,14 @@ function stringArrayField2(value, field) {
|
|
|
5493
5822
|
return fieldValue;
|
|
5494
5823
|
}
|
|
5495
5824
|
function requireAbsolutePath2(path2, field) {
|
|
5496
|
-
if (!
|
|
5825
|
+
if (!isAbsolute7(path2)) {
|
|
5497
5826
|
throw new LspRequestContextParseError2("relative_path", `LSP request context.${field} must be absolute: ${path2}`);
|
|
5498
5827
|
}
|
|
5499
5828
|
}
|
|
5500
5829
|
function isPathInside2(parent, child) {
|
|
5501
|
-
const childPath =
|
|
5830
|
+
const childPath = resolve10(child);
|
|
5502
5831
|
const relativePath = relative5(parent, childPath);
|
|
5503
|
-
return relativePath === "" || !relativePath.startsWith("..") && !
|
|
5832
|
+
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute7(relativePath);
|
|
5504
5833
|
}
|
|
5505
5834
|
function isMissingPathError2(error) {
|
|
5506
5835
|
const code = errorCode2(error);
|
|
@@ -5523,9 +5852,9 @@ function errorCode2(error) {
|
|
|
5523
5852
|
}
|
|
5524
5853
|
|
|
5525
5854
|
// src/daemon-cli-path.ts
|
|
5526
|
-
import { existsSync as
|
|
5855
|
+
import { existsSync as existsSync15, readFileSync as readFileSync7 } from "node:fs";
|
|
5527
5856
|
import { createRequire as createRequire2 } from "node:module";
|
|
5528
|
-
import { dirname as
|
|
5857
|
+
import { dirname as dirname11, join as join10 } from "node:path";
|
|
5529
5858
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
5530
5859
|
var requireFromHere2 = createRequire2(import.meta.url);
|
|
5531
5860
|
var PACKAGE_LSP_DAEMON_CLI = "@code-yeongyu/lsp-daemon/cli";
|
|
@@ -5547,7 +5876,7 @@ function resolveLspDaemonCli() {
|
|
|
5547
5876
|
if (packageCli !== null)
|
|
5548
5877
|
return resolveConfiguredLspDaemonCli(packageCli);
|
|
5549
5878
|
const bundledCli = fileURLToPath4(new URL("../../lsp-daemon/dist/cli.js", import.meta.url));
|
|
5550
|
-
if (
|
|
5879
|
+
if (existsSync15(bundledCli))
|
|
5551
5880
|
return resolveConfiguredLspDaemonCli(bundledCli);
|
|
5552
5881
|
return resolveConfiguredLspDaemonCli(bundledCli);
|
|
5553
5882
|
}
|
|
@@ -5572,7 +5901,7 @@ function resolveConfiguredLspDaemonCli(cliPath) {
|
|
|
5572
5901
|
}
|
|
5573
5902
|
function readDaemonPackageVersion(cliPath) {
|
|
5574
5903
|
try {
|
|
5575
|
-
const parsed = JSON.parse(
|
|
5904
|
+
const parsed = JSON.parse(readFileSync7(join10(dirname11(cliPath), "package.json"), "utf8"));
|
|
5576
5905
|
if (isRecord9(parsed) && typeof parsed["version"] === "string" && parsed["version"].length > 0) {
|
|
5577
5906
|
return parsed["version"];
|
|
5578
5907
|
}
|
|
@@ -5587,9 +5916,9 @@ function isRecord9(value) {
|
|
|
5587
5916
|
}
|
|
5588
5917
|
|
|
5589
5918
|
// src/lsp-session-state.ts
|
|
5590
|
-
import { mkdirSync as mkdirSync4, readFileSync as
|
|
5919
|
+
import { mkdirSync as mkdirSync4, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "node:fs";
|
|
5591
5920
|
import { homedir } from "node:os";
|
|
5592
|
-
import { dirname as
|
|
5921
|
+
import { dirname as dirname13, join as join11 } from "node:path";
|
|
5593
5922
|
function sessionIdFrom(input) {
|
|
5594
5923
|
return typeof input.session_id === "string" && input.session_id.length > 0 ? input.session_id : undefined;
|
|
5595
5924
|
}
|
|
@@ -5615,12 +5944,12 @@ function isLspDaemonUnreachableDiagnostics(diagnostics) {
|
|
|
5615
5944
|
return diagnostics.includes("LSP daemon unreachable");
|
|
5616
5945
|
}
|
|
5617
5946
|
function sessionStatePath(sessionId) {
|
|
5618
|
-
const root = process.env["PLUGIN_DATA"] ??
|
|
5619
|
-
return
|
|
5947
|
+
const root = process.env["PLUGIN_DATA"] ?? join11(homedir(), ".codex", "codex-lsp");
|
|
5948
|
+
return join11(root, "sessions", `${safePathSegment(sessionId)}.json`);
|
|
5620
5949
|
}
|
|
5621
5950
|
function readSessionState(path2) {
|
|
5622
5951
|
try {
|
|
5623
|
-
const parsed = JSON.parse(
|
|
5952
|
+
const parsed = JSON.parse(readFileSync9(path2, "utf8"));
|
|
5624
5953
|
if (isRecord10(parsed) && isLspSessionState(parsed))
|
|
5625
5954
|
return normalizeSessionState(parsed);
|
|
5626
5955
|
return emptyState();
|
|
@@ -5631,8 +5960,8 @@ function readSessionState(path2) {
|
|
|
5631
5960
|
}
|
|
5632
5961
|
}
|
|
5633
5962
|
function writeSessionState(path2, state) {
|
|
5634
|
-
mkdirSync4(
|
|
5635
|
-
|
|
5963
|
+
mkdirSync4(dirname13(path2), { recursive: true });
|
|
5964
|
+
writeFileSync4(path2, `${JSON.stringify(state)}
|
|
5636
5965
|
`);
|
|
5637
5966
|
}
|
|
5638
5967
|
function emptyState() {
|
|
@@ -5775,13 +6104,13 @@ function notConfiguredAvailability(details) {
|
|
|
5775
6104
|
return typeof extension === "string" && extension.length > 0 ? { extension } : undefined;
|
|
5776
6105
|
}
|
|
5777
6106
|
function codexLspRequestContext(env = process.env, cwd = process.cwd()) {
|
|
5778
|
-
const canonicalCwd3 =
|
|
5779
|
-
const codexHome =
|
|
6107
|
+
const canonicalCwd3 = realpathSync8(resolve12(cwd));
|
|
6108
|
+
const codexHome = resolve12(env["CODEX_HOME"]?.trim() || join12(homedir3(), ".codex"));
|
|
5780
6109
|
return parseLspRequestContext2({
|
|
5781
6110
|
cwd: canonicalCwd3,
|
|
5782
|
-
projectConfigPaths: [
|
|
5783
|
-
userConfigPath:
|
|
5784
|
-
installDecisionsPath:
|
|
6111
|
+
projectConfigPaths: [join12(canonicalCwd3, ".codex", "lsp-client.json")],
|
|
6112
|
+
userConfigPath: join12(codexHome, "lsp-client.json"),
|
|
6113
|
+
installDecisionsPath: join12(codexHome, "lsp-install-decisions.json"),
|
|
5785
6114
|
capabilities: { installDecisionTool: true }
|
|
5786
6115
|
});
|
|
5787
6116
|
}
|
|
@@ -5875,7 +6204,7 @@ function isContextPressureTranscript(transcriptPath) {
|
|
|
5875
6204
|
if (typeof transcriptPath !== "string")
|
|
5876
6205
|
return false;
|
|
5877
6206
|
try {
|
|
5878
|
-
return hasContextPressureMarker(
|
|
6207
|
+
return hasContextPressureMarker(readFileSync10(transcriptPath, "utf8"));
|
|
5879
6208
|
} catch (error) {
|
|
5880
6209
|
if (error instanceof Error)
|
|
5881
6210
|
return false;
|
|
@@ -5957,15 +6286,15 @@ main().catch((error) => {
|
|
|
5957
6286
|
});
|
|
5958
6287
|
async function runPackageLspMcpCli() {
|
|
5959
6288
|
const cliPath = resolveLspDaemonCliPath();
|
|
5960
|
-
const child = spawn3(execPath2, [cliPath, "mcp"], { stdio: "inherit" });
|
|
5961
|
-
await new Promise((
|
|
6289
|
+
const child = spawn3(execPath2, [cliPath, "mcp"], { stdio: "inherit", windowsHide: true });
|
|
6290
|
+
await new Promise((resolve11, reject) => {
|
|
5962
6291
|
child.once("error", reject);
|
|
5963
6292
|
child.once("exit", (code, signal) => {
|
|
5964
6293
|
if (code !== null && code !== 0)
|
|
5965
6294
|
process.exitCode = code;
|
|
5966
6295
|
if (code === null && signal !== null)
|
|
5967
6296
|
process.exitCode = 1;
|
|
5968
|
-
|
|
6297
|
+
resolve11();
|
|
5969
6298
|
});
|
|
5970
6299
|
});
|
|
5971
6300
|
}
|