oh-my-opencode 5.0.0-beta.2 → 5.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/command/publish.md +44 -16
- package/.agents/skills/publish/SKILL.md +44 -16
- package/.agents/skills/senpi-qa/SKILL.md +80 -0
- package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.mjs +65 -0
- package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.test.mjs +171 -0
- package/.agents/skills/work-with-pr/SKILL.md +37 -23
- package/.opencode/command/publish.md +44 -16
- package/.opencode/skills/work-with-pr/SKILL.md +37 -23
- package/README.ja.md +25 -21
- package/README.ko.md +25 -21
- package/README.md +38 -23
- package/README.ru.md +24 -20
- package/README.zh-cn.md +25 -21
- package/dist/agents/atlas/agent.d.ts +0 -1
- package/dist/agents/sisyphus/grok-4.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +2 -0
- package/dist/agents/sisyphus-agent-config.d.ts +6 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/fallback-lane-policy.d.ts +1 -0
- package/dist/cli/index.js +23057 -20893
- package/dist/cli/install-codex/install-codex-test-fixtures.d.ts +1 -1
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli/runtime-commands.d.ts +1 -1
- package/dist/cli/worktree-sweep/classify.d.ts +16 -0
- package/dist/cli/worktree-sweep/format.d.ts +8 -0
- package/dist/cli/worktree-sweep/git.d.ts +19 -0
- package/dist/cli/worktree-sweep/index.d.ts +7 -0
- package/dist/cli/worktree-sweep/options.d.ts +2 -0
- package/dist/cli/worktree-sweep/parse-worktree-list.d.ts +8 -0
- package/dist/cli/worktree-sweep/sweep.d.ts +2 -0
- package/dist/cli/worktree-sweep/types.d.ts +65 -0
- package/dist/cli/worktree-sweep/worktree-sweep.d.ts +2 -0
- package/dist/cli-node/index.js +23093 -20929
- package/dist/config/schema/commands.d.ts +1 -1
- package/dist/config/schema/hooks.d.ts +1 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +4 -1
- package/dist/config/schema/ulw-execute.d.ts +5 -0
- package/dist/config/validate.d.ts +2 -0
- package/dist/create-hooks.d.ts +3 -1
- package/dist/features/btw-side/btw-command-draft.d.ts +7 -0
- package/dist/features/btw-side/context-injector.d.ts +15 -0
- package/dist/features/btw-side/index.d.ts +8 -0
- package/dist/features/btw-side/metadata.d.ts +15 -0
- package/dist/features/btw-side/parent-context-budget.d.ts +9 -0
- package/dist/features/btw-side/server-session-registry.d.ts +8 -0
- package/dist/features/btw-side/tui-adoption-cache.d.ts +13 -0
- package/dist/features/btw-side/tui-adoption-guard.d.ts +5 -0
- package/dist/features/btw-side/tui-controller-types.d.ts +68 -0
- package/dist/features/btw-side/tui-controller.d.ts +19 -0
- package/dist/features/btw-side/tui-escape-return.d.ts +12 -0
- package/dist/features/btw-side/tui-keymap.d.ts +17 -0
- package/dist/features/btw-side/tui-parent-validator.d.ts +6 -0
- package/dist/features/btw-side/tui-picker-options.d.ts +20 -0
- package/dist/features/btw-side/tui-picker.d.ts +9 -0
- package/dist/features/btw-side/tui-prompt-queue.d.ts +8 -0
- package/dist/features/btw-side/tui-session-bridge.d.ts +11 -0
- package/dist/features/btw-side/tui-session-catalog.d.ts +35 -0
- package/dist/features/btw-side/tui-side-removal.d.ts +11 -0
- package/dist/features/btw-side/tui-side-start.d.ts +9 -0
- package/dist/features/btw-side/tui-wiring.d.ts +8 -0
- package/dist/features/builtin-commands/templates/ulw-execute.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/opengateway-provider/index.d.ts +13 -0
- package/dist/hooks/atlas/atlas-hook.d.ts +1 -0
- package/dist/hooks/atlas/atlas-lifecycle-store.d.ts +50 -0
- package/dist/hooks/atlas/event-handler.d.ts +1 -0
- package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
- package/dist/hooks/atlas/tool-execute-before.d.ts +3 -0
- package/dist/hooks/atlas/types.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/prometheus-md-only/agent-resolution.d.ts +2 -2
- package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +2 -0
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +1 -0
- package/dist/hooks/runtime-fallback/runtime-model-settings.d.ts +6 -0
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +1 -1
- package/dist/hooks/runtime-fallback/types.d.ts +3 -1
- package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
- package/dist/hooks/{start-work → ulw-execute}/context-info-builder.d.ts +1 -1
- package/dist/hooks/{start-work → ulw-execute}/index.d.ts +1 -1
- package/dist/hooks/ulw-execute/ulw-execute-hook.d.ts +23 -0
- package/dist/index.js +11724 -6355
- package/dist/oh-my-opencode.schema.json +15 -2
- package/dist/plugin/chat-message/types.d.ts +3 -3
- package/dist/plugin/chat-message/ulw-execute-message.d.ts +5 -0
- package/dist/plugin/event-session-lifecycle.d.ts +1 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
- package/dist/plugin/messages-transform.d.ts +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/shared/runtime-fallback-retry-marker.d.ts +16 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/skills/ast-grep/AGENTS.md +51 -0
- package/dist/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/dist/skills/frontend/SKILL.md +11 -7
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/print-paged-media.md +76 -0
- package/dist/skills/frontend/references/design/stylegallery.md +80 -0
- package/dist/skills/frontend/references/designpowers/README.md +1 -1
- package/dist/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
- package/dist/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
- package/dist/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
- package/dist/skills/frontend/references/designpowers/orchestration.md +1 -1
- package/dist/skills/frontend/references/designpowers/routing.md +5 -5
- package/dist/skills/review-work/SKILL.md +3 -3
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/dist/skills/ultimate-browsing/SKILL.md +2 -0
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/dist/skills/{start-work → ulw-execute}/SKILL.md +9 -8
- package/dist/skills/ulw-plan/SKILL.md +6 -6
- package/dist/skills/ulw-plan/references/full-workflow.md +31 -7
- package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
- package/dist/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/dist/skills/ulw-research/SKILL.md +1 -1
- package/dist/skills/visual-qa/AGENTS.md +58 -0
- package/dist/skills/visual-qa/SKILL.md +3 -2
- package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
- package/dist/tools/delegate-task/tool-description.d.ts +3 -1
- package/dist/tui.js +8824 -8906
- package/package.json +38 -35
- package/packages/git-bash-mcp/dist/cli.js +5 -1
- package/packages/git-bash-mcp/package.json +1 -1
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
- package/packages/lsp-core/src/lsp/client-wrapper-outside-cwd.test.ts +78 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +66 -13
- package/packages/lsp-core/src/lsp/client-wrapper.ts +70 -18
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/lsp/workspace-markers.ts +1 -0
- package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
- package/packages/lsp-core/src/tools/navigation.ts +4 -2
- package/packages/lsp-core/src/tools/rename.ts +4 -2
- package/packages/lsp-core/src/tools/symbols.ts +1 -1
- package/packages/lsp-daemon/dist/cli.js +246 -185
- package/packages/lsp-daemon/dist/client.js +222 -164
- package/packages/lsp-daemon/dist/ensure-daemon.js +1 -0
- package/packages/lsp-daemon/dist/index.js +236 -177
- package/packages/lsp-daemon/dist/version-reap.js +1 -1
- package/packages/lsp-tools-mcp/dist/cli.js +198 -136
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +62 -92
- package/packages/lsp-tools-mcp/dist/mcp.js +200 -138
- package/packages/lsp-tools-mcp/dist/request-context.js +11 -12
- package/packages/lsp-tools-mcp/dist/tools.js +204 -146
- package/packages/omo-codex/THIRD-PARTY-NOTICES.md +4 -4
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +4 -4
- package/packages/omo-codex/plugin/AGENTS.md +47 -0
- package/packages/omo-codex/plugin/README.md +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +32 -31
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +224 -81
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +224 -82
- package/packages/omo-codex/plugin/components/codegraph/package.json +4 -4
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-hook-runtime.ts +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/AGENTS.md +9 -0
- package/packages/omo-codex/plugin/components/comment-checker/biome.json +2 -2
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +2 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +5 -5
- package/packages/omo-codex/plugin/components/comment-checker/src/apply-patch.ts +2 -8
- package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +1 -2
- package/packages/omo-codex/plugin/components/comment-checker/src/request-extractor.ts +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/src/runner.ts +1 -0
- package/packages/omo-codex/plugin/components/git-bash/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +3 -4
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +2 -2
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +5 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +4 -21
- package/packages/omo-codex/plugin/components/lsp/AGENTS.md +30 -15
- package/packages/omo-codex/plugin/components/lsp/biome.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +4 -4
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +217 -171
- package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +1 -1
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +5 -5
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +1 -5
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +6 -7
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +1 -2
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +11 -1
- package/packages/omo-codex/plugin/components/rules/AGENTS.md +12 -0
- package/packages/omo-codex/plugin/components/rules/biome.json +2 -2
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +57 -42
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +7 -7
- package/packages/omo-codex/plugin/components/rules/src/config.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +6 -2
- package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +1 -4
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +4 -9
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +17 -25
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
- package/packages/omo-codex/plugin/components/rules/test/dynamic-target-fingerprints.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +7 -4
- package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +39 -72
- package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/package-smoke.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/parser.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/rules-engine-consumption.test.ts +3 -6
- package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/sources.test.ts +2 -5
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +2 -17
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +5 -5
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
- package/packages/omo-codex/plugin/components/telemetry/AGENTS.md +8 -0
- package/packages/omo-codex/plugin/components/telemetry/biome.json +2 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +2433 -422
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +2437 -426
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +5 -5
- package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +1 -4
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +4 -14
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +1 -1
- package/packages/omo-codex/plugin/components/telemetry/test/diagnostics.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -0
- package/packages/omo-codex/plugin/components/ultrawork/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +13 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +5 -5
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +13 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +6 -6
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +31 -7
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +9 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
- package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/AGENTS.md +5 -4
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/NOTICE +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/README.md +5 -5
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/biome.json +2 -2
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/directive.md +6 -6
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/dist/cli.js +12 -12
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +28 -0
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/package.json +12 -12
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/boulder-reader.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/codex-hook.ts +3 -3
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/directive.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/index.ts +1 -1
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/boulder-reader.test.ts +3 -3
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/cli.test.ts +1 -4
- package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/codex-hook.test.ts +8 -22
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +13 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +2 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/paths.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +3 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +25 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-snapshot.test.ts +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +5 -37
- package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +8 -5
- package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
- package/packages/omo-codex/plugin/components/ulw-loop/vitest.config.ts +1 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +17 -0
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +17 -0
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +681 -395
- package/packages/omo-codex/plugin/package.json +2 -2
- package/packages/omo-codex/plugin/scripts/AGENTS.md +40 -0
- package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +1 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +11 -11
- package/packages/omo-codex/plugin/shared/package.json +3 -4
- package/packages/omo-codex/plugin/skills/ast-grep/AGENTS.md +51 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +11 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/print-paged-media.md +76 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/orchestration.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/designpowers/routing.md +5 -5
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +2 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +13 -1
- package/packages/omo-codex/plugin/skills/{start-work → ulw-execute}/SKILL.md +12 -11
- package/packages/omo-codex/plugin/skills/ulw-execute/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +6 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +31 -7
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +58 -0
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +3 -2
- package/packages/omo-codex/plugin/test/AGENTS.md +47 -0
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +8 -28
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
- package/packages/omo-codex/plugin/test/component-bin-names.test.mjs +2 -2
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +2 -2
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +4 -4
- package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +12 -12
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
- package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
- package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
- package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
- package/packages/omo-codex/scripts/AGENTS.md +36 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2601 -528
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/shared-skills/skills/ast-grep/AGENTS.md +51 -0
- package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +11 -7
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/print-paged-media.md +76 -0
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/shared-skills/skills/frontend/references/designpowers/README.md +1 -1
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-a-direction.md +1 -1
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +11 -11
- package/packages/shared-skills/skills/frontend/references/designpowers/lane-d-memory.md +3 -3
- package/packages/shared-skills/skills/frontend/references/designpowers/orchestration.md +1 -1
- package/packages/shared-skills/skills/frontend/references/designpowers/routing.md +5 -5
- package/packages/shared-skills/skills/review-work/SKILL.md +3 -3
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +2 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/shared-skills/skills/{start-work → ulw-execute}/SKILL.md +9 -8
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +6 -6
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +31 -7
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +5 -5
- package/packages/shared-skills/skills/ulw-research/SKILL.md +1 -1
- package/packages/shared-skills/skills/visual-qa/AGENTS.md +58 -0
- package/packages/shared-skills/skills/visual-qa/SKILL.md +3 -2
- package/script/qa/web-terminal-visual-qa.mjs +2 -0
- package/script/qa/xterm-live-terminal.mjs +18 -2
- package/dist/config/schema/start-work.d.ts +0 -5
- package/dist/features/builtin-commands/templates/start-work.d.ts +0 -1
- package/dist/hooks/start-work/start-work-hook.d.ts +0 -23
- package/dist/plugin/chat-message/start-work-message.d.ts +0 -5
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +0 -28
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +0 -17
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +0 -17
- package/packages/omo-codex/plugin/skills/start-work/agents/openai.yaml +0 -2
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
- package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
- /package/dist/hooks/{start-work → ulw-execute}/context-info-formatters.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/explicit-plan-context.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/notepad-scaffold.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/parse-user-request.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/plan-discovery-context.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/plan-selection.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/session-plan-affinity.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/work-initializer.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/worktree-block.d.ts +0 -0
- /package/dist/hooks/{start-work → ulw-execute}/worktree-detector.d.ts +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/.gitattributes +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/CHANGELOG.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/LICENSE +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/plan-checklist.ts +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/src/types.ts +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-completed.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-mixed-platforms.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/boulder-single-codex-work.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-all-done.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-scaffold.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-with-nested-checkboxes.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/test/fixtures/plan-with-unchecked.md +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/tsconfig.build.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/tsconfig.json +0 -0
- /package/packages/omo-codex/plugin/components/{start-work-continuation → ulw-execute-continuation}/vitest.config.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/daemon-client.ts
|
|
2
2
|
import { connect } from "node:net";
|
|
3
3
|
import { homedir as homedir3 } from "node:os";
|
|
4
|
-
import { join as
|
|
4
|
+
import { join as join8 } from "node:path";
|
|
5
5
|
|
|
6
6
|
// ../lsp-core/src/request-context.ts
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -10,18 +10,17 @@ import { homedir } from "node:os";
|
|
|
10
10
|
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
11
11
|
|
|
12
12
|
class LspRequestContextParseError extends Error {
|
|
13
|
-
code;
|
|
14
|
-
name = "LspRequestContextParseError";
|
|
15
13
|
constructor(code, message) {
|
|
16
14
|
super(message);
|
|
17
15
|
this.code = code;
|
|
16
|
+
this.name = "LspRequestContextParseError";
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
class LspRequestContextUnavailableError extends Error {
|
|
22
|
-
name = "LspRequestContextUnavailableError";
|
|
23
21
|
constructor() {
|
|
24
22
|
super("LSP request context is required. Standalone MCP startup must install one with runWithRequestContext(createStandaloneMcpRequestContext()).");
|
|
23
|
+
this.name = "LspRequestContextUnavailableError";
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
var storage = new AsyncLocalStorage;
|
|
@@ -179,7 +178,6 @@ function isPlainRecord(value) {
|
|
|
179
178
|
|
|
180
179
|
// src/daemon-request-error.ts
|
|
181
180
|
class DaemonRequestError extends Error {
|
|
182
|
-
requestWritten;
|
|
183
181
|
constructor(message, requestWritten) {
|
|
184
182
|
super(message);
|
|
185
183
|
this.name = "DaemonRequestError";
|
|
@@ -202,7 +200,6 @@ class DaemonRequestCancelledError extends DaemonRequestError {
|
|
|
202
200
|
}
|
|
203
201
|
|
|
204
202
|
class DaemonRequestTimedOutError extends DaemonRequestError {
|
|
205
|
-
timeoutMs;
|
|
206
203
|
constructor(requestWritten, timeoutMs) {
|
|
207
204
|
super("daemon request timed out", requestWritten);
|
|
208
205
|
this.name = "DaemonRequestTimedOutError";
|
|
@@ -281,14 +278,12 @@ var PROTOCOL_ERROR_CODE = -32002;
|
|
|
281
278
|
var AUTH_TOKEN_BYTES = 32;
|
|
282
279
|
|
|
283
280
|
class UnsafePrivateDirectoryError extends Error {
|
|
284
|
-
path;
|
|
285
|
-
reason;
|
|
286
|
-
name = "UnsafePrivateDirectoryError";
|
|
287
|
-
code = "unsafe_private_directory";
|
|
288
281
|
constructor(path, reason) {
|
|
289
282
|
super(`unsafe private directory ${path}: ${reason}`);
|
|
290
283
|
this.path = path;
|
|
291
284
|
this.reason = reason;
|
|
285
|
+
this.name = "UnsafePrivateDirectoryError";
|
|
286
|
+
this.code = "unsafe_private_directory";
|
|
292
287
|
}
|
|
293
288
|
}
|
|
294
289
|
function authEnvelope(token) {
|
|
@@ -472,20 +467,18 @@ var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
|
|
|
472
467
|
var DAEMON_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
473
468
|
|
|
474
469
|
class InvalidRuntimeOverrideError extends Error {
|
|
475
|
-
code = "invalid_runtime_override";
|
|
476
|
-
reason;
|
|
477
470
|
constructor(reason, message) {
|
|
478
471
|
super(message);
|
|
472
|
+
this.code = "invalid_runtime_override";
|
|
479
473
|
this.name = "InvalidRuntimeOverrideError";
|
|
480
474
|
this.reason = reason;
|
|
481
475
|
}
|
|
482
476
|
}
|
|
483
477
|
|
|
484
478
|
class InvalidDaemonVersionError extends Error {
|
|
485
|
-
code = "invalid_daemon_version";
|
|
486
|
-
version;
|
|
487
479
|
constructor(version) {
|
|
488
480
|
super("LSP daemon version must match [A-Za-z0-9][A-Za-z0-9._+-]{0,127}");
|
|
481
|
+
this.code = "invalid_daemon_version";
|
|
489
482
|
this.name = "InvalidDaemonVersionError";
|
|
490
483
|
this.version = version;
|
|
491
484
|
}
|
|
@@ -531,10 +524,9 @@ var requireFromHere = createRequire(import.meta.url);
|
|
|
531
524
|
var MAX_SOCKET_PATH_LENGTH = 100;
|
|
532
525
|
|
|
533
526
|
class InvalidDaemonDirectoryError extends Error {
|
|
534
|
-
code = "invalid_daemon_directory";
|
|
535
|
-
directory;
|
|
536
527
|
constructor(directory) {
|
|
537
528
|
super(`${OMO_LSP_DAEMON_DIR} must be an absolute path`);
|
|
529
|
+
this.code = "invalid_daemon_directory";
|
|
538
530
|
this.name = "InvalidDaemonDirectoryError";
|
|
539
531
|
this.directory = directory;
|
|
540
532
|
}
|
|
@@ -729,7 +721,8 @@ function spawnDaemonProcess(paths) {
|
|
|
729
721
|
try {
|
|
730
722
|
const child = spawn(resolveDaemonNodeExecutable(), [paths.cliPath, "daemon"], {
|
|
731
723
|
detached: true,
|
|
732
|
-
stdio: ["ignore", logFd, logFd]
|
|
724
|
+
stdio: ["ignore", logFd, logFd],
|
|
725
|
+
windowsHide: true
|
|
733
726
|
});
|
|
734
727
|
child.once("spawn", () => closeSync2(logFd));
|
|
735
728
|
child.once("error", (error) => {
|
|
@@ -1106,7 +1099,11 @@ function createParentWatchdog(config, onDeadParent) {
|
|
|
1106
1099
|
const probeAlive = config.probeAlive ?? isProcessAlive;
|
|
1107
1100
|
let fired = false;
|
|
1108
1101
|
const timer = setInterval(() => {
|
|
1109
|
-
if (fired
|
|
1102
|
+
if (fired)
|
|
1103
|
+
return;
|
|
1104
|
+
const alive = probeAlive(parentPid);
|
|
1105
|
+
config.onPoll?.(alive);
|
|
1106
|
+
if (alive)
|
|
1110
1107
|
return;
|
|
1111
1108
|
fired = true;
|
|
1112
1109
|
onDeadParent(parentPid, pollIntervalMs);
|
|
@@ -1141,8 +1138,8 @@ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
|
|
|
1141
1138
|
};
|
|
1142
1139
|
}
|
|
1143
1140
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
1144
|
-
import { existsSync as
|
|
1145
|
-
import { dirname as
|
|
1141
|
+
import { existsSync as existsSync11, realpathSync as realpathSync5, statSync as statSync4 } from "node:fs";
|
|
1142
|
+
import { basename as basename3, dirname as dirname9, join as join5, resolve as resolve7 } from "node:path";
|
|
1146
1143
|
|
|
1147
1144
|
// ../lsp-core/src/lsp/effective-extension.ts
|
|
1148
1145
|
import { basename as basename2, extname } from "node:path";
|
|
@@ -1156,22 +1153,15 @@ function effectiveExtension(filePath) {
|
|
|
1156
1153
|
|
|
1157
1154
|
// ../lsp-core/src/lsp/errors.ts
|
|
1158
1155
|
class LspConnectionClosedError extends Error {
|
|
1159
|
-
serverId;
|
|
1160
|
-
root;
|
|
1161
|
-
name = "LspConnectionClosedError";
|
|
1162
1156
|
constructor(serverId, root, message) {
|
|
1163
1157
|
super(message ?? `LSP connection closed for ${serverId} at ${root}`);
|
|
1164
1158
|
this.serverId = serverId;
|
|
1165
1159
|
this.root = root;
|
|
1160
|
+
this.name = "LspConnectionClosedError";
|
|
1166
1161
|
}
|
|
1167
1162
|
}
|
|
1168
1163
|
|
|
1169
1164
|
class LspProcessExitedError extends Error {
|
|
1170
|
-
serverId;
|
|
1171
|
-
root;
|
|
1172
|
-
exitCode;
|
|
1173
|
-
stderrTail;
|
|
1174
|
-
name = "LspProcessExitedError";
|
|
1175
1165
|
constructor(serverId, root, exitCode, stderrTail) {
|
|
1176
1166
|
const stderrSuffix = stderrTail ? `
|
|
1177
1167
|
stderr tail: ${stderrTail}` : "";
|
|
@@ -1180,46 +1170,49 @@ stderr tail: ${stderrTail}` : "";
|
|
|
1180
1170
|
this.root = root;
|
|
1181
1171
|
this.exitCode = exitCode;
|
|
1182
1172
|
this.stderrTail = stderrTail;
|
|
1173
|
+
this.name = "LspProcessExitedError";
|
|
1183
1174
|
}
|
|
1184
1175
|
}
|
|
1185
1176
|
|
|
1186
1177
|
class LspRequestTimeoutError extends Error {
|
|
1187
|
-
method;
|
|
1188
|
-
stderrTail;
|
|
1189
|
-
name = "LspRequestTimeoutError";
|
|
1190
1178
|
constructor(method, stderrTail) {
|
|
1191
1179
|
const stderrSuffix = stderrTail ? `
|
|
1192
1180
|
recent stderr: ${stderrTail}` : "";
|
|
1193
1181
|
super(`LSP request timeout (method: ${method})${stderrSuffix}`);
|
|
1194
1182
|
this.method = method;
|
|
1195
1183
|
this.stderrTail = stderrTail;
|
|
1184
|
+
this.name = "LspRequestTimeoutError";
|
|
1196
1185
|
}
|
|
1197
1186
|
}
|
|
1198
1187
|
|
|
1199
1188
|
class LspInvalidPathError extends Error {
|
|
1200
|
-
|
|
1189
|
+
constructor() {
|
|
1190
|
+
super(...arguments);
|
|
1191
|
+
this.name = "LspInvalidPathError";
|
|
1192
|
+
}
|
|
1201
1193
|
}
|
|
1202
1194
|
|
|
1203
1195
|
class LspServerLookupError extends Error {
|
|
1204
|
-
lookup;
|
|
1205
|
-
name = "LspServerLookupError";
|
|
1206
1196
|
constructor(message, lookup) {
|
|
1207
1197
|
super(message);
|
|
1208
1198
|
this.lookup = lookup;
|
|
1199
|
+
this.name = "LspServerLookupError";
|
|
1209
1200
|
}
|
|
1210
1201
|
}
|
|
1211
1202
|
|
|
1212
1203
|
class LspServerInitializingError extends Error {
|
|
1213
|
-
originalError;
|
|
1214
|
-
name = "LspServerInitializingError";
|
|
1215
1204
|
constructor(originalError) {
|
|
1216
1205
|
super(`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`);
|
|
1217
1206
|
this.originalError = originalError;
|
|
1207
|
+
this.name = "LspServerInitializingError";
|
|
1218
1208
|
}
|
|
1219
1209
|
}
|
|
1220
1210
|
|
|
1221
1211
|
class LspProcessSpawnError extends Error {
|
|
1222
|
-
|
|
1212
|
+
constructor() {
|
|
1213
|
+
super(...arguments);
|
|
1214
|
+
this.name = "LspProcessSpawnError";
|
|
1215
|
+
}
|
|
1223
1216
|
}
|
|
1224
1217
|
function isLspDeadConnectionError(err) {
|
|
1225
1218
|
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
@@ -1264,20 +1257,31 @@ var METHOD_NOT_FOUND = -32601;
|
|
|
1264
1257
|
var INTERNAL_ERROR = -32603;
|
|
1265
1258
|
|
|
1266
1259
|
class JsonRpcConnection {
|
|
1267
|
-
reader;
|
|
1268
|
-
writer;
|
|
1269
|
-
pendingRequests = new Map;
|
|
1270
|
-
notificationHandlers = new Map;
|
|
1271
|
-
requestHandlers = new Map;
|
|
1272
|
-
closeHandlers = [];
|
|
1273
|
-
errorHandlers = [];
|
|
1274
|
-
inputBuffer = Buffer.alloc(0);
|
|
1275
|
-
nextRequestId = 1;
|
|
1276
|
-
listening = false;
|
|
1277
|
-
disposed = false;
|
|
1278
1260
|
constructor(reader, writer) {
|
|
1279
1261
|
this.reader = reader;
|
|
1280
1262
|
this.writer = writer;
|
|
1263
|
+
this.pendingRequests = new Map;
|
|
1264
|
+
this.notificationHandlers = new Map;
|
|
1265
|
+
this.requestHandlers = new Map;
|
|
1266
|
+
this.closeHandlers = [];
|
|
1267
|
+
this.errorHandlers = [];
|
|
1268
|
+
this.inputBuffer = Buffer.alloc(0);
|
|
1269
|
+
this.nextRequestId = 1;
|
|
1270
|
+
this.listening = false;
|
|
1271
|
+
this.disposed = false;
|
|
1272
|
+
this.handleData = (chunk) => {
|
|
1273
|
+
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
1274
|
+
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
1275
|
+
this.drainInputBuffer();
|
|
1276
|
+
};
|
|
1277
|
+
this.handleClose = () => {
|
|
1278
|
+
for (const handler of this.closeHandlers) {
|
|
1279
|
+
handler();
|
|
1280
|
+
}
|
|
1281
|
+
};
|
|
1282
|
+
this.handleStreamError = (error) => {
|
|
1283
|
+
this.emitError(error);
|
|
1284
|
+
};
|
|
1281
1285
|
}
|
|
1282
1286
|
listen() {
|
|
1283
1287
|
if (this.listening)
|
|
@@ -1398,19 +1402,6 @@ class JsonRpcConnection {
|
|
|
1398
1402
|
this.notificationHandlers.clear();
|
|
1399
1403
|
this.requestHandlers.clear();
|
|
1400
1404
|
}
|
|
1401
|
-
handleData = (chunk) => {
|
|
1402
|
-
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
1403
|
-
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
1404
|
-
this.drainInputBuffer();
|
|
1405
|
-
};
|
|
1406
|
-
handleClose = () => {
|
|
1407
|
-
for (const handler of this.closeHandlers) {
|
|
1408
|
-
handler();
|
|
1409
|
-
}
|
|
1410
|
-
};
|
|
1411
|
-
handleStreamError = (error) => {
|
|
1412
|
-
this.emitError(error);
|
|
1413
|
-
};
|
|
1414
1405
|
drainInputBuffer() {
|
|
1415
1406
|
while (true) {
|
|
1416
1407
|
const headerEnd = this.inputBuffer.indexOf(HEADER_SEPARATOR2);
|
|
@@ -1758,31 +1749,25 @@ function isPosition(value) {
|
|
|
1758
1749
|
|
|
1759
1750
|
// ../lsp-core/src/lsp/transport.ts
|
|
1760
1751
|
class LspClientNotStartedError extends Error {
|
|
1761
|
-
serverId;
|
|
1762
|
-
root;
|
|
1763
|
-
name = "LspClientNotStartedError";
|
|
1764
1752
|
constructor(serverId, root) {
|
|
1765
1753
|
super("LSP client not started");
|
|
1766
1754
|
this.serverId = serverId;
|
|
1767
1755
|
this.root = root;
|
|
1756
|
+
this.name = "LspClientNotStartedError";
|
|
1768
1757
|
}
|
|
1769
1758
|
}
|
|
1770
1759
|
|
|
1771
1760
|
class LspClientTransport {
|
|
1772
|
-
root;
|
|
1773
|
-
server;
|
|
1774
|
-
proc = null;
|
|
1775
|
-
connection = null;
|
|
1776
|
-
stderrBuffer = [];
|
|
1777
|
-
processExited = false;
|
|
1778
|
-
diagnosticsStore = new Map;
|
|
1779
|
-
requestTimeoutMs;
|
|
1780
|
-
initializeTimeoutMs;
|
|
1781
|
-
workspaceApplyEditHandler = null;
|
|
1782
|
-
diagnosticPullSupported = false;
|
|
1783
1761
|
constructor(root, server2, timeouts = {}) {
|
|
1784
1762
|
this.root = root;
|
|
1785
1763
|
this.server = server2;
|
|
1764
|
+
this.proc = null;
|
|
1765
|
+
this.connection = null;
|
|
1766
|
+
this.stderrBuffer = [];
|
|
1767
|
+
this.processExited = false;
|
|
1768
|
+
this.diagnosticsStore = new Map;
|
|
1769
|
+
this.workspaceApplyEditHandler = null;
|
|
1770
|
+
this.diagnosticPullSupported = false;
|
|
1786
1771
|
this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
1787
1772
|
this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
1788
1773
|
}
|
|
@@ -2279,16 +2264,12 @@ function movedPath(candidate, oldPath, newPath) {
|
|
|
2279
2264
|
}
|
|
2280
2265
|
|
|
2281
2266
|
class WorkspaceDocumentState {
|
|
2282
|
-
sendNotification;
|
|
2283
|
-
clearDiagnostics;
|
|
2284
|
-
openDocuments = new Map;
|
|
2285
|
-
openByUri = new Map;
|
|
2286
|
-
openPromises = new Map;
|
|
2287
|
-
now;
|
|
2288
|
-
versionlessPublishQuiescenceMs;
|
|
2289
2267
|
constructor(sendNotification, clearDiagnostics, options = {}) {
|
|
2290
2268
|
this.sendNotification = sendNotification;
|
|
2291
2269
|
this.clearDiagnostics = clearDiagnostics;
|
|
2270
|
+
this.openDocuments = new Map;
|
|
2271
|
+
this.openByUri = new Map;
|
|
2272
|
+
this.openPromises = new Map;
|
|
2292
2273
|
this.now = options.now ?? (() => Date.now());
|
|
2293
2274
|
this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
|
|
2294
2275
|
}
|
|
@@ -2552,13 +2533,11 @@ import { dirname as dirname4, isAbsolute as isAbsolute4, relative as relative3,
|
|
|
2552
2533
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2553
2534
|
|
|
2554
2535
|
class WorkspaceEditPathError extends Error {
|
|
2555
|
-
path;
|
|
2556
|
-
detail;
|
|
2557
|
-
name = "WorkspaceEditPathError";
|
|
2558
2536
|
constructor(path2, detail) {
|
|
2559
2537
|
super(`${detail}: ${path2}`);
|
|
2560
2538
|
this.path = path2;
|
|
2561
2539
|
this.detail = detail;
|
|
2540
|
+
this.name = "WorkspaceEditPathError";
|
|
2562
2541
|
}
|
|
2563
2542
|
}
|
|
2564
2543
|
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
@@ -2850,13 +2829,11 @@ function canonicalFingerprint(operations) {
|
|
|
2850
2829
|
|
|
2851
2830
|
// ../lsp-core/src/lsp/workspace-edit-types.ts
|
|
2852
2831
|
class WorkspaceEditValidationError extends Error {
|
|
2853
|
-
changeIndex;
|
|
2854
|
-
detail;
|
|
2855
|
-
name = "WorkspaceEditValidationError";
|
|
2856
2832
|
constructor(changeIndex, detail) {
|
|
2857
2833
|
super(`change ${changeIndex}: ${detail}`);
|
|
2858
2834
|
this.changeIndex = changeIndex;
|
|
2859
2835
|
this.detail = detail;
|
|
2836
|
+
this.name = "WorkspaceEditValidationError";
|
|
2860
2837
|
}
|
|
2861
2838
|
}
|
|
2862
2839
|
|
|
@@ -3354,10 +3331,9 @@ function simulateDelete(operation, virtual) {
|
|
|
3354
3331
|
import { existsSync as existsSync6, lstatSync as lstatSync4, readdirSync as readdirSync2 } from "node:fs";
|
|
3355
3332
|
import { dirname as dirname6, resolve as resolve5 } from "node:path";
|
|
3356
3333
|
class WorkspaceSnapshotBuilder {
|
|
3357
|
-
workspaceRoot;
|
|
3358
|
-
snapshots = new Map;
|
|
3359
3334
|
constructor(workspaceRoot) {
|
|
3360
3335
|
this.workspaceRoot = workspaceRoot;
|
|
3336
|
+
this.snapshots = new Map;
|
|
3361
3337
|
}
|
|
3362
3338
|
build(operations) {
|
|
3363
3339
|
this.add(this.workspaceRoot, false);
|
|
@@ -3401,8 +3377,10 @@ function snapshotOperations(operations, workspaceRoot) {
|
|
|
3401
3377
|
|
|
3402
3378
|
// ../lsp-core/src/lsp/workspace-edit-plan.ts
|
|
3403
3379
|
class PlanPathIndex {
|
|
3404
|
-
|
|
3405
|
-
|
|
3380
|
+
constructor() {
|
|
3381
|
+
this.firstChangeByPath = new Map;
|
|
3382
|
+
this.reportedPathByCanonical = new Map;
|
|
3383
|
+
}
|
|
3406
3384
|
build(operations) {
|
|
3407
3385
|
for (const operation of operations) {
|
|
3408
3386
|
switch (operation.kind) {
|
|
@@ -3491,14 +3469,11 @@ function isRecord4(value) {
|
|
|
3491
3469
|
}
|
|
3492
3470
|
|
|
3493
3471
|
class WorkspaceMutationController {
|
|
3494
|
-
workspaceRoot;
|
|
3495
|
-
documents;
|
|
3496
|
-
activeLease = null;
|
|
3497
|
-
nextLeaseId = 1;
|
|
3498
|
-
io;
|
|
3499
3472
|
constructor(workspaceRoot, documents) {
|
|
3500
3473
|
this.workspaceRoot = workspaceRoot;
|
|
3501
3474
|
this.documents = documents;
|
|
3475
|
+
this.activeLease = null;
|
|
3476
|
+
this.nextLeaseId = 1;
|
|
3502
3477
|
}
|
|
3503
3478
|
setIo(io) {
|
|
3504
3479
|
this.io = io;
|
|
@@ -3611,12 +3586,9 @@ var DIAGNOSTICS_FRESHNESS_TIMEOUT_MS = 3000;
|
|
|
3611
3586
|
var VERSIONLESS_PUBLISH_QUIESCENCE_MS = 250;
|
|
3612
3587
|
|
|
3613
3588
|
class LspClient extends LspClientConnection {
|
|
3614
|
-
diagnosticPullErrors = [];
|
|
3615
|
-
documents;
|
|
3616
|
-
workspaceMutations;
|
|
3617
|
-
diagnosticsFreshnessTimeoutMs;
|
|
3618
3589
|
constructor(root, server2, options = {}) {
|
|
3619
3590
|
super(root, server2, options);
|
|
3591
|
+
this.diagnosticPullErrors = [];
|
|
3620
3592
|
this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
|
|
3621
3593
|
this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
|
|
3622
3594
|
versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
|
|
@@ -3916,16 +3888,11 @@ function awaitWithSignal2(promise, signal) {
|
|
|
3916
3888
|
}
|
|
3917
3889
|
|
|
3918
3890
|
class LspManager {
|
|
3919
|
-
clients = new Map;
|
|
3920
|
-
reaperHandle = null;
|
|
3921
|
-
signalDisposer = null;
|
|
3922
|
-
disposed = false;
|
|
3923
|
-
idleTimeoutMs;
|
|
3924
|
-
initTimeoutMs;
|
|
3925
|
-
reaperIntervalMs;
|
|
3926
|
-
clientFactory;
|
|
3927
|
-
now;
|
|
3928
3891
|
constructor(options = {}) {
|
|
3892
|
+
this.clients = new Map;
|
|
3893
|
+
this.reaperHandle = null;
|
|
3894
|
+
this.signalDisposer = null;
|
|
3895
|
+
this.disposed = false;
|
|
3929
3896
|
this.idleTimeoutMs = options.idleTimeoutMs ?? IDLE_TIMEOUT_MS;
|
|
3930
3897
|
this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
3931
3898
|
this.reaperIntervalMs = options.reaperIntervalMs ?? REAPER_INTERVAL_MS;
|
|
@@ -4157,15 +4124,52 @@ async function disposeDefaultLspManager() {
|
|
|
4157
4124
|
}
|
|
4158
4125
|
}
|
|
4159
4126
|
|
|
4127
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
4128
|
+
import { existsSync as existsSync7, realpathSync as realpathSync4 } from "node:fs";
|
|
4129
|
+
import { dirname as dirname7, join as join3 } from "node:path";
|
|
4130
|
+
|
|
4131
|
+
// ../lsp-core/src/lsp/workspace-markers.ts
|
|
4132
|
+
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4133
|
+
|
|
4134
|
+
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
4135
|
+
function findWorkspaceRootOutsideContext(directory) {
|
|
4136
|
+
const marked = nearestMarkedAncestor(directory);
|
|
4137
|
+
if (marked !== undefined)
|
|
4138
|
+
return marked;
|
|
4139
|
+
return realpathSync4(nearestExistingAncestor(directory));
|
|
4140
|
+
}
|
|
4141
|
+
function nearestMarkedAncestor(directory) {
|
|
4142
|
+
let current = directory;
|
|
4143
|
+
for (;; ) {
|
|
4144
|
+
if (existsSync7(current) && WORKSPACE_MARKERS.some((marker) => existsSync7(join3(current, marker)))) {
|
|
4145
|
+
return realpathSync4(current);
|
|
4146
|
+
}
|
|
4147
|
+
const parent = dirname7(current);
|
|
4148
|
+
if (parent === current)
|
|
4149
|
+
return;
|
|
4150
|
+
current = parent;
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
function nearestExistingAncestor(directory) {
|
|
4154
|
+
let current = directory;
|
|
4155
|
+
while (!existsSync7(current)) {
|
|
4156
|
+
const parent = dirname7(current);
|
|
4157
|
+
if (parent === current)
|
|
4158
|
+
return current;
|
|
4159
|
+
current = parent;
|
|
4160
|
+
}
|
|
4161
|
+
return current;
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4160
4164
|
// ../lsp-core/src/lsp/server-install-state.ts
|
|
4161
|
-
import { existsSync as
|
|
4162
|
-
import { dirname as
|
|
4165
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
4166
|
+
import { dirname as dirname8 } from "node:path";
|
|
4163
4167
|
function getInstallDecisionsPath() {
|
|
4164
4168
|
return lspRequestContext().installDecisionsPath;
|
|
4165
4169
|
}
|
|
4166
4170
|
function loadInstallDecisions() {
|
|
4167
4171
|
const path2 = getInstallDecisionsPath();
|
|
4168
|
-
if (!
|
|
4172
|
+
if (!existsSync8(path2))
|
|
4169
4173
|
return {};
|
|
4170
4174
|
try {
|
|
4171
4175
|
const parsed = JSON.parse(readFileSync4(path2, "utf8"));
|
|
@@ -4187,7 +4191,7 @@ function isInstallDecision(value) {
|
|
|
4187
4191
|
}
|
|
4188
4192
|
function writeInstallDecisions(decisions) {
|
|
4189
4193
|
const path2 = getInstallDecisionsPath();
|
|
4190
|
-
mkdirSync3(
|
|
4194
|
+
mkdirSync3(dirname8(path2), { recursive: true });
|
|
4191
4195
|
const tmpPath = `${path2}.tmp`;
|
|
4192
4196
|
writeFileSync2(tmpPath, `${JSON.stringify(decisions, null, 2)}
|
|
4193
4197
|
`, "utf8");
|
|
@@ -4206,7 +4210,7 @@ function isRecord5(value) {
|
|
|
4206
4210
|
}
|
|
4207
4211
|
|
|
4208
4212
|
// ../lsp-core/src/lsp/config-loader.ts
|
|
4209
|
-
import { existsSync as
|
|
4213
|
+
import { existsSync as existsSync9, readFileSync as readFileSync5 } from "node:fs";
|
|
4210
4214
|
|
|
4211
4215
|
// ../lsp-core/src/lsp/server-definitions.ts
|
|
4212
4216
|
var LSP_INSTALL_HINTS = {
|
|
@@ -4363,7 +4367,7 @@ function getUserConfigPath() {
|
|
|
4363
4367
|
return lspRequestContext().userConfigPath;
|
|
4364
4368
|
}
|
|
4365
4369
|
function loadJsonFile(path2) {
|
|
4366
|
-
if (!
|
|
4370
|
+
if (!existsSync9(path2))
|
|
4367
4371
|
return null;
|
|
4368
4372
|
try {
|
|
4369
4373
|
const parsed = JSON.parse(readFileSync5(path2, "utf-8"));
|
|
@@ -4551,8 +4555,8 @@ function getDisabledServerIds() {
|
|
|
4551
4555
|
}
|
|
4552
4556
|
|
|
4553
4557
|
// ../lsp-core/src/lsp/server-installation.ts
|
|
4554
|
-
import { existsSync as
|
|
4555
|
-
import { delimiter as delimiter3, join as
|
|
4558
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
4559
|
+
import { delimiter as delimiter3, join as join4 } from "node:path";
|
|
4556
4560
|
function isServerInstalled(command, _workingDirectory) {
|
|
4557
4561
|
if (command.length === 0)
|
|
4558
4562
|
return false;
|
|
@@ -4560,7 +4564,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
4560
4564
|
if (!cmd)
|
|
4561
4565
|
return false;
|
|
4562
4566
|
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
4563
|
-
if (
|
|
4567
|
+
if (existsSync10(cmd))
|
|
4564
4568
|
return true;
|
|
4565
4569
|
}
|
|
4566
4570
|
const isWindows = process.platform === "win32";
|
|
@@ -4581,7 +4585,7 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
4581
4585
|
const paths = pathEnv.split(delimiter3);
|
|
4582
4586
|
for (const p of paths) {
|
|
4583
4587
|
for (const suffix of exts) {
|
|
4584
|
-
if (
|
|
4588
|
+
if (existsSync10(join4(p, cmd + suffix))) {
|
|
4585
4589
|
return true;
|
|
4586
4590
|
}
|
|
4587
4591
|
}
|
|
@@ -4677,7 +4681,6 @@ function getAllServers() {
|
|
|
4677
4681
|
}
|
|
4678
4682
|
|
|
4679
4683
|
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
4680
|
-
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
4681
4684
|
function isDirectoryPath(filePath) {
|
|
4682
4685
|
try {
|
|
4683
4686
|
return statSync4(filePath).isDirectory();
|
|
@@ -4686,32 +4689,85 @@ function isDirectoryPath(filePath) {
|
|
|
4686
4689
|
}
|
|
4687
4690
|
}
|
|
4688
4691
|
function findWorkspaceRoot(filePath) {
|
|
4689
|
-
const
|
|
4692
|
+
const cwd = contextCwd();
|
|
4693
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4690
4694
|
let dir = abs;
|
|
4691
4695
|
if (!isDirectoryPath(dir)) {
|
|
4692
|
-
dir =
|
|
4693
|
-
}
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4696
|
+
dir = dirname9(dir);
|
|
4697
|
+
}
|
|
4698
|
+
if (!isPathInside(cwd, abs))
|
|
4699
|
+
return findWorkspaceRootOutsideContext(dir);
|
|
4700
|
+
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4701
|
+
while (isPathInside(cwd, dir)) {
|
|
4702
|
+
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4703
|
+
if (canonicalDir !== undefined) {
|
|
4704
|
+
for (const marker of WORKSPACE_MARKERS) {
|
|
4705
|
+
if (existsSync11(join5(dir, marker))) {
|
|
4706
|
+
return canonicalDir;
|
|
4707
|
+
}
|
|
4699
4708
|
}
|
|
4700
4709
|
}
|
|
4701
|
-
|
|
4702
|
-
|
|
4710
|
+
if (dir === cwd)
|
|
4711
|
+
break;
|
|
4712
|
+
dir = dirname9(dir);
|
|
4703
4713
|
}
|
|
4704
|
-
return
|
|
4714
|
+
return fallbackRoot;
|
|
4705
4715
|
}
|
|
4706
|
-
function
|
|
4716
|
+
function resolveReadablePathInsideContext(filePath) {
|
|
4707
4717
|
const cwd = contextCwd();
|
|
4708
4718
|
const abs = resolve7(cwd, filePath);
|
|
4719
|
+
if (isPathInside(cwd, abs))
|
|
4720
|
+
return abs;
|
|
4721
|
+
const rebased = rebaseThroughCanonicalAncestor(abs, cwd);
|
|
4722
|
+
if (rebased !== undefined)
|
|
4723
|
+
return rebased;
|
|
4724
|
+
return canonicalizeExistingOrNearestAncestor(abs);
|
|
4725
|
+
}
|
|
4726
|
+
function resolvePathInsideContext(filePath) {
|
|
4727
|
+
const cwd = contextCwd();
|
|
4728
|
+
const abs = resolveReadablePathInsideContext(filePath);
|
|
4709
4729
|
const canonical = canonicalizeExistingOrNearestAncestor(abs);
|
|
4710
4730
|
if (!isPathInside(cwd, canonical)) {
|
|
4711
4731
|
throw new LspInvalidPathError(`LSP file path must be inside request cwd: ${filePath}`);
|
|
4712
4732
|
}
|
|
4713
4733
|
return canonical;
|
|
4714
4734
|
}
|
|
4735
|
+
function rebaseThroughCanonicalAncestor(path2, cwd) {
|
|
4736
|
+
let current = path2;
|
|
4737
|
+
const suffix = [];
|
|
4738
|
+
while (true) {
|
|
4739
|
+
if (existsSync11(current)) {
|
|
4740
|
+
const canonical = realpathSync5(current);
|
|
4741
|
+
if (isPathInside(cwd, canonical))
|
|
4742
|
+
return suffix.length === 0 ? canonical : join5(canonical, ...suffix);
|
|
4743
|
+
}
|
|
4744
|
+
const parent = dirname9(current);
|
|
4745
|
+
if (parent === current)
|
|
4746
|
+
return;
|
|
4747
|
+
suffix.unshift(basename3(current));
|
|
4748
|
+
current = parent;
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4751
|
+
function existingDirectoryInsideContext(directory, cwd) {
|
|
4752
|
+
if (!existsSync11(directory))
|
|
4753
|
+
return;
|
|
4754
|
+
const canonical = realpathSync5(directory);
|
|
4755
|
+
if (!statSync4(canonical).isDirectory())
|
|
4756
|
+
return;
|
|
4757
|
+
return isPathInside(cwd, canonical) ? canonical : undefined;
|
|
4758
|
+
}
|
|
4759
|
+
function nearestExistingDirectoryInsideContext(directory, cwd) {
|
|
4760
|
+
let current = directory;
|
|
4761
|
+
while (isPathInside(cwd, current)) {
|
|
4762
|
+
const canonical = existingDirectoryInsideContext(current, cwd);
|
|
4763
|
+
if (canonical !== undefined)
|
|
4764
|
+
return canonical;
|
|
4765
|
+
if (current === cwd)
|
|
4766
|
+
return;
|
|
4767
|
+
current = dirname9(current);
|
|
4768
|
+
}
|
|
4769
|
+
return;
|
|
4770
|
+
}
|
|
4715
4771
|
function formatServerLookupError(result) {
|
|
4716
4772
|
if (result.status === "not_installed") {
|
|
4717
4773
|
return formatNotInstalled(result);
|
|
@@ -4782,7 +4838,7 @@ function formatNotInstalled(result) {
|
|
|
4782
4838
|
].join(`
|
|
4783
4839
|
`);
|
|
4784
4840
|
}
|
|
4785
|
-
var
|
|
4841
|
+
var READ_ONLY_TOOLS = new Set([
|
|
4786
4842
|
"diagnostics",
|
|
4787
4843
|
"definition",
|
|
4788
4844
|
"references",
|
|
@@ -4791,7 +4847,7 @@ var READ_ONLY_RETRY_TOOLS = new Set([
|
|
|
4791
4847
|
"prepareRename"
|
|
4792
4848
|
]);
|
|
4793
4849
|
async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
4794
|
-
const absPath = resolvePathInsideContext(filePath);
|
|
4850
|
+
const absPath = READ_ONLY_TOOLS.has(toolName) ? resolveReadablePathInsideContext(filePath) : resolvePathInsideContext(filePath);
|
|
4795
4851
|
if (isDirectoryPath(absPath)) {
|
|
4796
4852
|
throw new LspInvalidPathError("Directory paths are not supported by this LSP tool. " + "Use lsp.diagnostics with a directory path for directory diagnostics.");
|
|
4797
4853
|
}
|
|
@@ -4806,9 +4862,9 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4806
4862
|
const acquireAndCall = async (allowRetry) => {
|
|
4807
4863
|
const client = await manager.getClient(root, server2, options.signal);
|
|
4808
4864
|
try {
|
|
4809
|
-
return await fn(client, root);
|
|
4865
|
+
return await fn(client, root, absPath);
|
|
4810
4866
|
} catch (err) {
|
|
4811
|
-
if (allowRetry &&
|
|
4867
|
+
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
4812
4868
|
manager.invalidateClient(root, server2.id, client);
|
|
4813
4869
|
return acquireAndCall(false);
|
|
4814
4870
|
}
|
|
@@ -4826,8 +4882,8 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
4826
4882
|
}
|
|
4827
4883
|
|
|
4828
4884
|
// ../lsp-core/src/lsp/directory-diagnostics.ts
|
|
4829
|
-
import { existsSync as
|
|
4830
|
-
import { join as
|
|
4885
|
+
import { existsSync as existsSync12, lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
|
|
4886
|
+
import { join as join6, resolve as resolve8 } from "node:path";
|
|
4831
4887
|
|
|
4832
4888
|
// ../lsp-core/src/lsp/formatters.ts
|
|
4833
4889
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
@@ -4957,7 +5013,7 @@ function collectFilesWithExtension(dir, extension, maxFiles) {
|
|
|
4957
5013
|
for (const entry of entries) {
|
|
4958
5014
|
if (files.length >= maxFiles)
|
|
4959
5015
|
return;
|
|
4960
|
-
const fullPath =
|
|
5016
|
+
const fullPath = join6(currentDir, entry);
|
|
4961
5017
|
let stat;
|
|
4962
5018
|
try {
|
|
4963
5019
|
stat = lstatSync5(fullPath);
|
|
@@ -4983,7 +5039,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
4983
5039
|
throw new LspInvalidPathError(`Extension must start with a dot (e.g., ".ts", not "${extension}"). Use ".${extension}" instead.`);
|
|
4984
5040
|
}
|
|
4985
5041
|
const absDir = resolve8(options.workspaceRoot ?? contextCwd(), directory);
|
|
4986
|
-
if (!
|
|
5042
|
+
if (!existsSync12(absDir)) {
|
|
4987
5043
|
throw new LspInvalidPathError(`Directory does not exist: ${absDir}`);
|
|
4988
5044
|
}
|
|
4989
5045
|
const serverResult = options.server === undefined ? findServerForExtension(extension) : { status: "found", server: options.server };
|
|
@@ -5070,7 +5126,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
5070
5126
|
|
|
5071
5127
|
// ../lsp-core/src/lsp/infer-extension.ts
|
|
5072
5128
|
import { lstatSync as lstatSync6, readdirSync as readdirSync4 } from "node:fs";
|
|
5073
|
-
import { join as
|
|
5129
|
+
import { join as join7 } from "node:path";
|
|
5074
5130
|
var SKIP_DIRECTORIES2 = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
|
|
5075
5131
|
var MAX_SCAN_ENTRIES = 500;
|
|
5076
5132
|
function inferExtensionFromDirectory(directory) {
|
|
@@ -5088,7 +5144,7 @@ function inferExtensionFromDirectory(directory) {
|
|
|
5088
5144
|
for (const entry of entries) {
|
|
5089
5145
|
if (scanned >= MAX_SCAN_ENTRIES)
|
|
5090
5146
|
return;
|
|
5091
|
-
const fullPath =
|
|
5147
|
+
const fullPath = join7(dir, entry);
|
|
5092
5148
|
let stat;
|
|
5093
5149
|
try {
|
|
5094
5150
|
stat = lstatSync6(fullPath);
|
|
@@ -5263,7 +5319,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
5263
5319
|
const filePath = requireString(params, "filePath");
|
|
5264
5320
|
const severity = severityFilter(params);
|
|
5265
5321
|
try {
|
|
5266
|
-
const absPath =
|
|
5322
|
+
const absPath = resolveReadablePathInsideContext(filePath);
|
|
5267
5323
|
if (isDirectoryPath(absPath)) {
|
|
5268
5324
|
const extension = inferExtensionFromDirectory(absPath);
|
|
5269
5325
|
if (!extension) {
|
|
@@ -5292,7 +5348,7 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
5292
5348
|
};
|
|
5293
5349
|
return text(output2.output, details2);
|
|
5294
5350
|
}
|
|
5295
|
-
const result = await withLspClient(filePath, async (client) => client.diagnostics(
|
|
5351
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.diagnostics(resolvedFilePath, signal), "diagnostics", clientOptions(signal));
|
|
5296
5352
|
if (result.transientError) {
|
|
5297
5353
|
const message = result.transientError.message;
|
|
5298
5354
|
const details2 = {
|
|
@@ -5367,7 +5423,7 @@ async function executeLspGotoDefinition(params, signal) {
|
|
|
5367
5423
|
const line = requireNumber(params, "line");
|
|
5368
5424
|
const character = requireNumber(params, "character");
|
|
5369
5425
|
try {
|
|
5370
|
-
const result = await withLspClient(filePath, async (client) => client.definition(
|
|
5426
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.definition(resolvedFilePath, line, character, signal), "definition", clientOptions(signal));
|
|
5371
5427
|
const locations = !result ? [] : Array.isArray(result) ? result : [result];
|
|
5372
5428
|
const details = { filePath, line, character, locations };
|
|
5373
5429
|
if (locations.length === 0)
|
|
@@ -5392,7 +5448,7 @@ async function executeLspFindReferences(params, signal) {
|
|
|
5392
5448
|
const character = requireNumber(params, "character");
|
|
5393
5449
|
const includeDeclaration = optionalBoolean(params, "includeDeclaration") ?? true;
|
|
5394
5450
|
try {
|
|
5395
|
-
const result = await withLspClient(filePath, async (client) => client.references(
|
|
5451
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.references(resolvedFilePath, line, character, includeDeclaration, signal), "references", clientOptions(signal));
|
|
5396
5452
|
const references = Array.isArray(result) ? result : [];
|
|
5397
5453
|
const total = references.length;
|
|
5398
5454
|
const truncated = total > DEFAULT_MAX_REFERENCES;
|
|
@@ -5434,7 +5490,7 @@ async function executeLspPrepareRename(params, signal) {
|
|
|
5434
5490
|
const line = requireNumber(params, "line");
|
|
5435
5491
|
const character = requireNumber(params, "character");
|
|
5436
5492
|
try {
|
|
5437
|
-
const result = await withLspClient(filePath, async (client) => client.prepareRename(
|
|
5493
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.prepareRename(resolvedFilePath, line, character, signal), "prepareRename", clientOptions(signal));
|
|
5438
5494
|
const details = { filePath, line, character, result };
|
|
5439
5495
|
return text(formatPrepareRenameResult(result), details);
|
|
5440
5496
|
} catch (error) {
|
|
@@ -5455,7 +5511,7 @@ async function executeLspRename(params, signal) {
|
|
|
5455
5511
|
const character = requireNumber(params, "character");
|
|
5456
5512
|
const newName = requireString(params, "newName");
|
|
5457
5513
|
try {
|
|
5458
|
-
const result = await withLspClient(filePath, async (client) => client.rename(
|
|
5514
|
+
const result = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.rename(resolvedFilePath, line, character, newName, signal), "rename", clientOptions(signal));
|
|
5459
5515
|
const details = { filePath, line, character, newName, apply: result.apply, edit: result.edit };
|
|
5460
5516
|
return text(formatApplyResult(result.apply), details, !result.apply.success);
|
|
5461
5517
|
} catch (error) {
|
|
@@ -5535,7 +5591,7 @@ async function executeLspSymbols(params, signal) {
|
|
|
5535
5591
|
const symbols2 = await withLspClient(filePath, async (client) => client.workspaceSymbols(query, signal), "workspaceSymbols", clientOptions(signal));
|
|
5536
5592
|
return formatSymbolsResult(filePath, scope, symbols2, limit, query);
|
|
5537
5593
|
}
|
|
5538
|
-
const symbols = await withLspClient(filePath, async (client) => client.documentSymbols(
|
|
5594
|
+
const symbols = await withLspClient(filePath, async (client, _workspaceRoot, resolvedFilePath) => client.documentSymbols(resolvedFilePath, signal), "documentSymbols", clientOptions(signal));
|
|
5539
5595
|
return formatSymbolsResult(filePath, scope, symbols, limit);
|
|
5540
5596
|
} catch (error) {
|
|
5541
5597
|
const query = optionalString(params, "query");
|
|
@@ -5771,7 +5827,10 @@ function requestedProtocolVersion(params) {
|
|
|
5771
5827
|
var CONTEXT_KEY = "_context";
|
|
5772
5828
|
|
|
5773
5829
|
class InvalidDaemonRequestError extends Error {
|
|
5774
|
-
|
|
5830
|
+
constructor() {
|
|
5831
|
+
super(...arguments);
|
|
5832
|
+
this.name = "InvalidDaemonRequestError";
|
|
5833
|
+
}
|
|
5775
5834
|
}
|
|
5776
5835
|
function extractRequestContext(raw) {
|
|
5777
5836
|
if (!isPlainRecord(raw) || raw["method"] !== "tools/call")
|
|
@@ -5892,9 +5951,9 @@ function currentRequestContext(env = process.env) {
|
|
|
5892
5951
|
const home = env["HOME"] ?? homedir3();
|
|
5893
5952
|
return parseLspRequestContext({
|
|
5894
5953
|
cwd,
|
|
5895
|
-
projectConfigPaths: [
|
|
5896
|
-
userConfigPath:
|
|
5897
|
-
installDecisionsPath:
|
|
5954
|
+
projectConfigPaths: [join8(cwd, ".codex", "lsp-client.json")],
|
|
5955
|
+
userConfigPath: join8(home, ".codex", "lsp-client.json"),
|
|
5956
|
+
installDecisionsPath: join8(home, ".codex", "lsp-install-decisions.json"),
|
|
5898
5957
|
capabilities: { installDecisionTool: true }
|
|
5899
5958
|
});
|
|
5900
5959
|
}
|
|
@@ -6035,10 +6094,9 @@ var OMO_LSP_DAEMON_VERSION2 = "OMO_LSP_DAEMON_VERSION";
|
|
|
6035
6094
|
var DAEMON_VERSION_PATTERN2 = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
6036
6095
|
|
|
6037
6096
|
class InvalidRuntimeOverrideError2 extends Error {
|
|
6038
|
-
code = "invalid_runtime_override";
|
|
6039
|
-
reason;
|
|
6040
6097
|
constructor(reason, message) {
|
|
6041
6098
|
super(message);
|
|
6099
|
+
this.code = "invalid_runtime_override";
|
|
6042
6100
|
this.name = "InvalidRuntimeOverrideError";
|
|
6043
6101
|
this.reason = reason;
|
|
6044
6102
|
}
|
|
@@ -6085,13 +6143,13 @@ function currentRequestContext2(env = process.env) {
|
|
|
6085
6143
|
return currentRequestContext(env);
|
|
6086
6144
|
}
|
|
6087
6145
|
export {
|
|
6088
|
-
|
|
6089
|
-
resolveDaemonRuntime2 as resolveDaemonRuntime,
|
|
6090
|
-
currentRequestContext2 as currentRequestContext,
|
|
6091
|
-
callToolViaDaemon2 as callToolViaDaemon,
|
|
6092
|
-
callDiagnosticsViaDaemon2 as callDiagnosticsViaDaemon,
|
|
6093
|
-
OMO_LSP_DAEMON_VERSION2 as OMO_LSP_DAEMON_VERSION,
|
|
6094
|
-
OMO_LSP_DAEMON_DIR2 as OMO_LSP_DAEMON_DIR,
|
|
6146
|
+
InvalidRuntimeOverrideError2 as InvalidRuntimeOverrideError,
|
|
6095
6147
|
OMO_LSP_DAEMON_CLI2 as OMO_LSP_DAEMON_CLI,
|
|
6096
|
-
|
|
6148
|
+
OMO_LSP_DAEMON_DIR2 as OMO_LSP_DAEMON_DIR,
|
|
6149
|
+
OMO_LSP_DAEMON_VERSION2 as OMO_LSP_DAEMON_VERSION,
|
|
6150
|
+
callDiagnosticsViaDaemon2 as callDiagnosticsViaDaemon,
|
|
6151
|
+
callToolViaDaemon2 as callToolViaDaemon,
|
|
6152
|
+
currentRequestContext2 as currentRequestContext,
|
|
6153
|
+
resolveDaemonRuntime2 as resolveDaemonRuntime,
|
|
6154
|
+
validateDaemonVersion2 as validateDaemonVersion
|
|
6097
6155
|
};
|