oh-my-opencode 5.0.0-beta.30 → 5.0.0-beta.32
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 +178 -37
- package/dist/cli-node/index.js +178 -37
- package/dist/config/schema/background-task.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +1 -0
- package/dist/features/background-agent/constants.d.ts +0 -7
- package/dist/features/background-agent/manager.d.ts +2 -1
- package/dist/features/background-agent/parent-wake-dispatched-tracker.d.ts +0 -1
- package/dist/features/background-agent/parent-wake-notifier-types.d.ts +1 -1
- package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -1
- package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -1
- package/dist/features/background-agent/subagent-spawn-limits.d.ts +8 -0
- package/dist/features/monitor/manager-internals.d.ts +1 -1
- package/dist/features/monitor/output-injector-types.d.ts +1 -1
- package/dist/features/task-toast-manager/manager.d.ts +0 -24
- package/dist/features/team-mode/tools/messaging-live-delivery-recipient.d.ts +1 -0
- package/dist/features/team-mode/tools/messaging-runtime.d.ts +1 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/message-storage-directory.d.ts +0 -3
- package/dist/hooks/anthropic-context-window-limit-recovery/state.d.ts +1 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/storage/empty-messages.d.ts +0 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/tool-result-storage.d.ts +11 -0
- package/dist/hooks/claude-code-hooks/session-hook-state.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/stop.d.ts +2 -0
- package/dist/hooks/claude-code-hooks/todo.d.ts +0 -1
- package/dist/hooks/claude-code-hooks/transcript.d.ts +2 -0
- package/dist/hooks/fsync-skip-warning/index.d.ts +4 -0
- package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +1 -0
- package/dist/hooks/hashline-edit-diff-enhancer/pending-captures.d.ts +13 -0
- package/dist/hooks/keyword-detector/hook.d.ts +7 -0
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +0 -1
- package/dist/hooks/model-fallback/hook.d.ts +1 -1
- package/dist/index.js +681 -273
- package/dist/oh-my-opencode.schema.json +5 -0
- package/dist/plugin-dispose.d.ts +3 -0
- package/dist/shared/agent-tool-restrictions.d.ts +0 -1
- package/dist/skills/ultimate-browsing/references/insane-search/README.md +9 -2
- package/dist/tools/delegate-task/sync-session-cleanup.d.ts +3 -0
- package/dist/tools/delegate-task/sync-session-poller.d.ts +1 -0
- package/dist/tools/delegate-task/types.d.ts +1 -0
- package/dist/tools/session-manager/directory-filter.d.ts +2 -0
- package/dist/tui.js +148 -9
- package/package.json +16 -15
- package/packages/git-bash-mcp/dist/cli.js +1 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +47 -19
- package/packages/lsp-core/src/lsp/client-diagnostics-pull-timeout.test.ts +64 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +97 -0
- package/packages/lsp-core/src/lsp/client-wrapper.ts +21 -6
- package/packages/lsp-core/src/lsp/client.ts +6 -3
- package/packages/lsp-core/src/lsp/constants.ts +5 -0
- package/packages/lsp-core/src/lsp/controlled-clock-test-support.ts +61 -0
- package/packages/lsp-core/src/lsp/errors.ts +15 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +10 -3
- package/packages/lsp-core/src/lsp/manager-lifecycle.test.ts +262 -0
- package/packages/lsp-core/src/lsp/manager.ts +106 -13
- package/packages/lsp-core/src/lsp/timer-provider.ts +13 -0
- package/packages/lsp-core/src/lsp/transport-request-timeout.test.ts +73 -0
- package/packages/lsp-core/src/lsp/transport.ts +7 -2
- package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +84 -1
- package/packages/lsp-core/src/lsp/workspace-document-state.ts +30 -11
- package/packages/lsp-core/src/lsp/workspace-markers.ts +18 -1
- package/packages/lsp-core/src/mcp.ts +3 -0
- package/packages/lsp-core/src/tools/parameters.test.ts +51 -0
- package/packages/lsp-daemon/dist/cli.js +155 -34
- package/packages/lsp-daemon/dist/client.js +155 -34
- package/packages/lsp-daemon/dist/index.js +155 -34
- package/packages/lsp-daemon/dist/proxy.js +3 -0
- package/packages/lsp-tools-mcp/dist/cli.js +155 -34
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +134 -28
- package/packages/lsp-tools-mcp/dist/mcp.js +155 -34
- package/packages/lsp-tools-mcp/dist/tools.js +154 -34
- package/packages/lsp-tools-mcp/package.json +1 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +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/codegraph/dist/cli.js +17 -2
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +17 -2
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +12 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable-idle.test.ts +47 -0
- 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/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +152 -34
- 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 +1 -1
- 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/ultrawork/AGENTS.md +5 -4
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +489 -4
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -2
- package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +30 -14
- package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +4 -0
- package/packages/omo-codex/plugin/components/ultrawork/src/directive.ts +5 -2
- package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +14 -8
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +12 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +5 -2
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +14 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +10 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.d.ts +8 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.js +113 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +9 -5
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +856 -347
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +27 -6
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +14 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +17 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +17 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.d.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.js +19 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.js +53 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.d.ts +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.js +85 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +4 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +41 -102
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +4 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.js +185 -14
- package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.js +33 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.d.ts +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.js +65 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +17 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +7 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +25 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-template.ts +127 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +10 -12
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +34 -5
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +19 -9
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +18 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-missing-recovery.ts +27 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-aggregate.ts +57 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-artifacts.ts +103 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +54 -123
- package/packages/omo-codex/plugin/components/ulw-loop/src/review-blockers.ts +4 -2
- package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-guard.ts +187 -12
- package/packages/omo-codex/plugin/components/ulw-loop/src/status-next-actions.ts +36 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/surface.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +107 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-template.test.ts +92 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-status-next-actions.test.ts +183 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +35 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +7 -3
- package/packages/omo-codex/plugin/components/ulw-loop/test/guided-recovery.test.ts +105 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate.test.ts +101 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +46 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-senpi-surface.test.ts +131 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-guard.test.ts +318 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/surface.test.ts +74 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +9 -3
- 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 +1 -1
- 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 +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 +13 -13
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +31 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +9 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +17 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +11 -1
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +13 -0
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +5 -2
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +9 -2
- package/dist/features/builtin-skills/index.d.ts +0 -1
- package/dist/features/builtin-skills/skill-file-loader.d.ts +0 -1
- package/dist/features/builtin-skills/skills/agent-browser-skill.d.ts +0 -1
- package/dist/features/builtin-skills/skills/agent-browser-template.d.ts +0 -1
- package/dist/features/builtin-skills/skills/debugging.d.ts +0 -1
- package/dist/features/builtin-skills/skills/dev-browser.d.ts +0 -1
- package/dist/features/builtin-skills/skills/frontend.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-atomic-planning.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-context-analysis.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-execution-verification.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +0 -1
- package/dist/features/builtin-skills/skills/git-master.d.ts +0 -1
- package/dist/features/builtin-skills/skills/index.d.ts +0 -1
- package/dist/features/builtin-skills/skills/init-deep.d.ts +0 -1
- package/dist/features/builtin-skills/skills/playwright-cli.d.ts +0 -1
- package/dist/features/builtin-skills/skills/playwright-mcp-skill.d.ts +0 -1
- package/dist/features/builtin-skills/skills/playwright.d.ts +0 -1
- package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +0 -1
- package/dist/features/builtin-skills/skills/review-work.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-research.d.ts +0 -1
- package/dist/features/builtin-skills/skills/security-review.d.ts +0 -1
- package/dist/features/builtin-skills/skills/team-mode.d.ts +0 -1
- package/dist/features/builtin-skills/skills/visual-qa.d.ts +0 -1
- package/dist/features/builtin-skills/skills.d.ts +0 -1
- package/dist/features/builtin-skills/types.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/command-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/discovery-core.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/discovery-paths.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/discovery.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/index.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/install-path-resolver.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/installed-plugin-database.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/loaded-plugin.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-key.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-manifest.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/plugin-settings.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +0 -1
- package/dist/features/claude-code-plugin-loader/types.d.ts +0 -1
- package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +0 -11
- package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +0 -7
- package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +0 -1
- package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +0 -1
- package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +0 -1
- package/dist/shared/prompt-async-gate/queue.d.ts +0 -1
- package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +0 -1
- package/dist/shared/prompt-async-gate/reservations.d.ts +0 -1
- package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +0 -1
- package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +0 -1
- package/dist/shared/prompt-async-gate/timing.d.ts +0 -1
- package/dist/shared/prompt-async-gate/types.d.ts +0 -1
- package/dist/tools/call-omo-agent/message-storage-directory.d.ts +0 -1
- package/dist/tools/delegate-task/model-string-parser.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/missing-dependency-result.d.ts +0 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +0 -483
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +0 -490
|
@@ -1007,6 +1007,7 @@ async function runJsonRpcStdioServer(config) {
|
|
|
1007
1007
|
const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
|
|
1008
1008
|
isClosed = true;
|
|
1009
1009
|
config.onIdleTimeout?.();
|
|
1010
|
+
config.input.destroy();
|
|
1010
1011
|
});
|
|
1011
1012
|
const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
|
|
1012
1013
|
isClosed = true;
|
|
@@ -1218,6 +1219,16 @@ class LspProcessSpawnError extends Error {
|
|
|
1218
1219
|
this.name = "LspProcessSpawnError";
|
|
1219
1220
|
}
|
|
1220
1221
|
}
|
|
1222
|
+
|
|
1223
|
+
class LspClientRespawnBudgetExceededError extends Error {
|
|
1224
|
+
constructor(serverId, root, retryLimit) {
|
|
1225
|
+
super(`LSP server ${serverId} at ${root} failed to stay alive; respawn budget exhausted ` + `(${retryLimit} consecutive dead generations). Retrying after the cooldown may succeed.`);
|
|
1226
|
+
this.serverId = serverId;
|
|
1227
|
+
this.root = root;
|
|
1228
|
+
this.retryLimit = retryLimit;
|
|
1229
|
+
this.name = "LspClientRespawnBudgetExceededError";
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1221
1232
|
function isLspDeadConnectionError(err) {
|
|
1222
1233
|
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
1223
1234
|
}
|
|
@@ -1239,6 +1250,13 @@ import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
|
1239
1250
|
// ../lsp-core/src/lsp/connection.ts
|
|
1240
1251
|
import { pathToFileURL } from "node:url";
|
|
1241
1252
|
|
|
1253
|
+
// ../lsp-core/src/lsp/timer-provider.ts
|
|
1254
|
+
var realTimerProvider = {
|
|
1255
|
+
now: () => Date.now(),
|
|
1256
|
+
setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
|
|
1257
|
+
clearTimeout: (handle) => clearTimeout(handle)
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1242
1260
|
// ../lsp-core/src/lsp/constants.ts
|
|
1243
1261
|
var DEFAULT_MAX_REFERENCES = 200;
|
|
1244
1262
|
var DEFAULT_MAX_SYMBOLS = 200;
|
|
@@ -1251,6 +1269,8 @@ var MAX_RESIDENT_CLIENTS = 6;
|
|
|
1251
1269
|
var REAPER_INTERVAL_MS = 60000;
|
|
1252
1270
|
var STOP_HARD_KILL_TIMEOUT_MS = 5000;
|
|
1253
1271
|
var STOP_SIGKILL_GRACE_MS = 1000;
|
|
1272
|
+
var CLIENT_RESPAWN_RETRY_LIMIT = 2;
|
|
1273
|
+
var CLIENT_RESPAWN_COOLDOWN_MS = 60000;
|
|
1254
1274
|
|
|
1255
1275
|
// ../lsp-core/src/lsp/json-rpc-connection.ts
|
|
1256
1276
|
var HEADER_SEPARATOR2 = `\r
|
|
@@ -1776,6 +1796,7 @@ class LspClientTransport {
|
|
|
1776
1796
|
this.documentFormattingSupported = false;
|
|
1777
1797
|
this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
1778
1798
|
this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
1799
|
+
this.timerProvider = timeouts.timerProvider ?? realTimerProvider;
|
|
1779
1800
|
}
|
|
1780
1801
|
pid() {
|
|
1781
1802
|
return this.proc?.pid;
|
|
@@ -1876,7 +1897,7 @@ class LspClientTransport {
|
|
|
1876
1897
|
const options = args[1];
|
|
1877
1898
|
const timeoutMs = options?.timeoutMs ?? this.requestTimeoutMs;
|
|
1878
1899
|
const timeoutController = new AbortController;
|
|
1879
|
-
const timeoutHandle = setTimeout(() => {
|
|
1900
|
+
const timeoutHandle = this.timerProvider.setTimeout(() => {
|
|
1880
1901
|
const stderrTail = this.stderrBuffer.slice(-5).join(`
|
|
1881
1902
|
`);
|
|
1882
1903
|
timeoutController.abort(new LspRequestTimeoutError(method, stderrTail || undefined));
|
|
@@ -1895,7 +1916,7 @@ class LspClientTransport {
|
|
|
1895
1916
|
}
|
|
1896
1917
|
throw error;
|
|
1897
1918
|
} finally {
|
|
1898
|
-
clearTimeout(timeoutHandle);
|
|
1919
|
+
this.timerProvider.clearTimeout(timeoutHandle);
|
|
1899
1920
|
combinedSignal.dispose();
|
|
1900
1921
|
}
|
|
1901
1922
|
}
|
|
@@ -2276,6 +2297,17 @@ function canonicalPath(filePath) {
|
|
|
2276
2297
|
return absolute;
|
|
2277
2298
|
}
|
|
2278
2299
|
}
|
|
2300
|
+
function normalizeDocumentUri(uri) {
|
|
2301
|
+
let decoded = uri;
|
|
2302
|
+
try {
|
|
2303
|
+
decoded = decodeURIComponent(uri);
|
|
2304
|
+
} catch {
|
|
2305
|
+
decoded = uri;
|
|
2306
|
+
}
|
|
2307
|
+
if (process.platform !== "win32")
|
|
2308
|
+
return decoded;
|
|
2309
|
+
return decoded.replace(/^(file:\/\/\/)([a-z]):/, (_match, prefix, drive) => `${prefix}${drive.toUpperCase()}:`);
|
|
2310
|
+
}
|
|
2279
2311
|
function isSameOrDescendant(candidate, parent) {
|
|
2280
2312
|
const suffix = relative2(parent, candidate);
|
|
2281
2313
|
return suffix === "" || !suffix.startsWith("..") && suffix !== "..";
|
|
@@ -2292,7 +2324,12 @@ class WorkspaceDocumentState {
|
|
|
2292
2324
|
this.openDocuments = new Map;
|
|
2293
2325
|
this.openByUri = new Map;
|
|
2294
2326
|
this.openPromises = new Map;
|
|
2295
|
-
this.
|
|
2327
|
+
this.timerProvider = options.timerProvider ?? {
|
|
2328
|
+
now: options.now ?? (() => Date.now()),
|
|
2329
|
+
setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
|
|
2330
|
+
clearTimeout: (handle) => clearTimeout(handle)
|
|
2331
|
+
};
|
|
2332
|
+
this.now = () => this.timerProvider.now();
|
|
2296
2333
|
this.versionlessPublishQuiescenceMs = options.versionlessPublishQuiescenceMs ?? DEFAULT_VERSIONLESS_PUBLISH_QUIESCENCE_MS;
|
|
2297
2334
|
}
|
|
2298
2335
|
async openFile(filePath) {
|
|
@@ -2314,7 +2351,7 @@ class WorkspaceDocumentState {
|
|
|
2314
2351
|
return this.openDocuments.get(canonicalPath(filePath))?.version;
|
|
2315
2352
|
}
|
|
2316
2353
|
getStoredDiagnostics(uri) {
|
|
2317
|
-
const state = this.openByUri.get(uri);
|
|
2354
|
+
const state = this.openByUri.get(normalizeDocumentUri(uri));
|
|
2318
2355
|
if (!state)
|
|
2319
2356
|
return [];
|
|
2320
2357
|
return state.lastPublish?.diagnostics ?? state.pullCache?.diagnostics ?? [];
|
|
@@ -2336,13 +2373,13 @@ class WorkspaceDocumentState {
|
|
|
2336
2373
|
return state !== undefined && state.uri === snapshot.uri && state.version === snapshot.version && state.generation === snapshot.documentGeneration;
|
|
2337
2374
|
}
|
|
2338
2375
|
getPullCache(snapshot) {
|
|
2339
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
2376
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
2340
2377
|
if (!state?.pullCache || state.pullCache.documentVersion !== snapshot.version)
|
|
2341
2378
|
return null;
|
|
2342
2379
|
return state.pullCache;
|
|
2343
2380
|
}
|
|
2344
2381
|
recordPullDiagnostics(snapshot, report) {
|
|
2345
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
2382
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
2346
2383
|
if (!state)
|
|
2347
2384
|
return;
|
|
2348
2385
|
state.pullCache = {
|
|
@@ -2352,7 +2389,7 @@ class WorkspaceDocumentState {
|
|
|
2352
2389
|
};
|
|
2353
2390
|
}
|
|
2354
2391
|
recordPublishedDiagnostics(params) {
|
|
2355
|
-
const state = this.openByUri.get(params.uri);
|
|
2392
|
+
const state = this.openByUri.get(normalizeDocumentUri(params.uri));
|
|
2356
2393
|
if (!state)
|
|
2357
2394
|
return;
|
|
2358
2395
|
state.publishGeneration += 1;
|
|
@@ -2366,7 +2403,7 @@ class WorkspaceDocumentState {
|
|
|
2366
2403
|
this.notifyWaiters(state);
|
|
2367
2404
|
}
|
|
2368
2405
|
resolvePushDiagnostics(snapshot) {
|
|
2369
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
2406
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
2370
2407
|
if (!state?.lastPublish)
|
|
2371
2408
|
return { status: "missing" };
|
|
2372
2409
|
const publish = state.lastPublish;
|
|
@@ -2380,7 +2417,7 @@ class WorkspaceDocumentState {
|
|
|
2380
2417
|
return waitMs === 0 ? { status: "ready", diagnostics: publish.diagnostics } : { status: "wait", waitMs };
|
|
2381
2418
|
}
|
|
2382
2419
|
waitForDiagnosticsActivity(snapshot, timeoutMs) {
|
|
2383
|
-
const state = this.openByUri.get(snapshot.uri);
|
|
2420
|
+
const state = this.openByUri.get(normalizeDocumentUri(snapshot.uri));
|
|
2384
2421
|
if (!state || timeoutMs <= 0)
|
|
2385
2422
|
return Promise.resolve();
|
|
2386
2423
|
return new Promise((resolveActivity) => {
|
|
@@ -2389,11 +2426,11 @@ class WorkspaceDocumentState {
|
|
|
2389
2426
|
if (settled)
|
|
2390
2427
|
return;
|
|
2391
2428
|
settled = true;
|
|
2392
|
-
clearTimeout(timer);
|
|
2429
|
+
this.timerProvider.clearTimeout(timer);
|
|
2393
2430
|
state.waiters.delete(finish);
|
|
2394
2431
|
resolveActivity();
|
|
2395
2432
|
};
|
|
2396
|
-
const timer = setTimeout(finish, timeoutMs);
|
|
2433
|
+
const timer = this.timerProvider.setTimeout(finish, timeoutMs);
|
|
2397
2434
|
if (typeof timer.unref === "function")
|
|
2398
2435
|
timer.unref();
|
|
2399
2436
|
state.waiters.add(finish);
|
|
@@ -2501,7 +2538,7 @@ class WorkspaceDocumentState {
|
|
|
2501
2538
|
waiters: new Set
|
|
2502
2539
|
};
|
|
2503
2540
|
this.openDocuments.set(path2, state);
|
|
2504
|
-
this.openByUri.set(state.uri, state);
|
|
2541
|
+
this.openByUri.set(normalizeDocumentUri(state.uri), state);
|
|
2505
2542
|
this.notifyWaiters(state);
|
|
2506
2543
|
await this.sendNotification("textDocument/didOpen", {
|
|
2507
2544
|
textDocument: { uri: state.uri, languageId: state.languageId, version: state.version, text }
|
|
@@ -2526,7 +2563,7 @@ class WorkspaceDocumentState {
|
|
|
2526
2563
|
}
|
|
2527
2564
|
async closeDocument(state) {
|
|
2528
2565
|
this.openDocuments.delete(state.path);
|
|
2529
|
-
this.openByUri.delete(state.uri);
|
|
2566
|
+
this.openByUri.delete(normalizeDocumentUri(state.uri));
|
|
2530
2567
|
this.clearDiagnostics(state.uri);
|
|
2531
2568
|
this.notifyWaiters(state);
|
|
2532
2569
|
await this.sendNotification("textDocument/didClose", { textDocument: { uri: state.uri } });
|
|
@@ -3613,6 +3650,7 @@ class LspClient extends LspClientConnection {
|
|
|
3613
3650
|
this.diagnosticPullErrors = [];
|
|
3614
3651
|
this.diagnosticsFreshnessTimeoutMs = options.diagnosticsFreshnessTimeoutMs ?? DIAGNOSTICS_FRESHNESS_TIMEOUT_MS;
|
|
3615
3652
|
this.documents = new WorkspaceDocumentState((method, params) => this.sendNotification(method, params), (uri) => this.diagnosticsStore.delete(uri), {
|
|
3653
|
+
timerProvider: this.timerProvider,
|
|
3616
3654
|
versionlessPublishQuiescenceMs: options.versionlessPublishQuiescenceMs ?? VERSIONLESS_PUBLISH_QUIESCENCE_MS
|
|
3617
3655
|
});
|
|
3618
3656
|
this.workspaceMutations = new WorkspaceMutationController(root, this.documents);
|
|
@@ -3716,7 +3754,7 @@ class LspClient extends LspClientConnection {
|
|
|
3716
3754
|
const absPath = this.resolveWorkspacePath(filePath);
|
|
3717
3755
|
const uri = pathToFileURL3(absPath).href;
|
|
3718
3756
|
await this.openFile(absPath);
|
|
3719
|
-
const deadlineAt =
|
|
3757
|
+
const deadlineAt = this.timerProvider.now() + this.diagnosticsFreshnessTimeoutMs;
|
|
3720
3758
|
for (;; ) {
|
|
3721
3759
|
signal?.throwIfAborted();
|
|
3722
3760
|
const snapshot = this.documents.captureDiagnosticSnapshot(absPath);
|
|
@@ -3729,7 +3767,7 @@ class LspClient extends LspClientConnection {
|
|
|
3729
3767
|
if (!pushFallbackOnly) {
|
|
3730
3768
|
const cached = this.documents.getPullCache(snapshot);
|
|
3731
3769
|
try {
|
|
3732
|
-
const remainingMs2 = deadlineAt -
|
|
3770
|
+
const remainingMs2 = deadlineAt - this.timerProvider.now();
|
|
3733
3771
|
if (remainingMs2 <= 0)
|
|
3734
3772
|
return this.freshnessTimeout(absPath);
|
|
3735
3773
|
const result = await this.sendRequest("textDocument/diagnostic", {
|
|
@@ -3764,7 +3802,7 @@ class LspClient extends LspClientConnection {
|
|
|
3764
3802
|
}
|
|
3765
3803
|
if (!pushFallbackOnly)
|
|
3766
3804
|
continue;
|
|
3767
|
-
const remainingMs = deadlineAt -
|
|
3805
|
+
const remainingMs = deadlineAt - this.timerProvider.now();
|
|
3768
3806
|
if (remainingMs <= 0) {
|
|
3769
3807
|
if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
|
|
3770
3808
|
const cached = this.documents.getPullCache(snapshot);
|
|
@@ -3924,6 +3962,8 @@ function awaitWithSignal2(promise, signal) {
|
|
|
3924
3962
|
class LspManager {
|
|
3925
3963
|
constructor(options = {}) {
|
|
3926
3964
|
this.clients = new Map;
|
|
3965
|
+
this.pendingStops = new Map;
|
|
3966
|
+
this.respawnBudgets = new Map;
|
|
3927
3967
|
this.reaperHandle = null;
|
|
3928
3968
|
this.signalDisposer = null;
|
|
3929
3969
|
this.disposed = false;
|
|
@@ -3949,17 +3989,52 @@ class LspManager {
|
|
|
3949
3989
|
getKey(root, serverId) {
|
|
3950
3990
|
return `${root}::${serverId}`;
|
|
3951
3991
|
}
|
|
3992
|
+
tombstoneStop(key, client) {
|
|
3993
|
+
const stop = stopClientBestEffort(client);
|
|
3994
|
+
this.pendingStops.set(key, stop);
|
|
3995
|
+
stop.finally(() => {
|
|
3996
|
+
if (this.pendingStops.get(key) === stop) {
|
|
3997
|
+
this.pendingStops.delete(key);
|
|
3998
|
+
}
|
|
3999
|
+
});
|
|
4000
|
+
return stop;
|
|
4001
|
+
}
|
|
4002
|
+
recordDeadGeneration(key) {
|
|
4003
|
+
let budget = this.respawnBudgets.get(key);
|
|
4004
|
+
if (budget === undefined) {
|
|
4005
|
+
budget = { deadGenerations: 0, exhaustedAt: null };
|
|
4006
|
+
this.respawnBudgets.set(key, budget);
|
|
4007
|
+
}
|
|
4008
|
+
budget.deadGenerations += 1;
|
|
4009
|
+
}
|
|
4010
|
+
markHealthyGeneration(key) {
|
|
4011
|
+
this.respawnBudgets.delete(key);
|
|
4012
|
+
}
|
|
4013
|
+
ensureRespawnAllowed(key, root, serverId) {
|
|
4014
|
+
const budget = this.respawnBudgets.get(key);
|
|
4015
|
+
if (budget === undefined || budget.deadGenerations < CLIENT_RESPAWN_RETRY_LIMIT)
|
|
4016
|
+
return;
|
|
4017
|
+
if (budget.exhaustedAt === null) {
|
|
4018
|
+
budget.exhaustedAt = this.now();
|
|
4019
|
+
throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
|
|
4020
|
+
}
|
|
4021
|
+
if (this.now() - budget.exhaustedAt < CLIENT_RESPAWN_COOLDOWN_MS) {
|
|
4022
|
+
throw new LspClientRespawnBudgetExceededError(serverId, root, CLIENT_RESPAWN_RETRY_LIMIT);
|
|
4023
|
+
}
|
|
4024
|
+
budget.deadGenerations = 0;
|
|
4025
|
+
budget.exhaustedAt = null;
|
|
4026
|
+
}
|
|
3952
4027
|
reapStale() {
|
|
3953
4028
|
const t = this.now();
|
|
3954
4029
|
for (const [key, managed] of this.clients) {
|
|
3955
4030
|
if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
|
|
3956
|
-
stopClientBestEffort(managed.client);
|
|
3957
4031
|
this.clients.delete(key);
|
|
4032
|
+
this.tombstoneStop(key, managed.client);
|
|
3958
4033
|
continue;
|
|
3959
4034
|
}
|
|
3960
4035
|
if (!managed.isInitializing && managed.refCount === 0 && managed.pendingWaiters === 0 && t - managed.lastUsedAt > this.idleTimeoutMs) {
|
|
3961
|
-
stopClientBestEffort(managed.client);
|
|
3962
4036
|
this.clients.delete(key);
|
|
4037
|
+
this.tombstoneStop(key, managed.client);
|
|
3963
4038
|
}
|
|
3964
4039
|
}
|
|
3965
4040
|
}
|
|
@@ -3969,7 +4044,7 @@ class LspManager {
|
|
|
3969
4044
|
if (!victim)
|
|
3970
4045
|
return;
|
|
3971
4046
|
this.clients.delete(victim.key);
|
|
3972
|
-
|
|
4047
|
+
this.tombstoneStop(victim.key, victim.managed.client);
|
|
3973
4048
|
}
|
|
3974
4049
|
}
|
|
3975
4050
|
leastRecentlyUsedIdleClient() {
|
|
@@ -3986,7 +4061,7 @@ class LspManager {
|
|
|
3986
4061
|
async tryDeleteIfOrphaned(key, managed) {
|
|
3987
4062
|
if (managed.refCount === 0 && managed.pendingWaiters === 0 && !managed.isInitializing && this.clients.get(key) === managed) {
|
|
3988
4063
|
this.clients.delete(key);
|
|
3989
|
-
await
|
|
4064
|
+
await this.tombstoneStop(key, managed.client);
|
|
3990
4065
|
}
|
|
3991
4066
|
}
|
|
3992
4067
|
async getClient(root, server2, signal) {
|
|
@@ -3995,12 +4070,22 @@ class LspManager {
|
|
|
3995
4070
|
}
|
|
3996
4071
|
signal?.throwIfAborted();
|
|
3997
4072
|
const key = this.getKey(root, server2.id);
|
|
4073
|
+
for (;; ) {
|
|
4074
|
+
const pendingStop = this.pendingStops.get(key);
|
|
4075
|
+
if (pendingStop === undefined)
|
|
4076
|
+
break;
|
|
4077
|
+
await awaitWithSignal2(pendingStop, signal);
|
|
4078
|
+
signal?.throwIfAborted();
|
|
4079
|
+
}
|
|
4080
|
+
if (this.disposed) {
|
|
4081
|
+
throw new Error("LspManager has been disposed");
|
|
4082
|
+
}
|
|
3998
4083
|
let managed = this.clients.get(key);
|
|
3999
4084
|
if (managed) {
|
|
4000
4085
|
const t = this.now();
|
|
4001
4086
|
if (managed.isInitializing && managed.initializingSince !== null && t - managed.initializingSince > this.initTimeoutMs) {
|
|
4002
|
-
await stopClientBestEffort(managed.client);
|
|
4003
4087
|
this.clients.delete(key);
|
|
4088
|
+
await this.tombstoneStop(key, managed.client);
|
|
4004
4089
|
managed = undefined;
|
|
4005
4090
|
}
|
|
4006
4091
|
}
|
|
@@ -4021,15 +4106,20 @@ class LspManager {
|
|
|
4021
4106
|
signal.throwIfAborted();
|
|
4022
4107
|
}
|
|
4023
4108
|
if (!managed.client.isAlive()) {
|
|
4024
|
-
|
|
4025
|
-
this.clients.
|
|
4109
|
+
this.recordDeadGeneration(key);
|
|
4110
|
+
if (this.clients.get(key) === managed) {
|
|
4111
|
+
this.clients.delete(key);
|
|
4112
|
+
}
|
|
4113
|
+
await this.tombstoneStop(key, managed.client);
|
|
4026
4114
|
return this.getClient(root, server2, signal);
|
|
4027
4115
|
}
|
|
4116
|
+
this.markHealthyGeneration(key);
|
|
4028
4117
|
managed.refCount++;
|
|
4029
4118
|
managed.lastUsedAt = this.now();
|
|
4030
4119
|
return managed.client;
|
|
4031
4120
|
}
|
|
4032
4121
|
this.evictForAdmission();
|
|
4122
|
+
this.ensureRespawnAllowed(key, root, server2.id);
|
|
4033
4123
|
const client = this.clientFactory(root, server2);
|
|
4034
4124
|
const initStartedAt = this.now();
|
|
4035
4125
|
const initPromise = (async () => {
|
|
@@ -4053,7 +4143,7 @@ class LspManager {
|
|
|
4053
4143
|
if (this.clients.get(key) === newManaged) {
|
|
4054
4144
|
this.clients.delete(key);
|
|
4055
4145
|
}
|
|
4056
|
-
await
|
|
4146
|
+
await this.tombstoneStop(key, client);
|
|
4057
4147
|
throw err;
|
|
4058
4148
|
}
|
|
4059
4149
|
newManaged.pendingWaiters--;
|
|
@@ -4064,6 +4154,15 @@ class LspManager {
|
|
|
4064
4154
|
await this.tryDeleteIfOrphaned(key, newManaged);
|
|
4065
4155
|
signal.throwIfAborted();
|
|
4066
4156
|
}
|
|
4157
|
+
if (!client.isAlive()) {
|
|
4158
|
+
this.recordDeadGeneration(key);
|
|
4159
|
+
if (this.clients.get(key) === newManaged) {
|
|
4160
|
+
this.clients.delete(key);
|
|
4161
|
+
}
|
|
4162
|
+
await this.tombstoneStop(key, client);
|
|
4163
|
+
return this.getClient(root, server2, signal);
|
|
4164
|
+
}
|
|
4165
|
+
this.markHealthyGeneration(key);
|
|
4067
4166
|
newManaged.refCount++;
|
|
4068
4167
|
newManaged.lastUsedAt = this.now();
|
|
4069
4168
|
return client;
|
|
@@ -4084,15 +4183,20 @@ class LspManager {
|
|
|
4084
4183
|
if (client && managed.client !== client)
|
|
4085
4184
|
return;
|
|
4086
4185
|
this.clients.delete(key);
|
|
4087
|
-
|
|
4186
|
+
this.tombstoneStop(key, managed.client);
|
|
4088
4187
|
}
|
|
4089
4188
|
warmupClient(root, server2) {
|
|
4090
4189
|
if (this.disposed)
|
|
4091
4190
|
return;
|
|
4092
4191
|
const key = this.getKey(root, server2.id);
|
|
4093
|
-
if (this.clients.has(key))
|
|
4192
|
+
if (this.clients.has(key) || this.pendingStops.has(key))
|
|
4094
4193
|
return;
|
|
4095
4194
|
this.evictForAdmission();
|
|
4195
|
+
try {
|
|
4196
|
+
this.ensureRespawnAllowed(key, root, server2.id);
|
|
4197
|
+
} catch {
|
|
4198
|
+
return;
|
|
4199
|
+
}
|
|
4096
4200
|
const client = this.clientFactory(root, server2);
|
|
4097
4201
|
const initStartedAt = this.now();
|
|
4098
4202
|
const initPromise = (async () => {
|
|
@@ -4118,7 +4222,7 @@ class LspManager {
|
|
|
4118
4222
|
if (this.clients.get(key) === managed) {
|
|
4119
4223
|
this.clients.delete(key);
|
|
4120
4224
|
}
|
|
4121
|
-
|
|
4225
|
+
this.tombstoneStop(key, client);
|
|
4122
4226
|
});
|
|
4123
4227
|
}
|
|
4124
4228
|
isServerInitializing(root, serverId) {
|
|
@@ -4162,8 +4266,11 @@ class LspManager {
|
|
|
4162
4266
|
for (const managed of this.clients.values()) {
|
|
4163
4267
|
stopPromises.push(stopClientBestEffort(managed.client));
|
|
4164
4268
|
}
|
|
4269
|
+
const tombstonedStops = [...this.pendingStops.values()];
|
|
4165
4270
|
this.clients.clear();
|
|
4166
|
-
|
|
4271
|
+
this.respawnBudgets.clear();
|
|
4272
|
+
await Promise.allSettled([...stopPromises, ...tombstonedStops]);
|
|
4273
|
+
this.pendingStops.clear();
|
|
4167
4274
|
}
|
|
4168
4275
|
}
|
|
4169
4276
|
var _defaultInstance = null;
|
|
@@ -4186,7 +4293,16 @@ import { existsSync as existsSync7, realpathSync as realpathSync4 } from "node:f
|
|
|
4186
4293
|
import { dirname as dirname7, join as join3 } from "node:path";
|
|
4187
4294
|
|
|
4188
4295
|
// ../lsp-core/src/lsp/workspace-markers.ts
|
|
4189
|
-
var
|
|
4296
|
+
var GIT_WORKSPACE_MARKER = ".git";
|
|
4297
|
+
var PROJECT_WORKSPACE_MARKERS = [
|
|
4298
|
+
"package.json",
|
|
4299
|
+
"pyproject.toml",
|
|
4300
|
+
"Cargo.toml",
|
|
4301
|
+
"go.mod",
|
|
4302
|
+
"pom.xml",
|
|
4303
|
+
"build.gradle"
|
|
4304
|
+
];
|
|
4305
|
+
var WORKSPACE_MARKERS = [GIT_WORKSPACE_MARKER, ...PROJECT_WORKSPACE_MARKERS];
|
|
4190
4306
|
|
|
4191
4307
|
// ../lsp-core/src/lsp/outside-context-workspace.ts
|
|
4192
4308
|
function findWorkspaceRootOutsideContext(directory) {
|
|
@@ -4875,20 +4991,25 @@ function findWorkspaceRoot(filePath) {
|
|
|
4875
4991
|
if (!isPathInside(cwd, abs))
|
|
4876
4992
|
return findWorkspaceRootOutsideContext(dir);
|
|
4877
4993
|
const fallbackRoot = nearestExistingDirectoryInsideContext(dir, cwd) ?? cwd;
|
|
4994
|
+
let nearestPackageRoot;
|
|
4878
4995
|
while (isPathInside(cwd, dir)) {
|
|
4879
4996
|
const canonicalDir = existingDirectoryInsideContext(dir, cwd);
|
|
4880
4997
|
if (canonicalDir !== undefined) {
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4998
|
+
if (existsSync11(join5(dir, GIT_WORKSPACE_MARKER))) {
|
|
4999
|
+
return canonicalDir;
|
|
5000
|
+
}
|
|
5001
|
+
if (nearestPackageRoot === undefined && hasProjectWorkspaceMarker(dir)) {
|
|
5002
|
+
nearestPackageRoot = canonicalDir;
|
|
4885
5003
|
}
|
|
4886
5004
|
}
|
|
4887
5005
|
if (dir === cwd)
|
|
4888
5006
|
break;
|
|
4889
5007
|
dir = dirname10(dir);
|
|
4890
5008
|
}
|
|
4891
|
-
return fallbackRoot;
|
|
5009
|
+
return nearestPackageRoot ?? fallbackRoot;
|
|
5010
|
+
}
|
|
5011
|
+
function hasProjectWorkspaceMarker(directory) {
|
|
5012
|
+
return PROJECT_WORKSPACE_MARKERS.some((marker) => existsSync11(join5(directory, marker)));
|
|
4892
5013
|
}
|
|
4893
5014
|
function resolveReadablePathInsideContext(filePath) {
|
|
4894
5015
|
const cwd = contextCwd();
|