oh-my-opencode 4.10.0 → 4.11.0
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/skills/codex-qa/SKILL.md +96 -0
- package/.agents/skills/codex-qa/references/app-server.md +63 -0
- package/.agents/skills/codex-qa/references/components-hooks.md +38 -0
- package/.agents/skills/codex-qa/references/docker-qa.md +62 -0
- package/.agents/skills/codex-qa/references/install-verify.md +57 -0
- package/.agents/skills/codex-qa/references/isolation.md +57 -0
- package/.agents/skills/codex-qa/references/logging-debug.md +60 -0
- package/.agents/skills/codex-qa/scripts/app-server-drive.sh +76 -0
- package/.agents/skills/codex-qa/scripts/hook-unit-probe.sh +69 -0
- package/.agents/skills/codex-qa/scripts/install-verify.sh +60 -0
- package/.agents/skills/codex-qa/scripts/lib/app-server-client.mjs +117 -0
- package/.agents/skills/codex-qa/scripts/lib/common.sh +180 -0
- package/.agents/skills/codex-qa/scripts/lib/mock-model.mjs +56 -0
- package/.agents/skills/codex-qa/scripts/tui-smoke.sh +71 -0
- package/.agents/skills/opencode-qa/SKILL.md +8 -1
- package/.agents/skills/opencode-qa/references/docker-qa.md +72 -0
- package/.agents/skills/tech-debt-audit/SKILL.md +14 -14
- package/.agents/skills/work-with-pr/SKILL.md +77 -53
- package/.opencode/skills/work-with-pr/SKILL.md +79 -55
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +2 -2
- package/README.ru.md +3 -3
- package/README.zh-cn.md +3 -3
- package/THIRD-PARTY-NOTICES.md +205 -0
- package/dist/agents/dynamic-agent-prompt-types.d.ts +1 -1
- package/dist/agents/index.d.ts +0 -1
- package/dist/agents/prometheus/index.d.ts +0 -1
- package/dist/agents/prometheus/system-prompt.d.ts +0 -2
- package/dist/cli/config-manager/add-tui-plugin-to-tui-config.d.ts +7 -0
- package/dist/cli/doctor/checks/codex-components.d.ts +4 -4
- package/dist/cli/doctor/checks/codex-runtime-wrapper.d.ts +7 -0
- package/dist/cli/doctor/checks/codex.d.ts +1 -1
- package/dist/cli/doctor/checks/config.d.ts +1 -1
- package/dist/cli/doctor/checks/dependencies.d.ts +1 -2
- package/dist/cli/doctor/checks/index.d.ts +1 -1
- package/dist/cli/doctor/checks/model-resolution.d.ts +1 -1
- package/dist/cli/doctor/checks/system.d.ts +1 -1
- package/dist/cli/doctor/checks/team-mode.d.ts +1 -1
- package/dist/cli/doctor/checks/tools-gh.d.ts +1 -1
- package/dist/cli/doctor/checks/tools-mcp.d.ts +1 -1
- package/dist/cli/doctor/checks/tools.d.ts +2 -1
- package/dist/cli/doctor/checks/tui-plugin-config.d.ts +7 -1
- package/dist/cli/doctor/framework/constants.d.ts +32 -0
- package/dist/cli/doctor/framework/spawn-with-timeout.d.ts +8 -0
- package/dist/cli/doctor/framework/types.d.ts +147 -0
- package/dist/cli/doctor/index.d.ts +4 -4
- package/dist/cli/doctor/runner.d.ts +1 -1
- package/dist/cli/index.js +9717 -7523
- package/dist/cli/install-ast-grep-sg.d.ts +10 -0
- package/dist/cli/install-codex/codex-cache-bins.d.ts +1 -21
- package/dist/cli/install-codex/codex-cache-bundled-mcps.d.ts +1 -5
- package/dist/cli/install-codex/codex-cache-command-shim.d.ts +1 -1
- package/dist/cli/install-codex/codex-cache-fs.d.ts +1 -3
- package/dist/cli/install-codex/codex-cache-install.d.ts +1 -13
- package/dist/cli/install-codex/codex-cache-legacy-bins.d.ts +1 -3
- package/dist/cli/install-codex/codex-cache-local-dependencies.d.ts +1 -1
- package/dist/cli/install-codex/codex-cache-mcp-manifest.d.ts +1 -2
- package/dist/cli/install-codex/codex-cache-paths.d.ts +1 -2
- package/dist/cli/install-codex/codex-cache-prune.d.ts +1 -10
- package/dist/cli/install-codex/codex-cache.d.ts +1 -4
- package/dist/cli/install-codex/codex-cached-marketplace-manifest.d.ts +1 -6
- package/dist/cli/install-codex/codex-cleanup-config.d.ts +1 -6
- package/dist/cli/install-codex/codex-cleanup.d.ts +1 -25
- package/dist/cli/install-codex/codex-config-agents.d.ts +1 -3
- package/dist/cli/install-codex/codex-config-features.d.ts +1 -1
- package/dist/cli/install-codex/codex-config-marketplaces.d.ts +1 -6
- package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
- package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -9
- package/dist/cli/install-codex/codex-config-reasoning.d.ts +1 -2
- package/dist/cli/install-codex/codex-config-toml-sections.d.ts +1 -9
- package/dist/cli/install-codex/codex-config-toml.d.ts +1 -13
- package/dist/cli/install-codex/codex-hook-trust.d.ts +1 -6
- package/dist/cli/install-codex/codex-installation-detection.d.ts +1 -36
- package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +1 -8
- package/dist/cli/install-codex/codex-marketplace-snapshot.d.ts +1 -15
- package/dist/cli/install-codex/codex-marketplace.d.ts +1 -9
- package/dist/cli/install-codex/codex-model-catalog.d.ts +1 -13
- package/dist/cli/install-codex/codex-multi-agent-v2-config.d.ts +1 -12
- package/dist/cli/install-codex/codex-package-layout.d.ts +1 -1
- package/dist/cli/install-codex/codex-process.d.ts +1 -7
- package/dist/cli/install-codex/codex-project-local-cleanup-best-effort.d.ts +1 -7
- package/dist/cli/install-codex/codex-project-local-cleanup.d.ts +1 -35
- package/dist/cli/install-codex/git-bash.d.ts +1 -35
- package/dist/cli/install-codex/index.d.ts +1 -11
- package/dist/cli/install-codex/install-codex.d.ts +1 -10
- package/dist/cli/install-codex/lazycodex-version-stamp.d.ts +1 -19
- package/dist/cli/install-codex/link-cached-plugin-agents.d.ts +1 -20
- package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +1 -5
- package/dist/cli/install-codex/toml-section-editor.d.ts +1 -11
- package/dist/cli/install-codex/types.d.ts +1 -76
- package/dist/cli/mcp-oauth/login.d.ts +1 -1
- package/dist/cli-node/index.js +9774 -7525
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema/agent-names.d.ts +1 -1
- package/dist/config/schema/codegraph.d.ts +9 -0
- package/dist/config/schema/git-env-prefix.d.ts +1 -5
- package/dist/config/schema/hooks.d.ts +3 -0
- package/dist/config/schema/monitor.d.ts +15 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +27 -16
- package/dist/config/schema/openclaw.d.ts +5 -4
- package/dist/config/schema/team-mode.d.ts +1 -16
- package/dist/config/schema/tmux.d.ts +4 -5
- package/dist/config/schema/tui.d.ts +10 -0
- package/dist/config/schema.d.ts +2 -0
- package/dist/config/validate.d.ts +8 -0
- package/dist/create-hooks.d.ts +5 -0
- package/dist/create-managers.d.ts +7 -0
- package/dist/create-runtime-tmux-config.d.ts +1 -1
- package/dist/create-tools.d.ts +1 -1
- package/dist/features/background-agent/error-classifier.d.ts +2 -2
- package/dist/features/background-agent/manager.d.ts +29 -2
- package/dist/features/background-agent/parent-wake-dispatched-tracker.d.ts +8 -0
- package/dist/features/background-agent/parent-wake-notifier.d.ts +4 -0
- package/dist/features/background-agent/spawner/fallback-agent.d.ts +3 -2
- package/dist/features/background-agent/spawner/task-prompt-body.d.ts +5 -6
- package/dist/features/background-agent/task-snapshot.d.ts +2 -0
- package/dist/features/background-agent/types.d.ts +7 -0
- package/dist/features/builtin-commands/templates/refactor-sections/intro-and-analysis.d.ts +1 -1
- package/dist/features/builtin-commands/templates/refactor-sections/plan-and-execution.d.ts +1 -1
- package/dist/features/builtin-commands/templates/refactor-sections/team-mode-addendum.d.ts +1 -1
- package/dist/features/builtin-commands/templates/refactor-sections/verification-and-tooling.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
- package/dist/features/builtin-skills/index.d.ts +1 -2
- package/dist/features/builtin-skills/skill-file-loader.d.ts +1 -4
- package/dist/features/builtin-skills/skills/agent-browser-skill.d.ts +1 -2
- package/dist/features/builtin-skills/skills/agent-browser-template.d.ts +1 -2
- package/dist/features/builtin-skills/skills/debugging.d.ts +1 -2
- package/dist/features/builtin-skills/skills/dev-browser.d.ts +1 -2
- package/dist/features/builtin-skills/skills/frontend.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/commit-atomic-planning.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-context-analysis.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-execution-verification.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
- package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +1 -2
- package/dist/features/builtin-skills/skills/git-master.d.ts +1 -2
- package/dist/features/builtin-skills/skills/index.d.ts +1 -13
- package/dist/features/builtin-skills/skills/init-deep.d.ts +1 -2
- package/dist/features/builtin-skills/skills/playwright-cli.d.ts +1 -10
- package/dist/features/builtin-skills/skills/playwright-mcp-skill.d.ts +1 -2
- package/dist/features/builtin-skills/skills/playwright.d.ts +1 -2
- package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +1 -2
- package/dist/features/builtin-skills/skills/review-work.d.ts +1 -2
- package/dist/features/builtin-skills/skills/security-research.d.ts +1 -2
- package/dist/features/builtin-skills/skills/security-review.d.ts +1 -2
- package/dist/features/builtin-skills/skills/team-mode.d.ts +1 -2
- package/dist/features/builtin-skills/skills/visual-qa.d.ts +1 -2
- package/dist/features/builtin-skills/skills.d.ts +1 -12
- package/dist/features/builtin-skills/types.d.ts +1 -15
- package/dist/features/claude-code-agent-loader/agent-definitions-loader.d.ts +1 -3
- package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +1 -4
- package/dist/features/claude-code-agent-loader/index.d.ts +1 -5
- package/dist/features/claude-code-agent-loader/json-agent-loader.d.ts +1 -2
- package/dist/features/claude-code-agent-loader/loader.d.ts +1 -5
- package/dist/features/claude-code-agent-loader/opencode-config-agents-reader.d.ts +1 -2
- package/dist/features/claude-code-agent-loader/types.d.ts +1 -29
- package/dist/features/claude-code-command-loader/index.d.ts +1 -2
- package/dist/features/claude-code-command-loader/loader-cache.d.ts +1 -6
- package/dist/features/claude-code-command-loader/loader.d.ts +1 -8
- package/dist/features/claude-code-command-loader/types.d.ts +1 -42
- package/dist/features/claude-code-mcp-loader/configure-allowed-env-vars.d.ts +1 -5
- package/dist/features/claude-code-mcp-loader/index.d.ts +1 -11
- package/dist/features/claude-code-mcp-loader/loader.d.ts +1 -4
- package/dist/features/claude-code-mcp-loader/scope-filter.d.ts +1 -2
- package/dist/features/claude-code-mcp-loader/transformer.d.ts +1 -2
- package/dist/features/claude-code-mcp-loader/types.d.ts +1 -43
- package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/command-loader.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/discovery-core.d.ts +1 -2
- package/dist/features/claude-code-plugin-loader/discovery-paths.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +1 -2
- package/dist/features/claude-code-plugin-loader/index.d.ts +1 -10
- package/dist/features/claude-code-plugin-loader/install-path-resolver.d.ts +1 -1
- package/dist/features/claude-code-plugin-loader/installed-plugin-database.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/loaded-plugin.d.ts +1 -2
- package/dist/features/claude-code-plugin-loader/loader.d.ts +1 -36
- package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/plugin-key.d.ts +1 -1
- package/dist/features/claude-code-plugin-loader/plugin-manifest.d.ts +1 -4
- package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +1 -2
- package/dist/features/claude-code-plugin-loader/plugin-settings.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +1 -2
- package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +1 -3
- package/dist/features/claude-code-plugin-loader/types.d.ts +1 -240
- package/dist/features/claude-tasks/types.d.ts +4 -4
- package/dist/features/hook-message-injector/sdk-message-lookup.d.ts +9 -2
- package/dist/features/mcp-oauth/callback-server.d.ts +1 -19
- package/dist/features/mcp-oauth/dcr.d.ts +1 -34
- package/dist/features/mcp-oauth/discovery.d.ts +1 -8
- package/dist/features/mcp-oauth/oauth-authorization-flow.d.ts +1 -26
- package/dist/features/mcp-oauth/provider.d.ts +1 -30
- package/dist/features/mcp-oauth/refresh-mutex.d.ts +1 -26
- package/dist/features/mcp-oauth/resource-indicator.d.ts +1 -0
- package/dist/features/mcp-oauth/schema.d.ts +1 -0
- package/dist/features/mcp-oauth/step-up.d.ts +1 -8
- package/dist/features/mcp-oauth/storage.d.ts +1 -17
- package/dist/features/monitor/batcher.d.ts +36 -0
- package/dist/features/monitor/envelope.d.ts +9 -0
- package/dist/features/monitor/filter.d.ts +10 -0
- package/dist/features/monitor/index.d.ts +2 -0
- package/dist/features/monitor/line-stream.d.ts +29 -0
- package/dist/features/monitor/manager-internals.d.ts +65 -0
- package/dist/features/monitor/manager.d.ts +35 -0
- package/dist/features/monitor/monitor-state-factory.d.ts +24 -0
- package/dist/features/monitor/output-injector-session-inspect.d.ts +9 -0
- package/dist/features/monitor/output-injector-types.d.ts +48 -0
- package/dist/features/monitor/output-injector.d.ts +21 -0
- package/dist/features/monitor/permission.d.ts +33 -0
- package/dist/features/monitor/pipeline.d.ts +26 -0
- package/dist/features/monitor/process.d.ts +21 -0
- package/dist/features/monitor/ring-buffer.d.ts +25 -0
- package/dist/features/monitor/types.d.ts +83 -0
- package/dist/features/opencode-runtime-skills/index.d.ts +1 -2
- package/dist/features/opencode-runtime-skills/runtime-skill-config.d.ts +1 -17
- package/dist/features/opencode-runtime-skills/skill-markdown.d.ts +1 -7
- package/dist/features/opencode-runtime-skills/source-server.d.ts +1 -24
- package/dist/features/opencode-skill-loader/allowed-tools-parser.d.ts +1 -1
- package/dist/features/opencode-skill-loader/config-source-discovery.d.ts +1 -7
- package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -20
- package/dist/features/opencode-skill-loader/index.d.ts +1 -16
- package/dist/features/opencode-skill-loader/loaded-skill-from-path.d.ts +1 -9
- package/dist/features/opencode-skill-loader/loaded-skill-template-extractor.d.ts +1 -2
- package/dist/features/opencode-skill-loader/loader.d.ts +1 -21
- package/dist/features/opencode-skill-loader/merger/builtin-skill-converter.d.ts +1 -3
- package/dist/features/opencode-skill-loader/merger/config-skill-entry-loader.d.ts +1 -3
- package/dist/features/opencode-skill-loader/merger/scope-priority.d.ts +1 -2
- package/dist/features/opencode-skill-loader/merger/skill-definition-merger.d.ts +1 -3
- package/dist/features/opencode-skill-loader/merger/skills-config-normalizer.d.ts +1 -11
- package/dist/features/opencode-skill-loader/merger.d.ts +1 -7
- package/dist/features/opencode-skill-loader/opencode-config-skills-reader.d.ts +1 -5
- package/dist/features/opencode-skill-loader/skill-content.d.ts +1 -5
- package/dist/features/opencode-skill-loader/skill-deduplication.d.ts +1 -2
- package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +1 -5
- package/dist/features/opencode-skill-loader/skill-directory-loader.d.ts +1 -8
- package/dist/features/opencode-skill-loader/skill-discovery.d.ts +1 -4
- package/dist/features/opencode-skill-loader/skill-mcp-config.d.ts +1 -3
- package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -9
- package/dist/features/opencode-skill-loader/skill-template-resolver.d.ts +1 -11
- package/dist/features/opencode-skill-loader/types.d.ts +1 -34
- package/dist/features/skill-mcp-manager/cleanup.d.ts +1 -8
- package/dist/features/skill-mcp-manager/connection-type.d.ts +1 -7
- package/dist/features/skill-mcp-manager/connection.d.ts +1 -14
- package/dist/features/skill-mcp-manager/env-cleaner.d.ts +1 -2
- package/dist/features/skill-mcp-manager/error-redaction.d.ts +1 -10
- package/dist/features/skill-mcp-manager/http-client.d.ts +1 -19
- package/dist/features/skill-mcp-manager/index.d.ts +1 -2
- package/dist/features/skill-mcp-manager/manager.d.ts +1 -27
- package/dist/features/skill-mcp-manager/oauth-handler.d.ts +1 -17
- package/dist/features/skill-mcp-manager/stdio-client.d.ts +1 -16
- package/dist/features/skill-mcp-manager/types.d.ts +1 -79
- package/dist/features/team-mode/member-parser.d.ts +1 -16
- package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +1 -4
- package/dist/features/team-mode/team-layout-tmux/index.d.ts +1 -1
- package/dist/features/team-mode/team-layout-tmux/layout.d.ts +1 -37
- package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +1 -9
- package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +1 -9
- package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +1 -8
- package/dist/features/team-mode/team-mailbox/ack.d.ts +1 -2
- package/dist/features/team-mode/team-mailbox/inbox.d.ts +1 -3
- package/dist/features/team-mode/team-mailbox/index.d.ts +1 -7
- package/dist/features/team-mode/team-mailbox/pending-delivery-recovery.d.ts +1 -31
- package/dist/features/team-mode/team-mailbox/poll.d.ts +1 -10
- package/dist/features/team-mode/team-mailbox/reservation.d.ts +1 -11
- package/dist/features/team-mode/team-mailbox/send.d.ts +1 -30
- package/dist/features/team-mode/team-registry/index.d.ts +1 -3
- package/dist/features/team-mode/team-registry/loader.d.ts +1 -12
- package/dist/features/team-mode/team-registry/paths.d.ts +1 -28
- package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +1 -6
- package/dist/features/team-mode/team-registry/validator.d.ts +1 -10
- package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +1 -1
- package/dist/features/team-mode/team-state-store/active-resume.d.ts +1 -5
- package/dist/features/team-mode/team-state-store/creating-resume.d.ts +1 -4
- package/dist/features/team-mode/team-state-store/deleting-resume.d.ts +1 -4
- package/dist/features/team-mode/team-state-store/error-normalization.d.ts +1 -2
- package/dist/features/team-mode/team-state-store/index.d.ts +1 -1
- package/dist/features/team-mode/team-state-store/locks.d.ts +1 -15
- package/dist/features/team-mode/team-state-store/reservation-reconciliation.d.ts +1 -4
- package/dist/features/team-mode/team-state-store/resume-report.d.ts +1 -7
- package/dist/features/team-mode/team-state-store/resume.d.ts +1 -5
- package/dist/features/team-mode/team-state-store/runtime-cleanup.d.ts +1 -4
- package/dist/features/team-mode/team-state-store/session-liveness.d.ts +1 -9
- package/dist/features/team-mode/team-state-store/store.d.ts +1 -21
- package/dist/features/team-mode/team-state-store/worker-resume-status.d.ts +1 -9
- package/dist/features/team-mode/team-tasklist/claim.d.ts +1 -10
- package/dist/features/team-mode/team-tasklist/dependencies.d.ts +1 -2
- package/dist/features/team-mode/team-tasklist/get.d.ts +1 -3
- package/dist/features/team-mode/team-tasklist/index.d.ts +1 -6
- package/dist/features/team-mode/team-tasklist/list.d.ts +1 -8
- package/dist/features/team-mode/team-tasklist/store.d.ts +1 -3
- package/dist/features/team-mode/team-tasklist/test-support.d.ts +1 -9
- package/dist/features/team-mode/team-tasklist/update.d.ts +1 -9
- package/dist/features/team-mode/team-worktree/cleanup.d.ts +1 -3
- package/dist/features/team-mode/team-worktree/index.d.ts +1 -2
- package/dist/features/team-mode/team-worktree/manager.d.ts +1 -15
- package/dist/features/team-mode/tools/lifecycle-create-tool.d.ts +2 -2
- package/dist/features/team-mode/tools/lifecycle-inline-spec.d.ts +2 -2
- package/dist/features/team-mode/tools/lifecycle-participant.d.ts +2 -2
- package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +8 -8
- package/dist/features/team-mode/tools/messaging-live-delivery-recipient.d.ts +2 -2
- package/dist/features/team-mode/tools/messaging-live-delivery-reservation.d.ts +1 -1
- package/dist/features/team-mode/tools/messaging-live-delivery-state.d.ts +1 -1
- package/dist/features/team-mode/tools/messaging-live-delivery.d.ts +1 -1
- package/dist/features/team-mode/tools/messaging-runtime.d.ts +2 -2
- package/dist/features/team-mode/tools/query.d.ts +3 -3
- package/dist/features/team-mode/tools/tasks.d.ts +2 -2
- package/dist/features/team-mode/types.d.ts +1 -343
- package/dist/features/tui-sidebar/compute-view.d.ts +10 -0
- package/dist/features/tui-sidebar/config-validator.d.ts +2 -0
- package/dist/features/tui-sidebar/constants.d.ts +10 -0
- package/dist/features/tui-sidebar/derivers.d.ts +10 -0
- package/dist/features/tui-sidebar/element-helpers.d.ts +9 -0
- package/dist/features/tui-sidebar/loop-reader.d.ts +2 -0
- package/dist/features/tui-sidebar/mirror-io.d.ts +3 -0
- package/dist/features/tui-sidebar/mirror-manager.d.ts +28 -0
- package/dist/features/tui-sidebar/mirror-path.d.ts +3 -0
- package/dist/features/tui-sidebar/render-view.d.ts +15 -0
- package/dist/features/tui-sidebar/roster-resolver.d.ts +2 -0
- package/dist/features/tui-sidebar/snapshot-builder.d.ts +28 -0
- package/dist/features/tui-sidebar/snapshot-schema.d.ts +41 -0
- package/dist/features/tui-sidebar/state-types.d.ts +72 -0
- package/dist/hooks/ast-grep-sg-provision/hook.d.ts +19 -0
- package/dist/hooks/ast-grep-sg-provision/index.d.ts +1 -0
- package/dist/hooks/auto-slash-command/constants.d.ts +1 -5
- package/dist/hooks/auto-slash-command/detector.d.ts +1 -15
- package/dist/hooks/auto-slash-command/processed-command-store.d.ts +1 -7
- package/dist/hooks/auto-slash-command/types.d.ts +1 -48
- package/dist/hooks/auto-update-checker/constants.d.ts +3 -3
- package/dist/hooks/codegraph-bootstrap/command-runner.d.ts +16 -0
- package/dist/hooks/codegraph-bootstrap/hook.d.ts +34 -0
- package/dist/hooks/codegraph-bootstrap/index.d.ts +1 -0
- package/dist/hooks/codegraph-bootstrap/project-root.d.ts +1 -0
- package/dist/hooks/codegraph-bootstrap/status.d.ts +11 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +1 -2
- package/dist/hooks/delegate-task-retry/patterns.d.ts +2 -11
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/monitor-status-injector/hook.d.ts +30 -0
- package/dist/hooks/monitor-status-injector/index.d.ts +2 -0
- package/dist/hooks/runtime-fallback/auto-retry-signal.d.ts +1 -4
- package/dist/hooks/runtime-fallback/error-classifier.d.ts +7 -6
- package/dist/hooks/runtime-fallback/fallback-state.d.ts +3 -2
- package/dist/hooks/runtime-fallback/test-timeout-clock.test-support.d.ts +6 -0
- package/dist/hooks/tool-pair-validator/tool-part-ids.d.ts +2 -1
- package/dist/index.js +89513 -95172
- package/dist/interactive-bash-availability.d.ts +1 -0
- package/dist/mcp/codegraph.d.ts +16 -0
- package/dist/mcp/index.d.ts +10 -2
- package/dist/mcp/shared/ancestor-cli-resolver.d.ts +25 -0
- package/dist/mcp/types.d.ts +1 -1
- package/dist/oh-my-opencode.schema.json +139 -16
- package/dist/openclaw/config.d.ts +1 -8
- package/dist/openclaw/daemon.d.ts +1 -1
- package/dist/openclaw/dispatcher.d.ts +1 -12
- package/dist/openclaw/gateway-url-validation.d.ts +1 -1
- package/dist/openclaw/index.d.ts +1 -5
- package/dist/openclaw/reply-listener-discord.d.ts +1 -4
- package/dist/openclaw/reply-listener-injection.d.ts +1 -10
- package/dist/openclaw/reply-listener-log.d.ts +1 -2
- package/dist/openclaw/reply-listener-paths.d.ts +1 -7
- package/dist/openclaw/reply-listener-poll-loop.d.ts +1 -3
- package/dist/openclaw/reply-listener-process.d.ts +1 -4
- package/dist/openclaw/reply-listener-signature.d.ts +1 -2
- package/dist/openclaw/reply-listener-sleep.d.ts +1 -1
- package/dist/openclaw/reply-listener-spawn.d.ts +1 -5
- package/dist/openclaw/reply-listener-start.d.ts +1 -9
- package/dist/openclaw/reply-listener-startup.d.ts +1 -12
- package/dist/openclaw/reply-listener-state.d.ts +1 -29
- package/dist/openclaw/reply-listener-status.d.ts +1 -4
- package/dist/openclaw/reply-listener-stop.d.ts +1 -7
- package/dist/openclaw/reply-listener-telegram.d.ts +1 -4
- package/dist/openclaw/reply-listener.d.ts +1 -5
- package/dist/openclaw/runtime-dispatch.d.ts +1 -17
- package/dist/openclaw/session-registry-lock.d.ts +1 -2
- package/dist/openclaw/session-registry-paths.d.ts +1 -9
- package/dist/openclaw/session-registry-storage.d.ts +1 -4
- package/dist/openclaw/session-registry-types.d.ts +1 -11
- package/dist/openclaw/session-registry.d.ts +1 -8
- package/dist/openclaw/tmux.d.ts +1 -8
- package/dist/openclaw/types.d.ts +1 -42
- package/dist/plugin/event-error-utils.d.ts +2 -1
- package/dist/plugin/hooks/create-core-hooks.d.ts +5 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +3 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +4 -1
- package/dist/plugin/messages-transform.d.ts +1 -0
- package/dist/plugin/skill-context.d.ts +2 -0
- package/dist/plugin/tool-registry-factories.d.ts +2 -1
- package/dist/plugin/tool-registry-gated-tools.d.ts +7 -0
- package/dist/plugin/tool-registry.d.ts +1 -1
- package/dist/plugin/types.d.ts +2 -9
- package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -0
- package/dist/shared/archive-entry-validator.d.ts +1 -6
- package/dist/shared/bun-file-shim.d.ts +1 -8
- package/dist/shared/bun-spawn-shim.d.ts +1 -43
- package/dist/shared/bun-which-shim.d.ts +1 -1
- package/dist/shared/classify-path-environment.d.ts +1 -3
- package/dist/shared/command-executor/embedded-commands.d.ts +1 -7
- package/dist/shared/command-executor/execute-command.d.ts +1 -1
- package/dist/shared/command-executor/execute-hook-command.d.ts +1 -23
- package/dist/shared/command-executor/home-directory.d.ts +1 -1
- package/dist/shared/command-executor/resolve-commands-in-text.d.ts +1 -1
- package/dist/shared/command-executor/shell-path.d.ts +1 -2
- package/dist/shared/command-executor.d.ts +1 -4
- package/dist/shared/git-worktree/collect-git-diff-stats.d.ts +1 -2
- package/dist/shared/git-worktree/format-file-changes.d.ts +1 -2
- package/dist/shared/git-worktree/index.d.ts +1 -7
- package/dist/shared/git-worktree/parse-diff-numstat.d.ts +1 -2
- package/dist/shared/git-worktree/parse-status-porcelain-line.d.ts +1 -6
- package/dist/shared/git-worktree/parse-status-porcelain.d.ts +1 -2
- package/dist/shared/git-worktree/types.d.ts +1 -7
- package/dist/shared/internal-initiator-marker.d.ts +1 -46
- package/dist/shared/logger.d.ts +3 -11
- package/dist/shared/migration/agent-category.d.ts +1 -19
- package/dist/shared/migration/agent-names.d.ts +1 -6
- package/dist/shared/migration/config-migration.d.ts +1 -1
- package/dist/shared/migration/hook-names.d.ts +1 -6
- package/dist/shared/migration/migrations-sidecar.d.ts +1 -41
- package/dist/shared/migration/model-versions.d.ts +1 -22
- package/dist/shared/migration.d.ts +1 -5
- package/dist/shared/model-suggestion-retry.d.ts +39 -17
- package/dist/shared/plugin-identity.d.ts +8 -8
- package/dist/shared/posthog.d.ts +3 -0
- package/dist/shared/process-stream-reader.d.ts +1 -3
- package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +1 -1
- package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +1 -11
- package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +1 -9
- package/dist/shared/prompt-async-gate/queue.d.ts +1 -8
- package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +1 -14
- package/dist/shared/prompt-async-gate/reservations.d.ts +1 -9
- package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +1 -7
- package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +1 -16
- package/dist/shared/prompt-async-gate/timing.d.ts +1 -9
- package/dist/shared/prompt-async-gate/types.d.ts +1 -123
- package/dist/shared/prompt-async-gate.d.ts +3 -7
- package/dist/shared/prompt-failure-classifier.d.ts +1 -9
- package/dist/shared/session-idle-settle.d.ts +1 -12
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/shared/skill-path-resolver.d.ts +1 -1
- package/dist/shared/tmux/cmux-detect.d.ts +1 -8
- package/dist/shared/tmux/constants.d.ts +1 -5
- package/dist/shared/tmux/runner.d.ts +2 -13
- package/dist/shared/tmux/tmux-utils/adapter-deps.d.ts +9 -0
- package/dist/shared/tmux/tmux-utils/environment.d.ts +2 -4
- package/dist/shared/tmux/tmux-utils/layout.d.ts +4 -17
- package/dist/shared/tmux/tmux-utils/pane-close.d.ts +3 -10
- package/dist/shared/tmux/tmux-utils/pane-command.d.ts +1 -2
- package/dist/shared/tmux/tmux-utils/pane-dimensions.d.ts +2 -4
- package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -11
- package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +1 -13
- package/dist/shared/tmux/tmux-utils/server-health.d.ts +2 -15
- package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +3 -14
- package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -1
- package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +4 -17
- package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +1 -13
- package/dist/shared/tmux/types.d.ts +1 -4
- package/dist/shared/write-file-atomically.d.ts +2 -0
- package/dist/shared/zip-entry-listing/powershell-zip-entry-listing.d.ts +1 -4
- package/dist/shared/zip-entry-listing/python-zip-entry-listing.d.ts +1 -3
- package/dist/shared/zip-entry-listing/read-zip-symlink-target.d.ts +1 -1
- package/dist/shared/zip-entry-listing/tar-zip-entry-listing.d.ts +1 -3
- package/dist/shared/zip-entry-listing/zipinfo-zip-entry-listing.d.ts +1 -4
- package/dist/shared/zip-entry-listing.d.ts +1 -4
- package/dist/skills/ast-grep/LICENSE +21 -0
- package/dist/skills/ast-grep/README.md +136 -0
- package/dist/skills/ast-grep/SKILL.md +272 -0
- package/dist/skills/ast-grep/SOURCE +1 -0
- package/dist/skills/ast-grep/install.ps1 +235 -0
- package/dist/skills/ast-grep/install.sh +286 -0
- package/dist/skills/ast-grep/references/cli.md +231 -0
- package/dist/skills/ast-grep/references/install.md +166 -0
- package/dist/skills/ast-grep/references/patterns.md +147 -0
- package/dist/skills/ast-grep/references/pitfalls.md +303 -0
- package/dist/skills/ast-grep/references/recipes.md +402 -0
- package/dist/skills/ast-grep/references/sgconfig.md +248 -0
- package/dist/skills/ast-grep/references/yaml-rules.md +509 -0
- package/dist/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
- package/dist/skills/ast-grep/tests/smoke.ps1 +123 -0
- package/dist/skills/ast-grep/tests/smoke.sh +212 -0
- package/dist/skills/debugging/SKILL.md +116 -0
- package/dist/skills/debugging/references/methodology/00-setup.md +108 -0
- package/dist/skills/debugging/references/methodology/02-investigate.md +130 -0
- package/dist/skills/debugging/references/methodology/04-oracle-triple.md +136 -0
- package/dist/skills/debugging/references/methodology/05-escalate.md +69 -0
- package/dist/skills/debugging/references/methodology/06-fix.md +116 -0
- package/dist/skills/debugging/references/methodology/08-qa.md +94 -0
- package/dist/skills/debugging/references/methodology/09-cleanup.md +164 -0
- package/dist/skills/debugging/references/methodology/partial-runtime-evidence.md +229 -0
- package/dist/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
- package/dist/skills/debugging/references/runtimes/go.md +252 -0
- package/dist/skills/debugging/references/runtimes/native-binary.md +484 -0
- package/dist/skills/debugging/references/runtimes/node.md +260 -0
- package/dist/skills/debugging/references/runtimes/python.md +248 -0
- package/dist/skills/debugging/references/runtimes/rust.md +234 -0
- package/dist/skills/debugging/references/tools/ghidra.md +212 -0
- package/dist/skills/debugging/references/tools/playwright-cli.md +194 -0
- package/dist/skills/debugging/references/tools/pwndbg.md +263 -0
- package/dist/skills/debugging/references/tools/pwntools.md +265 -0
- package/dist/skills/frontend/ATTRIBUTION.md +127 -0
- package/dist/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
- package/dist/skills/frontend/SKILL.md +113 -0
- package/dist/skills/frontend/references/design/README.md +240 -0
- package/dist/skills/frontend/references/design/_INDEX.md +189 -0
- package/dist/skills/frontend/references/design/airbnb.md +390 -0
- package/dist/skills/frontend/references/design/airtable.md +89 -0
- package/dist/skills/frontend/references/design/apple.md +247 -0
- package/dist/skills/frontend/references/design/binance.md +345 -0
- package/dist/skills/frontend/references/design/bmw.md +180 -0
- package/dist/skills/frontend/references/design/brutalist-skill.md +92 -0
- package/dist/skills/frontend/references/design/bugatti.md +268 -0
- package/dist/skills/frontend/references/design/cal.md +259 -0
- package/dist/skills/frontend/references/design/claude.md +312 -0
- package/dist/skills/frontend/references/design/clay.md +304 -0
- package/dist/skills/frontend/references/design/clickhouse.md +281 -0
- package/dist/skills/frontend/references/design/cohere.md +266 -0
- package/dist/skills/frontend/references/design/coinbase.md +129 -0
- package/dist/skills/frontend/references/design/composio.md +307 -0
- package/dist/skills/frontend/references/design/cursor.md +309 -0
- package/dist/skills/frontend/references/design/design-system-architecture.md +217 -0
- package/dist/skills/frontend/references/design/elevenlabs.md +265 -0
- package/dist/skills/frontend/references/design/expo.md +281 -0
- package/dist/skills/frontend/references/design/ferrari.md +314 -0
- package/dist/skills/frontend/references/design/figma.md +220 -0
- package/dist/skills/frontend/references/design/framer.md +246 -0
- package/dist/skills/frontend/references/design/gpt-tasteskill.md +74 -0
- package/dist/skills/frontend/references/design/hashicorp.md +278 -0
- package/dist/skills/frontend/references/design/ibm.md +332 -0
- package/dist/skills/frontend/references/design/image-to-code-skill.md +1228 -0
- package/dist/skills/frontend/references/design/imagegen-brandkit.md +798 -0
- package/dist/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
- package/dist/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
- package/dist/skills/frontend/references/design/intercom.md +146 -0
- package/dist/skills/frontend/references/design/kraken.md +125 -0
- package/dist/skills/frontend/references/design/lamborghini.md +288 -0
- package/dist/skills/frontend/references/design/linear.app.md +367 -0
- package/dist/skills/frontend/references/design/lovable.md +298 -0
- package/dist/skills/frontend/references/design/mastercard.md +365 -0
- package/dist/skills/frontend/references/design/meta.md +366 -0
- package/dist/skills/frontend/references/design/minimalist-skill.md +85 -0
- package/dist/skills/frontend/references/design/minimax.md +257 -0
- package/dist/skills/frontend/references/design/mintlify.md +326 -0
- package/dist/skills/frontend/references/design/miro.md +108 -0
- package/dist/skills/frontend/references/design/mistral.ai.md +261 -0
- package/dist/skills/frontend/references/design/mongodb.md +266 -0
- package/dist/skills/frontend/references/design/nike.md +363 -0
- package/dist/skills/frontend/references/design/notion.md +309 -0
- package/dist/skills/frontend/references/design/nvidia.md +293 -0
- package/dist/skills/frontend/references/design/ollama.md +267 -0
- package/dist/skills/frontend/references/design/opencode.ai.md +281 -0
- package/dist/skills/frontend/references/design/output-skill.md +49 -0
- package/dist/skills/frontend/references/design/pinterest.md +230 -0
- package/dist/skills/frontend/references/design/playstation.md +364 -0
- package/dist/skills/frontend/references/design/posthog.md +256 -0
- package/dist/skills/frontend/references/design/raycast.md +268 -0
- package/dist/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
- package/dist/skills/frontend/references/design/redesign-skill.md +178 -0
- package/dist/skills/frontend/references/design/renault.md +311 -0
- package/dist/skills/frontend/references/design/replicate.md +261 -0
- package/dist/skills/frontend/references/design/resend.md +303 -0
- package/dist/skills/frontend/references/design/revolut.md +185 -0
- package/dist/skills/frontend/references/design/runwayml.md +244 -0
- package/dist/skills/frontend/references/design/sanity.md +357 -0
- package/dist/skills/frontend/references/design/sentry.md +262 -0
- package/dist/skills/frontend/references/design/shopify.md +350 -0
- package/dist/skills/frontend/references/design/soft-skill.md +98 -0
- package/dist/skills/frontend/references/design/spacex.md +194 -0
- package/dist/skills/frontend/references/design/spotify.md +246 -0
- package/dist/skills/frontend/references/design/starbucks.md +580 -0
- package/dist/skills/frontend/references/design/stitch-skill.md +184 -0
- package/dist/skills/frontend/references/design/stripe.md +322 -0
- package/dist/skills/frontend/references/design/supabase.md +255 -0
- package/dist/skills/frontend/references/design/superhuman.md +252 -0
- package/dist/skills/frontend/references/design/taste-skill.md +226 -0
- package/dist/skills/frontend/references/design/tesla.md +286 -0
- package/dist/skills/frontend/references/design/theverge.md +339 -0
- package/dist/skills/frontend/references/design/together.ai.md +263 -0
- package/dist/skills/frontend/references/design/uber.md +295 -0
- package/dist/skills/frontend/references/design/vercel.md +310 -0
- package/dist/skills/frontend/references/design/vodafone.md +423 -0
- package/dist/skills/frontend/references/design/voltagent.md +323 -0
- package/dist/skills/frontend/references/design/warp.md +253 -0
- package/dist/skills/frontend/references/design/webflow.md +92 -0
- package/dist/skills/frontend/references/design/wired.md +278 -0
- package/dist/skills/frontend/references/design/wise.md +173 -0
- package/dist/skills/frontend/references/design/x.ai.md +257 -0
- package/dist/skills/frontend/references/design/zapier.md +328 -0
- package/dist/skills/frontend/references/perfection/README.md +160 -0
- package/dist/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
- package/dist/skills/frontend/references/ui-ux-db/README.md +273 -0
- package/dist/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
- package/dist/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
- package/dist/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
- package/dist/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
- package/dist/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
- package/dist/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
- package/dist/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
- package/dist/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
- package/dist/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
- package/dist/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
- package/dist/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
- package/dist/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
- package/dist/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
- package/dist/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
- package/dist/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
- package/dist/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
- package/dist/skills/git-master/SKILL.md +100 -0
- package/dist/skills/git-master/agents/openai.yaml +13 -0
- package/dist/skills/init-deep/SKILL.md +309 -0
- package/dist/skills/lcx-contribute-bug-fix/SKILL.md +242 -0
- package/dist/skills/lcx-contribute-bug-fix/agents/openai.yaml +12 -0
- package/dist/skills/lcx-contribute-bug-fix/scripts/create-pr-body.mjs +107 -0
- package/dist/skills/lcx-doctor/SKILL.md +93 -0
- package/dist/skills/lcx-doctor/agents/openai.yaml +11 -0
- package/dist/skills/lcx-report-bug/SKILL.md +237 -0
- package/dist/skills/lcx-report-bug/agents/openai.yaml +11 -0
- package/dist/skills/lsp-setup/SKILL.md +139 -0
- package/dist/skills/lsp-setup/references/bash/README.md +60 -0
- package/dist/skills/lsp-setup/references/c-cpp/README.md +61 -0
- package/dist/skills/lsp-setup/references/csharp/README.md +71 -0
- package/dist/skills/lsp-setup/references/dart/README.md +48 -0
- package/dist/skills/lsp-setup/references/elixir/README.md +51 -0
- package/dist/skills/lsp-setup/references/go/README.md +57 -0
- package/dist/skills/lsp-setup/references/haskell/README.md +57 -0
- package/dist/skills/lsp-setup/references/java/README.md +57 -0
- package/dist/skills/lsp-setup/references/julia/README.md +60 -0
- package/dist/skills/lsp-setup/references/kotlin/README.md +59 -0
- package/dist/skills/lsp-setup/references/lua/README.md +66 -0
- package/dist/skills/lsp-setup/references/php/README.md +62 -0
- package/dist/skills/lsp-setup/references/python/README.md +71 -0
- package/dist/skills/lsp-setup/references/ruby/README.md +53 -0
- package/dist/skills/lsp-setup/references/rust/README.md +59 -0
- package/dist/skills/lsp-setup/references/swift/README.md +51 -0
- package/dist/skills/lsp-setup/references/terraform/README.md +62 -0
- package/dist/skills/lsp-setup/references/typescript/README.md +77 -0
- package/dist/skills/lsp-setup/references/yaml/README.md +70 -0
- package/dist/skills/lsp-setup/references/zig/README.md +49 -0
- package/dist/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
- package/dist/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
- package/dist/skills/lsp-setup/scripts/tsconfig.json +17 -0
- package/dist/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
- package/dist/skills/programming/SKILL.md +463 -0
- package/dist/skills/programming/references/go/README.md +90 -0
- package/dist/skills/programming/references/go/backend-stack.md +641 -0
- package/dist/skills/programming/references/go/bootstrap.md +328 -0
- package/dist/skills/programming/references/go/bubbletea-v2.md +360 -0
- package/dist/skills/programming/references/go/cobra-stack.md +468 -0
- package/dist/skills/programming/references/go/concurrency.md +362 -0
- package/dist/skills/programming/references/go/data-modeling.md +329 -0
- package/dist/skills/programming/references/go/error-handling.md +359 -0
- package/dist/skills/programming/references/go/golangci-strict.md +236 -0
- package/dist/skills/programming/references/go/grpc-connect.md +375 -0
- package/dist/skills/programming/references/go/libraries.md +337 -0
- package/dist/skills/programming/references/go/one-liners.md +202 -0
- package/dist/skills/programming/references/go/sqlc-pgx.md +471 -0
- package/dist/skills/programming/references/go/testing.md +467 -0
- package/dist/skills/programming/references/go/type-patterns.md +298 -0
- package/dist/skills/programming/references/python/README.md +314 -0
- package/dist/skills/programming/references/python/async-anyio.md +442 -0
- package/dist/skills/programming/references/python/data-modeling.md +233 -0
- package/dist/skills/programming/references/python/data-processing.md +133 -0
- package/dist/skills/programming/references/python/error-handling.md +218 -0
- package/dist/skills/programming/references/python/fastapi-stack.md +316 -0
- package/dist/skills/programming/references/python/httpx2-optimization.md +360 -0
- package/dist/skills/programming/references/python/libraries.md +307 -0
- package/dist/skills/programming/references/python/one-liners.md +268 -0
- package/dist/skills/programming/references/python/orjson-stack.md +378 -0
- package/dist/skills/programming/references/python/pydantic-ai.md +285 -0
- package/dist/skills/programming/references/python/pyproject-strict.md +232 -0
- package/dist/skills/programming/references/python/textual-tui.md +201 -0
- package/dist/skills/programming/references/python/type-patterns.md +176 -0
- package/dist/skills/programming/references/rust/README.md +317 -0
- package/dist/skills/programming/references/rust/async-tokio.md +299 -0
- package/dist/skills/programming/references/rust/axum-stack.md +467 -0
- package/dist/skills/programming/references/rust/cargo-strict.md +317 -0
- package/dist/skills/programming/references/rust/clap-stack.md +409 -0
- package/dist/skills/programming/references/rust/concurrency.md +375 -0
- package/dist/skills/programming/references/rust/libraries.md +439 -0
- package/dist/skills/programming/references/rust/one-liners.md +291 -0
- package/dist/skills/programming/references/rust/proptest-insta.md +429 -0
- package/dist/skills/programming/references/rust/type-state.md +354 -0
- package/dist/skills/programming/references/rust/unsafe-discipline.md +250 -0
- package/dist/skills/programming/references/rust/zero-cost-safety.md +527 -0
- package/dist/skills/programming/references/rust-ub/README.md +289 -0
- package/dist/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
- package/dist/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
- package/dist/skills/programming/references/typescript/README.md +195 -0
- package/dist/skills/programming/references/typescript/backend-hono.md +672 -0
- package/dist/skills/programming/references/typescript/bootstrap.md +199 -0
- package/dist/skills/programming/references/typescript/data-modeling.md +202 -0
- package/dist/skills/programming/references/typescript/error-handling.md +169 -0
- package/dist/skills/programming/references/typescript/tsconfig-strict.md +152 -0
- package/dist/skills/programming/references/typescript/type-patterns.md +196 -0
- package/dist/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
- package/dist/skills/programming/scripts/go/new-project.py +138 -0
- package/dist/skills/programming/scripts/go/templates/.editorconfig +13 -0
- package/dist/skills/programming/scripts/go/templates/.golangci.yml +95 -0
- package/dist/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
- package/dist/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
- package/dist/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
- package/dist/skills/programming/scripts/go/templates/ci.yml +37 -0
- package/dist/skills/programming/scripts/go/templates/config.go +24 -0
- package/dist/skills/programming/scripts/go/templates/gitignore +15 -0
- package/dist/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
- package/dist/skills/programming/scripts/go/templates/run.go +15 -0
- package/dist/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
- package/dist/skills/programming/scripts/python/new-project.py +172 -0
- package/dist/skills/programming/scripts/python/new-script.py +116 -0
- package/dist/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
- package/dist/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
- package/dist/skills/programming/scripts/rust/new-project.py +175 -0
- package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
- package/dist/skills/programming/scripts/typescript/new-project.ts +177 -0
- package/dist/skills/refactor/SKILL.md +754 -0
- package/dist/skills/remove-ai-slops/SKILL.md +317 -0
- package/dist/skills/review-work/SKILL.md +594 -0
- package/dist/skills/start-work/SKILL.md +178 -0
- package/dist/skills/ultraresearch/SKILL.md +230 -0
- package/dist/skills/ulw-plan/SKILL.md +69 -0
- package/dist/skills/ulw-plan/agents/openai.yaml +7 -0
- package/dist/skills/ulw-plan/references/full-workflow.md +99 -0
- package/dist/skills/ulw-plan/references/intent-clear.md +44 -0
- package/dist/skills/ulw-plan/references/intent-unclear.md +44 -0
- package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
- package/dist/skills/visual-qa/SKILL.md +235 -0
- package/dist/skills/visual-qa/references/agent-browser-setup.md +44 -0
- package/dist/skills/visual-qa/scripts/ansi.test.ts +45 -0
- package/dist/skills/visual-qa/scripts/ansi.ts +17 -0
- package/dist/skills/visual-qa/scripts/cli.test.ts +73 -0
- package/dist/skills/visual-qa/scripts/cli.ts +82 -0
- package/dist/skills/visual-qa/scripts/east-asian-width.test.ts +60 -0
- package/dist/skills/visual-qa/scripts/east-asian-width.ts +72 -0
- package/dist/skills/visual-qa/scripts/image-diff.test.ts +70 -0
- package/dist/skills/visual-qa/scripts/image-diff.ts +109 -0
- package/dist/skills/visual-qa/scripts/png-crc.ts +27 -0
- package/dist/skills/visual-qa/scripts/png-decode.test.ts +44 -0
- package/dist/skills/visual-qa/scripts/png-decode.ts +206 -0
- package/dist/skills/visual-qa/scripts/png-synth.ts +57 -0
- package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +127 -0
- package/dist/skills/visual-qa/scripts/tui-grid.test.ts +57 -0
- package/dist/skills/visual-qa/scripts/tui-grid.ts +88 -0
- package/dist/skills/visual-qa/scripts/types.ts +54 -0
- package/dist/tools/delegate-task/background-task-description.d.ts +2 -0
- package/dist/tools/delegate-task/constants.d.ts +13 -1
- package/dist/tools/delegate-task/model-selection.d.ts +3 -17
- package/dist/tools/delegate-task/model-string-parser.d.ts +1 -9
- package/dist/tools/delegate-task/sync-result-fetcher.d.ts +1 -0
- package/dist/tools/delegate-task/sync-session-poller.d.ts +1 -0
- package/dist/tools/delegate-task/types.d.ts +59 -2
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/monitor/create-monitor-tools.d.ts +4 -0
- package/dist/tools/monitor/index.d.ts +1 -0
- package/dist/tools/monitor/monitor-list.d.ts +7 -0
- package/dist/tools/monitor/monitor-output.d.ts +3 -0
- package/dist/tools/monitor/monitor-start.d.ts +9 -0
- package/dist/tools/monitor/monitor-stop.d.ts +16 -0
- package/dist/tools/skill/native-skills.d.ts +2 -2
- package/dist/tools/skill/scope-priority.d.ts +1 -4
- package/dist/tools/skill/skill-matcher.d.ts +1 -5
- package/dist/tools/task/types.d.ts +10 -10
- package/dist/tui.d.ts +4 -0
- package/dist/tui.js +69330 -0
- package/package.json +57 -36
- package/packages/git-bash-mcp/dist/cli.js +225 -55
- package/packages/lsp-core/package.json +41 -0
- package/packages/lsp-core/src/index.ts +28 -0
- package/packages/lsp-core/src/lsp/cleanup-errors.ts +5 -0
- package/packages/lsp-core/src/lsp/client-wrapper.ts +173 -0
- package/packages/lsp-core/src/lsp/client.ts +172 -0
- package/packages/lsp-core/src/lsp/config-loader.ts +266 -0
- package/packages/lsp-core/src/lsp/connection.ts +73 -0
- package/packages/lsp-core/src/lsp/constants.ts +11 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.ts +154 -0
- package/packages/lsp-core/src/lsp/effective-extension.ts +10 -0
- package/packages/lsp-core/src/lsp/errors.ts +63 -0
- package/packages/lsp-core/src/lsp/formatters.ts +141 -0
- package/packages/lsp-core/src/lsp/infer-extension.ts +66 -0
- package/packages/lsp-core/src/lsp/json-rpc-connection.ts +296 -0
- package/packages/lsp-core/src/lsp/language-mappings.ts +173 -0
- package/packages/lsp-core/src/lsp/manager.ts +369 -0
- package/packages/lsp-core/src/lsp/process-signal-cleanup.ts +21 -0
- package/packages/lsp-core/src/lsp/process.ts +202 -0
- package/packages/lsp-core/src/lsp/server-definitions.ts +176 -0
- package/packages/lsp-core/src/lsp/server-install-state.ts +70 -0
- package/packages/lsp-core/src/lsp/server-installation.ts +45 -0
- package/packages/lsp-core/src/lsp/server-resolution.ts +104 -0
- package/packages/lsp-core/src/lsp/startup-failure.ts +1 -0
- package/packages/lsp-core/src/lsp/transport.ts +299 -0
- package/packages/lsp-core/src/lsp/types.ts +126 -0
- package/packages/lsp-core/src/lsp/utils.test.ts +72 -0
- package/packages/lsp-core/src/lsp/utils.ts +40 -0
- package/packages/lsp-core/src/lsp/workspace-edit.ts +206 -0
- package/packages/lsp-core/src/mcp-protocol-pin.test.ts +68 -0
- package/packages/lsp-core/src/mcp.ts +95 -0
- package/packages/lsp-core/src/missing-dependency-result.ts +19 -0
- package/packages/lsp-core/src/request-context.ts +22 -0
- package/packages/lsp-core/src/tool-surface.test.ts +157 -0
- package/packages/lsp-core/src/tools/definitions.ts +141 -0
- package/packages/lsp-core/src/tools/diagnostics.ts +97 -0
- package/packages/lsp-core/src/tools/index.ts +10 -0
- package/packages/lsp-core/src/tools/install-decision.ts +39 -0
- package/packages/lsp-core/src/tools/navigation.ts +86 -0
- package/packages/lsp-core/src/tools/parameters.ts +49 -0
- package/packages/lsp-core/src/tools/rename.ts +72 -0
- package/packages/lsp-core/src/tools/result.ts +5 -0
- package/packages/lsp-core/src/tools/runtime.ts +21 -0
- package/packages/lsp-core/src/tools/schema.ts +9 -0
- package/packages/lsp-core/src/tools/status.ts +28 -0
- package/packages/lsp-core/src/tools/symbols.ts +99 -0
- package/packages/lsp-core/src/tools/types.ts +104 -0
- package/packages/lsp-core/src/tools.ts +1 -0
- package/packages/lsp-daemon/dist/cli.js +712 -527
- package/packages/lsp-daemon/dist/daemon-client.d.ts +1 -1
- package/packages/lsp-daemon/dist/daemon-server.js +1 -1
- package/packages/lsp-daemon/dist/index.d.ts +1 -1
- package/packages/lsp-daemon/dist/index.js +687 -500
- package/packages/lsp-daemon/dist/proxy.d.ts +3 -2
- package/packages/lsp-daemon/dist/proxy.js +16 -40
- package/packages/lsp-daemon/dist/request-routing.d.ts +2 -2
- package/packages/lsp-daemon/dist/request-routing.js +2 -2
- package/packages/lsp-daemon/package.json +2 -1
- package/packages/lsp-tools-mcp/dist/cli.js +3348 -15
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts +1 -1
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.d.ts +1 -13
- package/packages/lsp-tools-mcp/dist/lsp/client.d.ts +1 -20
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.d.ts +1 -16
- package/packages/lsp-tools-mcp/dist/lsp/connection.d.ts +1 -4
- package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts +1 -10
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.d.ts +1 -3
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -1
- package/packages/lsp-tools-mcp/dist/lsp/errors.d.ts +1 -35
- package/packages/lsp-tools-mcp/dist/lsp/formatters.d.ts +1 -12
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.d.ts +1 -1
- package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.d.ts +1 -36
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts +1 -4
- package/packages/lsp-tools-mcp/dist/lsp/manager.d.ts +1 -46
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +1390 -265
- package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.d.ts +1 -1
- package/packages/lsp-tools-mcp/dist/lsp/process.d.ts +1 -25
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.d.ts +1 -4
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +1 -12
- package/packages/lsp-tools-mcp/dist/lsp/server-installation.d.ts +1 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-resolution.d.ts +1 -11
- package/packages/lsp-tools-mcp/dist/lsp/startup-failure.d.ts +1 -3
- package/packages/lsp-tools-mcp/dist/lsp/transport.d.ts +1 -35
- package/packages/lsp-tools-mcp/dist/lsp/types.d.ts +1 -124
- package/packages/lsp-tools-mcp/dist/lsp/utils.d.ts +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.d.ts +1 -11
- package/packages/lsp-tools-mcp/dist/mcp.d.ts +1 -30
- package/packages/lsp-tools-mcp/dist/mcp.js +3312 -70
- package/packages/lsp-tools-mcp/dist/missing-dependency-result.d.ts +1 -2
- package/packages/lsp-tools-mcp/dist/request-context.d.ts +1 -7
- package/packages/lsp-tools-mcp/dist/request-context.js +16 -10
- package/packages/lsp-tools-mcp/dist/tools.d.ts +1 -90
- package/packages/lsp-tools-mcp/dist/tools.js +3028 -439
- package/packages/lsp-tools-mcp/package.json +3 -1
- package/packages/omo-codex/THIRD-PARTY-NOTICES.md +155 -0
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/.mcp.json +6 -5
- package/packages/omo-codex/plugin/README.md +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +1637 -1245
- 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/scripts/generate-manifests.mjs +8 -52
- package/packages/omo-codex/plugin/components/bootstrap/src/provision.ts +35 -143
- package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +11 -11
- package/packages/omo-codex/plugin/components/bootstrap/test/environment.test.ts +3 -2
- package/packages/omo-codex/plugin/components/bootstrap/test/provision.test.ts +37 -37
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +2205 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.d.ts +32 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +1603 -0
- package/packages/omo-codex/plugin/components/codegraph/package.json +27 -0
- package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +55 -0
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +83 -0
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +108 -0
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +191 -0
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +213 -0
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +563 -0
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +401 -0
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.build.json +13 -0
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.json +25 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +610 -7
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +4 -3
- package/packages/omo-codex/plugin/components/comment-checker/src/apply-patch.ts +28 -156
- package/packages/omo-codex/plugin/components/comment-checker/src/core-values.ts +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +2 -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 +6 -2
- package/packages/omo-codex/plugin/components/comment-checker/test/core.test.ts +38 -35
- package/packages/omo-codex/plugin/components/comment-checker/test/fixtures/apply-patch-mixed-requests.ts +60 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +155 -26
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +2 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +48 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/directive.md +11 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +223 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +123 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/directive.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/directive.js +5 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/index.d.ts +4 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/index.js +3 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/state.d.ts +9 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/state.js +45 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.d.ts +39 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.js +1 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +17 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +44 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/cli.ts +56 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +129 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/directive.ts +13 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/index.ts +4 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/state.ts +62 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/types.ts +38 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/cli.test.ts +124 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +346 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/tsconfig.build.json +12 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/tsconfig.json +27 -0
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/vitest.config.ts +10 -0
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +3738 -28
- 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/bundled-rules/hephaestus.md +1 -1
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +4565 -89
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +4 -3
- package/packages/omo-codex/plugin/components/rules/src/cli.ts +16 -3
- package/packages/omo-codex/plugin/components/rules/src/config.ts +3 -3
- package/packages/omo-codex/plugin/components/rules/src/dynamic-target-fingerprints.ts +6 -6
- package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +9 -4
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +3 -3
- package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +4 -4
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/dynamic-target-fingerprints.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +3 -3
- package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +2 -2
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +2 -2
- package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +2 -2
- package/packages/omo-codex/plugin/components/rules/test/parser.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/rules-engine-consumption.test.ts +92 -0
- package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/sources.test.ts +4 -4
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +394 -37
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +4 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/src/boulder-reader.ts +20 -147
- package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/src/index.ts +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +151 -27
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +87 -49
- package/packages/omo-codex/plugin/components/telemetry/LICENSE +21 -0
- package/packages/omo-codex/plugin/components/telemetry/NOTICE +6 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +5869 -42
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +5783 -108
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +4 -5
- package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +3 -3
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +92 -142
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +59 -3
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook-diagnostics.test.ts +3 -3
- package/packages/omo-codex/plugin/components/telemetry/test/diagnostics.test.ts +13 -7
- package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +31 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +29 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-executor.toml +24 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +23 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +22 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +104 -156
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +162 -37
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +4 -3
- package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +11 -0
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +47 -20
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +55 -88
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +44 -0
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +44 -0
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
- package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-test-helpers.ts +101 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +111 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +24 -128
- package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +16 -0
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +4 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +79 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +56 -82
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +38 -144
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +10 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +173 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +2419 -32
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +13 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +60 -12
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +67 -10
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +3 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +14 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +2 -6
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +49 -39
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.d.ts +8 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.js +109 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-blockers.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-blockers.js +41 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.d.ts +8 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +39 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +13 -6
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +176 -105
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
- 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 -17
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +100 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +162 -85
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +62 -136
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +250 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +18 -9
- package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +67 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/evidence.ts +124 -18
- package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +131 -54
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-goal-factory.ts +124 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-blockers.ts +48 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +44 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +230 -138
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +186 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-status.test.ts +85 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint.test.ts +120 -192
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint.test.ts +215 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +1 -195
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-complete-goals.test.ts +15 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +172 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-helpers.test.ts +0 -6
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +39 -8
- package/packages/omo-codex/plugin/components/ulw-loop/test/evidence-criteria-gate.test.ts +29 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/browser-screenshot.txt +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/cli-pass.txt +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/code-review.md +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/data-diff.txt +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/gate-review.md +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/http-dump.txt +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/rejection.txt +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/checkpoint-builders.ts +98 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +91 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/sample-quality-gate.json +110 -8
- package/packages/omo-codex/plugin/components/ulw-loop/test/goal-status.test.ts +35 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-crud.test.ts +11 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-blockers.test.ts +102 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-doc.test.ts +38 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +131 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +150 -176
- package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +12 -0
- package/packages/omo-codex/plugin/hooks/hooks.json +38 -17
- package/packages/omo-codex/plugin/package-lock.json +144 -49
- package/packages/omo-codex/plugin/package.json +4 -2
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +2 -0
- package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +0 -5
- package/packages/omo-codex/plugin/scripts/build-components.mjs +29 -5
- package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +2 -0
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/editor.mjs +125 -0
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/jsonc.mjs +43 -0
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/scaffold.mjs +29 -0
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +121 -0
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +5 -5
- package/packages/omo-codex/plugin/shared/package.json +24 -0
- package/packages/omo-codex/plugin/shared/src/config-loader.ts +28 -0
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +105 -0
- package/packages/omo-codex/plugin/shared/tsconfig.build.json +9 -0
- package/packages/omo-codex/plugin/shared/tsconfig.json +16 -0
- package/packages/omo-codex/plugin/skills/ast-grep/LICENSE +21 -0
- package/packages/omo-codex/plugin/skills/ast-grep/README.md +136 -0
- package/packages/omo-codex/plugin/skills/ast-grep/SKILL.md +272 -0
- package/packages/omo-codex/plugin/skills/ast-grep/SOURCE +1 -0
- package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +235 -0
- package/packages/omo-codex/plugin/skills/ast-grep/install.sh +286 -0
- package/packages/omo-codex/plugin/skills/ast-grep/references/cli.md +231 -0
- package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +166 -0
- package/packages/omo-codex/plugin/skills/ast-grep/references/patterns.md +147 -0
- package/packages/omo-codex/plugin/skills/ast-grep/references/pitfalls.md +303 -0
- package/packages/omo-codex/plugin/skills/ast-grep/references/recipes.md +402 -0
- package/packages/omo-codex/plugin/skills/ast-grep/references/sgconfig.md +248 -0
- package/packages/omo-codex/plugin/skills/ast-grep/references/yaml-rules.md +509 -0
- package/packages/omo-codex/plugin/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
- package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.ps1 +123 -0
- package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.sh +212 -0
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +127 -0
- package/packages/omo-codex/plugin/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +113 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +240 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +189 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/airbnb.md +390 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/airtable.md +89 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/apple.md +247 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/binance.md +345 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/bmw.md +180 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/brutalist-skill.md +92 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/bugatti.md +268 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/cal.md +259 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/claude.md +312 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/clay.md +304 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/clickhouse.md +281 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/cohere.md +266 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/coinbase.md +129 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/composio.md +307 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/cursor.md +309 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +217 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/elevenlabs.md +265 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/expo.md +281 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ferrari.md +314 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/figma.md +220 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/framer.md +246 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/gpt-tasteskill.md +74 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/hashicorp.md +278 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ibm.md +332 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/image-to-code-skill.md +1228 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-brandkit.md +798 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/intercom.md +146 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/kraken.md +125 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/lamborghini.md +288 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/linear.app.md +367 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/lovable.md +298 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mastercard.md +365 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/meta.md +366 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/minimalist-skill.md +85 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/minimax.md +257 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mintlify.md +326 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/miro.md +108 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mistral.ai.md +261 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/mongodb.md +266 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/nike.md +363 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/notion.md +309 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/nvidia.md +293 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ollama.md +267 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/opencode.ai.md +281 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/output-skill.md +49 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/pinterest.md +230 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/playstation.md +364 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/posthog.md +256 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/raycast.md +268 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/redesign-skill.md +178 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/renault.md +311 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/replicate.md +261 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/resend.md +303 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/revolut.md +185 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/runwayml.md +244 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/sanity.md +357 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/sentry.md +262 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/shopify.md +350 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/soft-skill.md +98 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/spacex.md +194 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/spotify.md +246 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/starbucks.md +580 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-skill.md +184 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stripe.md +322 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/supabase.md +255 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/superhuman.md +252 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/taste-skill.md +226 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/tesla.md +286 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/theverge.md +339 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/together.ai.md +263 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/uber.md +295 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/vercel.md +310 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/vodafone.md +423 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/voltagent.md +323 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/warp.md +253 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/webflow.md +92 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/wired.md +278 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/wise.md +173 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/x.ai.md +257 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/zapier.md +328 -0
- package/packages/omo-codex/plugin/skills/frontend/references/perfection/README.md +160 -0
- package/packages/omo-codex/plugin/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/README.md +273 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +14 -23
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +17 -17
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +47 -20
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +55 -88
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +44 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +44 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +19 -3
- package/packages/omo-codex/plugin/skills/visual-qa/references/agent-browser-setup.md +44 -0
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +119 -11
- package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -4
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +29 -2
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +2 -0
- package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +12 -12
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +26 -0
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +287 -0
- package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +199 -0
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +38 -2
- package/packages/omo-codex/plugin/test/index.js +13 -0
- package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +4 -5
- package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +5 -3
- package/packages/omo-codex/plugin/test/migrate-omo-sot.test.mjs +179 -0
- package/packages/omo-codex/plugin/test/payload-equivalence.test.mjs +109 -0
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +165 -0
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +6 -6
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -3
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +37 -1
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +3 -3
- package/packages/omo-codex/scripts/install-cache-copy.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-cli-args.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-config-autonomous-features.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-config-autonomous.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-config-preservation.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +1 -2
- package/packages/omo-codex/scripts/install-config.test.mjs +8 -6
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +13377 -0
- package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +55 -0
- package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +3 -4
- package/packages/omo-codex/scripts/install-hook-targets.test.mjs +1 -1
- package/packages/omo-codex/scripts/install-local.mjs +54 -237
- package/packages/omo-codex/scripts/install-local.test.mjs +8 -1
- package/packages/omo-codex/scripts/install-marketplace-cache.test.mjs +3 -3
- package/packages/omo-codex/scripts/install-mcp-runtime.test.mjs +34 -77
- package/packages/omo-codex/scripts/install-packaged-local.test.mjs +8 -4
- package/packages/omo-codex/scripts/install-project-local-cleanup.test.mjs +1 -1
- package/packages/shared-skills/package.json +6 -1
- package/packages/shared-skills/skills/ast-grep/LICENSE +21 -0
- package/packages/shared-skills/skills/ast-grep/README.md +136 -0
- package/packages/shared-skills/skills/ast-grep/SKILL.md +272 -0
- package/packages/shared-skills/skills/ast-grep/SOURCE +1 -0
- package/packages/shared-skills/skills/ast-grep/install.ps1 +235 -0
- package/packages/shared-skills/skills/ast-grep/install.sh +286 -0
- package/packages/shared-skills/skills/ast-grep/references/cli.md +231 -0
- package/packages/shared-skills/skills/ast-grep/references/install.md +166 -0
- package/packages/shared-skills/skills/ast-grep/references/patterns.md +147 -0
- package/packages/shared-skills/skills/ast-grep/references/pitfalls.md +303 -0
- package/packages/shared-skills/skills/ast-grep/references/recipes.md +402 -0
- package/packages/shared-skills/skills/ast-grep/references/sgconfig.md +248 -0
- package/packages/shared-skills/skills/ast-grep/references/yaml-rules.md +509 -0
- package/packages/shared-skills/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
- package/packages/shared-skills/skills/ast-grep/tests/smoke.ps1 +123 -0
- package/packages/shared-skills/skills/ast-grep/tests/smoke.sh +212 -0
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +127 -0
- package/packages/shared-skills/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
- package/packages/shared-skills/skills/frontend/SKILL.md +113 -0
- package/packages/shared-skills/skills/frontend/references/design/README.md +240 -0
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +189 -0
- package/packages/shared-skills/skills/frontend/references/design/airbnb.md +390 -0
- package/packages/shared-skills/skills/frontend/references/design/airtable.md +89 -0
- package/packages/shared-skills/skills/frontend/references/design/apple.md +247 -0
- package/packages/shared-skills/skills/frontend/references/design/binance.md +345 -0
- package/packages/shared-skills/skills/frontend/references/design/bmw.md +180 -0
- package/packages/shared-skills/skills/frontend/references/design/brutalist-skill.md +92 -0
- package/packages/shared-skills/skills/frontend/references/design/bugatti.md +268 -0
- package/packages/shared-skills/skills/frontend/references/design/cal.md +259 -0
- package/packages/shared-skills/skills/frontend/references/design/claude.md +312 -0
- package/packages/shared-skills/skills/frontend/references/design/clay.md +304 -0
- package/packages/shared-skills/skills/frontend/references/design/clickhouse.md +281 -0
- package/packages/shared-skills/skills/frontend/references/design/cohere.md +266 -0
- package/packages/shared-skills/skills/frontend/references/design/coinbase.md +129 -0
- package/packages/shared-skills/skills/frontend/references/design/composio.md +307 -0
- package/packages/shared-skills/skills/frontend/references/design/cursor.md +309 -0
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +217 -0
- package/packages/shared-skills/skills/frontend/references/design/elevenlabs.md +265 -0
- package/packages/shared-skills/skills/frontend/references/design/expo.md +281 -0
- package/packages/shared-skills/skills/frontend/references/design/ferrari.md +314 -0
- package/packages/shared-skills/skills/frontend/references/design/figma.md +220 -0
- package/packages/shared-skills/skills/frontend/references/design/framer.md +246 -0
- package/packages/shared-skills/skills/frontend/references/design/gpt-tasteskill.md +74 -0
- package/packages/shared-skills/skills/frontend/references/design/hashicorp.md +278 -0
- package/packages/shared-skills/skills/frontend/references/design/ibm.md +332 -0
- package/packages/shared-skills/skills/frontend/references/design/image-to-code-skill.md +1228 -0
- package/packages/shared-skills/skills/frontend/references/design/imagegen-brandkit.md +798 -0
- package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
- package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
- package/packages/shared-skills/skills/frontend/references/design/intercom.md +146 -0
- package/packages/shared-skills/skills/frontend/references/design/kraken.md +125 -0
- package/packages/shared-skills/skills/frontend/references/design/lamborghini.md +288 -0
- package/packages/shared-skills/skills/frontend/references/design/linear.app.md +367 -0
- package/packages/shared-skills/skills/frontend/references/design/lovable.md +298 -0
- package/packages/shared-skills/skills/frontend/references/design/mastercard.md +365 -0
- package/packages/shared-skills/skills/frontend/references/design/meta.md +366 -0
- package/packages/shared-skills/skills/frontend/references/design/minimalist-skill.md +85 -0
- package/packages/shared-skills/skills/frontend/references/design/minimax.md +257 -0
- package/packages/shared-skills/skills/frontend/references/design/mintlify.md +326 -0
- package/packages/shared-skills/skills/frontend/references/design/miro.md +108 -0
- package/packages/shared-skills/skills/frontend/references/design/mistral.ai.md +261 -0
- package/packages/shared-skills/skills/frontend/references/design/mongodb.md +266 -0
- package/packages/shared-skills/skills/frontend/references/design/nike.md +363 -0
- package/packages/shared-skills/skills/frontend/references/design/notion.md +309 -0
- package/packages/shared-skills/skills/frontend/references/design/nvidia.md +293 -0
- package/packages/shared-skills/skills/frontend/references/design/ollama.md +267 -0
- package/packages/shared-skills/skills/frontend/references/design/opencode.ai.md +281 -0
- package/packages/shared-skills/skills/frontend/references/design/output-skill.md +49 -0
- package/packages/shared-skills/skills/frontend/references/design/pinterest.md +230 -0
- package/packages/shared-skills/skills/frontend/references/design/playstation.md +364 -0
- package/packages/shared-skills/skills/frontend/references/design/posthog.md +256 -0
- package/packages/shared-skills/skills/frontend/references/design/raycast.md +268 -0
- package/packages/shared-skills/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
- package/packages/shared-skills/skills/frontend/references/design/redesign-skill.md +178 -0
- package/packages/shared-skills/skills/frontend/references/design/renault.md +311 -0
- package/packages/shared-skills/skills/frontend/references/design/replicate.md +261 -0
- package/packages/shared-skills/skills/frontend/references/design/resend.md +303 -0
- package/packages/shared-skills/skills/frontend/references/design/revolut.md +185 -0
- package/packages/shared-skills/skills/frontend/references/design/runwayml.md +244 -0
- package/packages/shared-skills/skills/frontend/references/design/sanity.md +357 -0
- package/packages/shared-skills/skills/frontend/references/design/sentry.md +262 -0
- package/packages/shared-skills/skills/frontend/references/design/shopify.md +350 -0
- package/packages/shared-skills/skills/frontend/references/design/soft-skill.md +98 -0
- package/packages/shared-skills/skills/frontend/references/design/spacex.md +194 -0
- package/packages/shared-skills/skills/frontend/references/design/spotify.md +246 -0
- package/packages/shared-skills/skills/frontend/references/design/starbucks.md +580 -0
- package/packages/shared-skills/skills/frontend/references/design/stitch-skill.md +184 -0
- package/packages/shared-skills/skills/frontend/references/design/stripe.md +322 -0
- package/packages/shared-skills/skills/frontend/references/design/supabase.md +255 -0
- package/packages/shared-skills/skills/frontend/references/design/superhuman.md +252 -0
- package/packages/shared-skills/skills/frontend/references/design/taste-skill.md +226 -0
- package/packages/shared-skills/skills/frontend/references/design/tesla.md +286 -0
- package/packages/shared-skills/skills/frontend/references/design/theverge.md +339 -0
- package/packages/shared-skills/skills/frontend/references/design/together.ai.md +263 -0
- package/packages/shared-skills/skills/frontend/references/design/uber.md +295 -0
- package/packages/shared-skills/skills/frontend/references/design/vercel.md +310 -0
- package/packages/shared-skills/skills/frontend/references/design/vodafone.md +423 -0
- package/packages/shared-skills/skills/frontend/references/design/voltagent.md +323 -0
- package/packages/shared-skills/skills/frontend/references/design/warp.md +253 -0
- package/packages/shared-skills/skills/frontend/references/design/webflow.md +92 -0
- package/packages/shared-skills/skills/frontend/references/design/wired.md +278 -0
- package/packages/shared-skills/skills/frontend/references/design/wise.md +173 -0
- package/packages/shared-skills/skills/frontend/references/design/x.ai.md +257 -0
- package/packages/shared-skills/skills/frontend/references/design/zapier.md +328 -0
- package/packages/shared-skills/skills/frontend/references/perfection/README.md +160 -0
- package/packages/shared-skills/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/README.md +273 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
- package/packages/shared-skills/skills/init-deep/SKILL.md +1 -1
- package/packages/shared-skills/skills/refactor/SKILL.md +12 -21
- package/packages/shared-skills/skills/review-work/SKILL.md +11 -9
- package/packages/shared-skills/skills/start-work/SKILL.md +5 -4
- package/packages/shared-skills/skills/ultraresearch/SKILL.md +9 -8
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +69 -0
- package/packages/shared-skills/skills/ulw-plan/agents/openai.yaml +7 -0
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +99 -0
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +44 -0
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +44 -0
- package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
- package/packages/shared-skills/skills/visual-qa/SKILL.md +17 -1
- package/packages/shared-skills/skills/visual-qa/references/agent-browser-setup.md +44 -0
- package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +48 -4
- package/dist/cli/doctor/constants.d.ts +0 -32
- package/dist/cli/doctor/spawn-with-timeout.d.ts +0 -8
- package/dist/cli/doctor/types.d.ts +0 -148
- package/dist/features/builtin-skills/skills/frontend-ui-ux.d.ts +0 -2
- package/dist/mcp/ast-grep.d.ts +0 -11
- package/packages/ast-grep-mcp/dist/cli.js +0 -1159
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.js +0 -6
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +0 -132
- package/packages/lsp-tools-mcp/dist/lsp/client.js +0 -131
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +0 -220
- package/packages/lsp-tools-mcp/dist/lsp/connection.js +0 -66
- package/packages/lsp-tools-mcp/dist/lsp/constants.js +0 -10
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +0 -125
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +0 -8
- package/packages/lsp-tools-mcp/dist/lsp/errors.js +0 -56
- package/packages/lsp-tools-mcp/dist/lsp/formatters.js +0 -106
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +0 -59
- package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.js +0 -247
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +0 -170
- package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.js +0 -17
- package/packages/lsp-tools-mcp/dist/lsp/process.js +0 -153
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +0 -170
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +0 -51
- package/packages/lsp-tools-mcp/dist/lsp/server-installation.js +0 -40
- package/packages/lsp-tools-mcp/dist/lsp/server-resolution.js +0 -86
- package/packages/lsp-tools-mcp/dist/lsp/startup-failure.js +0 -35
- package/packages/lsp-tools-mcp/dist/lsp/transport.js +0 -241
- package/packages/lsp-tools-mcp/dist/lsp/types.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +0 -175
- package/packages/lsp-tools-mcp/dist/missing-dependency-result.js +0 -14
- package/packages/omo-codex/plugin/components/bootstrap/manifests/ast-grep.json +0 -22
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +0 -7
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +0 -173
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +0 -22
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +0 -165
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +0 -1
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +0 -1
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +0 -5
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +0 -4
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +0 -6
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +0 -10
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +0 -2
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +0 -11
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +0 -3
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +0 -104
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +0 -26
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +0 -144
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +0 -43
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +0 -1
- package/packages/omo-codex/plugin/components/comment-checker/src/record.ts +0 -11
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +0 -5
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +0 -1
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +0 -47
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +0 -127
- package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +0 -2
- package/packages/omo-codex/plugin/components/rules/dist/config.js +0 -100
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +0 -2
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +0 -26
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +0 -8
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +0 -36
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +0 -7
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +0 -65
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +0 -3
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +0 -14
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +0 -2
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +0 -24
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +0 -4
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +0 -24
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +0 -13
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +0 -172
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +0 -74
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +0 -4
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +0 -1
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +0 -32
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +0 -13
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +0 -29
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +0 -9
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +0 -51
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +0 -70
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +0 -101
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +0 -5
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +0 -60
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +0 -61
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +0 -7
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +0 -60
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +0 -11
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +0 -75
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +0 -29
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +0 -44
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +0 -1
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +0 -5
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +0 -85
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +0 -12
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +0 -14
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +0 -51
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +0 -33
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +0 -5
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +0 -40
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +0 -28
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +0 -146
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +0 -7
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +0 -112
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +0 -18
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +0 -93
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +0 -3
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +0 -27
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +0 -7
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +0 -30
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +0 -2
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +0 -237
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +0 -3
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +0 -31
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +0 -1
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +0 -48
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +0 -1
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +0 -23
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +0 -14
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +0 -111
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +0 -3
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +0 -9
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +0 -18
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +0 -59
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +0 -126
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +0 -8
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +0 -20
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +0 -3
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +0 -41
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +0 -10
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +0 -90
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +0 -3
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +0 -128
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +0 -168
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +0 -4
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +0 -49
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +0 -4
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +0 -91
- package/packages/omo-codex/plugin/components/rules/src/rules/cache.ts +0 -64
- package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +0 -122
- package/packages/omo-codex/plugin/components/rules/src/rules/engine-dynamic-cache.ts +0 -87
- package/packages/omo-codex/plugin/components/rules/src/rules/engine-dynamic-loader.ts +0 -94
- package/packages/omo-codex/plugin/components/rules/src/rules/engine-loader.ts +0 -84
- package/packages/omo-codex/plugin/components/rules/src/rules/engine-paths.ts +0 -103
- package/packages/omo-codex/plugin/components/rules/src/rules/engine-static-loader.ts +0 -43
- package/packages/omo-codex/plugin/components/rules/src/rules/engine-types.ts +0 -45
- package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +0 -123
- package/packages/omo-codex/plugin/components/rules/src/rules/errors.ts +0 -13
- package/packages/omo-codex/plugin/components/rules/src/rules/finder-cache.ts +0 -73
- package/packages/omo-codex/plugin/components/rules/src/rules/finder-paths.ts +0 -47
- package/packages/omo-codex/plugin/components/rules/src/rules/finder-sources.ts +0 -45
- package/packages/omo-codex/plugin/components/rules/src/rules/finder.ts +0 -220
- package/packages/omo-codex/plugin/components/rules/src/rules/formatter.ts +0 -149
- package/packages/omo-codex/plugin/components/rules/src/rules/matcher.ts +0 -142
- package/packages/omo-codex/plugin/components/rules/src/rules/ordering.ts +0 -33
- package/packages/omo-codex/plugin/components/rules/src/rules/parser-frontmatter.ts +0 -39
- package/packages/omo-codex/plugin/components/rules/src/rules/parser-yaml.ts +0 -271
- package/packages/omo-codex/plugin/components/rules/src/rules/parser.ts +0 -35
- package/packages/omo-codex/plugin/components/rules/src/rules/plugin-root.ts +0 -55
- package/packages/omo-codex/plugin/components/rules/src/rules/project-root.ts +0 -30
- package/packages/omo-codex/plugin/components/rules/src/rules/scanner.ts +0 -162
- package/packages/omo-codex/plugin/components/rules/src/rules/sources.ts +0 -13
- package/packages/omo-codex/plugin/components/rules/src/rules/truncator.ts +0 -84
- package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +0 -141
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +0 -16
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +0 -146
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +0 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +0 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +0 -80
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +0 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +0 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +0 -5
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +0 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +0 -20
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +0 -1
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +0 -1
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +0 -18
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +0 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +0 -15
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +0 -42
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +0 -10
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +0 -35
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +0 -12
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +0 -108
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +0 -4
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +0 -31
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +0 -8
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +0 -68
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +0 -21
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +0 -8
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +0 -29
- package/packages/omo-codex/plugin/components/telemetry/src/atomic-write.ts +0 -22
- package/packages/omo-codex/plugin/components/telemetry/src/data-path.ts +0 -45
- package/packages/omo-codex/plugin/components/telemetry/src/diagnostics.ts +0 -154
- package/packages/omo-codex/plugin/components/telemetry/src/env-flags.ts +0 -43
- package/packages/omo-codex/plugin/components/telemetry/src/posthog-activity-state.ts +0 -97
- package/packages/omo-codex/plugin/components/ultrawork/agents/codex-ultrawork-reviewer.toml +0 -21
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +0 -2
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +0 -7
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +0 -122
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +0 -1
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +0 -2
- package/packages/omo-codex/plugin/skills/frontend-ui-ux/SKILL.md +0 -77
- package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +0 -85
- package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +0 -89
- package/packages/omo-codex/scripts/atomic-write.test.mjs +0 -82
- package/packages/omo-codex/scripts/install/agent-source-roots.mjs +0 -13
- package/packages/omo-codex/scripts/install/agents.d.mts +0 -18
- package/packages/omo-codex/scripts/install/agents.mjs +0 -227
- package/packages/omo-codex/scripts/install/atomic-write.mjs +0 -59
- package/packages/omo-codex/scripts/install/bin-dir.d.mts +0 -7
- package/packages/omo-codex/scripts/install/bin-dir.mjs +0 -20
- package/packages/omo-codex/scripts/install/bin-links.d.mts +0 -18
- package/packages/omo-codex/scripts/install/bin-links.mjs +0 -276
- package/packages/omo-codex/scripts/install/cache.mjs +0 -295
- package/packages/omo-codex/scripts/install/cached-marketplace-manifest.mjs +0 -21
- package/packages/omo-codex/scripts/install/cli-args.mjs +0 -149
- package/packages/omo-codex/scripts/install/command-shim.mjs +0 -1
- package/packages/omo-codex/scripts/install/config.d.mts +0 -35
- package/packages/omo-codex/scripts/install/config.mjs +0 -267
- package/packages/omo-codex/scripts/install/delegated-command.mjs +0 -29
- package/packages/omo-codex/scripts/install/git-bash-mcp-env.d.mts +0 -5
- package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +0 -28
- package/packages/omo-codex/scripts/install/git-bash.d.mts +0 -23
- package/packages/omo-codex/scripts/install/git-bash.mjs +0 -107
- package/packages/omo-codex/scripts/install/git-bash.test.mjs +0 -209
- package/packages/omo-codex/scripts/install/hook-targets.mjs +0 -46
- package/packages/omo-codex/scripts/install/hook-trust.d.mts +0 -10
- package/packages/omo-codex/scripts/install/hook-trust.mjs +0 -84
- package/packages/omo-codex/scripts/install/lazycodex-version-stamp.mjs +0 -102
- package/packages/omo-codex/scripts/install/legacy-bins.mjs +0 -66
- package/packages/omo-codex/scripts/install/marketplace.mjs +0 -104
- package/packages/omo-codex/scripts/install/mcp-runtime-cache.mjs +0 -81
- package/packages/omo-codex/scripts/install/model-catalog.mjs +0 -74
- package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +0 -50
- package/packages/omo-codex/scripts/install/permissions.d.mts +0 -1
- package/packages/omo-codex/scripts/install/permissions.mjs +0 -37
- package/packages/omo-codex/scripts/install/process.mjs +0 -22
- package/packages/omo-codex/scripts/install/project-local-cleanup.mjs +0 -228
- package/packages/omo-codex/scripts/install/reasoning-config.mjs +0 -72
- package/packages/omo-codex/scripts/install/snapshot.mjs +0 -53
- package/packages/omo-codex/scripts/install/source-package-build.mjs +0 -20
- package/packages/omo-codex/scripts/install/toml-editor.mjs +0 -64
- package/packages/omo-codex/scripts/install/utils.mjs +0 -15
- package/packages/omo-codex/scripts/sync-telemetry-component.mjs +0 -116
- package/packages/omo-codex/scripts/sync-telemetry-component.test.mjs +0 -94
- package/packages/shared-skills/skills/frontend-ui-ux/SKILL.md +0 -77
- /package/dist/cli/doctor/{doctor-target.d.ts → framework/doctor-target.d.ts} +0 -0
- /package/dist/cli/doctor/{format-default.d.ts → framework/format-default.d.ts} +0 -0
- /package/dist/cli/doctor/{format-shared.d.ts → framework/format-shared.d.ts} +0 -0
- /package/dist/cli/doctor/{format-status.d.ts → framework/format-status.d.ts} +0 -0
- /package/dist/cli/doctor/{format-verbose.d.ts → framework/format-verbose.d.ts} +0 -0
- /package/dist/cli/doctor/{formatter.d.ts → framework/formatter.d.ts} +0 -0
- /package/packages/omo-codex/plugin/components/{comment-checker → codegraph}/dist/cli.d.ts +0 -0
- /package/packages/omo-codex/plugin/components/{rules → lazycodex-executor-verify}/dist/cli.d.ts +0 -0
|
@@ -3,17 +3,217 @@
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
import { argv, stderr } from "node:process";
|
|
5
5
|
|
|
6
|
-
// src/
|
|
7
|
-
|
|
6
|
+
// ../mcp-stdio-core/src/record.ts
|
|
7
|
+
function isPlainRecord(value) {
|
|
8
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9
|
+
}
|
|
10
|
+
// ../mcp-stdio-core/src/responses.ts
|
|
11
|
+
function successResponse(id, result) {
|
|
12
|
+
return { jsonrpc: "2.0", id, result };
|
|
13
|
+
}
|
|
14
|
+
function errorResponse(id, code, message, data) {
|
|
15
|
+
return { jsonrpc: "2.0", id, error: data === undefined ? { code, message } : { code, message, data } };
|
|
16
|
+
}
|
|
17
|
+
function jsonRpcId(value) {
|
|
18
|
+
return typeof value === "string" || typeof value === "number" || value === null ? value : null;
|
|
19
|
+
}
|
|
20
|
+
function messageFromError(error) {
|
|
21
|
+
return error instanceof Error ? error.message : String(error);
|
|
22
|
+
}
|
|
23
|
+
// ../mcp-stdio-core/src/transport.ts
|
|
24
|
+
var HEADER_SEPARATOR = Buffer.from(`\r
|
|
25
|
+
\r
|
|
26
|
+
`);
|
|
27
|
+
async function* readStdioJsonRpcMessages(input) {
|
|
28
|
+
let buffer = Buffer.alloc(0);
|
|
29
|
+
for await (const chunk of input) {
|
|
30
|
+
buffer = Buffer.concat([buffer, bufferFromChunk(chunk)]);
|
|
31
|
+
while (true) {
|
|
32
|
+
const result = readNextMessage(buffer);
|
|
33
|
+
if (result.kind === "incomplete")
|
|
34
|
+
break;
|
|
35
|
+
buffer = result.remaining;
|
|
36
|
+
if (result.message)
|
|
37
|
+
yield result.message;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const trailing = buffer.toString("utf8").trim();
|
|
41
|
+
if (trailing.length > 0) {
|
|
42
|
+
yield parseJsonPayload(trailing, "line");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function writeStdioJsonRpcResponse(output, response, responseMode) {
|
|
46
|
+
const body = JSON.stringify(response);
|
|
47
|
+
if (responseMode === "framed") {
|
|
48
|
+
output.write(`Content-Length: ${Buffer.byteLength(body, "utf8")}\r
|
|
49
|
+
\r
|
|
50
|
+
${body}`);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
output.write(`${body}
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
function readNextMessage(buffer) {
|
|
57
|
+
if (buffer.length === 0)
|
|
58
|
+
return { kind: "incomplete" };
|
|
59
|
+
return startsWithContentLength(buffer) ? readFramedMessage(buffer) : readLineMessage(buffer);
|
|
60
|
+
}
|
|
61
|
+
function readLineMessage(buffer) {
|
|
62
|
+
const newlineIndex = buffer.indexOf(10);
|
|
63
|
+
if (newlineIndex === -1)
|
|
64
|
+
return { kind: "incomplete" };
|
|
65
|
+
const line = buffer.subarray(0, newlineIndex).toString("utf8").replace(/\r$/, "");
|
|
66
|
+
if (line.trim().length === 0) {
|
|
67
|
+
return { kind: "complete", remaining: buffer.subarray(newlineIndex + 1) };
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
kind: "complete",
|
|
71
|
+
message: parseJsonPayload(line, "line"),
|
|
72
|
+
remaining: buffer.subarray(newlineIndex + 1)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function readFramedMessage(buffer) {
|
|
76
|
+
const separatorIndex = buffer.indexOf(HEADER_SEPARATOR);
|
|
77
|
+
if (separatorIndex === -1)
|
|
78
|
+
return { kind: "incomplete" };
|
|
79
|
+
const headers = buffer.subarray(0, separatorIndex).toString("ascii");
|
|
80
|
+
const contentLength = parseContentLength(headers);
|
|
81
|
+
const bodyStart = separatorIndex + HEADER_SEPARATOR.length;
|
|
82
|
+
if (contentLength === undefined) {
|
|
83
|
+
return {
|
|
84
|
+
kind: "complete",
|
|
85
|
+
message: {
|
|
86
|
+
kind: "parse_error",
|
|
87
|
+
message: "Missing or invalid Content-Length header",
|
|
88
|
+
responseMode: "framed"
|
|
89
|
+
},
|
|
90
|
+
remaining: buffer.subarray(bodyStart)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const bodyEnd = bodyStart + contentLength;
|
|
94
|
+
if (buffer.length < bodyEnd)
|
|
95
|
+
return { kind: "incomplete" };
|
|
96
|
+
const body = buffer.subarray(bodyStart, bodyEnd).toString("utf8");
|
|
97
|
+
return {
|
|
98
|
+
kind: "complete",
|
|
99
|
+
message: parseJsonPayload(body, "framed"),
|
|
100
|
+
remaining: buffer.subarray(bodyEnd)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function startsWithContentLength(buffer) {
|
|
104
|
+
const prefix = buffer.subarray(0, "content-length:".length).toString("ascii").toLowerCase();
|
|
105
|
+
return prefix === "content-length:";
|
|
106
|
+
}
|
|
107
|
+
function parseContentLength(headers) {
|
|
108
|
+
for (const line of headers.split(`\r
|
|
109
|
+
`)) {
|
|
110
|
+
const match = /^content-length:\s*(\d+)$/i.exec(line);
|
|
111
|
+
if (match === null)
|
|
112
|
+
continue;
|
|
113
|
+
const value = match[1];
|
|
114
|
+
if (value === undefined)
|
|
115
|
+
return;
|
|
116
|
+
return Number(value);
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
function parseJsonPayload(payload, responseMode) {
|
|
121
|
+
try {
|
|
122
|
+
return { kind: "request", payload: JSON.parse(payload), responseMode };
|
|
123
|
+
} catch (error) {
|
|
124
|
+
return { kind: "parse_error", message: error instanceof Error ? error.message : String(error), responseMode };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function bufferFromChunk(chunk) {
|
|
128
|
+
if (Buffer.isBuffer(chunk))
|
|
129
|
+
return chunk;
|
|
130
|
+
if (typeof chunk === "string")
|
|
131
|
+
return Buffer.from(chunk);
|
|
132
|
+
throw new TypeError(`Unsupported stdio chunk type: ${typeof chunk}`);
|
|
133
|
+
}
|
|
8
134
|
|
|
9
|
-
// ../
|
|
10
|
-
|
|
135
|
+
// ../mcp-stdio-core/src/server.ts
|
|
136
|
+
var DEFAULT_IDLE_TIMEOUT_MS = 10 * 60000;
|
|
137
|
+
var noopLog = () => {};
|
|
138
|
+
async function runJsonRpcStdioServer(config) {
|
|
139
|
+
const log = config.log ?? noopLog;
|
|
140
|
+
const idleTimeoutMs = config.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
|
|
141
|
+
const idleTimer = createIdleTimer(idleTimeoutMs, log, config.onIdleTimeout);
|
|
142
|
+
log("stdio_started", { cwd: process.cwd(), idle_timeout_ms: idleTimeoutMs });
|
|
143
|
+
idleTimer.arm();
|
|
144
|
+
try {
|
|
145
|
+
for await (const message of readStdioJsonRpcMessages(config.input)) {
|
|
146
|
+
if (idleTimer.closed())
|
|
147
|
+
break;
|
|
148
|
+
idleTimer.arm();
|
|
149
|
+
if (message.kind === "parse_error") {
|
|
150
|
+
handleParseError(message, config, log);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
await handleRequest(message, config, log);
|
|
154
|
+
}
|
|
155
|
+
} finally {
|
|
156
|
+
idleTimer.clear();
|
|
157
|
+
log("stdio_stopped");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function handleParseError(message, config, log) {
|
|
161
|
+
log("parse_error", { message: message.message });
|
|
162
|
+
const response = config.parseErrorResponse?.(message.message) ?? errorResponse(null, -32700, "Parse error", message.message);
|
|
163
|
+
if (response !== undefined) {
|
|
164
|
+
writeStdioJsonRpcResponse(config.output, response, message.responseMode);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
async function handleRequest(message, config, log) {
|
|
168
|
+
const parsed = message.payload;
|
|
169
|
+
const id = isPlainRecord(parsed) ? jsonRpcId(parsed["id"]) : null;
|
|
170
|
+
const method = isPlainRecord(parsed) && typeof parsed["method"] === "string" ? parsed["method"] : null;
|
|
171
|
+
log("request", { id: id === null ? null : String(id), method });
|
|
172
|
+
try {
|
|
173
|
+
const response = await config.handler(parsed, config.handlerOptions);
|
|
174
|
+
if (response === undefined)
|
|
175
|
+
return;
|
|
176
|
+
writeStdioJsonRpcResponse(config.output, response, message.responseMode);
|
|
177
|
+
log("response", { id: String(response.id), method, is_error: response.error !== undefined });
|
|
178
|
+
} catch (error) {
|
|
179
|
+
if (config.onHandlerError === undefined)
|
|
180
|
+
throw error;
|
|
181
|
+
config.onHandlerError(error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
|
|
185
|
+
let timer = null;
|
|
186
|
+
let isClosed = false;
|
|
187
|
+
return {
|
|
188
|
+
arm: () => {
|
|
189
|
+
if (timer !== null)
|
|
190
|
+
clearTimeout(timer);
|
|
191
|
+
if (idleTimeoutMs <= 0)
|
|
192
|
+
return;
|
|
193
|
+
timer = setTimeout(() => {
|
|
194
|
+
isClosed = true;
|
|
195
|
+
log("idle_timeout", { idle_timeout_ms: idleTimeoutMs });
|
|
196
|
+
onIdleTimeout?.();
|
|
197
|
+
}, idleTimeoutMs);
|
|
198
|
+
timer.unref();
|
|
199
|
+
},
|
|
200
|
+
clear: () => {
|
|
201
|
+
if (timer === null)
|
|
202
|
+
return;
|
|
203
|
+
clearTimeout(timer);
|
|
204
|
+
timer = null;
|
|
205
|
+
},
|
|
206
|
+
closed: () => isClosed
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
// ../lsp-core/src/tools/diagnostics.ts
|
|
210
|
+
import { resolve as resolve4 } from "node:path";
|
|
11
211
|
|
|
12
|
-
// ../lsp-
|
|
212
|
+
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
13
213
|
import { existsSync as existsSync5, statSync as statSync2 } from "node:fs";
|
|
14
214
|
import { dirname as dirname2, join as join5, resolve as resolve2 } from "node:path";
|
|
15
215
|
|
|
16
|
-
// ../lsp-
|
|
216
|
+
// ../lsp-core/src/request-context.ts
|
|
17
217
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
18
218
|
var storage = new AsyncLocalStorage;
|
|
19
219
|
function runWithRequestContext(context, fn) {
|
|
@@ -29,7 +229,7 @@ function contextEnv(key) {
|
|
|
29
229
|
return process.env[key];
|
|
30
230
|
}
|
|
31
231
|
|
|
32
|
-
// ../lsp-
|
|
232
|
+
// ../lsp-core/src/lsp/effective-extension.ts
|
|
33
233
|
import { basename, extname } from "node:path";
|
|
34
234
|
var BASENAME_EXTENSIONS = {
|
|
35
235
|
Dockerfile: ".dockerfile",
|
|
@@ -39,17 +239,24 @@ function effectiveExtension(filePath) {
|
|
|
39
239
|
return BASENAME_EXTENSIONS[basename(filePath)] ?? extname(filePath);
|
|
40
240
|
}
|
|
41
241
|
|
|
42
|
-
// ../lsp-
|
|
242
|
+
// ../lsp-core/src/lsp/errors.ts
|
|
43
243
|
class LspConnectionClosedError extends Error {
|
|
244
|
+
serverId;
|
|
245
|
+
root;
|
|
246
|
+
name = "LspConnectionClosedError";
|
|
44
247
|
constructor(serverId, root, message) {
|
|
45
248
|
super(message ?? `LSP connection closed for ${serverId} at ${root}`);
|
|
46
249
|
this.serverId = serverId;
|
|
47
250
|
this.root = root;
|
|
48
|
-
this.name = "LspConnectionClosedError";
|
|
49
251
|
}
|
|
50
252
|
}
|
|
51
253
|
|
|
52
254
|
class LspProcessExitedError extends Error {
|
|
255
|
+
serverId;
|
|
256
|
+
root;
|
|
257
|
+
exitCode;
|
|
258
|
+
stderrTail;
|
|
259
|
+
name = "LspProcessExitedError";
|
|
53
260
|
constructor(serverId, root, exitCode, stderrTail) {
|
|
54
261
|
const stderrSuffix = stderrTail ? `
|
|
55
262
|
stderr tail: ${stderrTail}` : "";
|
|
@@ -58,54 +265,47 @@ stderr tail: ${stderrTail}` : "";
|
|
|
58
265
|
this.root = root;
|
|
59
266
|
this.exitCode = exitCode;
|
|
60
267
|
this.stderrTail = stderrTail;
|
|
61
|
-
this.name = "LspProcessExitedError";
|
|
62
268
|
}
|
|
63
269
|
}
|
|
64
270
|
|
|
65
271
|
class LspRequestTimeoutError extends Error {
|
|
272
|
+
method;
|
|
273
|
+
stderrTail;
|
|
274
|
+
name = "LspRequestTimeoutError";
|
|
66
275
|
constructor(method, stderrTail) {
|
|
67
276
|
const stderrSuffix = stderrTail ? `
|
|
68
277
|
recent stderr: ${stderrTail}` : "";
|
|
69
278
|
super(`LSP request timeout (method: ${method})${stderrSuffix}`);
|
|
70
279
|
this.method = method;
|
|
71
280
|
this.stderrTail = stderrTail;
|
|
72
|
-
this.name = "LspRequestTimeoutError";
|
|
73
281
|
}
|
|
74
282
|
}
|
|
75
283
|
|
|
76
284
|
class LspInvalidPathError extends Error {
|
|
77
|
-
|
|
78
|
-
super(...arguments);
|
|
79
|
-
this.name = "LspInvalidPathError";
|
|
80
|
-
}
|
|
285
|
+
name = "LspInvalidPathError";
|
|
81
286
|
}
|
|
82
287
|
|
|
83
288
|
class LspServerLookupError extends Error {
|
|
84
|
-
|
|
85
|
-
super(...arguments);
|
|
86
|
-
this.name = "LspServerLookupError";
|
|
87
|
-
}
|
|
289
|
+
name = "LspServerLookupError";
|
|
88
290
|
}
|
|
89
291
|
|
|
90
292
|
class LspServerInitializingError extends Error {
|
|
293
|
+
originalError;
|
|
294
|
+
name = "LspServerInitializingError";
|
|
91
295
|
constructor(originalError) {
|
|
92
296
|
super(`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`);
|
|
93
297
|
this.originalError = originalError;
|
|
94
|
-
this.name = "LspServerInitializingError";
|
|
95
298
|
}
|
|
96
299
|
}
|
|
97
300
|
|
|
98
301
|
class LspProcessSpawnError extends Error {
|
|
99
|
-
|
|
100
|
-
super(...arguments);
|
|
101
|
-
this.name = "LspProcessSpawnError";
|
|
102
|
-
}
|
|
302
|
+
name = "LspProcessSpawnError";
|
|
103
303
|
}
|
|
104
304
|
function isLspDeadConnectionError(err) {
|
|
105
305
|
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
106
306
|
}
|
|
107
307
|
|
|
108
|
-
// ../lsp-
|
|
308
|
+
// ../lsp-core/src/lsp/cleanup-errors.ts
|
|
109
309
|
function reportBestEffortCleanupError(operation, error) {
|
|
110
310
|
if (process.env["CODEX_LSP_DEBUG_CLEANUP"] !== "1")
|
|
111
311
|
return;
|
|
@@ -113,15 +313,15 @@ function reportBestEffortCleanupError(operation, error) {
|
|
|
113
313
|
console.error(`[codex-lsp] ignored ${operation} failure during cleanup: ${message}`);
|
|
114
314
|
}
|
|
115
315
|
|
|
116
|
-
// ../lsp-
|
|
316
|
+
// ../lsp-core/src/lsp/client.ts
|
|
117
317
|
import { readFileSync } from "node:fs";
|
|
118
318
|
import { resolve } from "node:path";
|
|
119
319
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
120
320
|
|
|
121
|
-
// ../lsp-
|
|
321
|
+
// ../lsp-core/src/lsp/connection.ts
|
|
122
322
|
import { pathToFileURL } from "node:url";
|
|
123
323
|
|
|
124
|
-
// ../lsp-
|
|
324
|
+
// ../lsp-core/src/lsp/constants.ts
|
|
125
325
|
var DEFAULT_MAX_REFERENCES = 200;
|
|
126
326
|
var DEFAULT_MAX_SYMBOLS = 200;
|
|
127
327
|
var DEFAULT_MAX_DIAGNOSTICS = 200;
|
|
@@ -133,8 +333,8 @@ var REAPER_INTERVAL_MS = 60000;
|
|
|
133
333
|
var STOP_HARD_KILL_TIMEOUT_MS = 5000;
|
|
134
334
|
var STOP_SIGKILL_GRACE_MS = 1000;
|
|
135
335
|
|
|
136
|
-
// ../lsp-
|
|
137
|
-
var
|
|
336
|
+
// ../lsp-core/src/lsp/json-rpc-connection.ts
|
|
337
|
+
var HEADER_SEPARATOR2 = `\r
|
|
138
338
|
\r
|
|
139
339
|
`;
|
|
140
340
|
var PARSE_ERROR = -32700;
|
|
@@ -143,31 +343,20 @@ var METHOD_NOT_FOUND = -32601;
|
|
|
143
343
|
var INTERNAL_ERROR = -32603;
|
|
144
344
|
|
|
145
345
|
class JsonRpcConnection {
|
|
346
|
+
reader;
|
|
347
|
+
writer;
|
|
348
|
+
pendingRequests = new Map;
|
|
349
|
+
notificationHandlers = new Map;
|
|
350
|
+
requestHandlers = new Map;
|
|
351
|
+
closeHandlers = [];
|
|
352
|
+
errorHandlers = [];
|
|
353
|
+
inputBuffer = Buffer.alloc(0);
|
|
354
|
+
nextRequestId = 1;
|
|
355
|
+
listening = false;
|
|
356
|
+
disposed = false;
|
|
146
357
|
constructor(reader, writer) {
|
|
147
358
|
this.reader = reader;
|
|
148
359
|
this.writer = writer;
|
|
149
|
-
this.pendingRequests = new Map;
|
|
150
|
-
this.notificationHandlers = new Map;
|
|
151
|
-
this.requestHandlers = new Map;
|
|
152
|
-
this.closeHandlers = [];
|
|
153
|
-
this.errorHandlers = [];
|
|
154
|
-
this.inputBuffer = Buffer.alloc(0);
|
|
155
|
-
this.nextRequestId = 1;
|
|
156
|
-
this.listening = false;
|
|
157
|
-
this.disposed = false;
|
|
158
|
-
this.handleData = (chunk) => {
|
|
159
|
-
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
160
|
-
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
161
|
-
this.drainInputBuffer();
|
|
162
|
-
};
|
|
163
|
-
this.handleClose = () => {
|
|
164
|
-
for (const handler of this.closeHandlers) {
|
|
165
|
-
handler();
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
this.handleStreamError = (error) => {
|
|
169
|
-
this.emitError(error);
|
|
170
|
-
};
|
|
171
360
|
}
|
|
172
361
|
listen() {
|
|
173
362
|
if (this.listening)
|
|
@@ -235,19 +424,32 @@ class JsonRpcConnection {
|
|
|
235
424
|
this.notificationHandlers.clear();
|
|
236
425
|
this.requestHandlers.clear();
|
|
237
426
|
}
|
|
427
|
+
handleData = (chunk) => {
|
|
428
|
+
const chunkBuffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, "utf8");
|
|
429
|
+
this.inputBuffer = Buffer.concat([this.inputBuffer, chunkBuffer]);
|
|
430
|
+
this.drainInputBuffer();
|
|
431
|
+
};
|
|
432
|
+
handleClose = () => {
|
|
433
|
+
for (const handler of this.closeHandlers) {
|
|
434
|
+
handler();
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
handleStreamError = (error) => {
|
|
438
|
+
this.emitError(error);
|
|
439
|
+
};
|
|
238
440
|
drainInputBuffer() {
|
|
239
441
|
while (true) {
|
|
240
|
-
const headerEnd = this.inputBuffer.indexOf(
|
|
442
|
+
const headerEnd = this.inputBuffer.indexOf(HEADER_SEPARATOR2);
|
|
241
443
|
if (headerEnd === -1)
|
|
242
444
|
return;
|
|
243
445
|
const headers = this.inputBuffer.subarray(0, headerEnd).toString("ascii");
|
|
244
|
-
const contentLength =
|
|
446
|
+
const contentLength = parseContentLength2(headers);
|
|
245
447
|
if (contentLength === null) {
|
|
246
448
|
this.inputBuffer = Buffer.alloc(0);
|
|
247
449
|
this.emitError(new Error("JSON-RPC message is missing Content-Length header"));
|
|
248
450
|
return;
|
|
249
451
|
}
|
|
250
|
-
const bodyStart = headerEnd + Buffer.byteLength(
|
|
452
|
+
const bodyStart = headerEnd + Buffer.byteLength(HEADER_SEPARATOR2);
|
|
251
453
|
const bodyEnd = bodyStart + contentLength;
|
|
252
454
|
if (this.inputBuffer.length < bodyEnd)
|
|
253
455
|
return;
|
|
@@ -345,7 +547,7 @@ ${body}`;
|
|
|
345
547
|
}
|
|
346
548
|
}
|
|
347
549
|
}
|
|
348
|
-
function
|
|
550
|
+
function parseContentLength2(headers) {
|
|
349
551
|
for (const line of headers.split(`\r
|
|
350
552
|
`)) {
|
|
351
553
|
const separatorIndex = line.indexOf(":");
|
|
@@ -382,7 +584,7 @@ function toError(error) {
|
|
|
382
584
|
return error instanceof Error ? error : new Error(String(error));
|
|
383
585
|
}
|
|
384
586
|
|
|
385
|
-
// ../lsp-
|
|
587
|
+
// ../lsp-core/src/lsp/process.ts
|
|
386
588
|
import { spawn, spawnSync } from "node:child_process";
|
|
387
589
|
import { existsSync, statSync } from "node:fs";
|
|
388
590
|
import { delimiter, join } from "node:path";
|
|
@@ -528,7 +730,7 @@ function spawnProcess(command, options) {
|
|
|
528
730
|
return wrap(proc);
|
|
529
731
|
}
|
|
530
732
|
|
|
531
|
-
// ../lsp-
|
|
733
|
+
// ../lsp-core/src/lsp/transport.ts
|
|
532
734
|
function isRecord(value) {
|
|
533
735
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
534
736
|
}
|
|
@@ -552,14 +754,18 @@ function parseDiagnosticsParams(params) {
|
|
|
552
754
|
}
|
|
553
755
|
|
|
554
756
|
class LspClientTransport {
|
|
555
|
-
|
|
757
|
+
root;
|
|
758
|
+
server;
|
|
759
|
+
proc = null;
|
|
760
|
+
connection = null;
|
|
761
|
+
stderrBuffer = [];
|
|
762
|
+
processExited = false;
|
|
763
|
+
diagnosticsStore = new Map;
|
|
764
|
+
requestTimeoutMs;
|
|
765
|
+
initializeTimeoutMs;
|
|
766
|
+
constructor(root, server2, timeouts = {}) {
|
|
556
767
|
this.root = root;
|
|
557
|
-
this.server =
|
|
558
|
-
this.proc = null;
|
|
559
|
-
this.connection = null;
|
|
560
|
-
this.stderrBuffer = [];
|
|
561
|
-
this.processExited = false;
|
|
562
|
-
this.diagnosticsStore = new Map;
|
|
768
|
+
this.server = server2;
|
|
563
769
|
this.requestTimeoutMs = timeouts.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
564
770
|
this.initializeTimeoutMs = timeouts.initializeTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
565
771
|
}
|
|
@@ -758,7 +964,7 @@ function isPosition(value) {
|
|
|
758
964
|
return isRecord(value) && typeof value["line"] === "number" && typeof value["character"] === "number";
|
|
759
965
|
}
|
|
760
966
|
|
|
761
|
-
// ../lsp-
|
|
967
|
+
// ../lsp-core/src/lsp/connection.ts
|
|
762
968
|
var INITIALIZE_SETTLE_MS = 300;
|
|
763
969
|
|
|
764
970
|
class LspClientConnection extends LspClientTransport {
|
|
@@ -824,7 +1030,7 @@ class LspClientConnection extends LspClientTransport {
|
|
|
824
1030
|
}
|
|
825
1031
|
}
|
|
826
1032
|
|
|
827
|
-
// ../lsp-
|
|
1033
|
+
// ../lsp-core/src/lsp/language-mappings.ts
|
|
828
1034
|
var SYMBOL_KIND_MAP = {
|
|
829
1035
|
1: "File",
|
|
830
1036
|
2: "Module",
|
|
@@ -996,18 +1202,15 @@ function getLanguageId(ext) {
|
|
|
996
1202
|
return EXT_TO_LANG[ext] ?? "plaintext";
|
|
997
1203
|
}
|
|
998
1204
|
|
|
999
|
-
// ../lsp-
|
|
1205
|
+
// ../lsp-core/src/lsp/client.ts
|
|
1000
1206
|
var POST_OPEN_DELAY_MS = 1000;
|
|
1001
1207
|
var POST_DIAGNOSTICS_WAIT_MS = 500;
|
|
1002
1208
|
|
|
1003
1209
|
class LspClient extends LspClientConnection {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
this.lastSyncedText = new Map;
|
|
1009
|
-
this.diagnosticPullErrors = [];
|
|
1010
|
-
}
|
|
1210
|
+
openedFiles = new Set;
|
|
1211
|
+
documentVersions = new Map;
|
|
1212
|
+
lastSyncedText = new Map;
|
|
1213
|
+
diagnosticPullErrors = [];
|
|
1011
1214
|
getDiagnosticPullErrors() {
|
|
1012
1215
|
return this.diagnosticPullErrors;
|
|
1013
1216
|
}
|
|
@@ -1122,7 +1325,7 @@ class LspClient extends LspClientConnection {
|
|
|
1122
1325
|
}
|
|
1123
1326
|
}
|
|
1124
1327
|
|
|
1125
|
-
// ../lsp-
|
|
1328
|
+
// ../lsp-core/src/lsp/process-signal-cleanup.ts
|
|
1126
1329
|
function installProcessSignalCleanup(cleanup) {
|
|
1127
1330
|
const signals = process.platform === "win32" ? ["SIGINT", "SIGTERM", "SIGBREAK"] : ["SIGINT", "SIGTERM"];
|
|
1128
1331
|
const handler = () => {
|
|
@@ -1140,7 +1343,7 @@ function installProcessSignalCleanup(cleanup) {
|
|
|
1140
1343
|
};
|
|
1141
1344
|
}
|
|
1142
1345
|
|
|
1143
|
-
// ../lsp-
|
|
1346
|
+
// ../lsp-core/src/lsp/manager.ts
|
|
1144
1347
|
async function stopClientBestEffort(client) {
|
|
1145
1348
|
try {
|
|
1146
1349
|
await client.stop();
|
|
@@ -1181,15 +1384,20 @@ function awaitWithSignal(promise, signal) {
|
|
|
1181
1384
|
}
|
|
1182
1385
|
|
|
1183
1386
|
class LspManager {
|
|
1387
|
+
clients = new Map;
|
|
1388
|
+
reaperHandle = null;
|
|
1389
|
+
signalDisposer = null;
|
|
1390
|
+
disposed = false;
|
|
1391
|
+
idleTimeoutMs;
|
|
1392
|
+
initTimeoutMs;
|
|
1393
|
+
reaperIntervalMs;
|
|
1394
|
+
clientFactory;
|
|
1395
|
+
now;
|
|
1184
1396
|
constructor(options = {}) {
|
|
1185
|
-
this.clients = new Map;
|
|
1186
|
-
this.reaperHandle = null;
|
|
1187
|
-
this.signalDisposer = null;
|
|
1188
|
-
this.disposed = false;
|
|
1189
1397
|
this.idleTimeoutMs = options.idleTimeoutMs ?? IDLE_TIMEOUT_MS;
|
|
1190
1398
|
this.initTimeoutMs = options.initTimeoutMs ?? INIT_TIMEOUT_MS;
|
|
1191
1399
|
this.reaperIntervalMs = options.reaperIntervalMs ?? REAPER_INTERVAL_MS;
|
|
1192
|
-
this.clientFactory = options.clientFactory ?? ((root,
|
|
1400
|
+
this.clientFactory = options.clientFactory ?? ((root, server2) => new LspClient(root, server2));
|
|
1193
1401
|
this.now = options.now ?? (() => Date.now());
|
|
1194
1402
|
this.startReaper();
|
|
1195
1403
|
this.signalDisposer = installProcessSignalCleanup(() => this.stopAll());
|
|
@@ -1227,12 +1435,12 @@ class LspManager {
|
|
|
1227
1435
|
await stopClientBestEffort(managed.client);
|
|
1228
1436
|
}
|
|
1229
1437
|
}
|
|
1230
|
-
async getClient(root,
|
|
1438
|
+
async getClient(root, server2, signal) {
|
|
1231
1439
|
if (this.disposed) {
|
|
1232
1440
|
throw new Error("LspManager has been disposed");
|
|
1233
1441
|
}
|
|
1234
1442
|
signal?.throwIfAborted();
|
|
1235
|
-
const key = this.getKey(root,
|
|
1443
|
+
const key = this.getKey(root, server2.id);
|
|
1236
1444
|
let managed = this.clients.get(key);
|
|
1237
1445
|
if (managed) {
|
|
1238
1446
|
const t = this.now();
|
|
@@ -1261,13 +1469,13 @@ class LspManager {
|
|
|
1261
1469
|
if (!managed.client.isAlive()) {
|
|
1262
1470
|
await stopClientBestEffort(managed.client);
|
|
1263
1471
|
this.clients.delete(key);
|
|
1264
|
-
return this.getClient(root,
|
|
1472
|
+
return this.getClient(root, server2, signal);
|
|
1265
1473
|
}
|
|
1266
1474
|
managed.refCount++;
|
|
1267
1475
|
managed.lastUsedAt = this.now();
|
|
1268
1476
|
return managed.client;
|
|
1269
1477
|
}
|
|
1270
|
-
const client = this.clientFactory(root,
|
|
1478
|
+
const client = this.clientFactory(root, server2);
|
|
1271
1479
|
const initStartedAt = this.now();
|
|
1272
1480
|
const initPromise = (async () => {
|
|
1273
1481
|
await client.start();
|
|
@@ -1323,13 +1531,13 @@ class LspManager {
|
|
|
1323
1531
|
this.clients.delete(key);
|
|
1324
1532
|
stopClientBestEffort(managed.client);
|
|
1325
1533
|
}
|
|
1326
|
-
warmupClient(root,
|
|
1534
|
+
warmupClient(root, server2) {
|
|
1327
1535
|
if (this.disposed)
|
|
1328
1536
|
return;
|
|
1329
|
-
const key = this.getKey(root,
|
|
1537
|
+
const key = this.getKey(root, server2.id);
|
|
1330
1538
|
if (this.clients.has(key))
|
|
1331
1539
|
return;
|
|
1332
|
-
const client = this.clientFactory(root,
|
|
1540
|
+
const client = this.clientFactory(root, server2);
|
|
1333
1541
|
const initStartedAt = this.now();
|
|
1334
1542
|
const initPromise = (async () => {
|
|
1335
1543
|
await client.start();
|
|
@@ -1417,7 +1625,7 @@ async function disposeDefaultLspManager() {
|
|
|
1417
1625
|
}
|
|
1418
1626
|
}
|
|
1419
1627
|
|
|
1420
|
-
// ../lsp-
|
|
1628
|
+
// ../lsp-core/src/lsp/server-install-state.ts
|
|
1421
1629
|
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, renameSync, writeFileSync } from "node:fs";
|
|
1422
1630
|
import { homedir } from "node:os";
|
|
1423
1631
|
import { dirname, isAbsolute, join as join2 } from "node:path";
|
|
@@ -1469,12 +1677,12 @@ function isRecord2(value) {
|
|
|
1469
1677
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1470
1678
|
}
|
|
1471
1679
|
|
|
1472
|
-
// ../lsp-
|
|
1680
|
+
// ../lsp-core/src/lsp/config-loader.ts
|
|
1473
1681
|
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
1474
1682
|
import { homedir as homedir2 } from "node:os";
|
|
1475
1683
|
import { delimiter as delimiter2, isAbsolute as isAbsolute2, join as join3 } from "node:path";
|
|
1476
1684
|
|
|
1477
|
-
// ../lsp-
|
|
1685
|
+
// ../lsp-core/src/lsp/server-definitions.ts
|
|
1478
1686
|
var LSP_INSTALL_HINTS = {
|
|
1479
1687
|
typescript: "npm install -g typescript-language-server typescript",
|
|
1480
1688
|
deno: "Install Deno from https://deno.land",
|
|
@@ -1621,7 +1829,7 @@ var BUILTIN_SERVERS = {
|
|
|
1621
1829
|
}
|
|
1622
1830
|
};
|
|
1623
1831
|
|
|
1624
|
-
// ../lsp-
|
|
1832
|
+
// ../lsp-core/src/lsp/config-loader.ts
|
|
1625
1833
|
function resolveProjectConfigPath(path) {
|
|
1626
1834
|
return isAbsolute2(path) ? path : join3(contextCwd(), path);
|
|
1627
1835
|
}
|
|
@@ -1686,10 +1894,10 @@ function getMergedServers() {
|
|
|
1686
1894
|
}
|
|
1687
1895
|
if (seen.has(id))
|
|
1688
1896
|
continue;
|
|
1689
|
-
const
|
|
1690
|
-
if (!
|
|
1897
|
+
const server2 = createServerFromEntry(id, entry, source);
|
|
1898
|
+
if (!server2)
|
|
1691
1899
|
continue;
|
|
1692
|
-
servers.push(
|
|
1900
|
+
servers.push(server2);
|
|
1693
1901
|
seen.add(id);
|
|
1694
1902
|
}
|
|
1695
1903
|
}
|
|
@@ -1721,7 +1929,7 @@ function createServerFromEntry(id, entry, source) {
|
|
|
1721
1929
|
if (source === "project") {
|
|
1722
1930
|
if (!builtin)
|
|
1723
1931
|
return null;
|
|
1724
|
-
const
|
|
1932
|
+
const server3 = createServer({
|
|
1725
1933
|
id,
|
|
1726
1934
|
command: builtin.command,
|
|
1727
1935
|
extensions: entry.extensions ?? builtin.extensions,
|
|
@@ -1729,35 +1937,35 @@ function createServerFromEntry(id, entry, source) {
|
|
|
1729
1937
|
source
|
|
1730
1938
|
});
|
|
1731
1939
|
if (entry.initialization !== undefined) {
|
|
1732
|
-
|
|
1940
|
+
server3.initialization = entry.initialization;
|
|
1733
1941
|
}
|
|
1734
|
-
return
|
|
1942
|
+
return server3;
|
|
1735
1943
|
}
|
|
1736
1944
|
if (entry.command && entry.extensions) {
|
|
1737
|
-
const
|
|
1945
|
+
const server3 = createServer({
|
|
1738
1946
|
id,
|
|
1739
1947
|
command: entry.command,
|
|
1740
1948
|
extensions: entry.extensions,
|
|
1741
1949
|
priority: entry.priority ?? 0,
|
|
1742
1950
|
source
|
|
1743
1951
|
});
|
|
1744
|
-
applyOptionalServerFields(
|
|
1745
|
-
return
|
|
1952
|
+
applyOptionalServerFields(server3, entry);
|
|
1953
|
+
return server3;
|
|
1746
1954
|
}
|
|
1747
1955
|
if (!builtin)
|
|
1748
1956
|
return null;
|
|
1749
|
-
const
|
|
1957
|
+
const server2 = createServer({
|
|
1750
1958
|
id,
|
|
1751
1959
|
command: entry.command ?? builtin.command,
|
|
1752
1960
|
extensions: entry.extensions ?? builtin.extensions,
|
|
1753
1961
|
priority: entry.priority ?? 0,
|
|
1754
1962
|
source
|
|
1755
1963
|
});
|
|
1756
|
-
applyOptionalServerFields(
|
|
1757
|
-
return
|
|
1964
|
+
applyOptionalServerFields(server2, entry);
|
|
1965
|
+
return server2;
|
|
1758
1966
|
}
|
|
1759
1967
|
function createServer(input) {
|
|
1760
|
-
const
|
|
1968
|
+
const server2 = {
|
|
1761
1969
|
id: input.id,
|
|
1762
1970
|
command: input.command,
|
|
1763
1971
|
extensions: input.extensions,
|
|
@@ -1765,19 +1973,19 @@ function createServer(input) {
|
|
|
1765
1973
|
source: input.source
|
|
1766
1974
|
};
|
|
1767
1975
|
if (input.env !== undefined) {
|
|
1768
|
-
|
|
1976
|
+
server2.env = input.env;
|
|
1769
1977
|
}
|
|
1770
1978
|
if (input.initialization !== undefined) {
|
|
1771
|
-
|
|
1979
|
+
server2.initialization = input.initialization;
|
|
1772
1980
|
}
|
|
1773
|
-
return
|
|
1981
|
+
return server2;
|
|
1774
1982
|
}
|
|
1775
|
-
function applyOptionalServerFields(
|
|
1983
|
+
function applyOptionalServerFields(server2, entry) {
|
|
1776
1984
|
if (entry.env !== undefined) {
|
|
1777
|
-
|
|
1985
|
+
server2.env = entry.env;
|
|
1778
1986
|
}
|
|
1779
1987
|
if (entry.initialization !== undefined) {
|
|
1780
|
-
|
|
1988
|
+
server2.initialization = entry.initialization;
|
|
1781
1989
|
}
|
|
1782
1990
|
}
|
|
1783
1991
|
function isConfigJson(value) {
|
|
@@ -1826,7 +2034,7 @@ function getDisabledServerIds() {
|
|
|
1826
2034
|
return disabled;
|
|
1827
2035
|
}
|
|
1828
2036
|
|
|
1829
|
-
// ../lsp-
|
|
2037
|
+
// ../lsp-core/src/lsp/server-installation.ts
|
|
1830
2038
|
import { existsSync as existsSync4 } from "node:fs";
|
|
1831
2039
|
import { delimiter as delimiter3, join as join4 } from "node:path";
|
|
1832
2040
|
function isServerInstalled(command, _workingDirectory) {
|
|
@@ -1867,24 +2075,24 @@ function isServerInstalled(command, _workingDirectory) {
|
|
|
1867
2075
|
return false;
|
|
1868
2076
|
}
|
|
1869
2077
|
|
|
1870
|
-
// ../lsp-
|
|
2078
|
+
// ../lsp-core/src/lsp/server-resolution.ts
|
|
1871
2079
|
function findServerForExtension(ext) {
|
|
1872
2080
|
const servers = getMergedServers();
|
|
1873
|
-
for (const
|
|
1874
|
-
if (
|
|
2081
|
+
for (const server2 of servers) {
|
|
2082
|
+
if (server2.extensions.includes(ext) && isServerInstalled(server2.command)) {
|
|
1875
2083
|
const resolvedServer = {
|
|
1876
|
-
id:
|
|
1877
|
-
command:
|
|
1878
|
-
extensions:
|
|
1879
|
-
priority:
|
|
2084
|
+
id: server2.id,
|
|
2085
|
+
command: server2.command,
|
|
2086
|
+
extensions: server2.extensions,
|
|
2087
|
+
priority: server2.priority
|
|
1880
2088
|
};
|
|
1881
|
-
if (
|
|
2089
|
+
if (server2.env !== undefined) {
|
|
1882
2090
|
return {
|
|
1883
2091
|
status: "found",
|
|
1884
2092
|
server: {
|
|
1885
2093
|
...resolvedServer,
|
|
1886
|
-
env:
|
|
1887
|
-
...
|
|
2094
|
+
env: server2.env,
|
|
2095
|
+
...server2.initialization === undefined ? {} : { initialization: server2.initialization }
|
|
1888
2096
|
}
|
|
1889
2097
|
};
|
|
1890
2098
|
}
|
|
@@ -1892,20 +2100,20 @@ function findServerForExtension(ext) {
|
|
|
1892
2100
|
status: "found",
|
|
1893
2101
|
server: {
|
|
1894
2102
|
...resolvedServer,
|
|
1895
|
-
...
|
|
2103
|
+
...server2.initialization === undefined ? {} : { initialization: server2.initialization }
|
|
1896
2104
|
}
|
|
1897
2105
|
};
|
|
1898
2106
|
}
|
|
1899
2107
|
}
|
|
1900
|
-
for (const
|
|
1901
|
-
if (
|
|
1902
|
-
const installHint = LSP_INSTALL_HINTS[
|
|
2108
|
+
for (const server2 of servers) {
|
|
2109
|
+
if (server2.extensions.includes(ext)) {
|
|
2110
|
+
const installHint = LSP_INSTALL_HINTS[server2.id] ?? `Install '${server2.command[0]}' and ensure it's in your PATH`;
|
|
1903
2111
|
return {
|
|
1904
2112
|
status: "not_installed",
|
|
1905
2113
|
server: {
|
|
1906
|
-
id:
|
|
1907
|
-
command:
|
|
1908
|
-
extensions:
|
|
2114
|
+
id: server2.id,
|
|
2115
|
+
command: server2.command,
|
|
2116
|
+
extensions: server2.extensions
|
|
1909
2117
|
},
|
|
1910
2118
|
installHint
|
|
1911
2119
|
};
|
|
@@ -1923,18 +2131,18 @@ function getAllServers() {
|
|
|
1923
2131
|
const disabled = getDisabledServerIds();
|
|
1924
2132
|
const result = [];
|
|
1925
2133
|
const seen = new Set;
|
|
1926
|
-
for (const
|
|
1927
|
-
if (seen.has(
|
|
2134
|
+
for (const server2 of servers) {
|
|
2135
|
+
if (seen.has(server2.id))
|
|
1928
2136
|
continue;
|
|
1929
2137
|
result.push({
|
|
1930
|
-
id:
|
|
1931
|
-
installed: isServerInstalled(
|
|
1932
|
-
extensions:
|
|
2138
|
+
id: server2.id,
|
|
2139
|
+
installed: isServerInstalled(server2.command),
|
|
2140
|
+
extensions: server2.extensions,
|
|
1933
2141
|
disabled: false,
|
|
1934
|
-
source:
|
|
1935
|
-
priority:
|
|
2142
|
+
source: server2.source,
|
|
2143
|
+
priority: server2.priority
|
|
1936
2144
|
});
|
|
1937
|
-
seen.add(
|
|
2145
|
+
seen.add(server2.id);
|
|
1938
2146
|
}
|
|
1939
2147
|
for (const id of disabled) {
|
|
1940
2148
|
if (seen.has(id))
|
|
@@ -1952,7 +2160,7 @@ function getAllServers() {
|
|
|
1952
2160
|
return result;
|
|
1953
2161
|
}
|
|
1954
2162
|
|
|
1955
|
-
// ../lsp-
|
|
2163
|
+
// ../lsp-core/src/lsp/client-wrapper.ts
|
|
1956
2164
|
var WORKSPACE_MARKERS = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
1957
2165
|
function isDirectoryPath(filePath) {
|
|
1958
2166
|
try {
|
|
@@ -2001,16 +2209,16 @@ function formatServerLookupError(result) {
|
|
|
2001
2209
|
`);
|
|
2002
2210
|
}
|
|
2003
2211
|
function formatNotInstalled(result) {
|
|
2004
|
-
const { server, installHint } = result;
|
|
2005
|
-
const extensions =
|
|
2006
|
-
const decision = loadInstallDecision(
|
|
2212
|
+
const { server: server2, installHint } = result;
|
|
2213
|
+
const extensions = server2.extensions.join(", ");
|
|
2214
|
+
const decision = loadInstallDecision(server2.id)?.decision;
|
|
2007
2215
|
if (decision === "declined") {
|
|
2008
|
-
return `LSP server '${
|
|
2216
|
+
return `LSP server '${server2.id}' (${extensions}) is NOT INSTALLED; user previously declined installation — proceed without LSP.`;
|
|
2009
2217
|
}
|
|
2010
2218
|
const header = [
|
|
2011
|
-
`LSP server '${
|
|
2219
|
+
`LSP server '${server2.id}' for ${extensions} is NOT INSTALLED.`,
|
|
2012
2220
|
"",
|
|
2013
|
-
`Command not found: ${
|
|
2221
|
+
`Command not found: ${server2.command[0]}`,
|
|
2014
2222
|
""
|
|
2015
2223
|
];
|
|
2016
2224
|
if (decision === "allowed") {
|
|
@@ -2029,7 +2237,7 @@ function formatNotInstalled(result) {
|
|
|
2029
2237
|
"ACTION REQUIRED — ASK THE USER whether to install this LSP server.",
|
|
2030
2238
|
"- If the user agrees: run the install command above, then retry this tool.",
|
|
2031
2239
|
"- If the user declines, OR has NOT explicitly asked for LSP installation:",
|
|
2032
|
-
` call lsp_install_decision { server_id: "${
|
|
2240
|
+
` call lsp_install_decision { server_id: "${server2.id}", decision: "declined" },`,
|
|
2033
2241
|
" then ignore this message and proceed WITHOUT LSP."
|
|
2034
2242
|
].join(`
|
|
2035
2243
|
`);
|
|
@@ -2052,36 +2260,36 @@ async function withLspClient(filePath, fn, toolName, options = {}) {
|
|
|
2052
2260
|
if (result.status !== "found") {
|
|
2053
2261
|
throw new LspServerLookupError(formatServerLookupError(result));
|
|
2054
2262
|
}
|
|
2055
|
-
const
|
|
2263
|
+
const server2 = result.server;
|
|
2056
2264
|
const root = findWorkspaceRoot(absPath);
|
|
2057
2265
|
const manager = options.manager ?? getLspManager();
|
|
2058
2266
|
const acquireAndCall = async (allowRetry) => {
|
|
2059
|
-
const client = await manager.getClient(root,
|
|
2267
|
+
const client = await manager.getClient(root, server2, options.signal);
|
|
2060
2268
|
try {
|
|
2061
2269
|
return await fn(client, root);
|
|
2062
2270
|
} catch (err) {
|
|
2063
2271
|
if (allowRetry && READ_ONLY_RETRY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
2064
|
-
manager.invalidateClient(root,
|
|
2272
|
+
manager.invalidateClient(root, server2.id, client);
|
|
2065
2273
|
return acquireAndCall(false);
|
|
2066
2274
|
}
|
|
2067
2275
|
if (err instanceof LspRequestTimeoutError) {
|
|
2068
|
-
if (manager.isServerInitializing(root,
|
|
2276
|
+
if (manager.isServerInitializing(root, server2.id)) {
|
|
2069
2277
|
throw new LspServerInitializingError(err);
|
|
2070
2278
|
}
|
|
2071
2279
|
}
|
|
2072
2280
|
throw err;
|
|
2073
2281
|
} finally {
|
|
2074
|
-
manager.releaseClient(root,
|
|
2282
|
+
manager.releaseClient(root, server2.id);
|
|
2075
2283
|
}
|
|
2076
2284
|
};
|
|
2077
2285
|
return acquireAndCall(true);
|
|
2078
2286
|
}
|
|
2079
2287
|
|
|
2080
|
-
// ../lsp-
|
|
2288
|
+
// ../lsp-core/src/lsp/directory-diagnostics.ts
|
|
2081
2289
|
import { existsSync as existsSync6, lstatSync, readdirSync } from "node:fs";
|
|
2082
2290
|
import { join as join6, resolve as resolve3 } from "node:path";
|
|
2083
2291
|
|
|
2084
|
-
// ../lsp-
|
|
2292
|
+
// ../lsp-core/src/lsp/formatters.ts
|
|
2085
2293
|
import { fileURLToPath } from "node:url";
|
|
2086
2294
|
var DIAGNOSTIC_SEVERITY_FILTERS = {
|
|
2087
2295
|
error: 1,
|
|
@@ -2189,7 +2397,7 @@ function formatApplyResult(result) {
|
|
|
2189
2397
|
`);
|
|
2190
2398
|
}
|
|
2191
2399
|
|
|
2192
|
-
// ../lsp-
|
|
2400
|
+
// ../lsp-core/src/lsp/directory-diagnostics.ts
|
|
2193
2401
|
var SKIP_DIRECTORIES = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
|
|
2194
2402
|
function collectFilesWithExtension(dir, extension, maxFiles) {
|
|
2195
2403
|
const files = [];
|
|
@@ -2238,7 +2446,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
2238
2446
|
if (serverResult.status !== "found") {
|
|
2239
2447
|
throw new LspServerLookupError(formatServerLookupError(serverResult));
|
|
2240
2448
|
}
|
|
2241
|
-
const
|
|
2449
|
+
const server2 = serverResult.server;
|
|
2242
2450
|
const allFiles = collectFilesWithExtension(absDir, extension, maxFiles + 1);
|
|
2243
2451
|
const wasCapped = allFiles.length > maxFiles;
|
|
2244
2452
|
const filesToProcess = allFiles.slice(0, maxFiles);
|
|
@@ -2255,7 +2463,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
2255
2463
|
const manager = getLspManager();
|
|
2256
2464
|
const allDiagnostics = [];
|
|
2257
2465
|
const fileErrors = [];
|
|
2258
|
-
const client = await manager.getClient(root,
|
|
2466
|
+
const client = await manager.getClient(root, server2);
|
|
2259
2467
|
try {
|
|
2260
2468
|
for (const file of filesToProcess) {
|
|
2261
2469
|
try {
|
|
@@ -2273,7 +2481,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
2273
2481
|
}
|
|
2274
2482
|
}
|
|
2275
2483
|
} finally {
|
|
2276
|
-
manager.releaseClient(root,
|
|
2484
|
+
manager.releaseClient(root, server2.id);
|
|
2277
2485
|
}
|
|
2278
2486
|
const displayDiagnostics = allDiagnostics.slice(0, DEFAULT_MAX_DIAGNOSTICS);
|
|
2279
2487
|
const wasDiagCapped = allDiagnostics.length > DEFAULT_MAX_DIAGNOSTICS;
|
|
@@ -2303,7 +2511,7 @@ async function aggregateDiagnosticsForDirectory(directory, extension, severity,
|
|
|
2303
2511
|
`);
|
|
2304
2512
|
}
|
|
2305
2513
|
|
|
2306
|
-
// ../lsp-
|
|
2514
|
+
// ../lsp-core/src/lsp/infer-extension.ts
|
|
2307
2515
|
import { lstatSync as lstatSync2, readdirSync as readdirSync2 } from "node:fs";
|
|
2308
2516
|
import { join as join7 } from "node:path";
|
|
2309
2517
|
var SKIP_DIRECTORIES2 = new Set(["node_modules", ".git", "dist", "build", ".next", "out"]);
|
|
@@ -2359,175 +2567,7 @@ function inferExtensionFromDirectory(directory) {
|
|
|
2359
2567
|
return maxExt || null;
|
|
2360
2568
|
}
|
|
2361
2569
|
|
|
2362
|
-
// ../lsp-
|
|
2363
|
-
import { existsSync as existsSync7, readFileSync as readFileSync4, realpathSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
2364
|
-
import { dirname as dirname3, isAbsolute as isAbsolute3, relative, resolve as resolve4 } from "node:path";
|
|
2365
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2366
|
-
function errorMessage(error) {
|
|
2367
|
-
return error instanceof Error ? error.message : String(error);
|
|
2368
|
-
}
|
|
2369
|
-
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
2370
|
-
const relativePath = relative(workspaceRoot, filePath);
|
|
2371
|
-
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute3(relativePath);
|
|
2372
|
-
}
|
|
2373
|
-
function realpathForValidation(filePath) {
|
|
2374
|
-
if (existsSync7(filePath))
|
|
2375
|
-
return realpathSync(filePath);
|
|
2376
|
-
const parent = dirname3(filePath);
|
|
2377
|
-
return resolve4(realpathSync(parent), relative(parent, filePath));
|
|
2378
|
-
}
|
|
2379
|
-
function uriToWorkspacePath(uri, workspaceRoot) {
|
|
2380
|
-
let filePath;
|
|
2381
|
-
try {
|
|
2382
|
-
filePath = fileURLToPath2(uri);
|
|
2383
|
-
} catch (error) {
|
|
2384
|
-
return { success: false, error: `non-file URI ${uri}: ${errorMessage(error)}` };
|
|
2385
|
-
}
|
|
2386
|
-
let validatedPath;
|
|
2387
|
-
try {
|
|
2388
|
-
validatedPath = realpathForValidation(filePath);
|
|
2389
|
-
} catch (error) {
|
|
2390
|
-
return { success: false, error: `${filePath}: ${errorMessage(error)}` };
|
|
2391
|
-
}
|
|
2392
|
-
if (!isPathInsideWorkspace(validatedPath, workspaceRoot)) {
|
|
2393
|
-
return { success: false, error: `${filePath}: outside workspace ${workspaceRoot}` };
|
|
2394
|
-
}
|
|
2395
|
-
return { success: true, path: filePath };
|
|
2396
|
-
}
|
|
2397
|
-
function applyTextEditsToFile(filePath, edits) {
|
|
2398
|
-
try {
|
|
2399
|
-
const content = readFileSync4(filePath, "utf-8");
|
|
2400
|
-
const lines = content.split(`
|
|
2401
|
-
`);
|
|
2402
|
-
const sortedEdits = [...edits].sort((a, b) => {
|
|
2403
|
-
if (b.range.start.line !== a.range.start.line) {
|
|
2404
|
-
return b.range.start.line - a.range.start.line;
|
|
2405
|
-
}
|
|
2406
|
-
return b.range.start.character - a.range.start.character;
|
|
2407
|
-
});
|
|
2408
|
-
for (const edit of sortedEdits) {
|
|
2409
|
-
const startLine = edit.range.start.line;
|
|
2410
|
-
const startChar = edit.range.start.character;
|
|
2411
|
-
const endLine = edit.range.end.line;
|
|
2412
|
-
const endChar = edit.range.end.character;
|
|
2413
|
-
if (startLine === endLine) {
|
|
2414
|
-
const line = lines[startLine] ?? "";
|
|
2415
|
-
lines[startLine] = line.substring(0, startChar) + edit.newText + line.substring(endChar);
|
|
2416
|
-
} else {
|
|
2417
|
-
const firstLine = lines[startLine] ?? "";
|
|
2418
|
-
const lastLine = lines[endLine] ?? "";
|
|
2419
|
-
const newContent = firstLine.substring(0, startChar) + edit.newText + lastLine.substring(endChar);
|
|
2420
|
-
lines.splice(startLine, endLine - startLine + 1, ...newContent.split(`
|
|
2421
|
-
`));
|
|
2422
|
-
}
|
|
2423
|
-
}
|
|
2424
|
-
writeFileSync2(filePath, lines.join(`
|
|
2425
|
-
`), "utf-8");
|
|
2426
|
-
return { success: true, editCount: edits.length };
|
|
2427
|
-
} catch (err) {
|
|
2428
|
-
return {
|
|
2429
|
-
success: false,
|
|
2430
|
-
editCount: 0,
|
|
2431
|
-
error: err instanceof Error ? err.message : String(err)
|
|
2432
|
-
};
|
|
2433
|
-
}
|
|
2434
|
-
}
|
|
2435
|
-
function applyWorkspaceEdit(edit, options = {}) {
|
|
2436
|
-
if (!edit) {
|
|
2437
|
-
return { success: false, filesModified: [], totalEdits: 0, errors: ["No edit provided"] };
|
|
2438
|
-
}
|
|
2439
|
-
const result = { success: true, filesModified: [], totalEdits: 0, errors: [] };
|
|
2440
|
-
const workspaceRoot = realpathSync(options.workspaceRoot ?? contextCwd());
|
|
2441
|
-
if (edit.changes) {
|
|
2442
|
-
for (const [uri, edits] of Object.entries(edit.changes)) {
|
|
2443
|
-
const validatedPath = uriToWorkspacePath(uri, workspaceRoot);
|
|
2444
|
-
if (!validatedPath.success) {
|
|
2445
|
-
result.success = false;
|
|
2446
|
-
result.errors.push(validatedPath.error);
|
|
2447
|
-
continue;
|
|
2448
|
-
}
|
|
2449
|
-
const applyResult = applyTextEditsToFile(validatedPath.path, edits);
|
|
2450
|
-
if (applyResult.success) {
|
|
2451
|
-
result.filesModified.push(validatedPath.path);
|
|
2452
|
-
result.totalEdits += applyResult.editCount;
|
|
2453
|
-
} else {
|
|
2454
|
-
result.success = false;
|
|
2455
|
-
result.errors.push(`${validatedPath.path}: ${applyResult.error}`);
|
|
2456
|
-
}
|
|
2457
|
-
}
|
|
2458
|
-
}
|
|
2459
|
-
if (edit.documentChanges) {
|
|
2460
|
-
for (const change of edit.documentChanges) {
|
|
2461
|
-
if (!("kind" in change)) {
|
|
2462
|
-
const validatedPath = uriToWorkspacePath(change.textDocument.uri, workspaceRoot);
|
|
2463
|
-
if (!validatedPath.success) {
|
|
2464
|
-
result.success = false;
|
|
2465
|
-
result.errors.push(validatedPath.error);
|
|
2466
|
-
continue;
|
|
2467
|
-
}
|
|
2468
|
-
const applyResult = applyTextEditsToFile(validatedPath.path, change.edits);
|
|
2469
|
-
if (applyResult.success) {
|
|
2470
|
-
result.filesModified.push(validatedPath.path);
|
|
2471
|
-
result.totalEdits += applyResult.editCount;
|
|
2472
|
-
} else {
|
|
2473
|
-
result.success = false;
|
|
2474
|
-
result.errors.push(`${validatedPath.path}: ${applyResult.error}`);
|
|
2475
|
-
}
|
|
2476
|
-
continue;
|
|
2477
|
-
}
|
|
2478
|
-
if (change.kind === "create") {
|
|
2479
|
-
try {
|
|
2480
|
-
const validatedPath = uriToWorkspacePath(change.uri, workspaceRoot);
|
|
2481
|
-
if (!validatedPath.success) {
|
|
2482
|
-
result.success = false;
|
|
2483
|
-
result.errors.push(`Create ${change.uri}: ${validatedPath.error}`);
|
|
2484
|
-
continue;
|
|
2485
|
-
}
|
|
2486
|
-
writeFileSync2(validatedPath.path, "", "utf-8");
|
|
2487
|
-
result.filesModified.push(validatedPath.path);
|
|
2488
|
-
} catch (err) {
|
|
2489
|
-
result.success = false;
|
|
2490
|
-
result.errors.push(`Create ${change.uri}: ${String(err)}`);
|
|
2491
|
-
}
|
|
2492
|
-
} else if (change.kind === "rename") {
|
|
2493
|
-
try {
|
|
2494
|
-
const oldPath = uriToWorkspacePath(change.oldUri, workspaceRoot);
|
|
2495
|
-
const newPath = uriToWorkspacePath(change.newUri, workspaceRoot);
|
|
2496
|
-
if (!oldPath.success || !newPath.success) {
|
|
2497
|
-
const error = oldPath.success ? newPath.success ? "invalid URI" : newPath.error : oldPath.error;
|
|
2498
|
-
result.success = false;
|
|
2499
|
-
result.errors.push(`Rename ${change.oldUri}: ${error}`);
|
|
2500
|
-
continue;
|
|
2501
|
-
}
|
|
2502
|
-
const content = readFileSync4(oldPath.path, "utf-8");
|
|
2503
|
-
writeFileSync2(newPath.path, content, "utf-8");
|
|
2504
|
-
unlinkSync(oldPath.path);
|
|
2505
|
-
result.filesModified.push(newPath.path);
|
|
2506
|
-
} catch (err) {
|
|
2507
|
-
result.success = false;
|
|
2508
|
-
result.errors.push(`Rename ${change.oldUri}: ${String(err)}`);
|
|
2509
|
-
}
|
|
2510
|
-
} else if (change.kind === "delete") {
|
|
2511
|
-
try {
|
|
2512
|
-
const validatedPath = uriToWorkspacePath(change.uri, workspaceRoot);
|
|
2513
|
-
if (!validatedPath.success) {
|
|
2514
|
-
result.success = false;
|
|
2515
|
-
result.errors.push(`Delete ${change.uri}: ${validatedPath.error}`);
|
|
2516
|
-
continue;
|
|
2517
|
-
}
|
|
2518
|
-
unlinkSync(validatedPath.path);
|
|
2519
|
-
result.filesModified.push(validatedPath.path);
|
|
2520
|
-
} catch (err) {
|
|
2521
|
-
result.success = false;
|
|
2522
|
-
result.errors.push(`Delete ${change.uri}: ${String(err)}`);
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
}
|
|
2527
|
-
return result;
|
|
2528
|
-
}
|
|
2529
|
-
|
|
2530
|
-
// ../lsp-tools-mcp/dist/lsp/startup-failure.js
|
|
2570
|
+
// ../lsp-core/src/lsp/utils.ts
|
|
2531
2571
|
var RUST_SRC_REPAIR_MESSAGE = [
|
|
2532
2572
|
"rust-analyzer exited while loading Rust standard library sources.",
|
|
2533
2573
|
"",
|
|
@@ -2535,7 +2575,7 @@ var RUST_SRC_REPAIR_MESSAGE = [
|
|
|
2535
2575
|
" rustup component remove rust-src",
|
|
2536
2576
|
" rustup component add rust-src"
|
|
2537
2577
|
];
|
|
2538
|
-
function
|
|
2578
|
+
function errorMessage(error) {
|
|
2539
2579
|
return error instanceof Error ? error.message : String(error);
|
|
2540
2580
|
}
|
|
2541
2581
|
function formatKnownLspStartupFailure(error) {
|
|
@@ -2555,11 +2595,10 @@ function handleMissingDependencyError(error) {
|
|
|
2555
2595
|
const knownStartupFailure = formatKnownLspStartupFailure(error);
|
|
2556
2596
|
if (knownStartupFailure)
|
|
2557
2597
|
return knownStartupFailure;
|
|
2558
|
-
const message =
|
|
2598
|
+
const message = errorMessage(error);
|
|
2559
2599
|
return message.includes("NOT INSTALLED") || message.includes("No LSP server configured") ? message : null;
|
|
2560
2600
|
}
|
|
2561
|
-
|
|
2562
|
-
// ../lsp-tools-mcp/dist/missing-dependency-result.js
|
|
2601
|
+
// ../lsp-core/src/missing-dependency-result.ts
|
|
2563
2602
|
function missingDependencyResult(error, details) {
|
|
2564
2603
|
const message = handleMissingDependencyError(error);
|
|
2565
2604
|
if (!message)
|
|
@@ -2574,15 +2613,7 @@ function missingDependencyResult(error, details) {
|
|
|
2574
2613
|
};
|
|
2575
2614
|
}
|
|
2576
2615
|
|
|
2577
|
-
// ../lsp-
|
|
2578
|
-
var objectSchema = (properties, required = []) => ({
|
|
2579
|
-
type: "object",
|
|
2580
|
-
properties,
|
|
2581
|
-
required
|
|
2582
|
-
});
|
|
2583
|
-
function text(text2, details, isError = false) {
|
|
2584
|
-
return { content: [{ type: "text", text: text2 }], details, isError };
|
|
2585
|
-
}
|
|
2616
|
+
// ../lsp-core/src/tools/parameters.ts
|
|
2586
2617
|
function isRecord4(value) {
|
|
2587
2618
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2588
2619
|
}
|
|
@@ -2612,18 +2643,23 @@ function optionalBoolean(params, key) {
|
|
|
2612
2643
|
const value = params[key];
|
|
2613
2644
|
return typeof value === "boolean" ? value : undefined;
|
|
2614
2645
|
}
|
|
2615
|
-
function isSeverityFilter(value) {
|
|
2616
|
-
return value === "error" || value === "warning" || value === "information" || value === "hint" || value === "all";
|
|
2617
|
-
}
|
|
2618
2646
|
function severityFilter(params) {
|
|
2619
2647
|
const value = params["severity"];
|
|
2620
|
-
if (
|
|
2648
|
+
if (value === "error" || value === "warning" || value === "information" || value === "hint" || value === "all") {
|
|
2621
2649
|
return value;
|
|
2650
|
+
}
|
|
2622
2651
|
return "all";
|
|
2623
2652
|
}
|
|
2624
2653
|
function clientOptions(signal) {
|
|
2625
2654
|
return signal === undefined ? {} : { signal };
|
|
2626
2655
|
}
|
|
2656
|
+
|
|
2657
|
+
// ../lsp-core/src/tools/result.ts
|
|
2658
|
+
function text(text2, details, isError = false) {
|
|
2659
|
+
return { content: [{ type: "text", text: text2 }], details, isError };
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
// ../lsp-core/src/tools/diagnostics.ts
|
|
2627
2663
|
function asDiagnosticArray(result) {
|
|
2628
2664
|
if (!result)
|
|
2629
2665
|
return [];
|
|
@@ -2631,38 +2667,11 @@ function asDiagnosticArray(result) {
|
|
|
2631
2667
|
return result;
|
|
2632
2668
|
return result.items ?? [];
|
|
2633
2669
|
}
|
|
2634
|
-
function isDocumentSymbol(symbol) {
|
|
2635
|
-
return "range" in symbol;
|
|
2636
|
-
}
|
|
2637
|
-
async function executeLspStatus() {
|
|
2638
|
-
const servers = getAllServers();
|
|
2639
|
-
const snapshots = getLspManager().getSnapshot();
|
|
2640
|
-
const installed = servers.filter((server) => server.installed && !server.disabled);
|
|
2641
|
-
const configuredLines = servers.map((server) => {
|
|
2642
|
-
const state = server.disabled ? "disabled" : server.installed ? "installed" : "missing";
|
|
2643
|
-
return `- ${server.id}: ${state}; source=${server.source}; extensions=${server.extensions.join(", ")}`;
|
|
2644
|
-
});
|
|
2645
|
-
const activeLines = snapshots.map((snapshot) => {
|
|
2646
|
-
const state = snapshot.alive ? snapshot.isInitializing ? "initializing" : "alive" : "dead";
|
|
2647
|
-
return `- ${snapshot.serverId}: ${state}; root=${snapshot.root}; refs=${snapshot.refCount}`;
|
|
2648
|
-
});
|
|
2649
|
-
const lines = [
|
|
2650
|
-
`Configured LSP servers: ${servers.length}`,
|
|
2651
|
-
`Installed LSP servers: ${installed.length}`,
|
|
2652
|
-
"",
|
|
2653
|
-
...configuredLines,
|
|
2654
|
-
"",
|
|
2655
|
-
`Active LSP clients: ${snapshots.length}`,
|
|
2656
|
-
...activeLines
|
|
2657
|
-
];
|
|
2658
|
-
return text(lines.join(`
|
|
2659
|
-
`), { servers, snapshots });
|
|
2660
|
-
}
|
|
2661
2670
|
async function executeLspDiagnostics(params, signal) {
|
|
2662
2671
|
const filePath = requireString(params, "filePath");
|
|
2663
2672
|
const severity = severityFilter(params);
|
|
2664
2673
|
try {
|
|
2665
|
-
const absPath =
|
|
2674
|
+
const absPath = resolve4(contextCwd(), filePath);
|
|
2666
2675
|
if (isDirectoryPath(absPath)) {
|
|
2667
2676
|
const extension = inferExtensionFromDirectory(absPath);
|
|
2668
2677
|
if (!extension) {
|
|
@@ -2723,6 +2732,29 @@ async function executeLspDiagnostics(params, signal) {
|
|
|
2723
2732
|
throw error;
|
|
2724
2733
|
}
|
|
2725
2734
|
}
|
|
2735
|
+
// ../lsp-core/src/tools/install-decision.ts
|
|
2736
|
+
async function executeLspInstallDecision(params) {
|
|
2737
|
+
const serverId = requireString(params, "server_id");
|
|
2738
|
+
const decision = params["decision"];
|
|
2739
|
+
if (!isInstallDecision(decision)) {
|
|
2740
|
+
return text(`Invalid decision '${String(decision)}'. Expected "declined" or "allowed".`, { serverId, errorKind: "invalid_decision" }, true);
|
|
2741
|
+
}
|
|
2742
|
+
const serverIds = [...new Set(getMergedServers().map((server2) => server2.id))];
|
|
2743
|
+
if (!serverIds.includes(serverId)) {
|
|
2744
|
+
const preview = serverIds.slice(0, 20).join(", ");
|
|
2745
|
+
return text(`Unknown LSP server '${serverId}'. Known servers: ${preview}${serverIds.length > 20 ? "..." : ""}`, { serverId, errorKind: "unknown_server" }, true);
|
|
2746
|
+
}
|
|
2747
|
+
recordInstallDecision(serverId, decision);
|
|
2748
|
+
return text(`Recorded install decision for '${serverId}': ${decision}. ${decisionFollowUp(decision)}`, {
|
|
2749
|
+
serverId,
|
|
2750
|
+
decision
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
function decisionFollowUp(decision) {
|
|
2754
|
+
return decision === "declined" ? "Future LSP lookups for this server stay quiet; proceed without LSP." : "Future LSP lookups keep install instructions without asking the user.";
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
// ../lsp-core/src/tools/navigation.ts
|
|
2726
2758
|
async function executeLspGotoDefinition(params, signal) {
|
|
2727
2759
|
const filePath = requireString(params, "filePath");
|
|
2728
2760
|
const line = requireNumber(params, "line");
|
|
@@ -2788,6 +2820,263 @@ async function executeLspFindReferences(params, signal) {
|
|
|
2788
2820
|
throw error;
|
|
2789
2821
|
}
|
|
2790
2822
|
}
|
|
2823
|
+
|
|
2824
|
+
// ../lsp-core/src/lsp/workspace-edit.ts
|
|
2825
|
+
import { existsSync as existsSync7, readFileSync as readFileSync4, realpathSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
2826
|
+
import { dirname as dirname3, isAbsolute as isAbsolute3, relative, resolve as resolve5 } from "node:path";
|
|
2827
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2828
|
+
function errorMessage2(error) {
|
|
2829
|
+
return error instanceof Error ? error.message : String(error);
|
|
2830
|
+
}
|
|
2831
|
+
function isPathInsideWorkspace(filePath, workspaceRoot) {
|
|
2832
|
+
const relativePath = relative(workspaceRoot, filePath);
|
|
2833
|
+
return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute3(relativePath);
|
|
2834
|
+
}
|
|
2835
|
+
function realpathForValidation(filePath) {
|
|
2836
|
+
if (existsSync7(filePath))
|
|
2837
|
+
return realpathSync(filePath);
|
|
2838
|
+
const parent = dirname3(filePath);
|
|
2839
|
+
return resolve5(realpathSync(parent), relative(parent, filePath));
|
|
2840
|
+
}
|
|
2841
|
+
function uriToWorkspacePath(uri, workspaceRoot) {
|
|
2842
|
+
let filePath;
|
|
2843
|
+
try {
|
|
2844
|
+
filePath = fileURLToPath2(uri);
|
|
2845
|
+
} catch (error) {
|
|
2846
|
+
return { success: false, error: `non-file URI ${uri}: ${errorMessage2(error)}` };
|
|
2847
|
+
}
|
|
2848
|
+
let validatedPath;
|
|
2849
|
+
try {
|
|
2850
|
+
validatedPath = realpathForValidation(filePath);
|
|
2851
|
+
} catch (error) {
|
|
2852
|
+
return { success: false, error: `${filePath}: ${errorMessage2(error)}` };
|
|
2853
|
+
}
|
|
2854
|
+
if (!isPathInsideWorkspace(validatedPath, workspaceRoot)) {
|
|
2855
|
+
return { success: false, error: `${filePath}: outside workspace ${workspaceRoot}` };
|
|
2856
|
+
}
|
|
2857
|
+
return { success: true, path: filePath };
|
|
2858
|
+
}
|
|
2859
|
+
function applyTextEditsToFile(filePath, edits) {
|
|
2860
|
+
try {
|
|
2861
|
+
const content = readFileSync4(filePath, "utf-8");
|
|
2862
|
+
const lines = content.split(`
|
|
2863
|
+
`);
|
|
2864
|
+
const sortedEdits = [...edits].sort((a, b) => {
|
|
2865
|
+
if (b.range.start.line !== a.range.start.line) {
|
|
2866
|
+
return b.range.start.line - a.range.start.line;
|
|
2867
|
+
}
|
|
2868
|
+
return b.range.start.character - a.range.start.character;
|
|
2869
|
+
});
|
|
2870
|
+
for (const edit of sortedEdits) {
|
|
2871
|
+
const startLine = edit.range.start.line;
|
|
2872
|
+
const startChar = edit.range.start.character;
|
|
2873
|
+
const endLine = edit.range.end.line;
|
|
2874
|
+
const endChar = edit.range.end.character;
|
|
2875
|
+
if (startLine === endLine) {
|
|
2876
|
+
const line = lines[startLine] ?? "";
|
|
2877
|
+
lines[startLine] = line.substring(0, startChar) + edit.newText + line.substring(endChar);
|
|
2878
|
+
} else {
|
|
2879
|
+
const firstLine = lines[startLine] ?? "";
|
|
2880
|
+
const lastLine = lines[endLine] ?? "";
|
|
2881
|
+
const newContent = firstLine.substring(0, startChar) + edit.newText + lastLine.substring(endChar);
|
|
2882
|
+
lines.splice(startLine, endLine - startLine + 1, ...newContent.split(`
|
|
2883
|
+
`));
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
writeFileSync2(filePath, lines.join(`
|
|
2887
|
+
`), "utf-8");
|
|
2888
|
+
return { success: true, editCount: edits.length };
|
|
2889
|
+
} catch (err) {
|
|
2890
|
+
return {
|
|
2891
|
+
success: false,
|
|
2892
|
+
editCount: 0,
|
|
2893
|
+
error: err instanceof Error ? err.message : String(err)
|
|
2894
|
+
};
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
function applyWorkspaceEdit(edit, options = {}) {
|
|
2898
|
+
if (!edit) {
|
|
2899
|
+
return { success: false, filesModified: [], totalEdits: 0, errors: ["No edit provided"] };
|
|
2900
|
+
}
|
|
2901
|
+
const result = { success: true, filesModified: [], totalEdits: 0, errors: [] };
|
|
2902
|
+
const workspaceRoot = realpathSync(options.workspaceRoot ?? contextCwd());
|
|
2903
|
+
if (edit.changes) {
|
|
2904
|
+
for (const [uri, edits] of Object.entries(edit.changes)) {
|
|
2905
|
+
const validatedPath = uriToWorkspacePath(uri, workspaceRoot);
|
|
2906
|
+
if (!validatedPath.success) {
|
|
2907
|
+
result.success = false;
|
|
2908
|
+
result.errors.push(validatedPath.error);
|
|
2909
|
+
continue;
|
|
2910
|
+
}
|
|
2911
|
+
const applyResult = applyTextEditsToFile(validatedPath.path, edits);
|
|
2912
|
+
if (applyResult.success) {
|
|
2913
|
+
result.filesModified.push(validatedPath.path);
|
|
2914
|
+
result.totalEdits += applyResult.editCount;
|
|
2915
|
+
} else {
|
|
2916
|
+
result.success = false;
|
|
2917
|
+
result.errors.push(`${validatedPath.path}: ${applyResult.error}`);
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
if (edit.documentChanges) {
|
|
2922
|
+
for (const change of edit.documentChanges) {
|
|
2923
|
+
if (!("kind" in change)) {
|
|
2924
|
+
const validatedPath = uriToWorkspacePath(change.textDocument.uri, workspaceRoot);
|
|
2925
|
+
if (!validatedPath.success) {
|
|
2926
|
+
result.success = false;
|
|
2927
|
+
result.errors.push(validatedPath.error);
|
|
2928
|
+
continue;
|
|
2929
|
+
}
|
|
2930
|
+
const applyResult = applyTextEditsToFile(validatedPath.path, change.edits);
|
|
2931
|
+
if (applyResult.success) {
|
|
2932
|
+
result.filesModified.push(validatedPath.path);
|
|
2933
|
+
result.totalEdits += applyResult.editCount;
|
|
2934
|
+
} else {
|
|
2935
|
+
result.success = false;
|
|
2936
|
+
result.errors.push(`${validatedPath.path}: ${applyResult.error}`);
|
|
2937
|
+
}
|
|
2938
|
+
continue;
|
|
2939
|
+
}
|
|
2940
|
+
if (change.kind === "create") {
|
|
2941
|
+
try {
|
|
2942
|
+
const validatedPath = uriToWorkspacePath(change.uri, workspaceRoot);
|
|
2943
|
+
if (!validatedPath.success) {
|
|
2944
|
+
result.success = false;
|
|
2945
|
+
result.errors.push(`Create ${change.uri}: ${validatedPath.error}`);
|
|
2946
|
+
continue;
|
|
2947
|
+
}
|
|
2948
|
+
writeFileSync2(validatedPath.path, "", "utf-8");
|
|
2949
|
+
result.filesModified.push(validatedPath.path);
|
|
2950
|
+
} catch (err) {
|
|
2951
|
+
result.success = false;
|
|
2952
|
+
result.errors.push(`Create ${change.uri}: ${String(err)}`);
|
|
2953
|
+
}
|
|
2954
|
+
} else if (change.kind === "rename") {
|
|
2955
|
+
try {
|
|
2956
|
+
const oldPath = uriToWorkspacePath(change.oldUri, workspaceRoot);
|
|
2957
|
+
const newPath = uriToWorkspacePath(change.newUri, workspaceRoot);
|
|
2958
|
+
if (!oldPath.success || !newPath.success) {
|
|
2959
|
+
const error = oldPath.success ? newPath.success ? "invalid URI" : newPath.error : oldPath.error;
|
|
2960
|
+
result.success = false;
|
|
2961
|
+
result.errors.push(`Rename ${change.oldUri}: ${error}`);
|
|
2962
|
+
continue;
|
|
2963
|
+
}
|
|
2964
|
+
const content = readFileSync4(oldPath.path, "utf-8");
|
|
2965
|
+
writeFileSync2(newPath.path, content, "utf-8");
|
|
2966
|
+
unlinkSync(oldPath.path);
|
|
2967
|
+
result.filesModified.push(newPath.path);
|
|
2968
|
+
} catch (err) {
|
|
2969
|
+
result.success = false;
|
|
2970
|
+
result.errors.push(`Rename ${change.oldUri}: ${String(err)}`);
|
|
2971
|
+
}
|
|
2972
|
+
} else if (change.kind === "delete") {
|
|
2973
|
+
try {
|
|
2974
|
+
const validatedPath = uriToWorkspacePath(change.uri, workspaceRoot);
|
|
2975
|
+
if (!validatedPath.success) {
|
|
2976
|
+
result.success = false;
|
|
2977
|
+
result.errors.push(`Delete ${change.uri}: ${validatedPath.error}`);
|
|
2978
|
+
continue;
|
|
2979
|
+
}
|
|
2980
|
+
unlinkSync(validatedPath.path);
|
|
2981
|
+
result.filesModified.push(validatedPath.path);
|
|
2982
|
+
} catch (err) {
|
|
2983
|
+
result.success = false;
|
|
2984
|
+
result.errors.push(`Delete ${change.uri}: ${String(err)}`);
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
return result;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
// ../lsp-core/src/tools/rename.ts
|
|
2993
|
+
async function executeLspPrepareRename(params, signal) {
|
|
2994
|
+
const filePath = requireString(params, "filePath");
|
|
2995
|
+
const line = requireNumber(params, "line");
|
|
2996
|
+
const character = requireNumber(params, "character");
|
|
2997
|
+
try {
|
|
2998
|
+
const result = await withLspClient(filePath, async (client) => client.prepareRename(filePath, line, character), "prepareRename", clientOptions(signal));
|
|
2999
|
+
const details = { filePath, line, character, result };
|
|
3000
|
+
return text(formatPrepareRenameResult(result), details);
|
|
3001
|
+
} catch (error) {
|
|
3002
|
+
const missingDependency = missingDependencyResult(error, {
|
|
3003
|
+
filePath,
|
|
3004
|
+
line,
|
|
3005
|
+
character,
|
|
3006
|
+
result: null
|
|
3007
|
+
});
|
|
3008
|
+
if (missingDependency)
|
|
3009
|
+
return missingDependency;
|
|
3010
|
+
throw error;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
async function executeLspRename(params, signal) {
|
|
3014
|
+
const filePath = requireString(params, "filePath");
|
|
3015
|
+
const line = requireNumber(params, "line");
|
|
3016
|
+
const character = requireNumber(params, "character");
|
|
3017
|
+
const newName = requireString(params, "newName");
|
|
3018
|
+
try {
|
|
3019
|
+
const edit = await withLspClient(filePath, async (client, workspaceRoot) => ({
|
|
3020
|
+
edit: await client.rename(filePath, line, character, newName),
|
|
3021
|
+
workspaceRoot
|
|
3022
|
+
}), "rename", clientOptions(signal));
|
|
3023
|
+
const apply = applyWorkspaceEdit(edit.edit, { workspaceRoot: edit.workspaceRoot });
|
|
3024
|
+
const details = { filePath, line, character, newName, apply, edit: edit.edit };
|
|
3025
|
+
return text(formatApplyResult(apply), details, !apply.success);
|
|
3026
|
+
} catch (error) {
|
|
3027
|
+
const missingDependency = missingDependencyResult(error, {
|
|
3028
|
+
filePath,
|
|
3029
|
+
line,
|
|
3030
|
+
character,
|
|
3031
|
+
newName,
|
|
3032
|
+
apply: null,
|
|
3033
|
+
edit: null
|
|
3034
|
+
});
|
|
3035
|
+
if (missingDependency)
|
|
3036
|
+
return missingDependency;
|
|
3037
|
+
throw error;
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
// ../lsp-core/src/tools/schema.ts
|
|
3042
|
+
function objectSchema(properties, required = []) {
|
|
3043
|
+
return {
|
|
3044
|
+
type: "object",
|
|
3045
|
+
properties,
|
|
3046
|
+
required
|
|
3047
|
+
};
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
// ../lsp-core/src/tools/status.ts
|
|
3051
|
+
async function executeLspStatus() {
|
|
3052
|
+
const servers = getAllServers();
|
|
3053
|
+
const snapshots = getLspManager().getSnapshot();
|
|
3054
|
+
const installed = servers.filter((server2) => server2.installed && !server2.disabled);
|
|
3055
|
+
const configuredLines = servers.map((server2) => {
|
|
3056
|
+
const state = server2.disabled ? "disabled" : server2.installed ? "installed" : "missing";
|
|
3057
|
+
return `- ${server2.id}: ${state}; source=${server2.source}; extensions=${server2.extensions.join(", ")}`;
|
|
3058
|
+
});
|
|
3059
|
+
const activeLines = snapshots.map((snapshot) => {
|
|
3060
|
+
const state = snapshot.alive ? snapshot.isInitializing ? "initializing" : "alive" : "dead";
|
|
3061
|
+
return `- ${snapshot.serverId}: ${state}; root=${snapshot.root}; refs=${snapshot.refCount}`;
|
|
3062
|
+
});
|
|
3063
|
+
const lines = [
|
|
3064
|
+
`Configured LSP servers: ${servers.length}`,
|
|
3065
|
+
`Installed LSP servers: ${installed.length}`,
|
|
3066
|
+
"",
|
|
3067
|
+
...configuredLines,
|
|
3068
|
+
"",
|
|
3069
|
+
`Active LSP clients: ${snapshots.length}`,
|
|
3070
|
+
...activeLines
|
|
3071
|
+
];
|
|
3072
|
+
return text(lines.join(`
|
|
3073
|
+
`), { servers, snapshots });
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
// ../lsp-core/src/tools/symbols.ts
|
|
3077
|
+
function isDocumentSymbol(symbol) {
|
|
3078
|
+
return "range" in symbol;
|
|
3079
|
+
}
|
|
2791
3080
|
async function executeLspSymbols(params, signal) {
|
|
2792
3081
|
const filePath = requireString(params, "filePath");
|
|
2793
3082
|
const rawScope = optionalString(params, "scope") ?? "document";
|
|
@@ -2854,85 +3143,8 @@ function formatSymbolsResult(filePath, scope, symbols, limit, query) {
|
|
|
2854
3143
|
return text(lines.join(`
|
|
2855
3144
|
`), details);
|
|
2856
3145
|
}
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
const line = requireNumber(params, "line");
|
|
2860
|
-
const character = requireNumber(params, "character");
|
|
2861
|
-
try {
|
|
2862
|
-
const result = await withLspClient(filePath, async (client) => client.prepareRename(filePath, line, character), "prepareRename", clientOptions(signal));
|
|
2863
|
-
const details = { filePath, line, character, result };
|
|
2864
|
-
return text(formatPrepareRenameResult(result), details);
|
|
2865
|
-
} catch (error) {
|
|
2866
|
-
const missingDependency = missingDependencyResult(error, {
|
|
2867
|
-
filePath,
|
|
2868
|
-
line,
|
|
2869
|
-
character,
|
|
2870
|
-
result: null
|
|
2871
|
-
});
|
|
2872
|
-
if (missingDependency)
|
|
2873
|
-
return missingDependency;
|
|
2874
|
-
throw error;
|
|
2875
|
-
}
|
|
2876
|
-
}
|
|
2877
|
-
async function executeLspRename(params, signal) {
|
|
2878
|
-
const filePath = requireString(params, "filePath");
|
|
2879
|
-
const line = requireNumber(params, "line");
|
|
2880
|
-
const character = requireNumber(params, "character");
|
|
2881
|
-
const newName = requireString(params, "newName");
|
|
2882
|
-
try {
|
|
2883
|
-
const edit = await withLspClient(filePath, async (client, workspaceRoot) => ({
|
|
2884
|
-
edit: await client.rename(filePath, line, character, newName),
|
|
2885
|
-
workspaceRoot
|
|
2886
|
-
}), "rename", clientOptions(signal));
|
|
2887
|
-
const apply = applyWorkspaceEdit(edit.edit, { workspaceRoot: edit.workspaceRoot });
|
|
2888
|
-
const details = { filePath, line, character, newName, apply, edit: edit.edit };
|
|
2889
|
-
return text(formatApplyResult(apply), details, !apply.success);
|
|
2890
|
-
} catch (error) {
|
|
2891
|
-
const missingDependency = missingDependencyResult(error, {
|
|
2892
|
-
filePath,
|
|
2893
|
-
line,
|
|
2894
|
-
character,
|
|
2895
|
-
newName,
|
|
2896
|
-
apply: null,
|
|
2897
|
-
edit: null
|
|
2898
|
-
});
|
|
2899
|
-
if (missingDependency)
|
|
2900
|
-
return missingDependency;
|
|
2901
|
-
throw error;
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
async function executeLspInstallDecision(params) {
|
|
2905
|
-
const serverId = requireString(params, "server_id");
|
|
2906
|
-
const decision = params["decision"];
|
|
2907
|
-
if (!isInstallDecision(decision)) {
|
|
2908
|
-
return text(`Invalid decision '${String(decision)}'. Expected "declined" or "allowed".`, { serverId, errorKind: "invalid_decision" }, true);
|
|
2909
|
-
}
|
|
2910
|
-
const serverIds = [...new Set(getMergedServers().map((server) => server.id))];
|
|
2911
|
-
if (!serverIds.includes(serverId)) {
|
|
2912
|
-
const preview = serverIds.slice(0, 20).join(", ");
|
|
2913
|
-
return text(`Unknown LSP server '${serverId}'. Known servers: ${preview}${serverIds.length > 20 ? "..." : ""}`, { serverId, errorKind: "unknown_server" }, true);
|
|
2914
|
-
}
|
|
2915
|
-
recordInstallDecision(serverId, decision);
|
|
2916
|
-
return text(`Recorded install decision for '${serverId}': ${decision}. ${decisionFollowUp(decision)}`, {
|
|
2917
|
-
serverId,
|
|
2918
|
-
decision
|
|
2919
|
-
});
|
|
2920
|
-
}
|
|
2921
|
-
function decisionFollowUp(decision) {
|
|
2922
|
-
return decision === "declined" ? "Future LSP lookups for this server stay quiet; proceed without LSP." : "Future LSP lookups keep install instructions without asking the user.";
|
|
2923
|
-
}
|
|
2924
|
-
async function executeLspTool(name, params, signal) {
|
|
2925
|
-
const tool = LSP_MCP_TOOLS.find((candidate) => matchesToolName(candidate, name));
|
|
2926
|
-
if (!tool)
|
|
2927
|
-
throw new Error(`Unknown LSP tool: ${name}`);
|
|
2928
|
-
return tool.execute(params, signal);
|
|
2929
|
-
}
|
|
2930
|
-
function matchesToolName(tool, name) {
|
|
2931
|
-
return tool.name === name || (tool.aliases?.includes(name) ?? false);
|
|
2932
|
-
}
|
|
2933
|
-
function coerceToolArguments(value) {
|
|
2934
|
-
return isRecord4(value) ? value : {};
|
|
2935
|
-
}
|
|
3146
|
+
|
|
3147
|
+
// ../lsp-core/src/tools/definitions.ts
|
|
2936
3148
|
var LSP_MCP_TOOLS = [
|
|
2937
3149
|
{
|
|
2938
3150
|
name: "status",
|
|
@@ -3043,12 +3255,24 @@ var LSP_MCP_TOOLS = [
|
|
|
3043
3255
|
execute: executeLspInstallDecision
|
|
3044
3256
|
}
|
|
3045
3257
|
];
|
|
3046
|
-
|
|
3047
|
-
|
|
3258
|
+
// ../lsp-core/src/tools/runtime.ts
|
|
3259
|
+
async function executeLspTool(name, params, signal) {
|
|
3260
|
+
const tool = LSP_MCP_TOOLS.find((candidate) => matchesToolName(candidate, name));
|
|
3261
|
+
if (!tool)
|
|
3262
|
+
throw new Error(`Unknown LSP tool: ${name}`);
|
|
3263
|
+
return tool.execute(params, signal);
|
|
3264
|
+
}
|
|
3265
|
+
function matchesToolName(tool, name) {
|
|
3266
|
+
return tool.name === name || (tool.aliases?.includes(name) ?? false);
|
|
3267
|
+
}
|
|
3268
|
+
function coerceToolArguments(value) {
|
|
3269
|
+
return isRecord4(value) ? value : {};
|
|
3270
|
+
}
|
|
3271
|
+
// ../lsp-core/src/mcp.ts
|
|
3048
3272
|
var SERVER_NAME = "lsp";
|
|
3049
3273
|
var SERVER_VERSION = "0.1.0";
|
|
3050
3274
|
async function handleLspMcpRequest(input) {
|
|
3051
|
-
if (!
|
|
3275
|
+
if (!isPlainRecord(input)) {
|
|
3052
3276
|
return errorResponse(null, -32600, "Invalid Request");
|
|
3053
3277
|
}
|
|
3054
3278
|
const id = jsonRpcId(input["id"]);
|
|
@@ -3074,7 +3298,7 @@ async function handleLspMcpRequest(input) {
|
|
|
3074
3298
|
return errorResponse(id, -32601, `Method not found: ${String(method)}`);
|
|
3075
3299
|
}
|
|
3076
3300
|
async function handleToolCall(id, params) {
|
|
3077
|
-
if (!
|
|
3301
|
+
if (!isPlainRecord(params) || typeof params["name"] !== "string") {
|
|
3078
3302
|
return errorResponse(id, -32602, "tools/call requires params.name");
|
|
3079
3303
|
}
|
|
3080
3304
|
try {
|
|
@@ -3099,26 +3323,11 @@ function describeTool(tool) {
|
|
|
3099
3323
|
inputSchema: tool.inputSchema
|
|
3100
3324
|
};
|
|
3101
3325
|
}
|
|
3102
|
-
function successResponse(id, result) {
|
|
3103
|
-
return { jsonrpc: "2.0", id, result };
|
|
3104
|
-
}
|
|
3105
|
-
function errorResponse(id, code, message, data) {
|
|
3106
|
-
return { jsonrpc: "2.0", id, error: data === undefined ? { code, message } : { code, message, data } };
|
|
3107
|
-
}
|
|
3108
3326
|
function requestedProtocolVersion(params) {
|
|
3109
|
-
if (!
|
|
3327
|
+
if (!isPlainRecord(params) || typeof params["protocolVersion"] !== "string")
|
|
3110
3328
|
return "2024-11-05";
|
|
3111
3329
|
return params["protocolVersion"];
|
|
3112
3330
|
}
|
|
3113
|
-
function jsonRpcId(value) {
|
|
3114
|
-
return typeof value === "string" || typeof value === "number" || value === null ? value : null;
|
|
3115
|
-
}
|
|
3116
|
-
function isRecord5(value) {
|
|
3117
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3118
|
-
}
|
|
3119
|
-
function messageFromError(error) {
|
|
3120
|
-
return error instanceof Error ? error.message : String(error);
|
|
3121
|
-
}
|
|
3122
3331
|
|
|
3123
3332
|
// src/daemon-client.ts
|
|
3124
3333
|
import { connect as connect2 } from "node:net";
|
|
@@ -3333,13 +3542,13 @@ function resolveSocketPath(dir, version) {
|
|
|
3333
3542
|
// src/request-routing.ts
|
|
3334
3543
|
var CONTEXT_KEY = "_context";
|
|
3335
3544
|
function extractRequestContext(raw) {
|
|
3336
|
-
if (!
|
|
3545
|
+
if (!isRecord5(raw) || raw["method"] !== "tools/call")
|
|
3337
3546
|
return { input: raw, context: undefined };
|
|
3338
3547
|
const params = raw["params"];
|
|
3339
|
-
if (!
|
|
3548
|
+
if (!isRecord5(params))
|
|
3340
3549
|
return { input: raw, context: undefined };
|
|
3341
3550
|
const args = params["arguments"];
|
|
3342
|
-
if (!
|
|
3551
|
+
if (!isRecord5(args))
|
|
3343
3552
|
return { input: raw, context: undefined };
|
|
3344
3553
|
const context = parseContext(args[CONTEXT_KEY]);
|
|
3345
3554
|
if (!context)
|
|
@@ -3356,7 +3565,7 @@ function handleDaemonMessage(raw) {
|
|
|
3356
3565
|
return handleLspMcpRequest(input);
|
|
3357
3566
|
}
|
|
3358
3567
|
function parseContext(value) {
|
|
3359
|
-
if (!
|
|
3568
|
+
if (!isRecord5(value))
|
|
3360
3569
|
return;
|
|
3361
3570
|
const context = {};
|
|
3362
3571
|
const cwd = value["cwd"];
|
|
@@ -3367,11 +3576,11 @@ function parseContext(value) {
|
|
|
3367
3576
|
context.env = env;
|
|
3368
3577
|
return context.cwd === undefined && context.env === undefined ? undefined : context;
|
|
3369
3578
|
}
|
|
3370
|
-
function
|
|
3579
|
+
function isRecord5(value) {
|
|
3371
3580
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3372
3581
|
}
|
|
3373
3582
|
function isStringRecord2(value) {
|
|
3374
|
-
return
|
|
3583
|
+
return isRecord5(value) && Object.values(value).every((item) => typeof item === "string");
|
|
3375
3584
|
}
|
|
3376
3585
|
|
|
3377
3586
|
// src/socket-jsonrpc.ts
|
|
@@ -3498,10 +3707,10 @@ function sendToolCall(socketPath, name, args, timeoutMs) {
|
|
|
3498
3707
|
});
|
|
3499
3708
|
}
|
|
3500
3709
|
function toToolResult(message) {
|
|
3501
|
-
if (!
|
|
3710
|
+
if (!isRecord6(message) || message["id"] !== REQUEST_ID)
|
|
3502
3711
|
return null;
|
|
3503
3712
|
const result = message["result"];
|
|
3504
|
-
if (!
|
|
3713
|
+
if (!isRecord6(result) || !Array.isArray(result["content"]))
|
|
3505
3714
|
return null;
|
|
3506
3715
|
return {
|
|
3507
3716
|
content: result["content"],
|
|
@@ -3509,7 +3718,7 @@ function toToolResult(message) {
|
|
|
3509
3718
|
details: result["details"]
|
|
3510
3719
|
};
|
|
3511
3720
|
}
|
|
3512
|
-
function
|
|
3721
|
+
function isRecord6(value) {
|
|
3513
3722
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3514
3723
|
}
|
|
3515
3724
|
function errorText(error) {
|
|
@@ -3523,56 +3732,32 @@ async function runMcpStdioProxy(options = {}) {
|
|
|
3523
3732
|
const paths = options.paths ?? daemonPaths();
|
|
3524
3733
|
const context = options.context ?? currentRequestContext();
|
|
3525
3734
|
const callOptions = { paths, context, ...options.ensure ? { ensure: options.ensure } : {} };
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
if (response)
|
|
3533
|
-
output.write(`${JSON.stringify(response)}
|
|
3534
|
-
`);
|
|
3535
|
-
} catch (error) {
|
|
3735
|
+
await runJsonRpcStdioServer({
|
|
3736
|
+
input,
|
|
3737
|
+
output,
|
|
3738
|
+
handler: handleProxyRequest,
|
|
3739
|
+
handlerOptions: callOptions,
|
|
3740
|
+
onHandlerError: (error) => {
|
|
3536
3741
|
process.stderr.write(`[lsp-daemon] proxy error: ${error instanceof Error ? error.message : String(error)}
|
|
3537
3742
|
`);
|
|
3538
3743
|
}
|
|
3539
|
-
}
|
|
3744
|
+
});
|
|
3540
3745
|
}
|
|
3541
|
-
async function
|
|
3542
|
-
let parsed;
|
|
3543
|
-
try {
|
|
3544
|
-
parsed = JSON.parse(line);
|
|
3545
|
-
} catch (error) {
|
|
3546
|
-
return parseErrorResponse(error);
|
|
3547
|
-
}
|
|
3746
|
+
async function handleProxyRequest(parsed, callOptions) {
|
|
3548
3747
|
const toolCall = asToolCall(parsed);
|
|
3549
3748
|
if (!toolCall)
|
|
3550
3749
|
return handleLspMcpRequest(parsed);
|
|
3551
3750
|
const result = await callToolViaDaemon(toolCall.name, toolCall.args, callOptions);
|
|
3552
|
-
return {
|
|
3553
|
-
jsonrpc: "2.0",
|
|
3554
|
-
id: toolCall.id,
|
|
3555
|
-
result: { content: result.content, isError: result.isError ?? false, details: result.details }
|
|
3556
|
-
};
|
|
3751
|
+
return successResponse(toolCall.id, { content: result.content, isError: result.isError ?? false, details: result.details });
|
|
3557
3752
|
}
|
|
3558
3753
|
function asToolCall(parsed) {
|
|
3559
|
-
if (!
|
|
3754
|
+
if (!isPlainRecord(parsed) || parsed["method"] !== "tools/call")
|
|
3560
3755
|
return null;
|
|
3561
3756
|
const params = parsed["params"];
|
|
3562
|
-
if (!
|
|
3757
|
+
if (!isPlainRecord(params) || typeof params["name"] !== "string")
|
|
3563
3758
|
return null;
|
|
3564
3759
|
const args = params["arguments"];
|
|
3565
|
-
return { id:
|
|
3566
|
-
}
|
|
3567
|
-
function jsonRpcId2(value) {
|
|
3568
|
-
return typeof value === "string" || typeof value === "number" || value === null ? value : null;
|
|
3569
|
-
}
|
|
3570
|
-
function parseErrorResponse(error) {
|
|
3571
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
3572
|
-
return { jsonrpc: "2.0", id: null, error: { code: -32700, message: "Parse error", data: message } };
|
|
3573
|
-
}
|
|
3574
|
-
function isRecord8(value) {
|
|
3575
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3760
|
+
return { id: jsonRpcId(parsed["id"]), name: params["name"], args: isPlainRecord(args) ? args : {} };
|
|
3576
3761
|
}
|
|
3577
3762
|
|
|
3578
3763
|
// src/daemon-server.ts
|
|
@@ -3591,7 +3776,7 @@ async function startDaemonServer(paths, options = {}) {
|
|
|
3591
3776
|
const touch = () => {
|
|
3592
3777
|
lastActiveAt = Date.now();
|
|
3593
3778
|
};
|
|
3594
|
-
const
|
|
3779
|
+
const server2 = createServer2((socket) => {
|
|
3595
3780
|
connections.add(socket);
|
|
3596
3781
|
touch();
|
|
3597
3782
|
const decoder = createLineDecoder((message) => {
|
|
@@ -3605,9 +3790,9 @@ async function startDaemonServer(paths, options = {}) {
|
|
|
3605
3790
|
touch();
|
|
3606
3791
|
});
|
|
3607
3792
|
});
|
|
3608
|
-
|
|
3793
|
+
server2.on("error", (error) => logServerError(error));
|
|
3609
3794
|
const endpointPath = join9(paths.dir, "daemon.endpoint");
|
|
3610
|
-
await listen(
|
|
3795
|
+
await listen(server2, paths.socket);
|
|
3611
3796
|
writeFileSync3(paths.pid, `${process.pid}
|
|
3612
3797
|
`);
|
|
3613
3798
|
writeFileSync3(endpointPath, paths.socket);
|
|
@@ -3620,7 +3805,7 @@ async function startDaemonServer(paths, options = {}) {
|
|
|
3620
3805
|
for (const socket of connections)
|
|
3621
3806
|
socket.destroy();
|
|
3622
3807
|
connections.clear();
|
|
3623
|
-
await closeServer(
|
|
3808
|
+
await closeServer(server2);
|
|
3624
3809
|
unlinkQuietly(paths.socket);
|
|
3625
3810
|
unlinkQuietly(paths.pid);
|
|
3626
3811
|
unlinkQuietly(endpointPath);
|
|
@@ -3643,7 +3828,7 @@ async function startDaemonServer(paths, options = {}) {
|
|
|
3643
3828
|
}, idleCheckIntervalMs);
|
|
3644
3829
|
idleTimer.unref();
|
|
3645
3830
|
installSignalHandlers(close);
|
|
3646
|
-
return { server, close };
|
|
3831
|
+
return { server: server2, close };
|
|
3647
3832
|
}
|
|
3648
3833
|
async function respond(socket, message) {
|
|
3649
3834
|
try {
|
|
@@ -3654,18 +3839,18 @@ async function respond(socket, message) {
|
|
|
3654
3839
|
logServerError(error);
|
|
3655
3840
|
}
|
|
3656
3841
|
}
|
|
3657
|
-
function listen(
|
|
3842
|
+
function listen(server2, socketPath) {
|
|
3658
3843
|
return new Promise((resolve6, reject) => {
|
|
3659
3844
|
const onError = (error) => reject(error);
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3845
|
+
server2.once("error", onError);
|
|
3846
|
+
server2.listen(socketPath, () => {
|
|
3847
|
+
server2.removeListener("error", onError);
|
|
3663
3848
|
resolve6();
|
|
3664
3849
|
});
|
|
3665
3850
|
});
|
|
3666
3851
|
}
|
|
3667
|
-
function closeServer(
|
|
3668
|
-
return new Promise((resolve6) =>
|
|
3852
|
+
function closeServer(server2) {
|
|
3853
|
+
return new Promise((resolve6) => server2.close(() => resolve6()));
|
|
3669
3854
|
}
|
|
3670
3855
|
function installSignalHandlers(close) {
|
|
3671
3856
|
const handler = () => {
|