oh-my-opencode 5.0.0-beta.8 → 5.0.0-beta.81
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 +59 -23
- package/.agents/command/remove-deadcode.md +1 -1
- package/.agents/skills/codex-qa/scripts/lsp-e2e.sh +1 -3
- package/.agents/skills/hyperplan/SKILL.md +5 -5
- package/.agents/skills/opencode-qa/scripts/lsp-e2e.sh +1 -1
- package/.agents/skills/pre-publish-review/SKILL.md +9 -12
- package/.agents/skills/publish/SKILL.md +59 -23
- package/.agents/skills/remove-deadcode/SKILL.md +1 -1
- package/.agents/skills/security-research/SKILL.md +4 -4
- 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/tech-debt-audit/SKILL.md +6 -76
- package/.opencode/command/publish.md +59 -23
- package/.opencode/skills/pre-publish-review/SKILL.md +9 -12
- package/README.ja.md +66 -61
- package/README.ko.md +67 -62
- package/README.md +108 -182
- package/README.ru.md +63 -61
- package/README.zh-cn.md +62 -61
- package/THIRD-PARTY-NOTICES.md +35 -105
- package/dist/agents/atlas/agent.d.ts +0 -1
- package/dist/agents/gpt-prompt-identity.d.ts +1 -1
- package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
- package/dist/agents/types.d.ts +4 -2
- package/dist/cli/config-manager/parse-opencode-config-file.d.ts +2 -1
- package/dist/cli/doctor/checks/browser-provider.d.ts +2 -0
- package/dist/cli/doctor/checks/index.d.ts +2 -0
- package/dist/cli/doctor/checks/latest-version.d.ts +11 -0
- package/dist/cli/doctor/checks/system-plugin.d.ts +4 -3
- package/dist/cli/doctor/framework/constants.d.ts +5 -0
- package/dist/cli/doctor/framework/types.d.ts +2 -0
- package/dist/cli/fallback-lane-policy.d.ts +1 -0
- package/dist/cli/index.js +59118 -63486
- 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 +58841 -63186
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema/agent-names.d.ts +0 -1
- package/dist/config/schema/background-task.d.ts +1 -0
- package/dist/config/schema/browser-automation.d.ts +0 -2
- package/dist/config/schema/commands.d.ts +1 -1
- package/dist/config/schema/hooks.d.ts +1 -2
- package/dist/config/schema/oh-my-opencode-config.d.ts +5 -12
- package/dist/config/schema/ulw-execute.d.ts +5 -0
- package/dist/config/schema.d.ts +0 -1
- package/dist/config/validate.d.ts +2 -0
- package/dist/config-migration/category-deep-split.d.ts +3 -0
- package/dist/config-migration/migration-plans.d.ts +1 -0
- package/dist/create-hooks.d.ts +3 -2
- package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +1 -0
- package/dist/features/background-agent/constants.d.ts +0 -7
- package/dist/features/background-agent/error-classifier.d.ts +1 -0
- package/dist/features/background-agent/manager.d.ts +9 -1
- package/dist/features/background-agent/parent-wake-dispatched-tracker.d.ts +0 -1
- package/dist/features/background-agent/parent-wake-notifier-types.d.ts +1 -1
- package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -1
- package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -1
- package/dist/features/background-agent/subagent-spawn-limits.d.ts +8 -0
- package/dist/features/background-agent/types.d.ts +4 -0
- package/dist/features/boulder-state/storage.d.ts +1 -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/hyperplan.d.ts +1 -1
- package/dist/features/builtin-commands/templates/refactor-sections/team-mode-addendum.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
- 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/claude-tasks/storage.d.ts +7 -2
- package/dist/features/hook-message-injector/index.d.ts +1 -0
- package/dist/features/hook-message-injector/sdk-message-lookup.d.ts +1 -0
- package/dist/features/monitor/manager-internals.d.ts +1 -1
- package/dist/features/monitor/output-injector-types.d.ts +1 -1
- package/dist/features/opengateway-provider/index.d.ts +13 -0
- package/dist/features/task-toast-manager/manager.d.ts +0 -24
- package/dist/features/team-mode/tools/lifecycle-inline-spec.d.ts +1 -1
- package/dist/features/team-mode/tools/messaging-fallback-wake.d.ts +17 -0
- package/dist/features/team-mode/tools/messaging-live-delivery-recipient.d.ts +3 -0
- package/dist/features/team-mode/tools/messaging-runtime.d.ts +7 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/message-storage-directory.d.ts +0 -3
- package/dist/hooks/anthropic-context-window-limit-recovery/state.d.ts +1 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/storage/empty-messages.d.ts +0 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/tool-result-storage.d.ts +11 -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/claude-code-hooks/session-hook-state.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/stop.d.ts +2 -0
- package/dist/hooks/claude-code-hooks/todo.d.ts +0 -1
- package/dist/hooks/claude-code-hooks/transcript.d.ts +2 -0
- package/dist/hooks/comment-checker/__fixtures__/download-probe.fixture.d.ts +1 -0
- package/dist/hooks/compaction-context-injector/validated-model.d.ts +2 -0
- package/dist/hooks/fsync-skip-warning/index.d.ts +4 -0
- package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +1 -0
- package/dist/hooks/hashline-edit-diff-enhancer/pending-captures.d.ts +13 -0
- package/dist/hooks/index.d.ts +1 -2
- package/dist/hooks/keyword-detector/hook.d.ts +9 -0
- package/dist/hooks/keyword-detector/ultrawork/index.d.ts +2 -0
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +0 -1
- package/dist/hooks/model-fallback/hook.d.ts +1 -1
- package/dist/hooks/plan-format-validator/hook.d.ts +19 -0
- 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/hooks/unstable-agent-babysitter/task-message-analyzer.d.ts +1 -0
- package/dist/index.js +34199 -28037
- package/dist/mcp/index.d.ts +0 -4
- package/dist/mcp/types.d.ts +0 -1
- package/dist/oh-my-opencode.schema.json +28 -59
- package/dist/plugin/chat-message/types.d.ts +6 -4
- 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 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -3
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
- package/dist/plugin/messages-transform.d.ts +1 -0
- package/dist/plugin/stop-continuation.d.ts +3 -0
- package/dist/plugin/system-transform.d.ts +5 -1
- package/dist/plugin-config/omo-config-chain.d.ts +1 -0
- package/dist/plugin-dispose.d.ts +3 -0
- package/dist/shared/agent-tool-restrictions.d.ts +0 -1
- package/dist/shared/compaction-agent-config-checkpoint.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/omo-process-sweep.d.ts +2 -4
- 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/ast-grep/SKILL.md +13 -1
- package/dist/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/dist/skills/coding-agent-sessions/SKILL.md +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 +3 -1
- package/dist/skills/debugging/references/methodology/00-setup.md +12 -0
- package/dist/skills/debugging/references/methodology/02-investigate.md +26 -5
- 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/debugging/references/tools/playwright-cli.md +79 -161
- package/dist/skills/frontend/ATTRIBUTION.md +10 -0
- package/dist/skills/frontend/SKILL.md +8 -3
- package/dist/skills/frontend/references/design/README.md +13 -4
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/ambience-skill.md +145 -0
- package/dist/skills/frontend/references/design/aside.md +1 -1
- package/dist/skills/frontend/references/design/clone-from-url.md +1 -1
- package/dist/skills/frontend/references/design/design-system-architecture.md +1 -0
- package/dist/skills/frontend/references/design/interaction-skill.md +2 -0
- package/dist/skills/frontend/references/design/print-paged-media.md +76 -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/frontend/references/perfection/README.md +1 -0
- package/dist/skills/frontend/scripts/perfection/lighthouse-audit.py +2 -2
- package/dist/skills/git-master/SKILL.md +1 -1
- package/dist/skills/init-deep/SKILL.md +14 -14
- package/dist/skills/lsp-setup/SKILL.md +1 -1
- package/dist/skills/programming/SKILL.md +1 -1
- package/dist/skills/refactor/SKILL.md +5 -5
- package/dist/skills/remove-ai-slops/SKILL.md +5 -5
- package/dist/skills/review-work/SKILL.md +101 -419
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +32 -86
- package/dist/skills/ultimate-browsing/SKILL.md +32 -27
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +111 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +2 -2
- package/dist/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +5 -2
- package/dist/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +8 -6
- package/dist/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +86 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +4 -7
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +86 -95
- package/dist/skills/ultimate-browsing/references/insane-search/README.md +18 -5
- package/dist/skills/ultimate-browsing/references/insane-search/playwright.md +16 -13
- package/dist/skills/ultimate-browsing/scripts/extract_cookies.py +3 -3
- package/dist/skills/{start-work → ulw-execute}/SKILL.md +24 -22
- package/dist/skills/ulw-plan/SKILL.md +5 -6
- package/dist/skills/ulw-plan/references/full-workflow.md +6 -5
- package/dist/skills/ulw-plan/references/intent-unclear.md +2 -2
- package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +2 -1
- package/dist/skills/ulw-research/SKILL.md +10 -5
- package/dist/skills/visual-qa/AGENTS.md +58 -0
- package/dist/skills/visual-qa/SKILL.md +4 -3
- package/dist/skills/visual-qa/references/browser-setup.md +75 -0
- package/dist/tools/delegate-task/builtin-categories.d.ts +3 -1
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +2 -1
- package/dist/tools/delegate-task/constants.d.ts +2 -2
- package/dist/tools/delegate-task/openai-categories.d.ts +10 -3
- package/dist/tools/delegate-task/sync-session-cleanup.d.ts +3 -0
- package/dist/tools/delegate-task/sync-session-poller.d.ts +1 -0
- package/dist/tools/delegate-task/tool-description.d.ts +3 -1
- package/dist/tools/delegate-task/types.d.ts +4 -0
- package/dist/tools/session-manager/directory-filter.d.ts +2 -0
- package/dist/tui.d.ts +12 -0
- package/dist/tui.js +22186 -30577
- package/package.json +51 -50
- package/packages/git-bash-mcp/dist/cli.js +6 -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 +9 -1
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +100 -28
- package/packages/lsp-core/src/lsp/client-diagnostics-pull-timeout.test.ts +64 -0
- package/packages/lsp-core/src/lsp/client-wrapper-outside-cwd.test.ts +78 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +103 -6
- package/packages/lsp-core/src/lsp/client-wrapper.ts +50 -16
- package/packages/lsp-core/src/lsp/client.ts +32 -3
- package/packages/lsp-core/src/lsp/connection.ts +16 -0
- package/packages/lsp-core/src/lsp/constants.ts +6 -0
- package/packages/lsp-core/src/lsp/controlled-clock-test-support.ts +90 -0
- package/packages/lsp-core/src/lsp/errors.ts +15 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +10 -3
- 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/json-rpc-connection.ts +11 -6
- package/packages/lsp-core/src/lsp/manager-lifecycle.test.ts +262 -0
- package/packages/lsp-core/src/lsp/manager-max-clients.test.ts +151 -0
- package/packages/lsp-core/src/lsp/manager.ts +138 -12
- 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/timer-provider.ts +13 -0
- package/packages/lsp-core/src/lsp/transport-request-timeout.test.ts +73 -0
- package/packages/lsp-core/src/lsp/transport.ts +16 -2
- package/packages/lsp-core/src/lsp/types.ts +8 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +29 -1
- package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +84 -1
- package/packages/lsp-core/src/lsp/workspace-document-state.ts +35 -11
- package/packages/lsp-core/src/lsp/workspace-markers.ts +18 -0
- package/packages/lsp-core/src/mcp.ts +3 -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/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/parameters.test.ts +51 -0
- package/packages/lsp-core/src/tools/types.ts +10 -0
- package/packages/lsp-daemon/dist/cli.js +1421 -960
- package/packages/lsp-daemon/dist/client.d.ts +10 -0
- package/packages/lsp-daemon/dist/client.js +956 -498
- package/packages/lsp-daemon/dist/daemon-client.d.ts +3 -0
- package/packages/lsp-daemon/dist/daemon-client.js +23 -3
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +6 -1
- package/packages/lsp-daemon/dist/ensure-daemon.js +27 -5
- package/packages/lsp-daemon/dist/index.js +860 -407
- package/packages/lsp-daemon/dist/ownership.js +2 -2
- package/packages/lsp-daemon/dist/proxy.js +3 -0
- package/packages/lsp-daemon/dist/version-reap.js +1 -1
- package/packages/lsp-daemon/package.json +5 -4
- package/packages/lsp-tools-mcp/dist/cli.js +764 -341
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +274 -138
- package/packages/lsp-tools-mcp/dist/mcp.js +789 -368
- package/packages/lsp-tools-mcp/dist/request-context.js +12 -13
- package/packages/lsp-tools-mcp/dist/tools.js +719 -302
- package/packages/lsp-tools-mcp/package.json +5 -4
- package/packages/omo-codex/THIRD-PARTY-NOTICES.md +4 -21
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +4 -6
- package/packages/omo-codex/plugin/.mcp.json +0 -6
- package/packages/omo-codex/plugin/AGENTS.md +47 -0
- package/packages/omo-codex/plugin/README.md +6 -2
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +8402 -408
- 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/bootstrap/src/setup.ts +7 -1
- 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 +6 -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/dist/cli.js +1 -1
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.js +2 -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/git-bash/src/codex-hook.ts +2 -1
- package/packages/omo-codex/plugin/components/git-bash/test/codex-hook.test.ts +6 -7
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/AGENTS.md +2 -2
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +2 -2
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/directive.md +2 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +36 -29
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +32 -26
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.d.ts +3 -0
- 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 +6 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +32 -28
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/types.ts +3 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/cli.test.ts +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +137 -28
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-doctor/SKILL.md +4 -2
- 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 +977 -545
- 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 +6 -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/README.md +2 -0
- package/packages/omo-codex/plugin/components/rules/biome.json +2 -2
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-6.md +123 -0
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +91 -68
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +8 -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 +15 -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 +38 -3
- 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 +29 -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 +6 -5
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +4 -10
- 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 +5328 -1382
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +5524 -1579
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +6 -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 +10 -4
- package/packages/omo-codex/plugin/components/ultrawork/README.md +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-low.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +4 -4
- package/packages/omo-codex/plugin/components/ultrawork/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +500 -4
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +6 -6
- package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +30 -14
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +4 -5
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +5 -5
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -0
- package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +4 -0
- package/packages/omo-codex/plugin/components/ultrawork/src/directive.ts +5 -2
- 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/directive-source.test.ts +14 -8
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +12 -1
- 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 +4 -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 +6 -6
- 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 +11 -11
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/dist/cli.js +16 -16
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +16 -0
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/package.json +13 -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 +4 -4
- 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}/src/types.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 +4 -11
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/codex-hook.test.ts +24 -22
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +19 -0
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +17 -1
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +12 -1
- package/packages/omo-codex/plugin/components/ulw-loop/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +44 -27
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-codex-validation.d.ts +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-codex-validation.js +30 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +10 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +2 -5
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +5 -78
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.js +114 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +7 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +57 -46
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +21 -8
- 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 +12 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +40 -37
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +2191 -737
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +28 -8
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +8 -5
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +35 -23
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +25 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/driver-objective-ack.d.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/driver-objective-ack.js +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence-artifacts.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence-artifacts.js +37 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +24 -12
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ledger.d.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/ledger.js +39 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +19 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-commit.d.ts +19 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-commit.js +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +6 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +54 -25
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.d.ts +10 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.js +38 -31
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +10 -7
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +121 -100
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-log.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-log.js +115 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.d.ts +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.js +41 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.d.ts +7 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.js +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.js +104 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.d.ts +13 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +65 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +4 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +72 -117
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +25 -13
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk/factory.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk/factory.js +157 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk/manifest.d.ts +381 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk/manifest.js +127 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk/types.d.ts +130 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk/types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk.d.ts +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/sdk.js +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-budget-io.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-budget-io.js +67 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.d.ts +7 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.js +188 -59
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-role-guard.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-role-guard.js +22 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/state-lock.d.ts +19 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/state-lock.js +259 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.d.ts +7 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.js +41 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.js +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.d.ts +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.js +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +9 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.d.ts +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +11 -11
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +28 -23
- package/packages/omo-codex/plugin/components/ulw-loop/dist/success-criteria-input.d.ts +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/success-criteria-input.js +41 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.d.ts +19 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.js +83 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +18 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +7 -6
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +7 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +33 -10
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-codex-validation.ts +52 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +8 -6
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +5 -98
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-template.ts +134 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +59 -77
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-arg-parser.ts +10 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +24 -8
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +14 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +52 -46
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +8 -6
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +35 -7
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +51 -33
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/constants.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +27 -9
- package/packages/omo-codex/plugin/components/ulw-loop/src/driver-objective-ack.ts +20 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/evidence-artifacts.ts +45 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/evidence.ts +23 -16
- package/packages/omo-codex/plugin/components/ulw-loop/src/ledger.ts +38 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/paths.ts +32 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-commit.ts +132 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +67 -54
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-goal-factory.ts +63 -31
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +140 -119
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-log.ts +112 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-missing-recovery.ts +61 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-aggregate.ts +11 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-artifacts.ts +123 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +71 -15
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +6 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +92 -136
- package/packages/omo-codex/plugin/components/ulw-loop/src/review-blockers.ts +38 -13
- package/packages/omo-codex/plugin/components/ulw-loop/src/sdk/factory.ts +218 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/sdk/manifest.ts +156 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/sdk/types.ts +143 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/sdk.ts +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-budget-io.ts +59 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-guard.ts +196 -52
- package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-role-guard.ts +22 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/state-lock.ts +257 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/status-next-actions.ts +45 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-batch.ts +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-mutations.ts +5 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering-types.ts +13 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +12 -10
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +27 -22
- package/packages/omo-codex/plugin/components/ulw-loop/src/success-criteria-input.ts +56 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/surface.ts +115 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +131 -82
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-template.test.ts +147 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint.test.ts +16 -22
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint-continuation.test.ts +4 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint.test.ts +31 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-complete-goals.test.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +35 -8
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +38 -4
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-json-errors.test.ts +27 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-scope-required.test.ts +144 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-status-next-actions.test.ts +185 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-batch.test.ts +8 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-validation-batch.test.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +37 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-snapshot.test.ts +88 -11
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/barrier.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/cli-session.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-child.ts +65 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-cli-qa.mjs +76 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-crash.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-mutations.mjs +58 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-writer.ts +65 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/lease-clock.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +9 -4
- package/packages/omo-codex/plugin/components/ulw-loop/test/guided-recovery.test.ts +67 -0
- 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/plan-commit-log.test.ts +252 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-commit-recovery.test.ts +190 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io-cross-process.test.ts +106 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +74 -25
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-log-legacy-projection.test.ts +228 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-log-newest.test.ts +72 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate-basics.test.ts +258 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-cap-and-dedupe.test.ts +22 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-fields-messages.test.ts +98 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-lazycodex-surface.test.ts +93 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-poisoning-cascades.test.ts +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +51 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-senpi-surface.test.ts +131 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-single-report.test.ts +241 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +58 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/review-blockers.test.ts +9 -7
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-completed-plan.test.ts +43 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-contract.test.ts +137 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-driver-states.test.ts +174 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-dx.test.ts +219 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/sdk-session-context.test.ts +169 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-guard.test.ts +450 -7
- package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-role-matrix.test.ts +113 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/state-lock.test.ts +310 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/status-next-actions-surface.test.ts +133 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering-batch.test.ts +12 -12
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +12 -6
- 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/surface.test.ts +74 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +13 -8
- 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-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/post-tool-use-recording-spawn-admission.json +18 -0
- 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-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-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 +16 -7
- package/packages/omo-codex/plugin/package-lock.json +992 -681
- package/packages/omo-codex/plugin/package.json +6 -3
- package/packages/omo-codex/plugin/scripts/AGENTS.md +39 -0
- package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +1 -2
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +0 -9
- package/packages/omo-codex/plugin/scripts/canonical-ultrawork-directive.mjs +17 -0
- package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +0 -1
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +16 -7
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +8 -4
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +19 -90
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/toml-section-editor.mjs +1 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.d.mts +4 -0
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +111 -64
- package/packages/omo-codex/plugin/shared/package.json +3 -4
- package/packages/omo-codex/plugin/shared/src/config-loader.ts +2 -102
- package/packages/omo-codex/plugin/shared/src/config-migration.ts +0 -1
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +41 -130
- package/packages/omo-codex/plugin/skills/ast-grep/AGENTS.md +51 -0
- package/packages/omo-codex/plugin/skills/ast-grep/SKILL.md +13 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +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 +3 -1
- 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 +26 -5
- 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/debugging/references/tools/playwright-cli.md +79 -161
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +10 -0
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +8 -3
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +13 -4
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ambience-skill.md +145 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/aside.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/clone-from-url.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/interaction-skill.md +2 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/print-paged-media.md +76 -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/frontend/references/perfection/README.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/lighthouse-audit.py +2 -2
- package/packages/omo-codex/plugin/skills/git-master/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +20 -18
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +4 -2
- package/packages/omo-codex/plugin/skills/lsp-setup/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +11 -9
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +11 -9
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +116 -424
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +32 -86
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +32 -27
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +111 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +5 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +8 -6
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +86 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +4 -7
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +86 -95
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +18 -5
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/playwright.md +16 -13
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/extract_cookies.py +3 -3
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +44 -27
- package/packages/omo-codex/plugin/skills/{start-work → ulw-execute}/SKILL.md +35 -36
- package/packages/omo-codex/plugin/skills/ulw-execute/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +31 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +33 -10
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +4 -5
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +5 -5
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -0
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +16 -9
- package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +58 -0
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +10 -7
- package/packages/omo-codex/plugin/skills/visual-qa/references/browser-setup.md +75 -0
- 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 +16 -51
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +2 -3
- package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +2 -7
- package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +14 -4
- 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 +4 -29
- package/packages/omo-codex/plugin/test/bootstrap-default-role.test.mjs +66 -0
- package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +0 -31
- package/packages/omo-codex/plugin/test/canonical-ultrawork-directive.test.mjs +53 -0
- 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 -51
- package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +100 -2
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +5 -6
- package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
- package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +1 -3
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +35 -35
- package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
- package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +107 -15
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +168 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +54 -24
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +18 -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 +5 -5
- 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/check-model-catalog-parity.mjs +42 -0
- package/packages/omo-codex/scripts/install-cache-copy.test.mjs +27 -1
- package/packages/omo-codex/scripts/install-config-autonomous-features.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-config-autonomous.test.mjs +2 -1
- package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +0 -23
- package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +5 -5
- package/packages/omo-codex/scripts/install-config.test.mjs +15 -17
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +16149 -4304
- package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +3 -4
- package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +1 -25
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/omo-codex/scripts/install-mcp-runtime.test.mjs +0 -36
- package/packages/omo-codex/scripts/install-packaged-local.test.mjs +1 -6
- package/packages/{omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md → prompts-core/prompts/ultrawork/codex.md} +44 -34
- package/packages/shared-skills/package.json +7 -1
- package/packages/shared-skills/skill-source-filter.d.ts +16 -0
- package/packages/shared-skills/skill-source-filter.mjs +44 -0
- package/packages/shared-skills/skills/ast-grep/AGENTS.md +51 -0
- package/packages/shared-skills/skills/ast-grep/SKILL.md +13 -1
- package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +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 +3 -1
- package/packages/shared-skills/skills/debugging/references/methodology/00-setup.md +12 -0
- package/packages/shared-skills/skills/debugging/references/methodology/02-investigate.md +26 -5
- 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/debugging/references/tools/playwright-cli.md +79 -161
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +10 -0
- package/packages/shared-skills/skills/frontend/SKILL.md +8 -3
- package/packages/shared-skills/skills/frontend/references/design/README.md +13 -4
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/ambience-skill.md +145 -0
- package/packages/shared-skills/skills/frontend/references/design/aside.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/clone-from-url.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/interaction-skill.md +2 -0
- package/packages/shared-skills/skills/frontend/references/design/print-paged-media.md +76 -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/frontend/references/perfection/README.md +1 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/lighthouse-audit.py +2 -2
- package/packages/shared-skills/skills/git-master/SKILL.md +1 -1
- package/packages/shared-skills/skills/init-deep/SKILL.md +14 -14
- package/packages/shared-skills/skills/lsp-setup/SKILL.md +1 -1
- package/packages/shared-skills/skills/programming/SKILL.md +1 -1
- package/packages/shared-skills/skills/refactor/SKILL.md +5 -5
- package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +5 -5
- package/packages/shared-skills/skills/review-work/SKILL.md +101 -419
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +32 -86
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +32 -27
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +111 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +5 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +8 -6
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +86 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +4 -7
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +86 -95
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +18 -5
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/playwright.md +16 -13
- package/packages/shared-skills/skills/ultimate-browsing/scripts/extract_cookies.py +3 -3
- package/packages/shared-skills/skills/{start-work → ulw-execute}/SKILL.md +24 -22
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +5 -6
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +6 -5
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +2 -2
- package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +2 -1
- package/packages/shared-skills/skills/ulw-research/SKILL.md +10 -5
- package/packages/shared-skills/skills/visual-qa/AGENTS.md +58 -0
- package/packages/shared-skills/skills/visual-qa/SKILL.md +4 -3
- package/packages/shared-skills/skills/visual-qa/references/browser-setup.md +75 -0
- package/postinstall.mjs +2 -0
- package/script/qa/web-terminal-visual-qa.mjs +2 -0
- package/script/qa/xterm-live-terminal.mjs +18 -2
- package/.agents/skills/work-with-pr-workspace/evals/evals.json +0 -76
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.json +0 -138
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.md +0 -42
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +0 -57
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +0 -15
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +0 -454
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +0 -136
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +0 -47
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +0 -163
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +0 -15
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +0 -615
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +0 -99
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +0 -50
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +0 -111
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +0 -37
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +0 -11
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +0 -205
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +0 -78
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +0 -42
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +0 -87
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +0 -11
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +0 -334
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +0 -86
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +0 -23
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +0 -119
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +0 -32
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +0 -10
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +0 -221
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +0 -104
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +0 -41
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +0 -84
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +0 -10
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +0 -342
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +0 -131
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +0 -39
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +0 -128
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +0 -32
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +0 -10
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +0 -143
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +0 -82
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +0 -51
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +0 -69
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +0 -10
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +0 -252
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +0 -83
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +0 -33
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +0 -101
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +0 -32
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +0 -10
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +0 -387
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +0 -112
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +0 -51
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +0 -75
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +0 -10
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +0 -529
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +0 -127
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +0 -42
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +0 -120
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +0 -1
- package/.agents/skills/work-with-pr-workspace/iteration-1/review.html +0 -1326
- package/.opencode/skills/work-with-pr-workspace/evals/evals.json +0 -76
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.json +0 -138
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.md +0 -42
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +0 -57
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +0 -15
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +0 -454
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +0 -136
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +0 -47
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +0 -163
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +0 -15
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +0 -615
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +0 -99
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +0 -50
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +0 -111
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +0 -37
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +0 -11
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +0 -205
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +0 -78
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +0 -42
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +0 -87
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +0 -11
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +0 -334
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +0 -86
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +0 -23
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +0 -119
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +0 -32
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +0 -10
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +0 -221
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +0 -104
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +0 -41
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +0 -84
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +0 -10
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +0 -342
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +0 -131
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +0 -39
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +0 -128
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +0 -32
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +0 -10
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +0 -143
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +0 -82
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +0 -51
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +0 -69
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +0 -10
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +0 -252
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +0 -83
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +0 -33
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +0 -101
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +0 -32
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +0 -10
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +0 -387
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +0 -112
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +0 -51
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +0 -75
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +0 -10
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +0 -529
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +0 -127
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +0 -42
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +0 -120
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +0 -1
- package/.opencode/skills/work-with-pr-workspace/iteration-1/review.html +0 -1326
- package/dist/config/schema/codegraph.d.ts +0 -12
- package/dist/config/schema/start-work.d.ts +0 -5
- package/dist/features/builtin-commands/templates/start-work.d.ts +0 -1
- package/dist/features/builtin-skills/index.d.ts +0 -1
- package/dist/features/builtin-skills/skill-file-loader.d.ts +0 -1
- package/dist/features/builtin-skills/skills/agent-browser-skill.d.ts +0 -1
- package/dist/features/builtin-skills/skills/agent-browser-template.d.ts +0 -1
- package/dist/features/builtin-skills/skills/debugging.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dev-browser.d.ts +0 -1
- package/dist/features/builtin-skills/skills/frontend.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-atomic-planning.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-context-analysis.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-execution-verification.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master.d.ts +0 -1
- package/dist/features/builtin-skills/skills/index.d.ts +0 -1
- package/dist/features/builtin-skills/skills/init-deep.d.ts +0 -1
- package/dist/features/builtin-skills/skills/playwright-cli.d.ts +0 -1
- package/dist/features/builtin-skills/skills/playwright-mcp-skill.d.ts +0 -1
- package/dist/features/builtin-skills/skills/playwright.d.ts +0 -1
- package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +0 -1
- package/dist/features/builtin-skills/skills/review-work.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-research.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-review.d.ts +0 -1
- package/dist/features/builtin-skills/skills/team-mode.d.ts +0 -1
- package/dist/features/builtin-skills/skills/visual-qa.d.ts +0 -1
- package/dist/features/builtin-skills/skills.d.ts +0 -1
- package/dist/features/builtin-skills/types.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/command-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/discovery-core.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/discovery-paths.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/discovery.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/index.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/install-path-resolver.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/installed-plugin-database.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/loaded-plugin.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-key.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-manifest.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-settings.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/types.d.ts +0 -1
- package/dist/hooks/codegraph-bootstrap/command-runner.d.ts +0 -17
- package/dist/hooks/codegraph-bootstrap/hook.d.ts +0 -35
- package/dist/hooks/codegraph-bootstrap/index.d.ts +0 -1
- package/dist/hooks/codegraph-bootstrap/project-root.d.ts +0 -1
- package/dist/hooks/codegraph-bootstrap/status.d.ts +0 -11
- package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +0 -11
- package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +0 -7
- package/dist/hooks/start-work/start-work-hook.d.ts +0 -23
- package/dist/mcp/codegraph.d.ts +0 -16
- package/dist/plugin/chat-message/start-work-message.d.ts +0 -5
- package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +0 -1
- package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +0 -1
- package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +0 -1
- package/dist/shared/prompt-async-gate/queue.d.ts +0 -1
- package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +0 -1
- package/dist/shared/prompt-async-gate/reservations.d.ts +0 -1
- package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +0 -1
- package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +0 -1
- package/dist/shared/prompt-async-gate/timing.d.ts +0 -1
- package/dist/shared/prompt-async-gate/types.d.ts +0 -1
- 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/skills/visual-qa/references/agent-browser-setup.md +0 -45
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/dist/tools/call-omo-agent/message-storage-directory.d.ts +0 -1
- package/dist/tools/delegate-task/anthropic-categories.d.ts +0 -2
- package/dist/tools/delegate-task/model-string-parser.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/missing-dependency-result.d.ts +0 -1
- package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +0 -58
- package/packages/omo-codex/plugin/components/codegraph/NODE-RUNTIME-LICENSES.md +0 -2951
- package/packages/omo-codex/plugin/components/codegraph/NOTICE +0 -16
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +0 -12244
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +0 -9842
- package/packages/omo-codex/plugin/components/codegraph/package.json +0 -33
- package/packages/omo-codex/plugin/components/codegraph/src/cache-gc.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +0 -79
- package/packages/omo-codex/plugin/components/codegraph/src/hook-input.ts +0 -33
- package/packages/omo-codex/plugin/components/codegraph/src/hook-sweep.ts +0 -25
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +0 -131
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +0 -258
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +0 -309
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +0 -80
- package/packages/omo-codex/plugin/components/codegraph/src/post-tool-use-hook.ts +0 -34
- package/packages/omo-codex/plugin/components/codegraph/src/serve-invocation.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +0 -263
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-command.ts +0 -106
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-cooldown.ts +0 -145
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-hook-runtime.ts +0 -21
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-lock.ts +0 -139
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-outcome.ts +0 -15
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-paths.ts +0 -32
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-project.ts +0 -109
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker-result.ts +0 -148
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +0 -175
- package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +0 -81
- package/packages/omo-codex/plugin/components/codegraph/test/cache-gc.test.ts +0 -34
- package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +0 -112
- package/packages/omo-codex/plugin/components/codegraph/test/hook-registration.test.ts +0 -26
- package/packages/omo-codex/plugin/components/codegraph/test/hook-session-start-guard.test.ts +0 -160
- package/packages/omo-codex/plugin/components/codegraph/test/hook-store-upgrade.test.ts +0 -50
- package/packages/omo-codex/plugin/components/codegraph/test/hook-sweep.test.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +0 -320
- package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +0 -172
- package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +0 -91
- package/packages/omo-codex/plugin/components/codegraph/test/provisioned-node-guard.test.ts +0 -100
- package/packages/omo-codex/plugin/components/codegraph/test/serve-built-wrapper.test.ts +0 -76
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +0 -133
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +0 -245
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +0 -69
- package/packages/omo-codex/plugin/components/codegraph/test/serve-node-support.test.ts +0 -43
- package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +0 -147
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +0 -175
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +0 -385
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +0 -206
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-project.test.ts +0 -58
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-state.test.ts +0 -104
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-trust-boundary.test.ts +0 -65
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-availability.test.ts +0 -106
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-cooldown.test.ts +0 -116
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +0 -258
- package/packages/omo-codex/plugin/components/codegraph/test/sweep-cli.test.ts +0 -56
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.build.json +0 -13
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.json +0 -25
- package/packages/omo-codex/plugin/components/start-work-continuation/LICENSE +0 -21
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +0 -28
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +0 -477
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +0 -18
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +0 -17
- 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/scripts/migrate-omo-sot/editor.mjs +0 -125
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/jsonc.mjs +0 -43
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/scaffold.mjs +0 -29
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +0 -121
- 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/skills/visual-qa/references/agent-browser-setup.md +0 -45
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/component-codegraph-mcp-smoke.test.mjs +0 -76
- package/packages/omo-codex/plugin/test/migrate-omo-sot.test.mjs +0 -179
- 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/packages/shared-skills/skills/visual-qa/references/agent-browser-setup.md +0 -45
- /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/{codegraph → 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}/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
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// src/cli.ts
|
|
4
|
+
import { argv, stderr } from "node:process";
|
|
5
|
+
|
|
3
6
|
// ../lsp-core/src/lsp/cleanup-errors.ts
|
|
4
7
|
function writeCleanupError(message) {
|
|
5
8
|
process.stderr.write(`${message}
|
|
@@ -17,6 +20,13 @@ import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
|
17
20
|
// ../lsp-core/src/lsp/connection.ts
|
|
18
21
|
import { pathToFileURL } from "node:url";
|
|
19
22
|
|
|
23
|
+
// ../lsp-core/src/lsp/timer-provider.ts
|
|
24
|
+
var realTimerProvider = {
|
|
25
|
+
now: () => Date.now(),
|
|
26
|
+
setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
|
|
27
|
+
clearTimeout: (handle) => clearTimeout(handle)
|
|
28
|
+
};
|
|
29
|
+
|
|
20
30
|
// ../lsp-core/src/lsp/constants.ts
|
|
21
31
|
var DEFAULT_MAX_REFERENCES = 200;
|
|
22
32
|
var DEFAULT_MAX_SYMBOLS = 200;
|
|
@@ -25,28 +35,24 @@ var DEFAULT_MAX_DIRECTORY_FILES = 50;
|
|
|
25
35
|
var REQUEST_TIMEOUT_MS = 15000;
|
|
26
36
|
var INIT_TIMEOUT_MS = 60000;
|
|
27
37
|
var IDLE_TIMEOUT_MS = 5 * 60000;
|
|
38
|
+
var MAX_RESIDENT_CLIENTS = 6;
|
|
28
39
|
var REAPER_INTERVAL_MS = 60000;
|
|
29
40
|
var STOP_HARD_KILL_TIMEOUT_MS = 5000;
|
|
30
41
|
var STOP_SIGKILL_GRACE_MS = 1000;
|
|
42
|
+
var CLIENT_RESPAWN_RETRY_LIMIT = 2;
|
|
43
|
+
var CLIENT_RESPAWN_COOLDOWN_MS = 60000;
|
|
31
44
|
|
|
32
45
|
// ../lsp-core/src/lsp/errors.ts
|
|
33
46
|
class LspConnectionClosedError extends Error {
|
|
34
|
-
serverId;
|
|
35
|
-
root;
|
|
36
|
-
name = "LspConnectionClosedError";
|
|
37
47
|
constructor(serverId, root, message) {
|
|
38
48
|
super(message ?? `LSP connection closed for ${serverId} at ${root}`);
|
|
39
49
|
this.serverId = serverId;
|
|
40
50
|
this.root = root;
|
|
51
|
+
this.name = "LspConnectionClosedError";
|
|
41
52
|
}
|
|
42
53
|
}
|
|
43
54
|
|
|
44
55
|
class LspProcessExitedError extends Error {
|
|
45
|
-
serverId;
|
|
46
|
-
root;
|
|
47
|
-
exitCode;
|
|
48
|
-
stderrTail;
|
|
49
|
-
name = "LspProcessExitedError";
|
|
50
56
|
constructor(serverId, root, exitCode, stderrTail) {
|
|
51
57
|
const stderrSuffix = stderrTail ? `
|
|
52
58
|
stderr tail: ${stderrTail}` : "";
|
|
@@ -55,46 +61,59 @@ stderr tail: ${stderrTail}` : "";
|
|
|
55
61
|
this.root = root;
|
|
56
62
|
this.exitCode = exitCode;
|
|
57
63
|
this.stderrTail = stderrTail;
|
|
64
|
+
this.name = "LspProcessExitedError";
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
class LspRequestTimeoutError extends Error {
|
|
62
|
-
method;
|
|
63
|
-
stderrTail;
|
|
64
|
-
name = "LspRequestTimeoutError";
|
|
65
69
|
constructor(method, stderrTail) {
|
|
66
70
|
const stderrSuffix = stderrTail ? `
|
|
67
71
|
recent stderr: ${stderrTail}` : "";
|
|
68
72
|
super(`LSP request timeout (method: ${method})${stderrSuffix}`);
|
|
69
73
|
this.method = method;
|
|
70
74
|
this.stderrTail = stderrTail;
|
|
75
|
+
this.name = "LspRequestTimeoutError";
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
class LspInvalidPathError extends Error {
|
|
75
|
-
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
this.name = "LspInvalidPathError";
|
|
83
|
+
}
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
class LspServerLookupError extends Error {
|
|
79
|
-
lookup;
|
|
80
|
-
name = "LspServerLookupError";
|
|
81
87
|
constructor(message, lookup) {
|
|
82
88
|
super(message);
|
|
83
89
|
this.lookup = lookup;
|
|
90
|
+
this.name = "LspServerLookupError";
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
class LspServerInitializingError extends Error {
|
|
88
|
-
originalError;
|
|
89
|
-
name = "LspServerInitializingError";
|
|
90
95
|
constructor(originalError) {
|
|
91
96
|
super(`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`);
|
|
92
97
|
this.originalError = originalError;
|
|
98
|
+
this.name = "LspServerInitializingError";
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
class LspProcessSpawnError extends Error {
|
|
97
|
-
|
|
103
|
+
constructor() {
|
|
104
|
+
super(...arguments);
|
|
105
|
+
this.name = "LspProcessSpawnError";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
class LspClientRespawnBudgetExceededError extends Error {
|
|
110
|
+
constructor(serverId, root, retryLimit) {
|
|
111
|
+
super(`LSP server ${serverId} at ${root} failed to stay alive; respawn budget exhausted ` + `(${retryLimit} consecutive dead generations). Retrying after the cooldown may succeed.`);
|
|
112
|
+
this.serverId = serverId;
|
|
113
|
+
this.root = root;
|
|
114
|
+
this.retryLimit = retryLimit;
|
|
115
|
+
this.name = "LspClientRespawnBudgetExceededError";
|
|
116
|
+
}
|
|
98
117
|
}
|
|
99
118
|
function isLspDeadConnectionError(err) {
|
|
100
119
|
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
@@ -110,20 +129,31 @@ var METHOD_NOT_FOUND = -32601;
|
|
|
110
129
|
var INTERNAL_ERROR = -32603;
|
|
111
130
|
|
|
112
131
|
class JsonRpcConnection {
|
|
113
|
-
reader;
|
|
114
|
-
writer;
|
|
115
|
-
pendingRequests = new Map;
|
|
116
|
-
notificationHandlers = new Map;
|
|
117
|
-
requestHandlers = new Map;
|
|
118
|
-
closeHandlers = [];
|
|
119
|
-
errorHandlers = [];
|
|
120
|
-
inputBuffer = Buffer.alloc(0);
|
|
121
|
-
nextRequestId = 1;
|
|
122
|
-
listening = false;
|
|
123
|
-
disposed = false;
|
|
124
132
|
constructor(reader, writer) {
|
|
125
133
|
this.reader = reader;
|
|
126
134
|
this.writer = writer;
|
|
135
|
+
this.pendingRequests = new Map;
|
|
136
|
+
this.notificationHandlers = new Map;
|
|
137
|
+
this.requestHandlers = new Map;
|
|
138
|
+
this.closeHandlers = [];
|
|
139
|
+
this.errorHandlers = [];
|
|
140
|
+
this.inputBuffer = Buffer.alloc(0);
|
|
141
|
+
this.nextRequestId = 1;
|
|
142
|
+
this.listening = false;
|
|
143
|
+
this.disposed = false;
|
|
144
|
+
this.handleData = (chunk) => {
|
|
145
|
+
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
146
|
+
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
147
|
+
this.drainInputBuffer();
|
|
148
|
+
};
|
|
149
|
+
this.handleClose = () => {
|
|
150
|
+
for (const handler of this.closeHandlers) {
|
|
151
|
+
handler();
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
this.handleStreamError = (error) => {
|
|
155
|
+
this.emitError(error);
|
|
156
|
+
};
|
|
127
157
|
}
|
|
128
158
|
listen() {
|
|
129
159
|
if (this.listening)
|
|
@@ -158,6 +188,7 @@ class JsonRpcConnection {
|
|
|
158
188
|
let cancelAfterWrite = false;
|
|
159
189
|
let settled = false;
|
|
160
190
|
const writeCancel = () => this.writeMessage({ jsonrpc: "2.0", method: "$/cancelRequest", params: { id } });
|
|
191
|
+
let rejectAfterCancelWrite;
|
|
161
192
|
const responsePromise = new Promise((resolve, reject) => {
|
|
162
193
|
const cleanup = () => {
|
|
163
194
|
options.signal?.removeEventListener("abort", onAbort);
|
|
@@ -169,15 +200,19 @@ class JsonRpcConnection {
|
|
|
169
200
|
this.pendingRequests.delete(key);
|
|
170
201
|
cleanup();
|
|
171
202
|
const rejectCancelled = () => reject(abortError(options.signal));
|
|
203
|
+
rejectAfterCancelWrite = async () => {
|
|
204
|
+
try {
|
|
205
|
+
await writeCancel();
|
|
206
|
+
} catch (error) {
|
|
207
|
+
this.emitError(toError(error));
|
|
208
|
+
}
|
|
209
|
+
rejectCancelled();
|
|
210
|
+
};
|
|
172
211
|
if (!requestWritten) {
|
|
173
212
|
cancelAfterWrite = true;
|
|
174
|
-
rejectCancelled();
|
|
175
213
|
return;
|
|
176
214
|
}
|
|
177
|
-
|
|
178
|
-
this.emitError(toError(error));
|
|
179
|
-
rejectCancelled();
|
|
180
|
-
});
|
|
215
|
+
rejectAfterCancelWrite();
|
|
181
216
|
};
|
|
182
217
|
const onAbort = () => settleCancel();
|
|
183
218
|
this.pendingRequests.set(key, {
|
|
@@ -205,7 +240,7 @@ class JsonRpcConnection {
|
|
|
205
240
|
await this.writeMessage(message);
|
|
206
241
|
requestWritten = true;
|
|
207
242
|
if (cancelAfterWrite)
|
|
208
|
-
await
|
|
243
|
+
await rejectAfterCancelWrite?.();
|
|
209
244
|
} catch (error) {
|
|
210
245
|
if (settled)
|
|
211
246
|
return responsePromise;
|
|
@@ -244,19 +279,6 @@ class JsonRpcConnection {
|
|
|
244
279
|
this.notificationHandlers.clear();
|
|
245
280
|
this.requestHandlers.clear();
|
|
246
281
|
}
|
|
247
|
-
handleData = (chunk) => {
|
|
248
|
-
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
249
|
-
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
250
|
-
this.drainInputBuffer();
|
|
251
|
-
};
|
|
252
|
-
handleClose = () => {
|
|
253
|
-
for (const handler of this.closeHandlers) {
|
|
254
|
-
handler();
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
handleStreamError = (error) => {
|
|
258
|
-
this.emitError(error);
|
|
259
|
-
};
|
|
260
282
|
drainInputBuffer() {
|
|
261
283
|
while (true) {
|
|
262
284
|
const headerEnd = this.inputBuffer.indexOf(HEADER_SEPARATOR);
|
|
@@ -604,33 +626,29 @@ function isPosition(value) {
|
|
|
604
626
|
|
|
605
627
|
// ../lsp-core/src/lsp/transport.ts
|
|
606
628
|
class LspClientNotStartedError extends Error {
|
|
607
|
-
serverId;
|
|
608
|
-
root;
|
|
609
|
-
name = "LspClientNotStartedError";
|
|
610
629
|
constructor(serverId, root) {
|
|
611
630
|
super("LSP client not started");
|
|
612
631
|
this.serverId = serverId;
|
|
613
632
|
this.root = root;
|
|
633
|
+
this.name = "LspClientNotStartedError";
|
|
614
634
|
}
|
|
615
635
|
}
|
|
616
636
|
|
|
617
637
|
class LspClientTransport {
|
|
618
|
-
root;
|
|
619
|
-
server;
|
|
620
|
-
proc = null;
|
|
621
|
-
connection = null;
|
|
622
|
-
stderrBuffer = [];
|
|
623
|
-
processExited = false;
|
|
624
|
-
diagnosticsStore = new Map;
|
|
625
|
-
requestTimeoutMs;
|
|
626
|
-
initializeTimeoutMs;
|
|
627
|
-
workspaceApplyEditHandler = null;
|
|
628
|
-
diagnosticPullSupported = false;
|
|
629
638
|
constructor(root, server, timeouts = {}) {
|
|
630
639
|
this.root = root;
|
|
631
640
|
this.server = server;
|
|
641
|
+
this.proc = null;
|
|
642
|
+
this.connection = null;
|
|
643
|
+
this.stderrBuffer = [];
|
|
644
|
+
this.processExited = false;
|
|
645
|
+
this.diagnosticsStore = new Map;
|
|
646
|
+
this.workspaceApplyEditHandler = null;
|
|
647
|
+
this.diagnosticPullSupported = false;
|
|
648
|
+
this.documentFormattingSupported = false;
|
|
632
649
|
this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
633
650
|
this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
651
|
+
this.timerProvider = timeouts.timerProvider ?? realTimerProvider;
|
|
634
652
|
}
|
|
635
653
|
pid() {
|
|
636
654
|
return this.proc?.pid;
|
|
@@ -650,6 +668,12 @@ class LspClientTransport {
|
|
|
650
668
|
isDiagnosticPullSupported() {
|
|
651
669
|
return this.diagnosticPullSupported;
|
|
652
670
|
}
|
|
671
|
+
setDocumentFormattingSupported(supported) {
|
|
672
|
+
this.documentFormattingSupported = supported;
|
|
673
|
+
}
|
|
674
|
+
isDocumentFormattingSupported() {
|
|
675
|
+
return this.documentFormattingSupported;
|
|
676
|
+
}
|
|
653
677
|
handlePublishDiagnostics(params) {
|
|
654
678
|
this.diagnosticsStore.set(params.uri, [...params.diagnostics]);
|
|
655
679
|
}
|
|
@@ -725,7 +749,7 @@ class LspClientTransport {
|
|
|
725
749
|
const options = args[1];
|
|
726
750
|
const timeoutMs = options?.timeoutMs ?? this.requestTimeoutMs;
|
|
727
751
|
const timeoutController = new AbortController;
|
|
728
|
-
const timeoutHandle = setTimeout(() => {
|
|
752
|
+
const timeoutHandle = this.timerProvider.setTimeout(() => {
|
|
729
753
|
const stderrTail = this.stderrBuffer.slice(-5).join(`
|
|
730
754
|
`);
|
|
731
755
|
timeoutController.abort(new LspRequestTimeoutError(method, stderrTail || undefined));
|
|
@@ -744,7 +768,7 @@ class LspClientTransport {
|
|
|
744
768
|
}
|
|
745
769
|
throw error;
|
|
746
770
|
} finally {
|
|
747
|
-
clearTimeout(timeoutHandle);
|
|
771
|
+
this.timerProvider.clearTimeout(timeoutHandle);
|
|
748
772
|
combinedSignal.dispose();
|
|
749
773
|
}
|
|
750
774
|
}
|
|
@@ -863,6 +887,14 @@ function supportsDiagnosticPull(capabilities) {
|
|
|
863
887
|
return false;
|
|
864
888
|
return Object.hasOwn(capabilities, "diagnosticProvider");
|
|
865
889
|
}
|
|
890
|
+
function supportsDocumentFormatting(capabilities) {
|
|
891
|
+
if (capabilities === undefined)
|
|
892
|
+
return false;
|
|
893
|
+
const provider = capabilities.documentFormattingProvider;
|
|
894
|
+
if (provider === undefined || provider === null || provider === false)
|
|
895
|
+
return false;
|
|
896
|
+
return provider === true || typeof provider === "object";
|
|
897
|
+
}
|
|
866
898
|
|
|
867
899
|
class LspClientConnection extends LspClientTransport {
|
|
868
900
|
async initialize() {
|
|
@@ -879,6 +911,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
879
911
|
references: {},
|
|
880
912
|
documentSymbol: { hierarchicalDocumentSymbolSupport: true },
|
|
881
913
|
publishDiagnostics: {},
|
|
914
|
+
formatting: { dynamicRegistration: false },
|
|
882
915
|
rename: {
|
|
883
916
|
prepareSupport: true,
|
|
884
917
|
prepareSupportDefaultBehavior: 1
|
|
@@ -920,6 +953,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
920
953
|
initializationOptions: this.server.initialization
|
|
921
954
|
}, { timeoutMs: this.initializeTimeoutMs });
|
|
922
955
|
this.setDiagnosticPullSupported(supportsDiagnosticPull(result?.capabilities));
|
|
956
|
+
this.setDocumentFormattingSupported(supportsDocumentFormatting(result?.capabilities));
|
|
923
957
|
await this.sendNotification("initialized", {});
|
|
924
958
|
await this.sendNotification("workspace/didChangeConfiguration", {
|
|
925
959
|
settings: { json: { validate: { enable: true } } }
|
|
@@ -1125,6 +1159,17 @@ function canonicalPath(filePath) {
|
|
|
1125
1159
|
return absolute;
|
|
1126
1160
|
}
|
|
1127
1161
|
}
|
|
1162
|
+
function normalizeDocumentUri(uri) {
|
|
1163
|
+
let decoded = uri;
|
|
1164
|
+
try {
|
|
1165
|
+
decoded = decodeURIComponent(uri);
|
|
1166
|
+
} catch {
|
|
1167
|
+
decoded = uri;
|
|
1168
|
+
}
|
|
1169
|
+
if (process.platform !== "win32")
|
|
1170
|
+
return decoded;
|
|
1171
|
+
return decoded.replace(/^(file:\/\/\/)([a-z]):/, (_match, prefix, drive) => `${prefix}${drive.toUpperCase()}:`);
|
|
1172
|
+
}
|
|
1128
1173
|
function isSameOrDescendant(candidate, parent) {
|
|
1129
1174
|
const suffix = relative(parent, candidate);
|
|
1130
1175
|
return suffix === "" || !suffix.startsWith("..") && suffix !== "..";
|
|
@@ -1135,17 +1180,18 @@ function movedPath(candidate, oldPath, newPath) {
|
|
|
1135
1180
|
}
|
|
1136
1181
|
|
|
1137
1182
|
class WorkspaceDocumentState {
|
|
1138
|
-
sendNotification;
|
|
1139
|
-
clearDiagnostics;
|
|
1140
|
-
openDocuments = new Map;
|
|
1141
|
-
openByUri = new Map;
|
|
1142
|
-
openPromises = new Map;
|
|
1143
|
-
now;
|
|
1144
|
-
versionlessPublishQuiescenceMs;
|
|
1145
1183
|
constructor(sendNotification, clearDiagnostics, options = {}) {
|
|
1146
1184
|
this.sendNotification = sendNotification;
|
|
1147
1185
|
this.clearDiagnostics = clearDiagnostics;
|
|
1148
|
-
this.
|
|
1186
|
+
this.openDocuments = new Map;
|
|
1187
|
+
this.openByUri = new Map;
|
|
1188
|
+
this.openPromises = new Map;
|
|
1189
|
+
this.timerProvider = options.timerProvider ?? {
|
|
1190
|
+
now: options.now ?? (() => Date.now()),
|
|
1191
|
+
setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
|
|
1192
|
+
clearTimeout: (handle) => clearTimeout(handle)
|
|
1193
|
+
};
|
|
1194
|
+
this.now = () => this.timerProvider.now();
|
|
1149
1195
|
this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
|
|
1150
1196
|
}
|
|
1151
1197
|
async openFile(filePath) {
|
|
@@ -1167,7 +1213,7 @@ class WorkspaceDocumentState {
|
|
|
1167
1213
|
return this.openDocuments.get(canonicalPath(filePath))?.version;
|
|
1168
1214
|
}
|
|
1169
1215
|
getStoredDiagnostics(uri) {
|
|
1170
|
-
const state = this.openByUri.get(uri);
|
|
1216
|
+
const state = this.openByUri.get(normalizeDocumentUri(uri));
|
|
1171
1217
|
if (!state)
|
|
1172
1218
|
return [];
|
|
1173
1219
|
return state.lastPublish?.diagnostics ?? state.pullCache?.diagnostics ?? [];
|
|
@@ -1189,13 +1235,13 @@ class WorkspaceDocumentState {
|
|
|
1189
1235
|
return state !== undefined && state.uri === snapshot.uri && state.version === snapshot.version && state.generation === snapshot.documentGeneration;
|
|
1190
1236
|
}
|
|
1191
1237
|
getPullCache(snapshot) {
|
|
1192
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
1238
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
1193
1239
|
if (!state?.pullCache || state.pullCache.documentVersion !== snapshot.version)
|
|
1194
1240
|
return null;
|
|
1195
1241
|
return state.pullCache;
|
|
1196
1242
|
}
|
|
1197
1243
|
recordPullDiagnostics(snapshot, report) {
|
|
1198
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
1244
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
1199
1245
|
if (!state)
|
|
1200
1246
|
return;
|
|
1201
1247
|
state.pullCache = {
|
|
@@ -1205,7 +1251,7 @@ class WorkspaceDocumentState {
|
|
|
1205
1251
|
};
|
|
1206
1252
|
}
|
|
1207
1253
|
recordPublishedDiagnostics(params) {
|
|
1208
|
-
const state = this.openByUri.get(params.uri);
|
|
1254
|
+
const state = this.openByUri.get(normalizeDocumentUri(params.uri));
|
|
1209
1255
|
if (!state)
|
|
1210
1256
|
return;
|
|
1211
1257
|
state.publishGeneration += 1;
|
|
@@ -1219,7 +1265,7 @@ class WorkspaceDocumentState {
|
|
|
1219
1265
|
this.notifyWaiters(state);
|
|
1220
1266
|
}
|
|
1221
1267
|
resolvePushDiagnostics(snapshot) {
|
|
1222
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
1268
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
1223
1269
|
if (!state?.lastPublish)
|
|
1224
1270
|
return { status: "missing" };
|
|
1225
1271
|
const publish = state.lastPublish;
|
|
@@ -1233,20 +1279,22 @@ class WorkspaceDocumentState {
|
|
|
1233
1279
|
return waitMs === 0 ? { status: "ready", diagnostics: publish.diagnostics } : { status: "wait", waitMs };
|
|
1234
1280
|
}
|
|
1235
1281
|
waitForDiagnosticsActivity(snapshot, timeoutMs) {
|
|
1236
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
1282
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
1237
1283
|
if (!state || timeoutMs <= 0)
|
|
1238
1284
|
return Promise.resolve();
|
|
1285
|
+
if (state.publishGeneration !== snapshot.publishGeneration)
|
|
1286
|
+
return Promise.resolve();
|
|
1239
1287
|
return new Promise((resolveActivity) => {
|
|
1240
1288
|
let settled = false;
|
|
1241
1289
|
const finish = () => {
|
|
1242
1290
|
if (settled)
|
|
1243
1291
|
return;
|
|
1244
1292
|
settled = true;
|
|
1245
|
-
clearTimeout(timer);
|
|
1293
|
+
this.timerProvider.clearTimeout(timer);
|
|
1246
1294
|
state.waiters.delete(finish);
|
|
1247
1295
|
resolveActivity();
|
|
1248
1296
|
};
|
|
1249
|
-
const timer = setTimeout(finish, timeoutMs);
|
|
1297
|
+
const timer = this.timerProvider.setTimeout(finish, timeoutMs);
|
|
1250
1298
|
if (typeof timer.unref === "function")
|
|
1251
1299
|
timer.unref();
|
|
1252
1300
|
state.waiters.add(finish);
|
|
@@ -1354,7 +1402,7 @@ class WorkspaceDocumentState {
|
|
|
1354
1402
|
waiters: new Set
|
|
1355
1403
|
};
|
|
1356
1404
|
this.openDocuments.set(path, state);
|
|
1357
|
-
this.openByUri.set(state.uri, state);
|
|
1405
|
+
this.openByUri.set(normalizeDocumentUri(state.uri), state);
|
|
1358
1406
|
this.notifyWaiters(state);
|
|
1359
1407
|
await this.sendNotification("textDocument/didOpen", {
|
|
1360
1408
|
textDocument: { uri: state.uri, languageId: state.languageId, version: state.version, text }
|
|
@@ -1379,7 +1427,7 @@ class WorkspaceDocumentState {
|
|
|
1379
1427
|
}
|
|
1380
1428
|
async closeDocument(state) {
|
|
1381
1429
|
this.openDocuments.delete(state.path);
|
|
1382
|
-
this.openByUri.delete(state.uri);
|
|
1430
|
+
this.openByUri.delete(normalizeDocumentUri(state.uri));
|
|
1383
1431
|
this.clearDiagnostics(state.uri);
|
|
1384
1432
|
this.notifyWaiters(state);
|
|
1385
1433
|
await this.sendNotification("textDocument/didClose", { textDocument: { uri: state.uri } });
|
|
@@ -1408,13 +1456,11 @@ import { dirname, isAbsolute, relative as relative2, resolve as resolve2 } from
|
|
|
1408
1456
|
import { fileURLToPath } from "node:url";
|
|
1409
1457
|
|
|
1410
1458
|
class WorkspaceEditPathError extends Error {
|
|
1411
|
-
path;
|
|
1412
|
-
detail;
|
|
1413
|
-
name = "WorkspaceEditPathError";
|
|
1414
1459
|
constructor(path, detail) {
|
|
1415
1460
|
super(`${detail}: ${path}`);
|
|
1416
1461
|
this.path = path;
|
|
1417
1462
|
this.detail = detail;
|
|
1463
|
+
this.name = "WorkspaceEditPathError";
|
|
1418
1464
|
}
|
|
1419
1465
|
}
|
|
1420
1466
|
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
@@ -1706,13 +1752,11 @@ function canonicalFingerprint(operations) {
|
|
|
1706
1752
|
|
|
1707
1753
|
// ../lsp-core/src/lsp/workspace-edit-types.ts
|
|
1708
1754
|
class WorkspaceEditValidationError extends Error {
|
|
1709
|
-
changeIndex;
|
|
1710
|
-
detail;
|
|
1711
|
-
name = "WorkspaceEditValidationError";
|
|
1712
1755
|
constructor(changeIndex, detail) {
|
|
1713
1756
|
super(`change ${changeIndex}: ${detail}`);
|
|
1714
1757
|
this.changeIndex = changeIndex;
|
|
1715
1758
|
this.detail = detail;
|
|
1759
|
+
this.name = "WorkspaceEditValidationError";
|
|
1716
1760
|
}
|
|
1717
1761
|
}
|
|
1718
1762
|
|
|
@@ -1798,14 +1842,14 @@ function parseSinglePathResource(input, kind) {
|
|
|
1798
1842
|
return;
|
|
1799
1843
|
}
|
|
1800
1844
|
if (kind === "create") {
|
|
1801
|
-
const
|
|
1845
|
+
const options = parseOptions(change["options"], ["overwrite", "ignoreIfExists"], changeIndex);
|
|
1802
1846
|
target.operations.push({
|
|
1803
1847
|
kind,
|
|
1804
1848
|
changeIndex,
|
|
1805
1849
|
path: resolvedPath.path,
|
|
1806
1850
|
reportedPath: resolvedPath.requestedPath,
|
|
1807
|
-
overwrite:
|
|
1808
|
-
ignoreIfExists:
|
|
1851
|
+
overwrite: options["overwrite"] ?? false,
|
|
1852
|
+
ignoreIfExists: options["ignoreIfExists"] ?? false,
|
|
1809
1853
|
followedSymbolicLink: resolvedPath.followedSymbolicLink
|
|
1810
1854
|
});
|
|
1811
1855
|
return;
|
|
@@ -2210,10 +2254,9 @@ function simulateDelete(operation, virtual) {
|
|
|
2210
2254
|
import { existsSync as existsSync4, lstatSync as lstatSync3, readdirSync as readdirSync2 } from "node:fs";
|
|
2211
2255
|
import { dirname as dirname3, resolve as resolve4 } from "node:path";
|
|
2212
2256
|
class WorkspaceSnapshotBuilder {
|
|
2213
|
-
workspaceRoot;
|
|
2214
|
-
snapshots = new Map;
|
|
2215
2257
|
constructor(workspaceRoot) {
|
|
2216
2258
|
this.workspaceRoot = workspaceRoot;
|
|
2259
|
+
this.snapshots = new Map;
|
|
2217
2260
|
}
|
|
2218
2261
|
build(operations) {
|
|
2219
2262
|
this.add(this.workspaceRoot, false);
|
|
@@ -2257,8 +2300,10 @@ function snapshotOperations(operations, workspaceRoot) {
|
|
|
2257
2300
|
|
|
2258
2301
|
// ../lsp-core/src/lsp/workspace-edit-plan.ts
|
|
2259
2302
|
class PlanPathIndex {
|
|
2260
|
-
|
|
2261
|
-
|
|
2303
|
+
constructor() {
|
|
2304
|
+
this.firstChangeByPath = new Map;
|
|
2305
|
+
this.reportedPathByCanonical = new Map;
|
|
2306
|
+
}
|
|
2262
2307
|
build(operations) {
|
|
2263
2308
|
for (const operation of operations) {
|
|
2264
2309
|
switch (operation.kind) {
|
|
@@ -2274,11 +2319,11 @@ class PlanPathIndex {
|
|
|
2274
2319
|
}
|
|
2275
2320
|
}
|
|
2276
2321
|
}
|
|
2277
|
-
add(path,
|
|
2322
|
+
add(path, reportedPath, changeIndex) {
|
|
2278
2323
|
if (!this.firstChangeByPath.has(path))
|
|
2279
2324
|
this.firstChangeByPath.set(path, changeIndex);
|
|
2280
2325
|
if (!this.reportedPathByCanonical.has(path))
|
|
2281
|
-
this.reportedPathByCanonical.set(path,
|
|
2326
|
+
this.reportedPathByCanonical.set(path, reportedPath);
|
|
2282
2327
|
}
|
|
2283
2328
|
}
|
|
2284
2329
|
function fingerprintWorkspaceEdit(edit, workspaceRoot) {
|
|
@@ -2347,14 +2392,11 @@ function isRecord3(value) {
|
|
|
2347
2392
|
}
|
|
2348
2393
|
|
|
2349
2394
|
class WorkspaceMutationController {
|
|
2350
|
-
workspaceRoot;
|
|
2351
|
-
documents;
|
|
2352
|
-
activeLease = null;
|
|
2353
|
-
nextLeaseId = 1;
|
|
2354
|
-
io;
|
|
2355
2395
|
constructor(workspaceRoot, documents) {
|
|
2356
2396
|
this.workspaceRoot = workspaceRoot;
|
|
2357
2397
|
this.documents = documents;
|
|
2398
|
+
this.activeLease = null;
|
|
2399
|
+
this.nextLeaseId = 1;
|
|
2358
2400
|
}
|
|
2359
2401
|
setIo(io) {
|
|
2360
2402
|
this.io = io;
|
|
@@ -2393,8 +2435,8 @@ class WorkspaceMutationController {
|
|
|
2393
2435
|
};
|
|
2394
2436
|
}
|
|
2395
2437
|
lease.phase = "applying";
|
|
2396
|
-
lease.applyCompletion = new Promise((
|
|
2397
|
-
lease.resolveApply =
|
|
2438
|
+
lease.applyCompletion = new Promise((resolve) => {
|
|
2439
|
+
lease.resolveApply = resolve;
|
|
2398
2440
|
});
|
|
2399
2441
|
const edit = isRecord3(params) ? params["edit"] : undefined;
|
|
2400
2442
|
const record = edit === undefined ? { fingerprint: null, result: failure("workspace/applyEdit params.edit is required", 0) } : await this.applyEdit(edit, lease);
|
|
@@ -2467,14 +2509,12 @@ var DIAGNOSTICS_FRESHNESS_TIMEOUT_MS = 3000;
|
|
|
2467
2509
|
var VERSIONLESS_PUBLISH_QUIESCENCE_MS = 250;
|
|
2468
2510
|
|
|
2469
2511
|
class LspClient extends LspClientConnection {
|
|
2470
|
-
diagnosticPullErrors = [];
|
|
2471
|
-
documents;
|
|
2472
|
-
workspaceMutations;
|
|
2473
|
-
diagnosticsFreshnessTimeoutMs;
|
|
2474
2512
|
constructor(root, server, options = {}) {
|
|
2475
2513
|
super(root, server, options);
|
|
2514
|
+
this.diagnosticPullErrors = [];
|
|
2476
2515
|
this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
|
|
2477
2516
|
this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
|
|
2517
|
+
timerProvider: this.timerProvider,
|
|
2478
2518
|
versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
|
|
2479
2519
|
});
|
|
2480
2520
|
this.workspaceMutations = new WorkspaceMutationController(root, this.documents);
|
|
@@ -2527,6 +2567,18 @@ class LspClient extends LspClientConnection {
|
|
|
2527
2567
|
textDocument: { uri: pathToFileURL3(absPath).href }
|
|
2528
2568
|
}, options);
|
|
2529
2569
|
}
|
|
2570
|
+
async formatDocument(filePath, options, signal) {
|
|
2571
|
+
if (!this.isDocumentFormattingSupported())
|
|
2572
|
+
return null;
|
|
2573
|
+
const absPath = this.resolveWorkspacePath(filePath);
|
|
2574
|
+
await this.openFile(absPath);
|
|
2575
|
+
const requestOptions = signal === undefined ? {} : { signal };
|
|
2576
|
+
const edits = await this.sendRequest("textDocument/formatting", {
|
|
2577
|
+
textDocument: { uri: pathToFileURL3(absPath).href },
|
|
2578
|
+
options
|
|
2579
|
+
}, requestOptions);
|
|
2580
|
+
return edits ?? [];
|
|
2581
|
+
}
|
|
2530
2582
|
async workspaceSymbols(query, signal) {
|
|
2531
2583
|
const options = signal === undefined ? {} : { signal };
|
|
2532
2584
|
return this.sendRequest("workspace/symbol", { query }, options);
|
|
@@ -2566,7 +2618,7 @@ class LspClient extends LspClientConnection {
|
|
|
2566
2618
|
const absPath = this.resolveWorkspacePath(filePath);
|
|
2567
2619
|
const uri = pathToFileURL3(absPath).href;
|
|
2568
2620
|
await this.openFile(absPath);
|
|
2569
|
-
const deadlineAt =
|
|
2621
|
+
const deadlineAt = this.timerProvider.now() + this.diagnosticsFreshnessTimeoutMs;
|
|
2570
2622
|
for (;; ) {
|
|
2571
2623
|
signal?.throwIfAborted();
|
|
2572
2624
|
const snapshot = this.documents.captureDiagnosticSnapshot(absPath);
|
|
@@ -2579,13 +2631,13 @@ class LspClient extends LspClientConnection {
|
|
|
2579
2631
|
if (!pushFallbackOnly) {
|
|
2580
2632
|
const cached = this.documents.getPullCache(snapshot);
|
|
2581
2633
|
try {
|
|
2582
|
-
const
|
|
2583
|
-
if (
|
|
2634
|
+
const remainingMs = deadlineAt - this.timerProvider.now();
|
|
2635
|
+
if (remainingMs <= 0)
|
|
2584
2636
|
return this.freshnessTimeout(absPath);
|
|
2585
2637
|
const result = await this.sendRequest("textDocument/diagnostic", {
|
|
2586
2638
|
textDocument: { uri },
|
|
2587
2639
|
...cached?.resultId === undefined ? {} : { previousResultId: cached.resultId }
|
|
2588
|
-
}, { timeoutMs:
|
|
2640
|
+
}, { timeoutMs: remainingMs, ...signal === undefined ? {} : { signal } });
|
|
2589
2641
|
if (!this.documents.isCurrentSnapshot(snapshot))
|
|
2590
2642
|
continue;
|
|
2591
2643
|
const report = this.parseDiagnosticPullReport(result);
|
|
@@ -2614,7 +2666,7 @@ class LspClient extends LspClientConnection {
|
|
|
2614
2666
|
}
|
|
2615
2667
|
if (!pushFallbackOnly)
|
|
2616
2668
|
continue;
|
|
2617
|
-
const remainingMs = deadlineAt -
|
|
2669
|
+
const remainingMs = deadlineAt - this.timerProvider.now();
|
|
2618
2670
|
if (remainingMs <= 0) {
|
|
2619
2671
|
if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
|
|
2620
2672
|
const cached = this.documents.getPullCache(snapshot);
|
|
@@ -2666,7 +2718,7 @@ function waitForDiagnosticsActivity(wait, signal) {
|
|
|
2666
2718
|
return wait;
|
|
2667
2719
|
if (signal.aborted)
|
|
2668
2720
|
return Promise.reject(abortError2(signal));
|
|
2669
|
-
return new Promise((
|
|
2721
|
+
return new Promise((resolve, reject) => {
|
|
2670
2722
|
const onAbort = () => {
|
|
2671
2723
|
signal.removeEventListener("abort", onAbort);
|
|
2672
2724
|
reject(abortError2(signal));
|
|
@@ -2674,7 +2726,7 @@ function waitForDiagnosticsActivity(wait, signal) {
|
|
|
2674
2726
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
2675
2727
|
wait.then(() => {
|
|
2676
2728
|
signal.removeEventListener("abort", onAbort);
|
|
2677
|
-
|
|
2729
|
+
resolve();
|
|
2678
2730
|
}, (error) => {
|
|
2679
2731
|
signal.removeEventListener("abort", onAbort);
|
|
2680
2732
|
reject(error);
|
|
@@ -2742,7 +2794,7 @@ async function stopClientBestEffort(client) {
|
|
|
2742
2794
|
function awaitWithSignal(promise, signal) {
|
|
2743
2795
|
if (!signal)
|
|
2744
2796
|
return promise;
|
|
2745
|
-
return new Promise((
|
|
2797
|
+
return new Promise((resolve, reject) => {
|
|
2746
2798
|
let settled = false;
|
|
2747
2799
|
const onAbort = () => {
|
|
2748
2800
|
if (settled)
|
|
@@ -2760,7 +2812,7 @@ function awaitWithSignal(promise, signal) {
|
|
|
2760
2812
|
return;
|
|
2761
2813
|
settled = true;
|
|
2762
2814
|
signal.removeEventListener("abort", onAbort);
|
|
2763
|
-
|
|
2815
|
+
resolve(value);
|
|
2764
2816
|
}, (err) => {
|
|
2765
2817
|
if (settled)
|
|
2766
2818
|
return;
|
|
@@ -2772,18 +2824,16 @@ function awaitWithSignal(promise, signal) {
|
|
|
2772
2824
|
}
|
|
2773
2825
|
|
|
2774
2826
|
class LspManager {
|
|
2775
|
-
clients = new Map;
|
|
2776
|
-
reaperHandle = null;
|
|
2777
|
-
signalDisposer = null;
|
|
2778
|
-
disposed = false;
|
|
2779
|
-
idleTimeoutMs;
|
|
2780
|
-
initTimeoutMs;
|
|
2781
|
-
reaperIntervalMs;
|
|
2782
|
-
clientFactory;
|
|
2783
|
-
now;
|
|
2784
2827
|
constructor(options = {}) {
|
|
2828
|
+
this.clients = new Map;
|
|
2829
|
+
this.pendingStops = new Map;
|
|
2830
|
+
this.respawnBudgets = new Map;
|
|
2831
|
+
this.reaperHandle = null;
|
|
2832
|
+
this.signalDisposer = null;
|
|
2833
|
+
this.disposed = false;
|
|
2785
2834
|
this.idleTimeoutMs = options.idleTimeoutMs ?? IDLE_TIMEOUT_MS;
|
|
2786
2835
|
this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
2836
|
+
this.maxResidentClients = options.maxResidentClients ?? MAX_RESIDENT_CLIENTS;
|
|
2787
2837
|
this.reaperIntervalMs = options.reaperIntervalMs ?? REAPER_INTERVAL_MS;
|
|
2788
2838
|
this.clientFactory = options.clientFactory ?? ((root, server) => new LspClient(root, server));
|
|
2789
2839
|
this.now = options.now ?? (() => Date.now());
|
|
@@ -2803,24 +2853,79 @@ class LspManager {
|
|
|
2803
2853
|
getKey(root, serverId) {
|
|
2804
2854
|
return `${root}::${serverId}`;
|
|
2805
2855
|
}
|
|
2856
|
+
tombstoneStop(key, client) {
|
|
2857
|
+
const stop = stopClientBestEffort(client);
|
|
2858
|
+
this.pendingStops.set(key, stop);
|
|
2859
|
+
stop.finally(() => {
|
|
2860
|
+
if (this.pendingStops.get(key) === stop) {
|
|
2861
|
+
this.pendingStops.delete(key);
|
|
2862
|
+
}
|
|
2863
|
+
});
|
|
2864
|
+
return stop;
|
|
2865
|
+
}
|
|
2866
|
+
recordDeadGeneration(key) {
|
|
2867
|
+
let budget = this.respawnBudgets.get(key);
|
|
2868
|
+
if (budget === undefined) {
|
|
2869
|
+
budget = { deadGenerations: 0, exhaustedAt: null };
|
|
2870
|
+
this.respawnBudgets.set(key, budget);
|
|
2871
|
+
}
|
|
2872
|
+
budget.deadGenerations += 1;
|
|
2873
|
+
}
|
|
2874
|
+
markHealthyGeneration(key) {
|
|
2875
|
+
this.respawnBudgets.delete(key);
|
|
2876
|
+
}
|
|
2877
|
+
ensureRespawnAllowed(key, root, serverId) {
|
|
2878
|
+
const budget = this.respawnBudgets.get(key);
|
|
2879
|
+
if (budget === undefined || budget.deadGenerations < CLIENT_RESPAWN_RETRY_LIMIT)
|
|
2880
|
+
return;
|
|
2881
|
+
if (budget.exhaustedAt === null) {
|
|
2882
|
+
budget.exhaustedAt = this.now();
|
|
2883
|
+
throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
|
|
2884
|
+
}
|
|
2885
|
+
if (this.now() - budget.exhaustedAt < CLIENT_RESPAWN_COOLDOWN_MS) {
|
|
2886
|
+
throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
|
|
2887
|
+
}
|
|
2888
|
+
budget.deadGenerations = 0;
|
|
2889
|
+
budget.exhaustedAt = null;
|
|
2890
|
+
}
|
|
2806
2891
|
reapStale() {
|
|
2807
2892
|
const t = this.now();
|
|
2808
2893
|
for (const [key, managed] of this.clients) {
|
|
2809
2894
|
if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
|
|
2810
|
-
stopClientBestEffort(managed.client);
|
|
2811
2895
|
this.clients.delete(key);
|
|
2896
|
+
this.tombstoneStop(key, managed.client);
|
|
2812
2897
|
continue;
|
|
2813
2898
|
}
|
|
2814
2899
|
if (!managed.isInitializing && managed.refCount === 0 && managed.pendingWaiters === 0 && t - managed.lastUsedAt > this.idleTimeoutMs) {
|
|
2815
|
-
stopClientBestEffort(managed.client);
|
|
2816
2900
|
this.clients.delete(key);
|
|
2901
|
+
this.tombstoneStop(key, managed.client);
|
|
2817
2902
|
}
|
|
2818
2903
|
}
|
|
2819
2904
|
}
|
|
2905
|
+
evictForAdmission() {
|
|
2906
|
+
while (this.clients.size >= this.maxResidentClients) {
|
|
2907
|
+
const victim = this.leastRecentlyUsedIdleClient();
|
|
2908
|
+
if (!victim)
|
|
2909
|
+
return;
|
|
2910
|
+
this.clients.delete(victim.key);
|
|
2911
|
+
this.tombstoneStop(victim.key, victim.managed.client);
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
leastRecentlyUsedIdleClient() {
|
|
2915
|
+
let candidate = null;
|
|
2916
|
+
for (const [key, managed] of this.clients) {
|
|
2917
|
+
if (managed.refCount > 0 || managed.pendingWaiters > 0 || managed.isInitializing)
|
|
2918
|
+
continue;
|
|
2919
|
+
if (candidate === null || managed.lastUsedAt < candidate.managed.lastUsedAt) {
|
|
2920
|
+
candidate = { key, managed };
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
return candidate;
|
|
2924
|
+
}
|
|
2820
2925
|
async tryDeleteIfOrphaned(key, managed) {
|
|
2821
2926
|
if (managed.refCount === 0 && managed.pendingWaiters === 0 && !managed.isInitializing && this.clients.get(key) === managed) {
|
|
2822
2927
|
this.clients.delete(key);
|
|
2823
|
-
await
|
|
2928
|
+
await this.tombstoneStop(key, managed.client);
|
|
2824
2929
|
}
|
|
2825
2930
|
}
|
|
2826
2931
|
async getClient(root, server, signal) {
|
|
@@ -2829,12 +2934,22 @@ class LspManager {
|
|
|
2829
2934
|
}
|
|
2830
2935
|
signal?.throwIfAborted();
|
|
2831
2936
|
const key = this.getKey(root, server.id);
|
|
2937
|
+
for (;; ) {
|
|
2938
|
+
const pendingStop = this.pendingStops.get(key);
|
|
2939
|
+
if (pendingStop === undefined)
|
|
2940
|
+
break;
|
|
2941
|
+
await awaitWithSignal(pendingStop, signal);
|
|
2942
|
+
signal?.throwIfAborted();
|
|
2943
|
+
}
|
|
2944
|
+
if (this.disposed) {
|
|
2945
|
+
throw new Error("LspManager has been disposed");
|
|
2946
|
+
}
|
|
2832
2947
|
let managed = this.clients.get(key);
|
|
2833
2948
|
if (managed) {
|
|
2834
2949
|
const t = this.now();
|
|
2835
2950
|
if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
|
|
2836
|
-
await stopClientBestEffort(managed.client);
|
|
2837
2951
|
this.clients.delete(key);
|
|
2952
|
+
await this.tombstoneStop(key, managed.client);
|
|
2838
2953
|
managed = undefined;
|
|
2839
2954
|
}
|
|
2840
2955
|
}
|
|
@@ -2855,14 +2970,20 @@ class LspManager {
|
|
|
2855
2970
|
signal.throwIfAborted();
|
|
2856
2971
|
}
|
|
2857
2972
|
if (!managed.client.isAlive()) {
|
|
2858
|
-
|
|
2859
|
-
this.clients.
|
|
2973
|
+
this.recordDeadGeneration(key);
|
|
2974
|
+
if (this.clients.get(key) === managed) {
|
|
2975
|
+
this.clients.delete(key);
|
|
2976
|
+
}
|
|
2977
|
+
await this.tombstoneStop(key, managed.client);
|
|
2860
2978
|
return this.getClient(root, server, signal);
|
|
2861
2979
|
}
|
|
2980
|
+
this.markHealthyGeneration(key);
|
|
2862
2981
|
managed.refCount++;
|
|
2863
2982
|
managed.lastUsedAt = this.now();
|
|
2864
2983
|
return managed.client;
|
|
2865
2984
|
}
|
|
2985
|
+
this.evictForAdmission();
|
|
2986
|
+
this.ensureRespawnAllowed(key, root, server.id);
|
|
2866
2987
|
const client = this.clientFactory(root, server);
|
|
2867
2988
|
const initStartedAt = this.now();
|
|
2868
2989
|
const initPromise = (async () => {
|
|
@@ -2886,7 +3007,7 @@ class LspManager {
|
|
|
2886
3007
|
if (this.clients.get(key) === newManaged) {
|
|
2887
3008
|
this.clients.delete(key);
|
|
2888
3009
|
}
|
|
2889
|
-
await
|
|
3010
|
+
await this.tombstoneStop(key, client);
|
|
2890
3011
|
throw err;
|
|
2891
3012
|
}
|
|
2892
3013
|
newManaged.pendingWaiters--;
|
|
@@ -2897,6 +3018,15 @@ class LspManager {
|
|
|
2897
3018
|
await this.tryDeleteIfOrphaned(key, newManaged);
|
|
2898
3019
|
signal.throwIfAborted();
|
|
2899
3020
|
}
|
|
3021
|
+
if (!client.isAlive()) {
|
|
3022
|
+
this.recordDeadGeneration(key);
|
|
3023
|
+
if (this.clients.get(key) === newManaged) {
|
|
3024
|
+
this.clients.delete(key);
|
|
3025
|
+
}
|
|
3026
|
+
await this.tombstoneStop(key, client);
|
|
3027
|
+
return this.getClient(root, server, signal);
|
|
3028
|
+
}
|
|
3029
|
+
this.markHealthyGeneration(key);
|
|
2900
3030
|
newManaged.refCount++;
|
|
2901
3031
|
newManaged.lastUsedAt = this.now();
|
|
2902
3032
|
return client;
|
|
@@ -2917,14 +3047,20 @@ class LspManager {
|
|
|
2917
3047
|
if (client && managed.client !== client)
|
|
2918
3048
|
return;
|
|
2919
3049
|
this.clients.delete(key);
|
|
2920
|
-
|
|
3050
|
+
this.tombstoneStop(key, managed.client);
|
|
2921
3051
|
}
|
|
2922
3052
|
warmupClient(root, server) {
|
|
2923
3053
|
if (this.disposed)
|
|
2924
3054
|
return;
|
|
2925
3055
|
const key = this.getKey(root, server.id);
|
|
2926
|
-
if (this.clients.has(key))
|
|
3056
|
+
if (this.clients.has(key) || this.pendingStops.has(key))
|
|
2927
3057
|
return;
|
|
3058
|
+
this.evictForAdmission();
|
|
3059
|
+
try {
|
|
3060
|
+
this.ensureRespawnAllowed(key, root, server.id);
|
|
3061
|
+
} catch {
|
|
3062
|
+
return;
|
|
3063
|
+
}
|
|
2928
3064
|
const client = this.clientFactory(root, server);
|
|
2929
3065
|
const initStartedAt = this.now();
|
|
2930
3066
|
const initPromise = (async () => {
|
|
@@ -2950,7 +3086,7 @@ class LspManager {
|
|
|
2950
3086
|
if (this.clients.get(key) === managed) {
|
|
2951
3087
|
this.clients.delete(key);
|
|
2952
3088
|
}
|
|
2953
|
-
|
|
3089
|
+
this.tombstoneStop(key, client);
|
|
2954
3090
|
});
|
|
2955
3091
|
}
|
|
2956
3092
|
isServerInitializing(root, serverId) {
|
|
@@ -2994,8 +3130,11 @@ class LspManager {
|
|
|
2994
3130
|
for (const managed of this.clients.values()) {
|
|
2995
3131
|
stopPromises.push(stopClientBestEffort(managed.client));
|
|
2996
3132
|
}
|
|
3133
|
+
const tombstonedStops = [...this.pendingStops.values()];
|
|
2997
3134
|
this.clients.clear();
|
|
2998
|
-
|
|
3135
|
+
this.respawnBudgets.clear();
|
|
3136
|
+
await Promise.allSettled([...stopPromises, ...tombstonedStops]);
|
|
3137
|
+
this.pendingStops.clear();
|
|
2999
3138
|
}
|
|
3000
3139
|
}
|
|
3001
3140
|
var _defaultInstance = null;
|
|
@@ -3060,7 +3199,7 @@ ${body}` : `${body}
|
|
|
3060
3199
|
await writeChunk(output, payload);
|
|
3061
3200
|
}
|
|
3062
3201
|
function writeChunk(output, chunk) {
|
|
3063
|
-
return new Promise((
|
|
3202
|
+
return new Promise((resolve, reject) => {
|
|
3064
3203
|
let settled = false;
|
|
3065
3204
|
const onError = (error) => {
|
|
3066
3205
|
if (settled)
|
|
@@ -3080,7 +3219,7 @@ function writeChunk(output, chunk) {
|
|
|
3080
3219
|
return;
|
|
3081
3220
|
}
|
|
3082
3221
|
output.removeListener("error", onError);
|
|
3083
|
-
|
|
3222
|
+
resolve();
|
|
3084
3223
|
});
|
|
3085
3224
|
} catch (error) {
|
|
3086
3225
|
output.removeListener("error", onError);
|
|
@@ -3189,6 +3328,7 @@ async function runJsonRpcStdioServer(config) {
|
|
|
3189
3328
|
const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
|
|
3190
3329
|
isClosed = true;
|
|
3191
3330
|
config.onIdleTimeout?.();
|
|
3331
|
+
config.input.destroy();
|
|
3192
3332
|
});
|
|
3193
3333
|
const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
|
|
3194
3334
|
isClosed = true;
|
|
@@ -3285,7 +3425,11 @@ function createParentWatchdog(config, onDeadParent) {
|
|
|
3285
3425
|
const probeAlive = config.probeAlive ?? isProcessAlive;
|
|
3286
3426
|
let fired = false;
|
|
3287
3427
|
const timer = setInterval(() => {
|
|
3288
|
-
if (fired
|
|
3428
|
+
if (fired)
|
|
3429
|
+
return;
|
|
3430
|
+
const alive = probeAlive(parentPid);
|
|
3431
|
+
config.onPoll?.(alive);
|
|
3432
|
+
if (alive)
|
|
3289
3433
|
return;
|
|
3290
3434
|
fired = true;
|
|
3291
3435
|
onDeadParent(parentPid, pollIntervalMs);
|
|
@@ -3320,8 +3464,8 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
|
|
|
3320
3464
|
};
|
|
3321
3465
|
}
|
|
3322
3466
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
3323
|
-
import { existsSync as
|
|
3324
|
-
import { basename as basename3, dirname as
|
|
3467
|
+
import { existsSync as existsSync10, realpathSync as realpathSync5, statSync as statSync3 } from "node:fs";
|
|
3468
|
+
import { basename as basename3, dirname as dirname8, join as join5, resolve as resolve8 } from "node:path";
|
|
3325
3469
|
|
|
3326
3470
|
// ../lsp-core/src/request-context.ts
|
|
3327
3471
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -3330,18 +3474,17 @@ import { homedir } from "node:os";
|
|
|
3330
3474
|
import { basename as basename2, delimiter as delimiter2, dirname as dirname4, isAbsolute as isAbsolute2, join as join2, relative as relative4, resolve as resolve6 } from "node:path";
|
|
3331
3475
|
|
|
3332
3476
|
class LspRequestContextParseError extends Error {
|
|
3333
|
-
code;
|
|
3334
|
-
name = "LspRequestContextParseError";
|
|
3335
3477
|
constructor(code, message) {
|
|
3336
3478
|
super(message);
|
|
3337
3479
|
this.code = code;
|
|
3480
|
+
this.name = "LspRequestContextParseError";
|
|
3338
3481
|
}
|
|
3339
3482
|
}
|
|
3340
3483
|
|
|
3341
3484
|
class LspRequestContextUnavailableError extends Error {
|
|
3342
|
-
name = "LspRequestContextUnavailableError";
|
|
3343
3485
|
constructor() {
|
|
3344
3486
|
super("LSP request context is required. Standalone MCP startup must install one with runWithRequestContext(createStandaloneMcpRequestContext()).");
|
|
3487
|
+
this.name = "LspRequestContextUnavailableError";
|
|
3345
3488
|
}
|
|
3346
3489
|
}
|
|
3347
3490
|
var storage = new AsyncLocalStorage;
|
|
@@ -3371,7 +3514,7 @@ function contextEnv(key) {
|
|
|
3371
3514
|
}
|
|
3372
3515
|
function createStandaloneMcpRequestContext(input = {}) {
|
|
3373
3516
|
const env = input.env ?? process.env;
|
|
3374
|
-
const cwd = canonicalCwd(input.cwd ?? process.cwd());
|
|
3517
|
+
const cwd = canonicalCwd(input.cwd ?? env["LSP_TOOLS_MCP_CWD"] ?? process.cwd());
|
|
3375
3518
|
const home = input.homeDir ?? homedir();
|
|
3376
3519
|
const projectConfigPaths = translateProjectConfigEnv(env["LSP_TOOLS_MCP_PROJECT_CONFIG"], cwd);
|
|
3377
3520
|
const userConfigPath = translateHomeConfigEnv(env["LSP_TOOLS_MCP_USER_CONFIG"], home, ".codex/lsp-client.json");
|
|
@@ -3502,57 +3645,52 @@ function errorCode(error) {
|
|
|
3502
3645
|
return typeof code === "string" ? code : undefined;
|
|
3503
3646
|
}
|
|
3504
3647
|
|
|
3505
|
-
// ../lsp-core/src/lsp/
|
|
3506
|
-
import { existsSync as existsSync6,
|
|
3507
|
-
import { dirname as dirname5 } from "node:path";
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3648
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
3649
|
+
import { existsSync as existsSync6, realpathSync as realpathSync4 } from "node:fs";
|
|
3650
|
+
import { dirname as dirname5, join as join3 } from "node:path";
|
|
3651
|
+
|
|
3652
|
+
// ../lsp-core/src/lsp/workspace-markers.ts
|
|
3653
|
+
var GIT_WORKSPACE_MARKER = ".git";
|
|
3654
|
+
var PROJECT_WORKSPACE_MARKERS = [
|
|
3655
|
+
"package.json",
|
|
3656
|
+
"pyproject.toml",
|
|
3657
|
+
"Cargo.toml",
|
|
3658
|
+
"go.mod",
|
|
3659
|
+
"pom.xml",
|
|
3660
|
+
"build.gradle"
|
|
3661
|
+
];
|
|
3662
|
+
var WORKSPACE_MARKERS = [GIT_WORKSPACE_MARKER, ...PROJECT_WORKSPACE_MARKERS];
|
|
3663
|
+
|
|
3664
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
3665
|
+
function findWorkspaceRootOutsideContext(directory) {
|
|
3666
|
+
const marked = nearestMarkedAncestor(directory);
|
|
3667
|
+
if (marked !== undefined)
|
|
3668
|
+
return marked;
|
|
3669
|
+
return realpathSync4(nearestExistingAncestor(directory));
|
|
3670
|
+
}
|
|
3671
|
+
function nearestMarkedAncestor(directory) {
|
|
3672
|
+
let current = directory;
|
|
3673
|
+
for (;; ) {
|
|
3674
|
+
if (existsSync6(current) && WORKSPACE_MARKERS.some((marker) => existsSync6(join3(current, marker)))) {
|
|
3675
|
+
return realpathSync4(current);
|
|
3676
|
+
}
|
|
3677
|
+
const parent = dirname5(current);
|
|
3678
|
+
if (parent === current)
|
|
3679
|
+
return;
|
|
3680
|
+
current = parent;
|
|
3520
3681
|
}
|
|
3521
3682
|
}
|
|
3522
|
-
function
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
}
|
|
3530
|
-
|
|
3531
|
-
return value === "declined" || value === "allowed";
|
|
3532
|
-
}
|
|
3533
|
-
function writeInstallDecisions(decisions) {
|
|
3534
|
-
const path = getInstallDecisionsPath();
|
|
3535
|
-
mkdirSync(dirname5(path), { recursive: true });
|
|
3536
|
-
const tmpPath = `${path}.tmp`;
|
|
3537
|
-
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
3538
|
-
`, "utf8");
|
|
3539
|
-
renameSync2(tmpPath, path);
|
|
3540
|
-
}
|
|
3541
|
-
function isInstallDecisions(value) {
|
|
3542
|
-
return isRecord5(value) && Object.values(value).every(isInstallDecisionRecord);
|
|
3543
|
-
}
|
|
3544
|
-
function isInstallDecisionRecord(value) {
|
|
3545
|
-
if (!isRecord5(value))
|
|
3546
|
-
return false;
|
|
3547
|
-
return isInstallDecision(value["decision"]) && typeof value["decidedAt"] === "string";
|
|
3548
|
-
}
|
|
3549
|
-
function isRecord5(value) {
|
|
3550
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3683
|
+
function nearestExistingAncestor(directory) {
|
|
3684
|
+
let current = directory;
|
|
3685
|
+
while (!existsSync6(current)) {
|
|
3686
|
+
const parent = dirname5(current);
|
|
3687
|
+
if (parent === current)
|
|
3688
|
+
return current;
|
|
3689
|
+
current = parent;
|
|
3690
|
+
}
|
|
3691
|
+
return current;
|
|
3551
3692
|
}
|
|
3552
3693
|
|
|
3553
|
-
// ../lsp-core/src/lsp/config-loader.ts
|
|
3554
|
-
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
3555
|
-
|
|
3556
3694
|
// ../lsp-core/src/lsp/server-definitions.ts
|
|
3557
3695
|
var LSP_INSTALL_HINTS = {
|
|
3558
3696
|
typescript: "npm install -g typescript-language-server typescript",
|
|
@@ -3598,6 +3736,26 @@ var LSP_INSTALL_HINTS = {
|
|
|
3598
3736
|
julials: `julia -e 'using Pkg; Pkg.add("LanguageServer")'`,
|
|
3599
3737
|
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"
|
|
3600
3738
|
};
|
|
3739
|
+
var LSP_LOCAL_INSTALL_HINTS = {
|
|
3740
|
+
typescript: "bun add -d typescript-language-server typescript",
|
|
3741
|
+
vue: "bun add -d @vue/language-server",
|
|
3742
|
+
eslint: "bun add -d vscode-langservers-extracted",
|
|
3743
|
+
oxlint: "bun add -d oxlint",
|
|
3744
|
+
biome: "bun add -d @biomejs/biome",
|
|
3745
|
+
svelte: "bun add -d svelte-language-server",
|
|
3746
|
+
astro: "bun add -d @astrojs/language-server",
|
|
3747
|
+
bash: "bun add -d bash-language-server",
|
|
3748
|
+
"bash-ls": "bun add -d bash-language-server",
|
|
3749
|
+
"yaml-ls": "bun add -d yaml-language-server",
|
|
3750
|
+
php: "bun add -d intelephense",
|
|
3751
|
+
prisma: "bun add -d prisma",
|
|
3752
|
+
dockerfile: "bun add -d dockerfile-language-server-nodejs",
|
|
3753
|
+
pyright: "uv add --dev pyright",
|
|
3754
|
+
basedpyright: "uv add --dev basedpyright",
|
|
3755
|
+
ruff: "uv add --dev ruff",
|
|
3756
|
+
ty: "uv add --dev ty",
|
|
3757
|
+
"ruby-lsp": "bundle add ruby-lsp --group development"
|
|
3758
|
+
};
|
|
3601
3759
|
var BUILTIN_SERVERS = {
|
|
3602
3760
|
typescript: {
|
|
3603
3761
|
command: ["typescript-language-server", "--stdio"],
|
|
@@ -3700,7 +3858,56 @@ var BUILTIN_SERVERS = {
|
|
|
3700
3858
|
}
|
|
3701
3859
|
};
|
|
3702
3860
|
|
|
3861
|
+
// ../lsp-core/src/lsp/server-install-state.ts
|
|
3862
|
+
import { existsSync as existsSync7, mkdirSync, readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
3863
|
+
import { dirname as dirname6 } from "node:path";
|
|
3864
|
+
function getInstallDecisionsPath() {
|
|
3865
|
+
return lspRequestContext().installDecisionsPath;
|
|
3866
|
+
}
|
|
3867
|
+
function loadInstallDecisions() {
|
|
3868
|
+
const path = getInstallDecisionsPath();
|
|
3869
|
+
if (!existsSync7(path))
|
|
3870
|
+
return {};
|
|
3871
|
+
try {
|
|
3872
|
+
const parsed = JSON.parse(readFileSync3(path, "utf8"));
|
|
3873
|
+
return isInstallDecisions(parsed) ? parsed : {};
|
|
3874
|
+
} catch {
|
|
3875
|
+
return {};
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
function loadInstallDecision(serverId) {
|
|
3879
|
+
return loadInstallDecisions()[serverId];
|
|
3880
|
+
}
|
|
3881
|
+
function recordInstallDecision(serverId, decision, decidedAt = new Date().toISOString()) {
|
|
3882
|
+
const decisions = loadInstallDecisions();
|
|
3883
|
+
decisions[serverId] = { decision, decidedAt };
|
|
3884
|
+
writeInstallDecisions(decisions);
|
|
3885
|
+
}
|
|
3886
|
+
function isInstallDecision(value) {
|
|
3887
|
+
return value === "declined" || value === "allowed";
|
|
3888
|
+
}
|
|
3889
|
+
function writeInstallDecisions(decisions) {
|
|
3890
|
+
const path = getInstallDecisionsPath();
|
|
3891
|
+
mkdirSync(dirname6(path), { recursive: true });
|
|
3892
|
+
const tmpPath = `${path}.tmp`;
|
|
3893
|
+
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
3894
|
+
`, "utf8");
|
|
3895
|
+
renameSync2(tmpPath, path);
|
|
3896
|
+
}
|
|
3897
|
+
function isInstallDecisions(value) {
|
|
3898
|
+
return isRecord5(value) && Object.values(value).every(isInstallDecisionRecord);
|
|
3899
|
+
}
|
|
3900
|
+
function isInstallDecisionRecord(value) {
|
|
3901
|
+
if (!isRecord5(value))
|
|
3902
|
+
return false;
|
|
3903
|
+
return isInstallDecision(value["decision"]) && typeof value["decidedAt"] === "string";
|
|
3904
|
+
}
|
|
3905
|
+
function isRecord5(value) {
|
|
3906
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3907
|
+
}
|
|
3908
|
+
|
|
3703
3909
|
// ../lsp-core/src/lsp/config-loader.ts
|
|
3910
|
+
import { existsSync as existsSync8, readFileSync as readFileSync4 } from "node:fs";
|
|
3704
3911
|
function getProjectConfigPaths() {
|
|
3705
3912
|
return lspRequestContext().projectConfigPaths;
|
|
3706
3913
|
}
|
|
@@ -3708,7 +3915,7 @@ function getUserConfigPath() {
|
|
|
3708
3915
|
return lspRequestContext().userConfigPath;
|
|
3709
3916
|
}
|
|
3710
3917
|
function loadJsonFile(path) {
|
|
3711
|
-
if (!
|
|
3918
|
+
if (!existsSync8(path))
|
|
3712
3919
|
return null;
|
|
3713
3920
|
try {
|
|
3714
3921
|
const parsed = JSON.parse(readFileSync4(path, "utf-8"));
|
|
@@ -3755,10 +3962,10 @@ function getMergedServers() {
|
|
|
3755
3962
|
}
|
|
3756
3963
|
if (seen.has(id))
|
|
3757
3964
|
continue;
|
|
3758
|
-
const
|
|
3759
|
-
if (!
|
|
3965
|
+
const server = createServerFromEntry(id, entry, source);
|
|
3966
|
+
if (!server)
|
|
3760
3967
|
continue;
|
|
3761
|
-
servers.push(
|
|
3968
|
+
servers.push(server);
|
|
3762
3969
|
seen.add(id);
|
|
3763
3970
|
}
|
|
3764
3971
|
}
|
|
@@ -3790,7 +3997,7 @@ function createServerFromEntry(id, entry, source) {
|
|
|
3790
3997
|
if (source === "project") {
|
|
3791
3998
|
if (!builtin)
|
|
3792
3999
|
return null;
|
|
3793
|
-
const
|
|
4000
|
+
const server = createServer({
|
|
3794
4001
|
id,
|
|
3795
4002
|
command: builtin.command,
|
|
3796
4003
|
extensions: entry.extensions ?? builtin.extensions,
|
|
@@ -3798,35 +4005,35 @@ function createServerFromEntry(id, entry, source) {
|
|
|
3798
4005
|
source
|
|
3799
4006
|
});
|
|
3800
4007
|
if (entry.initialization !== undefined) {
|
|
3801
|
-
|
|
4008
|
+
server.initialization = entry.initialization;
|
|
3802
4009
|
}
|
|
3803
|
-
return
|
|
4010
|
+
return server;
|
|
3804
4011
|
}
|
|
3805
4012
|
if (entry.command && entry.extensions) {
|
|
3806
|
-
const
|
|
4013
|
+
const server = createServer({
|
|
3807
4014
|
id,
|
|
3808
4015
|
command: entry.command,
|
|
3809
4016
|
extensions: entry.extensions,
|
|
3810
4017
|
priority: entry.priority ?? 0,
|
|
3811
4018
|
source
|
|
3812
4019
|
});
|
|
3813
|
-
applyOptionalServerFields(
|
|
3814
|
-
return
|
|
4020
|
+
applyOptionalServerFields(server, entry);
|
|
4021
|
+
return server;
|
|
3815
4022
|
}
|
|
3816
4023
|
if (!builtin)
|
|
3817
4024
|
return null;
|
|
3818
|
-
const
|
|
4025
|
+
const server = createServer({
|
|
3819
4026
|
id,
|
|
3820
4027
|
command: entry.command ?? builtin.command,
|
|
3821
4028
|
extensions: entry.extensions ?? builtin.extensions,
|
|
3822
4029
|
priority: entry.priority ?? 0,
|
|
3823
4030
|
source
|
|
3824
4031
|
});
|
|
3825
|
-
applyOptionalServerFields(
|
|
3826
|
-
return
|
|
4032
|
+
applyOptionalServerFields(server, entry);
|
|
4033
|
+
return server;
|
|
3827
4034
|
}
|
|
3828
4035
|
function createServer(input) {
|
|
3829
|
-
const
|
|
4036
|
+
const server = {
|
|
3830
4037
|
id: input.id,
|
|
3831
4038
|
command: input.command,
|
|
3832
4039
|
extensions: input.extensions,
|
|
@@ -3834,19 +4041,19 @@ function createServer(input) {
|
|
|
3834
4041
|
source: input.source
|
|
3835
4042
|
};
|
|
3836
4043
|
if (input.env !== undefined) {
|
|
3837
|
-
|
|
4044
|
+
server.env = input.env;
|
|
3838
4045
|
}
|
|
3839
4046
|
if (input.initialization !== undefined) {
|
|
3840
|
-
|
|
4047
|
+
server.initialization = input.initialization;
|
|
3841
4048
|
}
|
|
3842
|
-
return
|
|
4049
|
+
return server;
|
|
3843
4050
|
}
|
|
3844
|
-
function applyOptionalServerFields(
|
|
4051
|
+
function applyOptionalServerFields(server, entry) {
|
|
3845
4052
|
if (entry.env !== undefined) {
|
|
3846
|
-
|
|
4053
|
+
server.env = entry.env;
|
|
3847
4054
|
}
|
|
3848
4055
|
if (entry.initialization !== undefined) {
|
|
3849
|
-
|
|
4056
|
+
server.initialization = entry.initialization;
|
|
3850
4057
|
}
|
|
3851
4058
|
}
|
|
3852
4059
|
function isConfigJson(value) {
|
|
@@ -3896,64 +4103,165 @@ function getDisabledServerIds() {
|
|
|
3896
4103
|
}
|
|
3897
4104
|
|
|
3898
4105
|
// ../lsp-core/src/lsp/server-installation.ts
|
|
3899
|
-
import { existsSync as
|
|
3900
|
-
import { delimiter as delimiter3, join as
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
4106
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
4107
|
+
import { delimiter as delimiter3, dirname as dirname7, isAbsolute as isAbsolute3, join as join4, resolve as resolve7 } from "node:path";
|
|
4108
|
+
var LOCAL_BIN_RULES = [
|
|
4109
|
+
{
|
|
4110
|
+
markers: ["package.json", "bun.lock", "bun.lockb", "package-lock.json", "yarn.lock", "pnpm-lock.yaml"],
|
|
4111
|
+
binDirs: [join4("node_modules", ".bin")]
|
|
4112
|
+
},
|
|
4113
|
+
{
|
|
4114
|
+
markers: [
|
|
4115
|
+
"pyproject.toml",
|
|
4116
|
+
"ty.toml",
|
|
4117
|
+
"requirements.txt",
|
|
4118
|
+
"setup.py",
|
|
4119
|
+
"setup.cfg",
|
|
4120
|
+
"Pipfile",
|
|
4121
|
+
"pyrightconfig.json",
|
|
4122
|
+
"ruff.toml",
|
|
4123
|
+
".ruff.toml"
|
|
4124
|
+
],
|
|
4125
|
+
binDirs: [
|
|
4126
|
+
join4(".venv", "bin"),
|
|
4127
|
+
join4(".venv", "Scripts"),
|
|
4128
|
+
join4("venv", "bin"),
|
|
4129
|
+
join4("venv", "Scripts"),
|
|
4130
|
+
join4(".env", "bin"),
|
|
4131
|
+
join4(".env", "Scripts")
|
|
4132
|
+
]
|
|
4133
|
+
},
|
|
4134
|
+
{
|
|
4135
|
+
markers: ["Gemfile", "Gemfile.lock"],
|
|
4136
|
+
binDirs: [join4("vendor", "bundle", "bin"), "bin"]
|
|
4137
|
+
},
|
|
4138
|
+
{
|
|
4139
|
+
markers: ["go.mod", "go.sum", "go.work"],
|
|
4140
|
+
binDirs: ["bin"]
|
|
4141
|
+
}
|
|
4142
|
+
];
|
|
4143
|
+
var resolutionCache = new Map;
|
|
4144
|
+
var probeCount = 0;
|
|
4145
|
+
function probe(path) {
|
|
4146
|
+
probeCount += 1;
|
|
4147
|
+
return existsSync9(path);
|
|
4148
|
+
}
|
|
4149
|
+
function executableSuffixes(platform, pathExt) {
|
|
4150
|
+
if (platform !== "win32")
|
|
4151
|
+
return [""];
|
|
4152
|
+
const configured = pathExt ?? process.env["PATHEXT"] ?? "";
|
|
4153
|
+
const systemExts = configured.split(";").filter((entry) => entry.length > 0).map((entry) => entry.toLowerCase());
|
|
4154
|
+
return [...new Set(["", ...systemExts, ".exe", ".cmd", ".bat", ".ps1"])];
|
|
4155
|
+
}
|
|
4156
|
+
function probeWithSuffixes(directory, command, suffixes) {
|
|
4157
|
+
for (const suffix of suffixes) {
|
|
4158
|
+
const candidate = join4(directory, command + suffix);
|
|
4159
|
+
if (probe(candidate))
|
|
4160
|
+
return candidate;
|
|
3910
4161
|
}
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
4162
|
+
return null;
|
|
4163
|
+
}
|
|
4164
|
+
function resolveLocal(command, workingDirectory, suffixes, stopAt) {
|
|
4165
|
+
const boundary = stopAt === undefined ? undefined : resolve7(stopAt);
|
|
4166
|
+
let current = resolve7(workingDirectory);
|
|
4167
|
+
while (true) {
|
|
4168
|
+
for (const rule of LOCAL_BIN_RULES) {
|
|
4169
|
+
if (!rule.markers.some((marker) => probe(join4(current, marker))))
|
|
4170
|
+
continue;
|
|
4171
|
+
for (const binDir of rule.binDirs) {
|
|
4172
|
+
const found = probeWithSuffixes(join4(current, binDir), command, suffixes);
|
|
4173
|
+
if (found !== null)
|
|
4174
|
+
return found;
|
|
4175
|
+
}
|
|
3920
4176
|
}
|
|
4177
|
+
if (probe(join4(current, ".git")))
|
|
4178
|
+
return null;
|
|
4179
|
+
if (boundary !== undefined && current === boundary)
|
|
4180
|
+
return null;
|
|
4181
|
+
const parent = dirname7(current);
|
|
4182
|
+
if (parent === current)
|
|
4183
|
+
return null;
|
|
4184
|
+
current = parent;
|
|
3921
4185
|
}
|
|
3922
|
-
|
|
3923
|
-
|
|
4186
|
+
}
|
|
4187
|
+
function resolveFromPath(command, suffixes, platform, pathEnvOverride) {
|
|
4188
|
+
let pathEnv = pathEnvOverride ?? process.env["PATH"] ?? "";
|
|
4189
|
+
if (platform === "win32" && !pathEnv) {
|
|
3924
4190
|
pathEnv = process.env["Path"] ?? "";
|
|
3925
4191
|
}
|
|
3926
|
-
const
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
}
|
|
4192
|
+
for (const entry of pathEnv.split(delimiter3)) {
|
|
4193
|
+
if (entry.length === 0)
|
|
4194
|
+
continue;
|
|
4195
|
+
const found = probeWithSuffixes(entry, command, suffixes);
|
|
4196
|
+
if (found !== null)
|
|
4197
|
+
return found;
|
|
3933
4198
|
}
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
4199
|
+
return null;
|
|
4200
|
+
}
|
|
4201
|
+
function resolveServerBinary(command, workingDirectory, options = {}) {
|
|
4202
|
+
if (command.length === 0)
|
|
4203
|
+
return null;
|
|
4204
|
+
const [cmd] = command;
|
|
4205
|
+
if (cmd === undefined || cmd.length === 0)
|
|
4206
|
+
return null;
|
|
4207
|
+
const platform = options.platform ?? process.platform;
|
|
4208
|
+
const suffixes = executableSuffixes(platform, options.pathExt);
|
|
4209
|
+
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
4210
|
+
const explicit = isAbsolute3(cmd) ? cmd : resolve7(workingDirectory ?? process.cwd(), cmd);
|
|
4211
|
+
return probe(explicit) ? explicit : null;
|
|
4212
|
+
}
|
|
4213
|
+
const cacheKey = JSON.stringify([
|
|
4214
|
+
workingDirectory ?? "",
|
|
4215
|
+
cmd,
|
|
4216
|
+
platform,
|
|
4217
|
+
options.stopAt ?? "",
|
|
4218
|
+
options.pathExt ?? "",
|
|
4219
|
+
options.pathEnv ?? process.env["PATH"] ?? ""
|
|
4220
|
+
]);
|
|
4221
|
+
const cached = resolutionCache.get(cacheKey);
|
|
4222
|
+
if (cached !== undefined)
|
|
4223
|
+
return cached;
|
|
4224
|
+
let resolved = null;
|
|
4225
|
+
if (workingDirectory !== undefined && workingDirectory.length > 0) {
|
|
4226
|
+
resolved = resolveLocal(cmd, workingDirectory, suffixes, options.stopAt);
|
|
4227
|
+
}
|
|
4228
|
+
resolved ??= resolveFromPath(cmd, suffixes, platform, options.pathEnv);
|
|
4229
|
+
if (resolved === null && cmd === "node")
|
|
4230
|
+
resolved = cmd;
|
|
4231
|
+
resolutionCache.set(cacheKey, resolved);
|
|
4232
|
+
return resolved;
|
|
4233
|
+
}
|
|
4234
|
+
function isServerInstalled(command, workingDirectory, options = {}) {
|
|
4235
|
+
if (command.length === 0)
|
|
4236
|
+
return false;
|
|
4237
|
+
return resolveServerBinary(command, workingDirectory, options) !== null;
|
|
3937
4238
|
}
|
|
3938
4239
|
|
|
3939
4240
|
// ../lsp-core/src/lsp/server-resolution.ts
|
|
4241
|
+
function withResolvedCommand(command, binaryPath) {
|
|
4242
|
+
return [binaryPath, ...command.slice(1)];
|
|
4243
|
+
}
|
|
3940
4244
|
function findServerForExtension(ext) {
|
|
3941
4245
|
const servers = getMergedServers();
|
|
3942
|
-
|
|
3943
|
-
|
|
4246
|
+
const workingDirectory = contextCwd();
|
|
4247
|
+
for (const server of servers) {
|
|
4248
|
+
if (!server.extensions.includes(ext))
|
|
4249
|
+
continue;
|
|
4250
|
+
const binaryPath = resolveServerBinary(server.command, workingDirectory);
|
|
4251
|
+
if (binaryPath !== null) {
|
|
3944
4252
|
const resolvedServer = {
|
|
3945
|
-
id:
|
|
3946
|
-
command:
|
|
3947
|
-
extensions:
|
|
3948
|
-
priority:
|
|
4253
|
+
id: server.id,
|
|
4254
|
+
command: withResolvedCommand(server.command, binaryPath),
|
|
4255
|
+
extensions: server.extensions,
|
|
4256
|
+
priority: server.priority
|
|
3949
4257
|
};
|
|
3950
|
-
if (
|
|
4258
|
+
if (server.env !== undefined) {
|
|
3951
4259
|
return {
|
|
3952
4260
|
status: "found",
|
|
3953
4261
|
server: {
|
|
3954
4262
|
...resolvedServer,
|
|
3955
|
-
env:
|
|
3956
|
-
...
|
|
4263
|
+
env: server.env,
|
|
4264
|
+
...server.initialization === undefined ? {} : { initialization: server.initialization }
|
|
3957
4265
|
}
|
|
3958
4266
|
};
|
|
3959
4267
|
}
|
|
@@ -3961,20 +4269,20 @@ function findServerForExtension(ext) {
|
|
|
3961
4269
|
status: "found",
|
|
3962
4270
|
server: {
|
|
3963
4271
|
...resolvedServer,
|
|
3964
|
-
...
|
|
4272
|
+
...server.initialization === undefined ? {} : { initialization: server.initialization }
|
|
3965
4273
|
}
|
|
3966
4274
|
};
|
|
3967
4275
|
}
|
|
3968
4276
|
}
|
|
3969
|
-
for (const
|
|
3970
|
-
if (
|
|
3971
|
-
const installHint = LSP_INSTALL_HINTS[
|
|
4277
|
+
for (const server of servers) {
|
|
4278
|
+
if (server.extensions.includes(ext)) {
|
|
4279
|
+
const installHint = LSP_INSTALL_HINTS[server.id] ?? `Install '${server.command[0]}' and ensure it's in your PATH`;
|
|
3972
4280
|
return {
|
|
3973
4281
|
status: "not_installed",
|
|
3974
4282
|
server: {
|
|
3975
|
-
id:
|
|
3976
|
-
command:
|
|
3977
|
-
extensions:
|
|
4283
|
+
id: server.id,
|
|
4284
|
+
command: server.command,
|
|
4285
|
+
extensions: server.extensions
|
|
3978
4286
|
},
|
|
3979
4287
|
installHint
|
|
3980
4288
|
};
|
|
@@ -3990,20 +4298,21 @@ function findServerForExtension(ext) {
|
|
|
3990
4298
|
function getAllServers() {
|
|
3991
4299
|
const servers = getMergedServers();
|
|
3992
4300
|
const disabled = getDisabledServerIds();
|
|
4301
|
+
const workingDirectory = contextCwd();
|
|
3993
4302
|
const result = [];
|
|
3994
4303
|
const seen = new Set;
|
|
3995
|
-
for (const
|
|
3996
|
-
if (seen.has(
|
|
4304
|
+
for (const server of servers) {
|
|
4305
|
+
if (seen.has(server.id))
|
|
3997
4306
|
continue;
|
|
3998
4307
|
result.push({
|
|
3999
|
-
id:
|
|
4000
|
-
installed: isServerInstalled(
|
|
4001
|
-
extensions:
|
|
4308
|
+
id: server.id,
|
|
4309
|
+
installed: isServerInstalled(server.command, workingDirectory),
|
|
4310
|
+
extensions: server.extensions,
|
|
4002
4311
|
disabled: false,
|
|
4003
|
-
source:
|
|
4004
|
-
priority:
|
|
4312
|
+
source: server.source,
|
|
4313
|
+
priority: server.priority
|
|
4005
4314
|
});
|
|
4006
|
-
seen.add(
|
|
4315
|
+
seen.add(server.id);
|
|
4007
4316
|
}
|
|
4008
4317
|
for (const id of disabled) {
|
|
4009
4318
|
if (seen.has(id))
|
|
@@ -4011,7 +4320,7 @@ function getAllServers() {
|
|
|
4011
4320
|
const builtin = BUILTIN_SERVERS[id];
|
|
4012
4321
|
result.push({
|
|
4013
4322
|
id,
|
|
4014
|
-
installed: builtin ? isServerInstalled(builtin.command) : false,
|
|
4323
|
+
installed: builtin ? isServerInstalled(builtin.command, workingDirectory) : false,
|
|
4015
4324
|
extensions: builtin?.extensions ?? [],
|
|
4016
4325
|
disabled: true,
|
|
4017
4326
|
source: "disabled",
|
|
@@ -4022,7 +4331,6 @@ function getAllServers() {
|
|
|
4022
4331
|
}
|
|
4023
4332
|
|
|
4024
4333
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
4025
|
-
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4026
4334
|
function isDirectoryPath(filePath) {
|
|
4027
4335
|
try {
|
|
4028
4336
|
return statSync3(filePath).isDirectory();
|
|
@@ -4035,36 +4343,40 @@ function findWorkspaceRoot(filePath) {
|
|
|
4035
4343
|
const abs = resolveReadablePathInsideContext(filePath);
|
|
4036
4344
|
let dir = abs;
|
|
4037
4345
|
if (!isDirectoryPath(dir)) {
|
|
4038
|
-
dir =
|
|
4346
|
+
dir = dirname8(dir);
|
|
4039
4347
|
}
|
|
4348
|
+
if (!isPathInside(cwd, abs))
|
|
4349
|
+
return findWorkspaceRootOutsideContext(dir);
|
|
4040
4350
|
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4351
|
+
let nearestPackageRoot;
|
|
4041
4352
|
while (isPathInside(cwd, dir)) {
|
|
4042
4353
|
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4043
4354
|
if (canonicalDir !== undefined) {
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4355
|
+
if (existsSync10(join5(dir, GIT_WORKSPACE_MARKER))) {
|
|
4356
|
+
return canonicalDir;
|
|
4357
|
+
}
|
|
4358
|
+
if (nearestPackageRoot === undefined && hasProjectWorkspaceMarker(dir)) {
|
|
4359
|
+
nearestPackageRoot = canonicalDir;
|
|
4048
4360
|
}
|
|
4049
4361
|
}
|
|
4050
4362
|
if (dir === cwd)
|
|
4051
4363
|
break;
|
|
4052
|
-
dir =
|
|
4364
|
+
dir = dirname8(dir);
|
|
4053
4365
|
}
|
|
4054
|
-
return fallbackRoot;
|
|
4366
|
+
return nearestPackageRoot ?? fallbackRoot;
|
|
4367
|
+
}
|
|
4368
|
+
function hasProjectWorkspaceMarker(directory) {
|
|
4369
|
+
return PROJECT_WORKSPACE_MARKERS.some((marker) => existsSync10(join5(directory, marker)));
|
|
4055
4370
|
}
|
|
4056
4371
|
function resolveReadablePathInsideContext(filePath) {
|
|
4057
4372
|
const cwd = contextCwd();
|
|
4058
|
-
const abs =
|
|
4373
|
+
const abs = resolve8(cwd, filePath);
|
|
4059
4374
|
if (isPathInside(cwd, abs))
|
|
4060
4375
|
return abs;
|
|
4061
4376
|
const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
|
|
4062
4377
|
if (rebased !== undefined)
|
|
4063
4378
|
return rebased;
|
|
4064
|
-
|
|
4065
|
-
if (isPathInside(cwd, canonical))
|
|
4066
|
-
return canonical;
|
|
4067
|
-
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4379
|
+
return canonicalizeExistingOrNearestAncestor(abs);
|
|
4068
4380
|
}
|
|
4069
4381
|
function resolvePathInsideContext(filePath) {
|
|
4070
4382
|
const cwd = contextCwd();
|
|
@@ -4079,12 +4391,12 @@ function rebaseThroughCanonicalAncestor(path, cwd) {
|
|
|
4079
4391
|
let current = path;
|
|
4080
4392
|
const suffix = [];
|
|
4081
4393
|
while (true) {
|
|
4082
|
-
if (
|
|
4083
|
-
const canonical =
|
|
4394
|
+
if (existsSync10(current)) {
|
|
4395
|
+
const canonical = realpathSync5(current);
|
|
4084
4396
|
if (isPathInside(cwd, canonical))
|
|
4085
|
-
return suffix.length === 0 ? canonical :
|
|
4397
|
+
return suffix.length === 0 ? canonical : join5(canonical, ...suffix);
|
|
4086
4398
|
}
|
|
4087
|
-
const parent =
|
|
4399
|
+
const parent = dirname8(current);
|
|
4088
4400
|
if (parent === current)
|
|
4089
4401
|
return;
|
|
4090
4402
|
suffix.unshift(basename3(current));
|
|
@@ -4092,9 +4404,9 @@ function rebaseThroughCanonicalAncestor(path, cwd) {
|
|
|
4092
4404
|
}
|
|
4093
4405
|
}
|
|
4094
4406
|
function existingDirectoryInsideContext(directory, cwd) {
|
|
4095
|
-
if (!
|
|
4407
|
+
if (!existsSync10(directory))
|
|
4096
4408
|
return;
|
|
4097
|
-
const canonical =
|
|
4409
|
+
const canonical = realpathSync5(directory);
|
|
4098
4410
|
if (!statSync3(canonical).isDirectory())
|
|
4099
4411
|
return;
|
|
4100
4412
|
return isPathInside(cwd, canonical) ? canonical : undefined;
|
|
@@ -4107,7 +4419,7 @@ function nearestExistingDirectoryInsideContext(directory, cwd) {
|
|
|
4107
4419
|
return canonical;
|
|
4108
4420
|
if (current === cwd)
|
|
4109
4421
|
return;
|
|
4110
|
-
current =
|
|
4422
|
+
current = dirname8(current);
|
|
4111
4423
|
}
|
|
4112
4424
|
return;
|
|
4113
4425
|
}
|
|
@@ -4134,33 +4446,46 @@ function formatServerLookupError(result) {
|
|
|
4134
4446
|
].join(`
|
|
4135
4447
|
`);
|
|
4136
4448
|
}
|
|
4449
|
+
function formatInstallOptions(serverId, installHint) {
|
|
4450
|
+
const localHint = LSP_LOCAL_INSTALL_HINTS[serverId];
|
|
4451
|
+
if (localHint === undefined) {
|
|
4452
|
+
return ["To install, run:", ` ${installHint}`];
|
|
4453
|
+
}
|
|
4454
|
+
return [
|
|
4455
|
+
"To install in THIS repository (preferred — no global install needed):",
|
|
4456
|
+
` ${localHint}`,
|
|
4457
|
+
"",
|
|
4458
|
+
"Or install it globally:",
|
|
4459
|
+
` ${installHint}`
|
|
4460
|
+
];
|
|
4461
|
+
}
|
|
4137
4462
|
function formatNotInstalled(result) {
|
|
4138
|
-
const { server
|
|
4139
|
-
const extensions =
|
|
4140
|
-
const decision = loadInstallDecision(
|
|
4463
|
+
const { server, installHint } = result;
|
|
4464
|
+
const extensions = server.extensions.join(", ");
|
|
4465
|
+
const decision = loadInstallDecision(server.id)?.decision;
|
|
4141
4466
|
const context = lspRequestContext();
|
|
4142
4467
|
if (decision === "declined") {
|
|
4143
|
-
return `LSP server '${
|
|
4468
|
+
return `LSP server '${server.id}' (${extensions}) is NOT INSTALLED; user previously declined installation — proceed without LSP.`;
|
|
4144
4469
|
}
|
|
4145
4470
|
const header = [
|
|
4146
|
-
`LSP server '${
|
|
4471
|
+
`LSP server '${server.id}' for ${extensions} is NOT INSTALLED.`,
|
|
4147
4472
|
"",
|
|
4148
|
-
`Command not found: ${
|
|
4473
|
+
`Command not found: ${server.command[0]}`,
|
|
4149
4474
|
""
|
|
4150
4475
|
];
|
|
4476
|
+
const installOptions = formatInstallOptions(server.id, installHint);
|
|
4151
4477
|
if (decision === "allowed") {
|
|
4152
4478
|
return [
|
|
4153
4479
|
...header,
|
|
4154
4480
|
"The user has pre-authorized LSP installation. Run the install command, then retry this tool:",
|
|
4155
|
-
|
|
4481
|
+
...installOptions.slice(1)
|
|
4156
4482
|
].join(`
|
|
4157
4483
|
`);
|
|
4158
4484
|
}
|
|
4159
4485
|
if (!context.capabilities.installDecisionTool) {
|
|
4160
4486
|
return [
|
|
4161
4487
|
...header,
|
|
4162
|
-
|
|
4163
|
-
` ${installHint}`,
|
|
4488
|
+
...installOptions,
|
|
4164
4489
|
"",
|
|
4165
4490
|
"ACTION REQUIRED — ASK THE USER whether to install this LSP server.",
|
|
4166
4491
|
"Install-decision recording is unavailable in this harness; proceed without LSP if the user declines."
|
|
@@ -4169,13 +4494,12 @@ function formatNotInstalled(result) {
|
|
|
4169
4494
|
}
|
|
4170
4495
|
return [
|
|
4171
4496
|
...header,
|
|
4172
|
-
|
|
4173
|
-
` ${installHint}`,
|
|
4497
|
+
...installOptions,
|
|
4174
4498
|
"",
|
|
4175
4499
|
"ACTION REQUIRED — ASK THE USER whether to install this LSP server.",
|
|
4176
4500
|
"- If the user agrees: run the install command above, then retry this tool.",
|
|
4177
4501
|
"- If the user declines, OR has NOT explicitly asked for LSP installation:",
|
|
4178
|
-
` call lsp_install_decision { server_id: "${
|
|
4502
|
+
` call lsp_install_decision { server_id: "${server.id}", decision: "declined" },`,
|
|
4179
4503
|
` which writes to ${context.installDecisionsPath},`,
|
|
4180
4504
|
" then ignore this message and proceed WITHOUT LSP."
|
|
4181
4505
|
].join(`
|
|
@@ -4199,34 +4523,34 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4199
4523
|
if (result.status !== "found") {
|
|
4200
4524
|
throw new LspServerLookupError(formatServerLookupError(result), result);
|
|
4201
4525
|
}
|
|
4202
|
-
const
|
|
4526
|
+
const server = result.server;
|
|
4203
4527
|
const root = findWorkspaceRoot(absPath);
|
|
4204
|
-
const
|
|
4528
|
+
const manager = options.manager ?? getLspManager();
|
|
4205
4529
|
const acquireAndCall = async (allowRetry) => {
|
|
4206
|
-
const client = await
|
|
4530
|
+
const client = await manager.getClient(root, server, options.signal);
|
|
4207
4531
|
try {
|
|
4208
4532
|
return await fn(client, root, absPath);
|
|
4209
4533
|
} catch (err) {
|
|
4210
4534
|
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
4211
|
-
|
|
4535
|
+
manager.invalidateClient(root, server.id, client);
|
|
4212
4536
|
return acquireAndCall(false);
|
|
4213
4537
|
}
|
|
4214
4538
|
if (err instanceof LspRequestTimeoutError) {
|
|
4215
|
-
if (
|
|
4539
|
+
if (manager.isServerInitializing(root, server.id)) {
|
|
4216
4540
|
throw new LspServerInitializingError(err);
|
|
4217
4541
|
}
|
|
4218
4542
|
}
|
|
4219
4543
|
throw err;
|
|
4220
4544
|
} finally {
|
|
4221
|
-
|
|
4545
|
+
manager.releaseClient(root, server.id);
|
|
4222
4546
|
}
|
|
4223
4547
|
};
|
|
4224
4548
|
return acquireAndCall(true);
|
|
4225
4549
|
}
|
|
4226
4550
|
|
|
4227
4551
|
// ../lsp-core/src/lsp/directory-diagnostics.ts
|
|
4228
|
-
import { existsSync as
|
|
4229
|
-
import { join as
|
|
4552
|
+
import { existsSync as existsSync11, lstatSync as lstatSync4, readdirSync as readdirSync3 } from "node:fs";
|
|
4553
|
+
import { join as join6, resolve as resolve9 } from "node:path";
|
|
4230
4554
|
|
|
4231
4555
|
// ../lsp-core/src/lsp/formatters.ts
|
|
4232
4556
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -4241,10 +4565,10 @@ function uriToPath(uri) {
|
|
|
4241
4565
|
}
|
|
4242
4566
|
function formatLocation(loc) {
|
|
4243
4567
|
if ("targetUri" in loc) {
|
|
4244
|
-
const
|
|
4245
|
-
const
|
|
4246
|
-
const
|
|
4247
|
-
return `${
|
|
4568
|
+
const uri = uriToPath(loc.targetUri);
|
|
4569
|
+
const line = loc.targetRange.start.line + 1;
|
|
4570
|
+
const char = loc.targetRange.start.character;
|
|
4571
|
+
return `${uri}:${line}:${char}`;
|
|
4248
4572
|
}
|
|
4249
4573
|
const uri = uriToPath(loc.uri);
|
|
4250
4574
|
const line = loc.range.start.line + 1;
|
|
@@ -4356,7 +4680,7 @@ function collectFilesWithExtension(dir, extension, maxFiles) {
|
|
|
4356
4680
|
for (const entry of entries) {
|
|
4357
4681
|
if (files.length >= maxFiles)
|
|
4358
4682
|
return;
|
|
4359
|
-
const fullPath =
|
|
4683
|
+
const fullPath = join6(currentDir, entry);
|
|
4360
4684
|
let stat;
|
|
4361
4685
|
try {
|
|
4362
4686
|
stat = lstatSync4(fullPath);
|
|
@@ -4381,15 +4705,15 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4381
4705
|
if (!extension.startsWith(".")) {
|
|
4382
4706
|
throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
|
|
4383
4707
|
}
|
|
4384
|
-
const absDir =
|
|
4385
|
-
if (!
|
|
4708
|
+
const absDir = resolve9(options.workspaceRoot ?? contextCwd(), directory);
|
|
4709
|
+
if (!existsSync11(absDir)) {
|
|
4386
4710
|
throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
|
|
4387
4711
|
}
|
|
4388
4712
|
const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
|
|
4389
4713
|
if (serverResult.status !== "found") {
|
|
4390
4714
|
throw new LspServerLookupError(formatServerLookupError(serverResult));
|
|
4391
4715
|
}
|
|
4392
|
-
const
|
|
4716
|
+
const server = serverResult.server;
|
|
4393
4717
|
const allFiles = (options.listFiles ?? collectFilesWithExtension)(absDir, extension, maxFiles + 1);
|
|
4394
4718
|
const wasCapped = allFiles.length > maxFiles;
|
|
4395
4719
|
const filesToProcess = allFiles.slice(0, maxFiles);
|
|
@@ -4404,12 +4728,12 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4404
4728
|
return { output, totalDiagnostics: 0, fileFailures: [] };
|
|
4405
4729
|
}
|
|
4406
4730
|
const root = options.workspaceRoot ?? findWorkspaceRoot(absDir);
|
|
4407
|
-
const
|
|
4731
|
+
const manager = options.manager ?? getLspManager();
|
|
4408
4732
|
const allDiagnostics = [];
|
|
4409
4733
|
const fileErrors = [];
|
|
4410
4734
|
const maxConcurrency = Math.max(1, options.maxConcurrency ?? DIRECTORY_DIAGNOSTICS_MAX_CONCURRENCY);
|
|
4411
4735
|
options.signal?.throwIfAborted();
|
|
4412
|
-
const client = await
|
|
4736
|
+
const client = await manager.getClient(root, server, options.signal);
|
|
4413
4737
|
try {
|
|
4414
4738
|
let nextIndex = 0;
|
|
4415
4739
|
const workers = Array.from({ length: Math.min(maxConcurrency, filesToProcess.length) }, async () => {
|
|
@@ -4437,7 +4761,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4437
4761
|
});
|
|
4438
4762
|
await Promise.all(workers);
|
|
4439
4763
|
} finally {
|
|
4440
|
-
|
|
4764
|
+
manager.releaseClient(root, server.id);
|
|
4441
4765
|
}
|
|
4442
4766
|
const displayDiagnostics = allDiagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
|
|
4443
4767
|
const wasDiagCapped = allDiagnostics.length > DEFAULT_MAX_DIAGNOSTICS;
|
|
@@ -4469,7 +4793,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4469
4793
|
|
|
4470
4794
|
// ../lsp-core/src/lsp/infer-extension.ts
|
|
4471
4795
|
import { lstatSync as lstatSync5, readdirSync as readdirSync4 } from "node:fs";
|
|
4472
|
-
import { join as
|
|
4796
|
+
import { join as join7 } from "node:path";
|
|
4473
4797
|
var SKIP_DIRECTORIES2 = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
|
|
4474
4798
|
var MAX_SCAN_ENTRIES = 500;
|
|
4475
4799
|
function inferExtensionFromDirectory(directory) {
|
|
@@ -4487,7 +4811,7 @@ function inferExtensionFromDirectory(directory) {
|
|
|
4487
4811
|
for (const entry of entries) {
|
|
4488
4812
|
if (scanned >= MAX_SCAN_ENTRIES)
|
|
4489
4813
|
return;
|
|
4490
|
-
const fullPath =
|
|
4814
|
+
const fullPath = join7(dir, entry);
|
|
4491
4815
|
let stat;
|
|
4492
4816
|
try {
|
|
4493
4817
|
stat = lstatSync5(fullPath);
|
|
@@ -4646,8 +4970,8 @@ function clientOptions(signal) {
|
|
|
4646
4970
|
}
|
|
4647
4971
|
|
|
4648
4972
|
// ../lsp-core/src/tools/result.ts
|
|
4649
|
-
function text(
|
|
4650
|
-
return { content: [{ type: "text", text
|
|
4973
|
+
function text(text, details, isError = false) {
|
|
4974
|
+
return { content: [{ type: "text", text }], details, isError };
|
|
4651
4975
|
}
|
|
4652
4976
|
|
|
4653
4977
|
// ../lsp-core/src/tools/diagnostics.ts
|
|
@@ -4667,7 +4991,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4667
4991
|
const extension = inferExtensionFromDirectory(absPath);
|
|
4668
4992
|
if (!extension) {
|
|
4669
4993
|
const message = `No supported source files found in directory: ${absPath}`;
|
|
4670
|
-
const
|
|
4994
|
+
const details = {
|
|
4671
4995
|
filePath,
|
|
4672
4996
|
severity,
|
|
4673
4997
|
mode: "directory",
|
|
@@ -4677,24 +5001,24 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4677
5001
|
error: message,
|
|
4678
5002
|
errorKind: "no_files"
|
|
4679
5003
|
};
|
|
4680
|
-
return text(message,
|
|
5004
|
+
return text(message, details);
|
|
4681
5005
|
}
|
|
4682
|
-
const
|
|
4683
|
-
const
|
|
5006
|
+
const output = await aggregateDiagnosticsForDirectory(absPath, extension, severity, undefined, signal === undefined ? {} : { signal });
|
|
5007
|
+
const details = {
|
|
4684
5008
|
filePath,
|
|
4685
5009
|
severity,
|
|
4686
5010
|
mode: "directory",
|
|
4687
5011
|
diagnostics: [],
|
|
4688
|
-
totalDiagnostics:
|
|
5012
|
+
totalDiagnostics: output.totalDiagnostics,
|
|
4689
5013
|
truncated: false,
|
|
4690
|
-
fileFailures: [...
|
|
5014
|
+
fileFailures: [...output.fileFailures]
|
|
4691
5015
|
};
|
|
4692
|
-
return text(
|
|
5016
|
+
return text(output.output, details);
|
|
4693
5017
|
}
|
|
4694
5018
|
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
|
|
4695
5019
|
if (result.transientError) {
|
|
4696
5020
|
const message = result.transientError.message;
|
|
4697
|
-
const
|
|
5021
|
+
const details = {
|
|
4698
5022
|
filePath,
|
|
4699
5023
|
severity,
|
|
4700
5024
|
mode: "file",
|
|
@@ -4704,7 +5028,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4704
5028
|
error: message,
|
|
4705
5029
|
errorKind: result.transientError.kind
|
|
4706
5030
|
};
|
|
4707
|
-
return text(message,
|
|
5031
|
+
return text(message, details, true);
|
|
4708
5032
|
}
|
|
4709
5033
|
const diagnostics = filterDiagnosticsBySeverity(asDiagnosticArray(result), severity);
|
|
4710
5034
|
const total = diagnostics.length;
|
|
@@ -4738,6 +5062,96 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
4738
5062
|
throw error;
|
|
4739
5063
|
}
|
|
4740
5064
|
}
|
|
5065
|
+
// ../lsp-core/src/lsp/format-document.ts
|
|
5066
|
+
import { readFileSync as readFileSync5, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync3 } from "node:fs";
|
|
5067
|
+
var DEFAULT_FORMATTING_OPTIONS = {
|
|
5068
|
+
tabSize: 4,
|
|
5069
|
+
insertSpaces: false,
|
|
5070
|
+
trimTrailingWhitespace: true,
|
|
5071
|
+
insertFinalNewline: true,
|
|
5072
|
+
trimFinalNewlines: true
|
|
5073
|
+
};
|
|
5074
|
+
var UNCHANGED = { status: "unchanged", linesAdded: 0, linesRemoved: 0 };
|
|
5075
|
+
async function formatDocumentWithClient(client, filePath, options = {}) {
|
|
5076
|
+
const edits = await client.formatDocument(filePath, options.formattingOptions ?? DEFAULT_FORMATTING_OPTIONS, options.signal);
|
|
5077
|
+
if (edits === null)
|
|
5078
|
+
return { status: "unavailable", reason: "capability_not_advertised" };
|
|
5079
|
+
if (edits.length === 0)
|
|
5080
|
+
return UNCHANGED;
|
|
5081
|
+
const before = readFileSync5(filePath, "utf-8");
|
|
5082
|
+
const normalized = normalizeTextEdits(before, edits, 0);
|
|
5083
|
+
if (normalized.text === before)
|
|
5084
|
+
return UNCHANGED;
|
|
5085
|
+
writeAtomically(filePath, normalized.text);
|
|
5086
|
+
await client.openFile(filePath);
|
|
5087
|
+
return {
|
|
5088
|
+
status: "formatted",
|
|
5089
|
+
...lineDelta(normalized.edits)
|
|
5090
|
+
};
|
|
5091
|
+
}
|
|
5092
|
+
function lineDelta(edits) {
|
|
5093
|
+
let linesAdded = 0;
|
|
5094
|
+
let linesRemoved = 0;
|
|
5095
|
+
for (const edit of edits) {
|
|
5096
|
+
linesRemoved += edit.range.end.line - edit.range.start.line + 1;
|
|
5097
|
+
linesAdded += edit.newText.split(`
|
|
5098
|
+
`).length;
|
|
5099
|
+
}
|
|
5100
|
+
return { linesAdded, linesRemoved };
|
|
5101
|
+
}
|
|
5102
|
+
function writeAtomically(filePath, content) {
|
|
5103
|
+
const tempPath = `${filePath}.omo-format.tmp`;
|
|
5104
|
+
writeFileSync3(tempPath, content, "utf-8");
|
|
5105
|
+
try {
|
|
5106
|
+
renameSync3(tempPath, filePath);
|
|
5107
|
+
} catch (error) {
|
|
5108
|
+
try {
|
|
5109
|
+
unlinkSync(tempPath);
|
|
5110
|
+
} catch {}
|
|
5111
|
+
throw error;
|
|
5112
|
+
}
|
|
5113
|
+
}
|
|
5114
|
+
|
|
5115
|
+
// ../lsp-core/src/tools/format.ts
|
|
5116
|
+
async function executeLspFormat(params, signal) {
|
|
5117
|
+
const filePath = requireString(params, "filePath");
|
|
5118
|
+
try {
|
|
5119
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => formatDocumentWithClient(client, resolvedFilePath, signal === undefined ? {} : { signal }), "format", clientOptions(signal));
|
|
5120
|
+
return text(describeResult(filePath, result), formatDetails(filePath, result));
|
|
5121
|
+
} catch (error) {
|
|
5122
|
+
const missingDependency = missingDependencyResult(error, {
|
|
5123
|
+
filePath,
|
|
5124
|
+
status: "unavailable",
|
|
5125
|
+
reason: "server_unavailable",
|
|
5126
|
+
linesAdded: 0,
|
|
5127
|
+
linesRemoved: 0
|
|
5128
|
+
});
|
|
5129
|
+
if (missingDependency)
|
|
5130
|
+
return missingDependency;
|
|
5131
|
+
throw error;
|
|
5132
|
+
}
|
|
5133
|
+
}
|
|
5134
|
+
function formatDetails(filePath, result) {
|
|
5135
|
+
if (result.status === "unavailable") {
|
|
5136
|
+
return { filePath, status: "unavailable", reason: result.reason, linesAdded: 0, linesRemoved: 0 };
|
|
5137
|
+
}
|
|
5138
|
+
return {
|
|
5139
|
+
filePath,
|
|
5140
|
+
status: result.status,
|
|
5141
|
+
linesAdded: result.linesAdded,
|
|
5142
|
+
linesRemoved: result.linesRemoved
|
|
5143
|
+
};
|
|
5144
|
+
}
|
|
5145
|
+
function describeResult(filePath, result) {
|
|
5146
|
+
if (result.status === "unavailable") {
|
|
5147
|
+
return `Formatting unavailable for ${filePath}: the language server does not advertise documentFormattingProvider.`;
|
|
5148
|
+
}
|
|
5149
|
+
if (result.status === "unchanged") {
|
|
5150
|
+
return `Already formatted: ${filePath}`;
|
|
5151
|
+
}
|
|
5152
|
+
return `Formatted ${filePath} (+${result.linesAdded}/-${result.linesRemoved} lines)`;
|
|
5153
|
+
}
|
|
5154
|
+
|
|
4741
5155
|
// ../lsp-core/src/tools/install-decision.ts
|
|
4742
5156
|
async function executeLspInstallDecision(params) {
|
|
4743
5157
|
const serverId = requireString(params, "server_id");
|
|
@@ -4745,7 +5159,7 @@ async function executeLspInstallDecision(params) {
|
|
|
4745
5159
|
if (!isInstallDecision(decision)) {
|
|
4746
5160
|
return text(`Invalid decision '${String(decision)}'. Expected "declined" or "allowed".`, { serverId, errorKind: "invalid_decision" }, true);
|
|
4747
5161
|
}
|
|
4748
|
-
const serverIds = [...new Set(getMergedServers().map((
|
|
5162
|
+
const serverIds = [...new Set(getMergedServers().map((server) => server.id))];
|
|
4749
5163
|
if (!serverIds.includes(serverId)) {
|
|
4750
5164
|
const preview = serverIds.slice(0, 20).join(", ");
|
|
4751
5165
|
return text(`Unknown LSP server '${serverId}'. Known servers: ${preview}${serverIds.length > 20 ? "..." : ""}`, { serverId, errorKind: "unknown_server" }, true);
|
|
@@ -4885,10 +5299,10 @@ function objectSchema(properties, required = []) {
|
|
|
4885
5299
|
async function executeLspStatus() {
|
|
4886
5300
|
const servers = getAllServers();
|
|
4887
5301
|
const snapshots = getLspManager().getSnapshot();
|
|
4888
|
-
const installed = servers.filter((
|
|
4889
|
-
const configuredLines = servers.map((
|
|
4890
|
-
const state =
|
|
4891
|
-
return `- ${
|
|
5302
|
+
const installed = servers.filter((server) => server.installed && !server.disabled);
|
|
5303
|
+
const configuredLines = servers.map((server) => {
|
|
5304
|
+
const state = server.disabled ? "disabled" : server.installed ? "installed" : "missing";
|
|
5305
|
+
return `- ${server.id}: ${state}; source=${server.source}; extensions=${server.extensions.join(", ")}`;
|
|
4892
5306
|
});
|
|
4893
5307
|
const activeLines = snapshots.map((snapshot) => {
|
|
4894
5308
|
const state = snapshot.alive ? snapshot.isInitializing ? "initializing" : "alive" : "dead";
|
|
@@ -4931,8 +5345,8 @@ async function executeLspSymbols(params, signal) {
|
|
|
4931
5345
|
errorKind: "missing_query"
|
|
4932
5346
|
});
|
|
4933
5347
|
}
|
|
4934
|
-
const
|
|
4935
|
-
return formatSymbolsResult(filePath, scope,
|
|
5348
|
+
const symbols = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
|
|
5349
|
+
return formatSymbolsResult(filePath, scope, symbols, limit, query);
|
|
4936
5350
|
}
|
|
4937
5351
|
const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
|
|
4938
5352
|
return formatSymbolsResult(filePath, scope, symbols, limit);
|
|
@@ -5070,6 +5484,16 @@ var LSP_MCP_TOOLS = [
|
|
|
5070
5484
|
}, ["filePath", "line", "character", "newName"]),
|
|
5071
5485
|
execute: executeLspRename
|
|
5072
5486
|
},
|
|
5487
|
+
{
|
|
5488
|
+
name: "format",
|
|
5489
|
+
aliases: ["lsp_format"],
|
|
5490
|
+
title: "LSP Format",
|
|
5491
|
+
description: "Format a source file with its language server and write the returned edits to disk.",
|
|
5492
|
+
inputSchema: objectSchema({
|
|
5493
|
+
filePath: { type: "string", description: "Source file path to format." }
|
|
5494
|
+
}, ["filePath"]),
|
|
5495
|
+
execute: executeLspFormat
|
|
5496
|
+
},
|
|
5073
5497
|
{
|
|
5074
5498
|
name: "install_decision",
|
|
5075
5499
|
aliases: ["lsp_install_decision"],
|
|
@@ -5177,7 +5601,6 @@ function requestedProtocolVersion(params) {
|
|
|
5177
5601
|
return params["protocolVersion"];
|
|
5178
5602
|
}
|
|
5179
5603
|
// src/cli.ts
|
|
5180
|
-
import { argv, stderr } from "node:process";
|
|
5181
5604
|
async function main() {
|
|
5182
5605
|
const [command = "mcp"] = argv.slice(2);
|
|
5183
5606
|
try {
|