lazycodex-ai 5.1.48 → 5.1.51
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/dist/cli/index.js +1194 -752
- package/dist/cli/service-auth/accounts-gate.d.ts +11 -0
- package/dist/cli/service-auth/commands.d.ts +2 -4
- package/dist/cli/service-auth/index.d.ts +1 -1
- package/dist/cli/service-auth/keystore.d.ts +26 -2
- package/dist/cli/service-auth/protocol.d.ts +7 -1
- package/dist/cli/service-auth/session.d.ts +6 -0
- package/dist/cli/service-auth/signed-out-marker.d.ts +11 -0
- package/dist/cli-node/index.js +1194 -752
- package/package.json +3 -1
- package/packages/lsp-core/package.json +45 -0
- package/packages/lsp-core/src/index.ts +30 -0
- package/packages/lsp-core/src/lsp/bun-command-output.ts +82 -0
- package/packages/lsp-core/src/lsp/bun-project-checks.test.ts +170 -0
- package/packages/lsp-core/src/lsp/bun-project-checks.ts +223 -0
- package/packages/lsp-core/src/lsp/cleanup-errors.test.ts +18 -0
- package/packages/lsp-core/src/lsp/cleanup-errors.ts +14 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +52 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +471 -0
- 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 +213 -0
- package/packages/lsp-core/src/lsp/client-wrapper.ts +290 -0
- package/packages/lsp-core/src/lsp/client.ts +398 -0
- package/packages/lsp-core/src/lsp/config-loader.ts +254 -0
- package/packages/lsp-core/src/lsp/connection.ts +95 -0
- package/packages/lsp-core/src/lsp/constants.ts +17 -0
- package/packages/lsp-core/src/lsp/controlled-clock-test-support.ts +90 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +221 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.ts +187 -0
- package/packages/lsp-core/src/lsp/effective-extension.ts +10 -0
- package/packages/lsp-core/src/lsp/errors.ts +89 -0
- package/packages/lsp-core/src/lsp/fake-bun-test-support.ts +102 -0
- package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +283 -0
- package/packages/lsp-core/src/lsp/fixtures/disposed-stdin-epipe-probe.ts +28 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-contract-probe.ts +196 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +234 -0
- package/packages/lsp-core/src/lsp/format-document.test.ts +143 -0
- package/packages/lsp-core/src/lsp/format-document.ts +90 -0
- package/packages/lsp-core/src/lsp/formatters.ts +144 -0
- package/packages/lsp-core/src/lsp/infer-extension.ts +66 -0
- package/packages/lsp-core/src/lsp/json-rpc-connection-cancellation.test.ts +97 -0
- package/packages/lsp-core/src/lsp/json-rpc-connection.ts +369 -0
- package/packages/lsp-core/src/lsp/language-mappings.ts +173 -0
- 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 +495 -0
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
- package/packages/lsp-core/src/lsp/process-pipe-errors.test.ts +21 -0
- package/packages/lsp-core/src/lsp/process-signal-cleanup.ts +21 -0
- package/packages/lsp-core/src/lsp/process.ts +221 -0
- package/packages/lsp-core/src/lsp/server-definitions.ts +205 -0
- package/packages/lsp-core/src/lsp/server-install-state.ts +67 -0
- package/packages/lsp-core/src/lsp/server-installation.test.ts +376 -0
- package/packages/lsp-core/src/lsp/server-installation.ts +218 -0
- package/packages/lsp-core/src/lsp/server-resolution-local-binary.test.ts +170 -0
- package/packages/lsp-core/src/lsp/server-resolution.ts +117 -0
- package/packages/lsp-core/src/lsp/startup-failure.ts +1 -0
- package/packages/lsp-core/src/lsp/timer-provider.ts +13 -0
- package/packages/lsp-core/src/lsp/transport-protocol.ts +52 -0
- package/packages/lsp-core/src/lsp/transport-request-timeout.test.ts +73 -0
- package/packages/lsp-core/src/lsp/transport.ts +339 -0
- package/packages/lsp-core/src/lsp/types.ts +134 -0
- package/packages/lsp-core/src/lsp/utils.test.ts +72 -0
- package/packages/lsp-core/src/lsp/utils.ts +40 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-failure.ts +19 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-lease.integration.test.ts +218 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-sync.integration.test.ts +113 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +194 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit.integration.test.ts +163 -0
- package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +150 -0
- package/packages/lsp-core/src/lsp/workspace-document-state.ts +392 -0
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +132 -0
- package/packages/lsp-core/src/lsp/workspace-edit-commit.test.ts +140 -0
- package/packages/lsp-core/src/lsp/workspace-edit-commit.ts +220 -0
- package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.test.ts +56 -0
- package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.ts +30 -0
- package/packages/lsp-core/src/lsp/workspace-edit-fingerprint.ts +44 -0
- package/packages/lsp-core/src/lsp/workspace-edit-options.test.ts +147 -0
- package/packages/lsp-core/src/lsp/workspace-edit-parse-helpers.ts +59 -0
- package/packages/lsp-core/src/lsp/workspace-edit-parser.ts +130 -0
- package/packages/lsp-core/src/lsp/workspace-edit-path.ts +98 -0
- package/packages/lsp-core/src/lsp/workspace-edit-plan-types.ts +60 -0
- package/packages/lsp-core/src/lsp/workspace-edit-plan.ts +73 -0
- package/packages/lsp-core/src/lsp/workspace-edit-prevalidation.test.ts +174 -0
- package/packages/lsp-core/src/lsp/workspace-edit-resource-parser.ts +89 -0
- package/packages/lsp-core/src/lsp/workspace-edit-simulation.ts +183 -0
- package/packages/lsp-core/src/lsp/workspace-edit-snapshot.ts +53 -0
- package/packages/lsp-core/src/lsp/workspace-edit-text.ts +125 -0
- package/packages/lsp-core/src/lsp/workspace-edit-types.ts +121 -0
- package/packages/lsp-core/src/lsp/workspace-edit.characterization.test.ts +95 -0
- package/packages/lsp-core/src/lsp/workspace-edit.ts +55 -0
- package/packages/lsp-core/src/lsp/workspace-markers.ts +18 -0
- package/packages/lsp-core/src/lsp/workspace-mutation-controller.ts +182 -0
- package/packages/lsp-core/src/mcp-protocol-pin.test.ts +97 -0
- package/packages/lsp-core/src/mcp.ts +122 -0
- package/packages/lsp-core/src/missing-dependency-result.test.ts +135 -0
- package/packages/lsp-core/src/missing-dependency-result.ts +79 -0
- package/packages/lsp-core/src/post-edit/file-location.ts +55 -0
- package/packages/lsp-core/src/post-edit/index.ts +3 -0
- package/packages/lsp-core/src/post-edit/not-installed-guidance.ts +36 -0
- package/packages/lsp-core/src/post-edit/not-installed.test.ts +224 -0
- package/packages/lsp-core/src/post-edit/orchestration.test.ts +157 -0
- package/packages/lsp-core/src/post-edit/orchestration.ts +205 -0
- package/packages/lsp-core/src/request-context.test.ts +200 -0
- package/packages/lsp-core/src/request-context.ts +235 -0
- package/packages/lsp-core/src/tool-surface.test.ts +173 -0
- package/packages/lsp-core/src/tools/bun-directory-diagnostics.test.ts +113 -0
- package/packages/lsp-core/src/tools/bun-directory-diagnostics.ts +75 -0
- package/packages/lsp-core/src/tools/definitions.ts +156 -0
- package/packages/lsp-core/src/tools/diagnostics.ts +133 -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 +11 -0
- package/packages/lsp-core/src/tools/install-decision.ts +39 -0
- package/packages/lsp-core/src/tools/navigation.ts +88 -0
- package/packages/lsp-core/src/tools/parameters.test.ts +51 -0
- package/packages/lsp-core/src/tools/parameters.ts +49 -0
- package/packages/lsp-core/src/tools/rename.ts +69 -0
- package/packages/lsp-core/src/tools/result.ts +5 -0
- package/packages/lsp-core/src/tools/runtime.ts +21 -0
- package/packages/lsp-core/src/tools/schema.ts +9 -0
- package/packages/lsp-core/src/tools/status.ts +28 -0
- package/packages/lsp-core/src/tools/symbols.ts +99 -0
- package/packages/lsp-core/src/tools/types.ts +116 -0
- package/packages/lsp-core/src/tools.ts +1 -0
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/README.md +1 -1
- 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/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- 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 +1 -1
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-contribute-bug-fix/SKILL.md +51 -55
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-report-bug/SKILL.md +7 -7
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-report-bug/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +2 -2
- package/packages/omo-codex/plugin/components/telemetry/README.md +2 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +52 -15
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +52 -19
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +2 -9
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +4 -13
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +0 -2
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook-diagnostics.test.ts +0 -3
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook.test.ts +3 -8
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +3 -0
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- 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 +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-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 +1 -1
- 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/package-lock.json +16 -16
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/shared/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/README.md +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +5 -3
- package/packages/omo-codex/plugin/skills/ast-grep/install.sh +4 -5
- package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +2 -2
- package/packages/omo-codex/plugin/skills/ast-grep/scripts/ast_grep_helper.py +13 -3
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +5 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +11 -11
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +2 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/codex.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/find-agent-sessions.py +6 -3
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +34 -12
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +2 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/component-catalogs.md +14 -10
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +19 -6
- package/packages/omo-codex/plugin/skills/frontend/references/design/grounding.md +29 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +2 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +2 -0
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +51 -55
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +7 -7
- package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +5 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +9 -6
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/summary.py +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/extract_cookies.py +4 -2
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +3 -0
- package/packages/omo-codex/plugin/skills/ulw-research/AGENTS.md +8 -4
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +7 -316
- package/packages/omo-codex/plugin/skills/ulw-research/references/deliverable-phase.md +23 -21
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger-grammar.md +7 -3
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger.md +42 -8
- package/packages/omo-codex/plugin/skills/ulw-research/references/fidelity-claim-kinds.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/references/markdown-blocks.md +12 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/report-gates.md +12 -5
- package/packages/omo-codex/plugin/skills/ulw-research/references/research-collection.md +195 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/research-delivery.md +123 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/claim-kinds.mjs +33 -5
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/contracts.mjs +13 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/conversion-probe.mjs +229 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/css-hiding.mjs +158 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/css-lite.mjs +4 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/entities.mjs +13 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-fill.mjs +11 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-meaning.mjs +13 -9
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-polish.mjs +40 -18
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-verify.mjs +25 -8
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands.mjs +35 -16
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-derive.mjs +7 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-fill.mjs +6 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger-kinds.mjs +6 -7
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-locate.mjs +15 -9
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-claims.mjs +4 -3
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-csv.mjs +32 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-lexicon.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-originals.mjs +161 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-policy.mjs +4 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-records.mjs +81 -14
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-snapshot-readability.mjs +49 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-sources.mjs +76 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-trace.mjs +25 -11
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-value-unit.mjs +202 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-values.mjs +40 -39
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-fidelity.mjs +8 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-static.mjs +10 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-lite.mjs +6 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-markup.mjs +2 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-text-map.mjs +140 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/markdown-closers.mjs +126 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/md-lite.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/number-grammar.mjs +33 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/numerals.mjs +18 -7
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome-start.mjs +66 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome.mjs +11 -22
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/placeholder.mjs +18 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-apply.mjs +3 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/raw-decode.mjs +110 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/raw-locator.mjs +47 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools-commands.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools.mjs +7 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-commands.mjs +79 -26
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-refresh.mjs +82 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-snapshot.mjs +73 -69
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-view.mjs +89 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/sources-citation.mjs +203 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/units.mjs +14 -3
- package/packages/omo-codex/plugin/test/payload-equivalence.test.mjs +6 -4
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +4 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +338 -237
- package/packages/prompts-core/prompts/ultrawork/codex.md +3 -0
- package/packages/shared-skills/skill-source-filter.mjs +6 -2
- package/packages/shared-skills/skills/ast-grep/README.md +1 -1
- package/packages/shared-skills/skills/ast-grep/install.ps1 +5 -3
- package/packages/shared-skills/skills/ast-grep/install.sh +4 -5
- package/packages/shared-skills/skills/ast-grep/references/install.md +2 -2
- package/packages/shared-skills/skills/ast-grep/scripts/ast_grep_helper.py +13 -3
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +5 -4
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +11 -11
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +2 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/codex.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/find-agent-sessions.py +6 -3
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +34 -12
- package/packages/shared-skills/skills/frontend/references/design/README.md +2 -2
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +2 -1
- package/packages/shared-skills/skills/frontend/references/design/component-catalogs.md +14 -10
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +19 -6
- package/packages/shared-skills/skills/frontend/references/design/grounding.md +29 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +2 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +2 -0
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +5 -4
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +9 -6
- package/packages/shared-skills/skills/ultimate-browsing/engine/summary.py +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/shared-skills/skills/ultimate-browsing/scripts/extract_cookies.py +4 -2
- package/packages/shared-skills/skills/ulw-research/AGENTS.md +8 -4
- package/packages/shared-skills/skills/ulw-research/SKILL.md +7 -316
- package/packages/shared-skills/skills/ulw-research/references/deliverable-phase.md +23 -21
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger-grammar.md +7 -3
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger.md +42 -8
- package/packages/shared-skills/skills/ulw-research/references/fidelity-claim-kinds.md +1 -1
- package/packages/shared-skills/skills/ulw-research/references/markdown-blocks.md +12 -0
- package/packages/shared-skills/skills/ulw-research/references/report-gates.md +12 -5
- package/packages/shared-skills/skills/ulw-research/references/research-collection.md +195 -0
- package/packages/shared-skills/skills/ulw-research/references/research-delivery.md +123 -0
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.mjs +33 -5
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.test.ts +37 -2
- package/packages/shared-skills/skills/ulw-research/scripts/claim-prefix.test.ts +76 -0
- package/packages/shared-skills/skills/ulw-research/scripts/contracts-validation.test.ts +83 -0
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.mjs +13 -4
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.test.ts +6 -110
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-altered.test.ts +154 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-originals.test.ts +297 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe-classes.test.ts +361 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe.mjs +229 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe.test.ts +218 -0
- package/packages/shared-skills/skills/ulw-research/scripts/copy-returns-polish.test.ts +4 -3
- package/packages/shared-skills/skills/ulw-research/scripts/css-hiding.mjs +158 -0
- package/packages/shared-skills/skills/ulw-research/scripts/css-lite.mjs +4 -2
- package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier-meaning.test.ts +186 -0
- package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier.test.ts +40 -87
- package/packages/shared-skills/skills/ulw-research/scripts/entities.mjs +13 -4
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-fill.mjs +11 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-meaning.mjs +13 -9
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-polish.mjs +40 -18
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-verify.mjs +25 -8
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands.mjs +35 -16
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive-2.test.ts +149 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.mjs +7 -2
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.test.ts +7 -192
- package/packages/shared-skills/skills/ulw-research/scripts/fact-fill.mjs +6 -4
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.mjs +6 -7
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.test.ts +2 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-legacy.test.ts +2 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-locate.mjs +15 -9
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions-2.test.ts +149 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions.test.ts +4 -168
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-rules.test.ts +3 -229
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-claims.mjs +4 -3
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-csv.mjs +32 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-lexicon.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-originals.mjs +161 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-policy.mjs +4 -4
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-records.mjs +81 -14
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-snapshot-readability.mjs +49 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-sources.mjs +76 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-trace.mjs +25 -11
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-value-unit.mjs +202 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.mjs +40 -39
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.test.ts +8 -29
- package/packages/shared-skills/skills/ulw-research/scripts/gates-fidelity.mjs +8 -6
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static-headings.test.ts +17 -0
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static.mjs +10 -1
- package/packages/shared-skills/skills/ulw-research/scripts/html-lite.mjs +6 -2
- package/packages/shared-skills/skills/ulw-research/scripts/html-markup.mjs +2 -2
- package/packages/shared-skills/skills/ulw-research/scripts/html-text-map.mjs +140 -0
- package/packages/shared-skills/skills/ulw-research/scripts/html-text-map.test.ts +148 -0
- package/packages/shared-skills/skills/ulw-research/scripts/markdown-closers.mjs +126 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite-boundaries.test.ts +46 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/number-grammar.mjs +33 -0
- package/packages/shared-skills/skills/ulw-research/scripts/number-grammar.test.ts +36 -0
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.mjs +18 -7
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.test.ts +3 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome-start.mjs +66 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome-start.test.ts +109 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome.mjs +11 -22
- package/packages/shared-skills/skills/ulw-research/scripts/page-source-locator.test.ts +187 -0
- package/packages/shared-skills/skills/ulw-research/scripts/placeholder.mjs +18 -6
- package/packages/shared-skills/skills/ulw-research/scripts/polish-apply.mjs +3 -2
- package/packages/shared-skills/skills/ulw-research/scripts/polish-markup.test.ts +15 -1
- package/packages/shared-skills/skills/ulw-research/scripts/polish-partial.test.ts +42 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-decode.mjs +110 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-locator.mjs +47 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-snapshot.test.ts +139 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-2.test.ts +233 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-3.test.ts +141 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-4.test.ts +135 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-5.test.ts +231 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-commands.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.mjs +7 -1
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.test.ts +5 -800
- package/packages/shared-skills/skills/ulw-research/scripts/snapshot-readability.test.ts +116 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-commands.mjs +79 -26
- package/packages/shared-skills/skills/ulw-research/scripts/source-integrity.test.ts +243 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-refresh.mjs +82 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.mjs +73 -69
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.test.ts +7 -4
- package/packages/shared-skills/skills/ulw-research/scripts/source-view.mjs +89 -0
- package/packages/shared-skills/skills/ulw-research/scripts/sources-citation.mjs +203 -0
- package/packages/shared-skills/skills/ulw-research/scripts/sources-citation.test.ts +236 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/contracts-support.ts +147 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/delivery-barrier-session.ts +59 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/derive-clock.ts +4 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-derive-support.ts +65 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-unit-dimensions-support.ts +41 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-unit-rules-support.ts +241 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fidelity-values-support.ts +30 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/conversion-probe.html +14 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/sources-shapes.html +20 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/numeral-classes.ts +196 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/report-tools-support.ts +182 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/value-mode-support.ts +48 -0
- package/packages/shared-skills/skills/ulw-research/scripts/units.mjs +14 -3
- package/packages/shared-skills/skills/ulw-research/scripts/units.test.ts +10 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-mode-unit-classes.test.ts +255 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-mode-unit.test.ts +179 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-cli.test.ts +157 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-followups.test.ts +72 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-priority.test.ts +80 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +0 -7
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +0 -19
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +0 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +0 -1128
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +0 -77
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +0 -86
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +0 -279
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate.py +0 -252
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +0 -78
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { type ChildProcess, spawn, spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, statSync } from "node:fs";
|
|
3
|
+
import { delimiter, join } from "node:path";
|
|
4
|
+
|
|
5
|
+
import { reportBestEffortCleanupError } from "./cleanup-errors.js";
|
|
6
|
+
import { LspInvalidPathError, LspProcessSpawnError } from "./errors.js";
|
|
7
|
+
|
|
8
|
+
export interface SpawnedProcess {
|
|
9
|
+
stdin: NodeJS.WritableStream;
|
|
10
|
+
stdout: NodeJS.ReadableStream;
|
|
11
|
+
stderr: NodeJS.ReadableStream;
|
|
12
|
+
pid: number | undefined;
|
|
13
|
+
exitCode: number | null;
|
|
14
|
+
exited: Promise<number>;
|
|
15
|
+
kill(signal?: NodeJS.Signals): void;
|
|
16
|
+
killed: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface SpawnOptions {
|
|
20
|
+
cwd: string;
|
|
21
|
+
env: Record<string, string | undefined>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface PreparedSpawnCommand {
|
|
25
|
+
command: string;
|
|
26
|
+
args: string[];
|
|
27
|
+
shell: false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function isMissingProcessError(error: unknown): boolean {
|
|
31
|
+
if (!(error instanceof Error) || !("code" in error)) return false;
|
|
32
|
+
return error.code === "ESRCH";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function reportKillError(context: string, error: unknown): void {
|
|
36
|
+
if (!isMissingProcessError(error)) {
|
|
37
|
+
reportBestEffortCleanupError(context, error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function validateCwd(cwd: string): { valid: boolean; error?: string } {
|
|
42
|
+
try {
|
|
43
|
+
if (!existsSync(cwd)) {
|
|
44
|
+
return { valid: false, error: `Working directory does not exist: ${cwd}` };
|
|
45
|
+
}
|
|
46
|
+
const stats = statSync(cwd);
|
|
47
|
+
if (!stats.isDirectory()) {
|
|
48
|
+
return { valid: false, error: `Path is not a directory: ${cwd}` };
|
|
49
|
+
}
|
|
50
|
+
return { valid: true };
|
|
51
|
+
} catch (err) {
|
|
52
|
+
return {
|
|
53
|
+
valid: false,
|
|
54
|
+
error: `Cannot access working directory: ${cwd} (${err instanceof Error ? err.message : String(err)})`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// The child's pipes outlive every JsonRpcConnection that borrows them: a
|
|
60
|
+
// connection detaches its listeners on dispose, yet a write issued before
|
|
61
|
+
// dispose can still fail later (on Windows a closed pipe reports EPIPE
|
|
62
|
+
// asynchronously). An 'error' event with no listener is raised as an unhandled
|
|
63
|
+
// error, so each pipe keeps this guard for its whole life. It reports only when
|
|
64
|
+
// no other owner is listening, so an attached connection keeps sole reporting.
|
|
65
|
+
function guardPipeErrors(stream: NodeJS.EventEmitter, pipe: string): void {
|
|
66
|
+
stream.on("error", (error: Error) => {
|
|
67
|
+
if (stream.listenerCount("error") > 1) return;
|
|
68
|
+
reportBestEffortCleanupError(`server ${pipe}`, error);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function wrap(proc: ChildProcess): SpawnedProcess {
|
|
73
|
+
const exitedPromise = new Promise<number>((resolve) => {
|
|
74
|
+
proc.once("close", (code) => resolve(code ?? 0));
|
|
75
|
+
proc.once("error", () => resolve(1));
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (!proc.stdin || !proc.stdout || !proc.stderr) {
|
|
79
|
+
throw new LspProcessSpawnError("Spawned process is missing one of stdin/stdout/stderr pipes");
|
|
80
|
+
}
|
|
81
|
+
guardPipeErrors(proc.stdin, "stdin");
|
|
82
|
+
guardPipeErrors(proc.stdout, "stdout");
|
|
83
|
+
guardPipeErrors(proc.stderr, "stderr");
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
stdin: proc.stdin,
|
|
87
|
+
stdout: proc.stdout,
|
|
88
|
+
stderr: proc.stderr,
|
|
89
|
+
get pid() {
|
|
90
|
+
return proc.pid ?? undefined;
|
|
91
|
+
},
|
|
92
|
+
get exitCode() {
|
|
93
|
+
return proc.exitCode;
|
|
94
|
+
},
|
|
95
|
+
get killed() {
|
|
96
|
+
return proc.killed;
|
|
97
|
+
},
|
|
98
|
+
exited: exitedPromise,
|
|
99
|
+
kill(signal?: NodeJS.Signals) {
|
|
100
|
+
killProcessTree(proc, signal ?? "SIGTERM");
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function killProcessTree(proc: ChildProcess, signal: NodeJS.Signals): void {
|
|
106
|
+
if (process.platform === "win32" && proc.pid) {
|
|
107
|
+
const result = spawnSync("taskkill", ["/pid", String(proc.pid), "/f", "/t"], {
|
|
108
|
+
stdio: "ignore",
|
|
109
|
+
windowsHide: true,
|
|
110
|
+
});
|
|
111
|
+
if (!result.error && result.status === 0) return;
|
|
112
|
+
if (result.error) reportKillError("windows process tree kill", result.error);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (process.platform !== "win32" && proc.pid) {
|
|
116
|
+
try {
|
|
117
|
+
process.kill(-proc.pid, signal);
|
|
118
|
+
return;
|
|
119
|
+
} catch (error) {
|
|
120
|
+
reportKillError("process group kill", error);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
proc.kill(signal);
|
|
126
|
+
} catch (error) {
|
|
127
|
+
reportKillError("process kill", error);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function isWindowsShellShim(command: string): boolean {
|
|
132
|
+
const lowerCommand = command.toLowerCase();
|
|
133
|
+
return lowerCommand.endsWith(".cmd") || lowerCommand.endsWith(".bat");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function splitPath(pathValue: string, platform: NodeJS.Platform): string[] {
|
|
137
|
+
const separator = platform === "win32" ? ";" : delimiter;
|
|
138
|
+
return pathValue.split(separator).filter(Boolean);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function getWindowsPathExtensions(env: Record<string, string | undefined>): string[] {
|
|
142
|
+
const rawExtensions = env["PATHEXT"] ?? ".COM;.EXE;.BAT;.CMD";
|
|
143
|
+
const extensions = rawExtensions
|
|
144
|
+
.split(";")
|
|
145
|
+
.map((extension) => extension.trim())
|
|
146
|
+
.filter(Boolean)
|
|
147
|
+
.map((extension) => (extension.startsWith(".") ? extension : `.${extension}`));
|
|
148
|
+
return [...new Set([...extensions, ".exe", ".cmd", ".bat", ""])];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function resolveWindowsCommand(command: string, env: Record<string, string | undefined>): string {
|
|
152
|
+
const hasPathSeparator = command.includes("/") || command.includes("\\");
|
|
153
|
+
const pathValue = env["PATH"] ?? env["Path"] ?? "";
|
|
154
|
+
const baseDirectories = hasPathSeparator ? [""] : splitPath(pathValue, "win32");
|
|
155
|
+
const extensions = getWindowsPathExtensions(env);
|
|
156
|
+
|
|
157
|
+
for (const baseDirectory of baseDirectories) {
|
|
158
|
+
for (const extension of extensions) {
|
|
159
|
+
const candidate = baseDirectory ? join(baseDirectory, `${command}${extension}`) : `${command}${extension}`;
|
|
160
|
+
if (existsSync(candidate)) return candidate;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return command;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function createSpawnCommand(
|
|
168
|
+
command: string[],
|
|
169
|
+
platform: NodeJS.Platform = process.platform,
|
|
170
|
+
commandProcessor: string = process.env["ComSpec"] ?? "cmd.exe",
|
|
171
|
+
env: Record<string, string | undefined> = process.env,
|
|
172
|
+
): PreparedSpawnCommand {
|
|
173
|
+
const [cmd, ...args] = command;
|
|
174
|
+
if (!cmd) {
|
|
175
|
+
throw new LspProcessSpawnError("[lsp] empty command");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (platform !== "win32") {
|
|
179
|
+
return { command: cmd, args, shell: false };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const resolvedCommand = resolveWindowsCommand(cmd, env);
|
|
183
|
+
if (!isWindowsShellShim(resolvedCommand)) {
|
|
184
|
+
return { command: resolvedCommand, args, shell: false };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
command: commandProcessor,
|
|
189
|
+
args: ["/d", "/s", "/c", resolvedCommand, ...args],
|
|
190
|
+
shell: false,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function spawnProcess(command: string[], options: SpawnOptions): SpawnedProcess {
|
|
195
|
+
const cwdValidation = validateCwd(options.cwd);
|
|
196
|
+
if (!cwdValidation.valid) {
|
|
197
|
+
throw new LspInvalidPathError(`[lsp] ${cwdValidation.error}`);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const [cmd] = command;
|
|
201
|
+
if (!cmd) {
|
|
202
|
+
throw new LspProcessSpawnError("[lsp] empty command");
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const preparedCommand = createSpawnCommand(
|
|
206
|
+
command,
|
|
207
|
+
process.platform,
|
|
208
|
+
process.env["ComSpec"] ?? "cmd.exe",
|
|
209
|
+
options.env,
|
|
210
|
+
);
|
|
211
|
+
const proc = spawn(preparedCommand.command, preparedCommand.args, {
|
|
212
|
+
cwd: options.cwd,
|
|
213
|
+
env: options.env,
|
|
214
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
215
|
+
windowsHide: true,
|
|
216
|
+
shell: preparedCommand.shell,
|
|
217
|
+
detached: process.platform !== "win32",
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
return wrap(proc);
|
|
221
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { LspServerConfig } from "./types.js";
|
|
2
|
+
|
|
3
|
+
export const LSP_INSTALL_HINTS: Record<string, string> = {
|
|
4
|
+
typescript: "npm install -g typescript-language-server typescript",
|
|
5
|
+
deno: "Install Deno from https://deno.land",
|
|
6
|
+
vue: "npm install -g @vue/language-server",
|
|
7
|
+
eslint: "npm install -g vscode-langservers-extracted",
|
|
8
|
+
oxlint: "npm install -g oxlint",
|
|
9
|
+
biome: "npm install -g @biomejs/biome",
|
|
10
|
+
gopls: "go install golang.org/x/tools/gopls@latest",
|
|
11
|
+
"ruby-lsp": "gem install ruby-lsp",
|
|
12
|
+
basedpyright: "pip install basedpyright",
|
|
13
|
+
pyright: "pip install pyright",
|
|
14
|
+
ty: "pip install ty",
|
|
15
|
+
ruff: "pip install ruff",
|
|
16
|
+
"elixir-ls": "See https://github.com/elixir-lsp/elixir-ls",
|
|
17
|
+
zls: "See https://github.com/zigtools/zls",
|
|
18
|
+
csharp: "dotnet tool install -g csharp-ls",
|
|
19
|
+
fsharp: "dotnet tool install -g fsautocomplete",
|
|
20
|
+
"sourcekit-lsp": "Included with Xcode or Swift toolchain",
|
|
21
|
+
rust:
|
|
22
|
+
"Install rust-analyzer and ensure it is in PATH. If using rustup: rustup component add rust-analyzer. " +
|
|
23
|
+
"If rust-analyzer exits while loading rust-src: rustup component remove rust-src && rustup component add rust-src.",
|
|
24
|
+
clangd: "See https://clangd.llvm.org/installation",
|
|
25
|
+
svelte: "npm install -g svelte-language-server",
|
|
26
|
+
astro: "npm install -g @astrojs/language-server",
|
|
27
|
+
"bash-ls": "npm install -g bash-language-server",
|
|
28
|
+
jdtls: "See https://github.com/eclipse-jdtls/eclipse.jdt.ls",
|
|
29
|
+
"yaml-ls": "npm install -g yaml-language-server",
|
|
30
|
+
"lua-ls": "See https://github.com/LuaLS/lua-language-server",
|
|
31
|
+
php: "npm install -g intelephense",
|
|
32
|
+
dart: "Included with Dart SDK",
|
|
33
|
+
"terraform-ls": "See https://github.com/hashicorp/terraform-ls",
|
|
34
|
+
terraform: "See https://github.com/hashicorp/terraform-ls",
|
|
35
|
+
prisma: "npm install -g prisma",
|
|
36
|
+
"ocaml-lsp": "opam install ocaml-lsp-server",
|
|
37
|
+
texlab: "See https://github.com/latex-lsp/texlab",
|
|
38
|
+
dockerfile: "npm install -g dockerfile-language-server-nodejs",
|
|
39
|
+
gleam: "See https://gleam.run/getting-started/installing/",
|
|
40
|
+
"clojure-lsp": "See https://clojure-lsp.io/installation/",
|
|
41
|
+
nixd: "nix profile install nixpkgs#nixd",
|
|
42
|
+
tinymist: "See https://github.com/Myriad-Dreamin/tinymist",
|
|
43
|
+
"haskell-language-server": "ghcup install hls",
|
|
44
|
+
bash: "npm install -g bash-language-server",
|
|
45
|
+
"kotlin-ls": "See https://github.com/Kotlin/kotlin-lsp",
|
|
46
|
+
julials: "julia -e 'using Pkg; Pkg.add(\"LanguageServer\")'",
|
|
47
|
+
razor:
|
|
48
|
+
"Razor runs through the Roslyn language server (cohosting). " +
|
|
49
|
+
"Install: dotnet tool install -g roslyn-language-server --prerelease (requires v5.8.0+). See https://github.com/dotnet/razor",
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Repo-local install commands, offered ahead of the global hints in `LSP_INSTALL_HINTS`.
|
|
54
|
+
*
|
|
55
|
+
* A devDependency (or project venv) is resolvable by `resolveServerBinary()` without any
|
|
56
|
+
* global install, and it pins the version the project actually expects. Only servers that
|
|
57
|
+
* are genuinely distributed per-project belong here; toolchain-wide servers (rust-analyzer,
|
|
58
|
+
* gopls, clangd, ...) keep their global hint alone.
|
|
59
|
+
*/
|
|
60
|
+
export const LSP_LOCAL_INSTALL_HINTS: Record<string, string> = {
|
|
61
|
+
typescript: "bun add -d typescript-language-server typescript",
|
|
62
|
+
vue: "bun add -d @vue/language-server",
|
|
63
|
+
eslint: "bun add -d vscode-langservers-extracted",
|
|
64
|
+
oxlint: "bun add -d oxlint",
|
|
65
|
+
biome: "bun add -d @biomejs/biome",
|
|
66
|
+
svelte: "bun add -d svelte-language-server",
|
|
67
|
+
astro: "bun add -d @astrojs/language-server",
|
|
68
|
+
bash: "bun add -d bash-language-server",
|
|
69
|
+
"bash-ls": "bun add -d bash-language-server",
|
|
70
|
+
"yaml-ls": "bun add -d yaml-language-server",
|
|
71
|
+
php: "bun add -d intelephense",
|
|
72
|
+
prisma: "bun add -d prisma",
|
|
73
|
+
dockerfile: "bun add -d dockerfile-language-server-nodejs",
|
|
74
|
+
pyright: "uv add --dev pyright",
|
|
75
|
+
basedpyright: "uv add --dev basedpyright",
|
|
76
|
+
ruff: "uv add --dev ruff",
|
|
77
|
+
ty: "uv add --dev ty",
|
|
78
|
+
"ruby-lsp": "bundle add ruby-lsp --group development",
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const BUILTIN_SERVERS: Record<string, Omit<LspServerConfig, "id">> = {
|
|
82
|
+
typescript: {
|
|
83
|
+
command: ["typescript-language-server", "--stdio"],
|
|
84
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"],
|
|
85
|
+
},
|
|
86
|
+
deno: { command: ["deno", "lsp"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs"] },
|
|
87
|
+
vue: { command: ["vue-language-server", "--stdio"], extensions: [".vue"] },
|
|
88
|
+
eslint: {
|
|
89
|
+
command: ["vscode-eslint-language-server", "--stdio"],
|
|
90
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue"],
|
|
91
|
+
},
|
|
92
|
+
oxlint: {
|
|
93
|
+
command: ["oxlint", "--lsp"],
|
|
94
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue", ".astro", ".svelte"],
|
|
95
|
+
},
|
|
96
|
+
biome: {
|
|
97
|
+
command: ["biome", "lsp-proxy", "--stdio"],
|
|
98
|
+
extensions: [
|
|
99
|
+
".ts",
|
|
100
|
+
".tsx",
|
|
101
|
+
".js",
|
|
102
|
+
".jsx",
|
|
103
|
+
".mjs",
|
|
104
|
+
".cjs",
|
|
105
|
+
".mts",
|
|
106
|
+
".cts",
|
|
107
|
+
".json",
|
|
108
|
+
".jsonc",
|
|
109
|
+
".vue",
|
|
110
|
+
".astro",
|
|
111
|
+
".svelte",
|
|
112
|
+
".css",
|
|
113
|
+
".graphql",
|
|
114
|
+
".gql",
|
|
115
|
+
".html",
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
gopls: { command: ["gopls"], extensions: [".go"] },
|
|
119
|
+
"ruby-lsp": {
|
|
120
|
+
command: ["rubocop", "--lsp"],
|
|
121
|
+
extensions: [".rb", ".rake", ".gemspec", ".ru"],
|
|
122
|
+
},
|
|
123
|
+
basedpyright: {
|
|
124
|
+
command: ["basedpyright-langserver", "--stdio"],
|
|
125
|
+
extensions: [".py", ".pyi"],
|
|
126
|
+
},
|
|
127
|
+
pyright: { command: ["pyright-langserver", "--stdio"], extensions: [".py", ".pyi"] },
|
|
128
|
+
ty: { command: ["ty", "server"], extensions: [".py", ".pyi"] },
|
|
129
|
+
ruff: { command: ["ruff", "server"], extensions: [".py", ".pyi"] },
|
|
130
|
+
"elixir-ls": { command: ["elixir-ls"], extensions: [".ex", ".exs"] },
|
|
131
|
+
zls: { command: ["zls"], extensions: [".zig", ".zon"] },
|
|
132
|
+
csharp: { command: ["csharp-ls"], extensions: [".cs"] },
|
|
133
|
+
fsharp: { command: ["fsautocomplete"], extensions: [".fs", ".fsi", ".fsx", ".fsscript"] },
|
|
134
|
+
"sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".m", ".mm"] },
|
|
135
|
+
rust: { command: ["rust-analyzer"], extensions: [".rs"] },
|
|
136
|
+
clangd: {
|
|
137
|
+
command: ["clangd", "--background-index", "--clang-tidy"],
|
|
138
|
+
extensions: [".c", ".cpp", ".cc", ".cxx", ".c++", ".h", ".hpp", ".hh", ".hxx", ".h++"],
|
|
139
|
+
},
|
|
140
|
+
svelte: { command: ["svelteserver", "--stdio"], extensions: [".svelte"] },
|
|
141
|
+
astro: { command: ["astro-ls", "--stdio"], extensions: [".astro"] },
|
|
142
|
+
bash: {
|
|
143
|
+
command: ["bash-language-server", "start"],
|
|
144
|
+
extensions: [".sh", ".bash", ".zsh", ".ksh"],
|
|
145
|
+
},
|
|
146
|
+
"bash-ls": {
|
|
147
|
+
command: ["bash-language-server", "start"],
|
|
148
|
+
extensions: [".sh", ".bash", ".zsh", ".ksh"],
|
|
149
|
+
},
|
|
150
|
+
jdtls: { command: ["jdtls"], extensions: [".java"] },
|
|
151
|
+
"yaml-ls": { command: ["yaml-language-server", "--stdio"], extensions: [".yaml", ".yml"] },
|
|
152
|
+
"lua-ls": { command: ["lua-language-server"], extensions: [".lua"] },
|
|
153
|
+
php: { command: ["intelephense", "--stdio"], extensions: [".php"] },
|
|
154
|
+
dart: { command: ["dart", "language-server", "--lsp"], extensions: [".dart"] },
|
|
155
|
+
terraform: { command: ["terraform-ls", "serve"], extensions: [".tf", ".tfvars"] },
|
|
156
|
+
"terraform-ls": { command: ["terraform-ls", "serve"], extensions: [".tf", ".tfvars"] },
|
|
157
|
+
prisma: { command: ["prisma", "language-server"], extensions: [".prisma"] },
|
|
158
|
+
"ocaml-lsp": { command: ["ocamllsp"], extensions: [".ml", ".mli"] },
|
|
159
|
+
texlab: { command: ["texlab"], extensions: [".tex", ".bib"] },
|
|
160
|
+
dockerfile: { command: ["docker-langserver", "--stdio"], extensions: [".dockerfile"] },
|
|
161
|
+
gleam: { command: ["gleam", "lsp"], extensions: [".gleam"] },
|
|
162
|
+
"clojure-lsp": {
|
|
163
|
+
command: ["clojure-lsp", "listen"],
|
|
164
|
+
extensions: [".clj", ".cljs", ".cljc", ".edn"],
|
|
165
|
+
},
|
|
166
|
+
nixd: { command: ["nixd"], extensions: [".nix"] },
|
|
167
|
+
tinymist: { command: ["tinymist"], extensions: [".typ", ".typc"] },
|
|
168
|
+
"haskell-language-server": {
|
|
169
|
+
command: ["haskell-language-server-wrapper", "--lsp"],
|
|
170
|
+
extensions: [".hs", ".lhs"],
|
|
171
|
+
},
|
|
172
|
+
"kotlin-ls": { command: ["kotlin-lsp", "--stdio"], extensions: [".kt", ".kts"] },
|
|
173
|
+
julials: {
|
|
174
|
+
command: ["julia", "--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"],
|
|
175
|
+
extensions: [".jl"],
|
|
176
|
+
},
|
|
177
|
+
razor: {
|
|
178
|
+
command: ["roslyn-language-server", "--stdio"],
|
|
179
|
+
extensions: [".razor", ".cshtml"],
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const AUTO_INSTALLABLE_SERVERS: Record<string, string[]> = {
|
|
184
|
+
typescript: ["npm", "install", "-g", "typescript-language-server", "typescript"],
|
|
185
|
+
vue: ["npm", "install", "-g", "@vue/language-server"],
|
|
186
|
+
eslint: ["npm", "install", "-g", "vscode-langservers-extracted"],
|
|
187
|
+
oxlint: ["npm", "install", "-g", "oxlint"],
|
|
188
|
+
biome: ["npm", "install", "-g", "@biomejs/biome"],
|
|
189
|
+
svelte: ["npm", "install", "-g", "svelte-language-server"],
|
|
190
|
+
astro: ["npm", "install", "-g", "@astrojs/language-server"],
|
|
191
|
+
"bash-ls": ["npm", "install", "-g", "bash-language-server"],
|
|
192
|
+
bash: ["npm", "install", "-g", "bash-language-server"],
|
|
193
|
+
"yaml-ls": ["npm", "install", "-g", "yaml-language-server"],
|
|
194
|
+
php: ["npm", "install", "-g", "intelephense"],
|
|
195
|
+
prisma: ["npm", "install", "-g", "prisma"],
|
|
196
|
+
dockerfile: ["npm", "install", "-g", "dockerfile-language-server-nodejs"],
|
|
197
|
+
gopls: ["go", "install", "golang.org/x/tools/gopls@latest"],
|
|
198
|
+
pyright: ["pip", "install", "pyright"],
|
|
199
|
+
basedpyright: ["pip", "install", "basedpyright"],
|
|
200
|
+
ruff: ["pip", "install", "ruff"],
|
|
201
|
+
ty: ["pip", "install", "ty"],
|
|
202
|
+
"ruby-lsp": ["gem", "install", "ruby-lsp"],
|
|
203
|
+
"ocaml-lsp": ["opam", "install", "ocaml-lsp-server"],
|
|
204
|
+
julials: ["julia", "-e", 'using Pkg; Pkg.add("LanguageServer")'],
|
|
205
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { lspRequestContext } from "../request-context.js";
|
|
5
|
+
|
|
6
|
+
export type InstallDecision = "declined" | "allowed";
|
|
7
|
+
|
|
8
|
+
export interface InstallDecisionRecord {
|
|
9
|
+
readonly decision: InstallDecision;
|
|
10
|
+
readonly decidedAt: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type InstallDecisions = Record<string, InstallDecisionRecord>;
|
|
14
|
+
|
|
15
|
+
export function getInstallDecisionsPath(): string {
|
|
16
|
+
return lspRequestContext().installDecisionsPath;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function loadInstallDecisions(): InstallDecisions {
|
|
20
|
+
const path = getInstallDecisionsPath();
|
|
21
|
+
if (!existsSync(path)) return {};
|
|
22
|
+
try {
|
|
23
|
+
const parsed: unknown = JSON.parse(readFileSync(path, "utf8"));
|
|
24
|
+
return isInstallDecisions(parsed) ? parsed : {};
|
|
25
|
+
} catch {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function loadInstallDecision(serverId: string): InstallDecisionRecord | undefined {
|
|
31
|
+
return loadInstallDecisions()[serverId];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function recordInstallDecision(
|
|
35
|
+
serverId: string,
|
|
36
|
+
decision: InstallDecision,
|
|
37
|
+
decidedAt: string = new Date().toISOString(),
|
|
38
|
+
): void {
|
|
39
|
+
const decisions = loadInstallDecisions();
|
|
40
|
+
decisions[serverId] = { decision, decidedAt };
|
|
41
|
+
writeInstallDecisions(decisions);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function isInstallDecision(value: unknown): value is InstallDecision {
|
|
45
|
+
return value === "declined" || value === "allowed";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function writeInstallDecisions(decisions: InstallDecisions): void {
|
|
49
|
+
const path = getInstallDecisionsPath();
|
|
50
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
51
|
+
const tmpPath = `${path}.tmp`;
|
|
52
|
+
writeFileSync(tmpPath, `${JSON.stringify(decisions, null, 2)}\n`, "utf8");
|
|
53
|
+
renameSync(tmpPath, path);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isInstallDecisions(value: unknown): value is InstallDecisions {
|
|
57
|
+
return isRecord(value) && Object.values(value).every(isInstallDecisionRecord);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function isInstallDecisionRecord(value: unknown): value is InstallDecisionRecord {
|
|
61
|
+
if (!isRecord(value)) return false;
|
|
62
|
+
return isInstallDecision(value["decision"]) && typeof value["decidedAt"] === "string";
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
66
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
67
|
+
}
|