oh-my-opencode 4.8.1 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/agents/sisyphus/claude-fable-5.d.ts +19 -0
- package/dist/agents/sisyphus/claude-opus-4-7.d.ts +3 -1
- package/dist/agents/sisyphus/claude-opus-4-8.d.ts +19 -0
- package/dist/agents/sisyphus/index.d.ts +4 -0
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/doctor/checks/codex.d.ts +1 -0
- package/dist/cli/doctor/checks/dependencies.d.ts +2 -2
- package/dist/cli/doctor/checks/tools-gh.d.ts +8 -1
- package/dist/cli/doctor/index.d.ts +1 -0
- package/dist/cli/doctor/types.d.ts +2 -0
- package/dist/cli/index.js +1908 -787
- package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
- package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -0
- package/dist/cli/install-codex/codex-config-toml.d.ts +1 -0
- package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +8 -0
- package/dist/cli/install-codex/install-codex.d.ts +1 -8
- package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +5 -0
- package/dist/cli/sparkshell-condense.d.ts +10 -0
- package/dist/cli/sparkshell-parse.d.ts +3 -0
- package/dist/cli/sparkshell-session-context.d.ts +20 -0
- package/dist/cli/sparkshell-spark.d.ts +23 -0
- package/dist/cli/sparkshell.d.ts +8 -1
- package/dist/cli-node/index.js +92564 -0
- package/dist/config/schema/agent-names.d.ts +2 -0
- package/dist/config/schema/hooks.d.ts +0 -2
- package/dist/config/schema/keyword-detector.d.ts +0 -6
- package/dist/config/schema/oh-my-opencode-config.d.ts +2 -4
- package/dist/create-hooks.d.ts +0 -2
- package/dist/features/background-agent/parent-wake-dedupe.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-flush-runner.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-session-history.d.ts +4 -0
- package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -0
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-skills/index.d.ts +1 -1
- package/dist/features/builtin-skills/skills.d.ts +4 -0
- package/dist/features/opencode-runtime-skills/source-server.d.ts +16 -1
- package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +2 -0
- package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +2 -0
- package/dist/features/team-mode/types.d.ts +1 -0
- package/dist/features/tmux-subagent/failed-readiness-cache.d.ts +28 -0
- package/dist/features/tmux-subagent/manager.d.ts +1 -9
- package/dist/features/tmux-subagent/resolve-server-url.d.ts +3 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/constants.d.ts +0 -4
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +1 -1
- package/dist/index.js +9001 -1795
- package/dist/oh-my-opencode.schema.json +2 -4
- package/dist/plugin/chat-params.d.ts +1 -8
- package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts +0 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -2
- package/dist/plugin/messages-transform.d.ts +0 -1
- package/dist/shared/model-availability.d.ts +10 -2
- package/dist/shared/module-resolution-failure.d.ts +7 -0
- package/package.json +25 -18
- package/packages/ast-grep-mcp/dist/cli.js +2 -10
- package/packages/git-bash-mcp/dist/cli.js +11 -4
- package/packages/lsp-daemon/dist/cli.d.ts +2 -0
- package/packages/lsp-daemon/dist/cli.js +3711 -0
- package/packages/lsp-daemon/dist/daemon-client.d.ts +19 -0
- package/packages/lsp-daemon/dist/daemon-client.js +114 -0
- package/packages/lsp-daemon/dist/daemon-server.d.ts +12 -0
- package/packages/lsp-daemon/dist/daemon-server.js +106 -0
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +21 -0
- package/packages/lsp-daemon/dist/ensure-daemon.js +97 -0
- package/packages/lsp-daemon/dist/index.d.ts +5 -0
- package/packages/lsp-daemon/dist/index.js +3573 -0
- package/packages/lsp-daemon/dist/lock.d.ts +7 -0
- package/packages/lsp-daemon/dist/lock.js +61 -0
- package/packages/lsp-daemon/dist/package.json +6 -0
- package/packages/lsp-daemon/dist/paths.d.ts +11 -0
- package/packages/lsp-daemon/dist/paths.js +49 -0
- package/packages/lsp-daemon/dist/proxy.d.ts +10 -0
- package/packages/lsp-daemon/dist/proxy.js +61 -0
- package/packages/lsp-daemon/dist/request-routing.d.ts +9 -0
- package/packages/lsp-daemon/dist/request-routing.js +44 -0
- package/packages/lsp-daemon/dist/run-daemon.d.ts +1 -0
- package/packages/lsp-daemon/dist/run-daemon.js +11 -0
- package/packages/lsp-daemon/dist/socket-jsonrpc.d.ts +5 -0
- package/packages/lsp-daemon/dist/socket-jsonrpc.js +25 -0
- package/packages/lsp-daemon/package.json +38 -0
- package/packages/lsp-tools-mcp/dist/cli.js +0 -0
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +40 -17
- package/packages/lsp-tools-mcp/dist/lsp/client.js +11 -9
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +5 -5
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +5 -3
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +8 -0
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +3 -2
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +12 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +12 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +51 -0
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +2 -1
- package/packages/lsp-tools-mcp/dist/request-context.d.ts +7 -0
- package/packages/lsp-tools-mcp/dist/request-context.js +14 -0
- package/packages/lsp-tools-mcp/dist/tools.js +44 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +46 -33
- package/packages/omo-codex/plugin/.mcp.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +7 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +173 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +10 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +22 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +165 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +5 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +4 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +6 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +10 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +2 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +11 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +3 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +104 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +26 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +144 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +43 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +29 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.d.ts +28 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.js +137 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/index.d.ts +1 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/index.js +1 -0
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +5 -2
- package/packages/omo-codex/plugin/components/lsp/.mcp.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +42 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +40 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +16 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +180 -0
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +12 -0
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +95 -0
- package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.js +79 -0
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +7 -7
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +68 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.mjs +45 -22
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +6 -2
- package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +4 -0
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +68 -0
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +8 -20
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +69 -96
- package/packages/omo-codex/plugin/components/rules/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +118 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +47 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +127 -0
- package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/config.js +100 -0
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +26 -0
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +8 -0
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +36 -0
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +65 -0
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +24 -0
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +24 -0
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +172 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +74 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +32 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +29 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +9 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +51 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +70 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +101 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +60 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +61 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +60 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +11 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +75 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +29 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +44 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +85 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +12 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +51 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +33 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +40 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +28 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +146 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +112 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +18 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +93 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +27 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +30 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +237 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +31 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +48 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +23 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +111 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +9 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +18 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +59 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +126 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +8 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +20 -0
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +41 -0
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +10 -0
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +90 -0
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +128 -0
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +168 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +49 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +91 -0
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +4 -2
- package/packages/omo-codex/plugin/components/rules/src/config.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +17 -0
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +4 -1
- package/packages/omo-codex/plugin/components/rules/src/post-compact-directive.ts +39 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +16 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +8 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +53 -4
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +127 -7
- package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +9 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +4 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +7 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +9 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +10 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +241 -0
- package/packages/omo-codex/plugin/components/rules/test/event-budget.test.ts +168 -0
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +86 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +15 -15
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +16 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +146 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +49 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +80 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +5 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +3 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +20 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +1 -0
- 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 +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +24 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +1 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +18 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +62 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +15 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +42 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +10 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +35 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +12 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +108 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +4 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +31 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +8 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +68 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +21 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +133 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +8 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +29 -0
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +5 -13
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +61 -185
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +122 -117
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +48 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +7 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +122 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +20 -11
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +17 -11
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -71
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +200 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.d.ts +17 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.d.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +183 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +55 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +145 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +39 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +100 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +26 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +28 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +145 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.d.ts +34 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +41 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +31 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +119 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +69 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +59 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +48 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +119 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +8 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +89 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +123 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +70 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.d.ts +10 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.js +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +63 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +292 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/types.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/types.js +5 -0
- 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/SKILL.md +14 -14
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +24 -25
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +0 -96
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +46 -0
- package/packages/omo-codex/plugin/hooks/hooks.json +16 -16
- package/packages/omo-codex/plugin/package-lock.json +10 -9
- package/packages/omo-codex/plugin/package.json +27 -26
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +64 -15
- package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +16 -0
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +82 -18
- package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +2 -2
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +23 -11
- package/packages/omo-codex/plugin/scripts/sync-version.mjs +94 -0
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +9 -9
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +93 -0
- package/packages/omo-codex/plugin/skills/lcx-doctor/agents/openai.yaml +11 -0
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +17 -13
- package/packages/omo-codex/plugin/skills/lsp-setup/SKILL.md +139 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/bash/README.md +60 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/c-cpp/README.md +61 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/csharp/README.md +71 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/dart/README.md +48 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/elixir/README.md +51 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/go/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/haskell/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/java/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/julia/README.md +60 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/kotlin/README.md +59 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/lua/README.md +66 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/php/README.md +62 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/python/README.md +71 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/ruby/README.md +53 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/rust/README.md +59 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/swift/README.md +51 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/terraform/README.md +62 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/typescript/README.md +77 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/yaml/README.md +70 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/zig/README.md +49 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/tsconfig.json +17 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +9 -9
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +10 -10
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +20 -22
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +38 -61
- package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +135 -677
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +14 -14
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +24 -25
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +20 -11
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +17 -11
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +9 -9
- package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -1
- package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +5 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +6 -6
- package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +194 -0
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +17 -0
- package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +15 -44
- package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +140 -0
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +189 -7
- package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +9 -31
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +68 -4
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +119 -0
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +11 -112
- package/packages/omo-codex/plugin/test/sync-version.test.mjs +68 -0
- package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +126 -0
- package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +2 -2
- package/packages/omo-codex/scripts/install/bin-dir.mjs +20 -0
- package/packages/omo-codex/scripts/install/bin-links.mjs +43 -6
- package/packages/omo-codex/scripts/install/cache.mjs +4 -0
- package/packages/omo-codex/scripts/install/config.mjs +4 -4
- package/packages/omo-codex/scripts/install/delegated-command.mjs +5 -1
- package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +28 -0
- package/packages/omo-codex/scripts/install/git-bash.mjs +12 -4
- package/packages/omo-codex/scripts/install/git-bash.test.mjs +39 -4
- package/packages/omo-codex/scripts/install/hook-targets.mjs +46 -0
- package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +12 -2
- package/packages/omo-codex/scripts/install/process.mjs +1 -0
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +131 -3
- package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +91 -0
- package/packages/omo-codex/scripts/install-config.test.mjs +50 -44
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +78 -0
- package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +93 -0
- package/packages/omo-codex/scripts/install-hook-targets.test.mjs +100 -0
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +3 -1
- package/packages/omo-codex/scripts/install-local.mjs +7 -18
- package/packages/omo-codex/scripts/install-local.test.mjs +34 -1
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
- package/packages/shared-skills/skills/lcx-doctor/SKILL.md +93 -0
- package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +11 -0
- package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +17 -13
- package/packages/shared-skills/skills/lsp-setup/SKILL.md +139 -0
- package/packages/shared-skills/skills/lsp-setup/references/bash/README.md +60 -0
- package/packages/shared-skills/skills/lsp-setup/references/c-cpp/README.md +61 -0
- package/packages/shared-skills/skills/lsp-setup/references/csharp/README.md +71 -0
- package/packages/shared-skills/skills/lsp-setup/references/dart/README.md +48 -0
- package/packages/shared-skills/skills/lsp-setup/references/elixir/README.md +51 -0
- package/packages/shared-skills/skills/lsp-setup/references/go/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/haskell/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/java/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/julia/README.md +60 -0
- package/packages/shared-skills/skills/lsp-setup/references/kotlin/README.md +59 -0
- package/packages/shared-skills/skills/lsp-setup/references/lua/README.md +66 -0
- package/packages/shared-skills/skills/lsp-setup/references/php/README.md +62 -0
- package/packages/shared-skills/skills/lsp-setup/references/python/README.md +71 -0
- package/packages/shared-skills/skills/lsp-setup/references/ruby/README.md +53 -0
- package/packages/shared-skills/skills/lsp-setup/references/rust/README.md +59 -0
- package/packages/shared-skills/skills/lsp-setup/references/swift/README.md +51 -0
- package/packages/shared-skills/skills/lsp-setup/references/terraform/README.md +62 -0
- package/packages/shared-skills/skills/lsp-setup/references/typescript/README.md +77 -0
- package/packages/shared-skills/skills/lsp-setup/references/yaml/README.md +70 -0
- package/packages/shared-skills/skills/lsp-setup/references/zig/README.md +49 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/tsconfig.json +17 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
- package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +1 -1
- package/packages/shared-skills/skills/review-work/SKILL.md +10 -14
- package/packages/shared-skills/skills/start-work/SKILL.md +30 -59
- package/packages/shared-skills/skills/ultraresearch/SKILL.md +126 -667
- package/dist/hooks/anthropic-effort/hook.d.ts +0 -26
- package/dist/hooks/anthropic-effort/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/analyze/default.d.ts +0 -12
- package/dist/hooks/keyword-detector/analyze/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +0 -12
- package/dist/hooks/keyword-detector/search/index.d.ts +0 -1
- package/dist/hooks/thinking-block-validator/hook.d.ts +0 -12
- package/dist/hooks/thinking-block-validator/index.d.ts +0 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/directive-contract.test.ts +0 -18
- package/packages/omo-codex/plugin/test/global-review-debug-gate.test.mjs +0 -29
- package/packages/omo-codex/plugin/test/subagent-guidance.test.mjs +0 -151
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// detect-lsp.ts <targetDir> [--json] — scan a directory for source languages and
|
|
3
|
+
// report, per detected language: the builtin LSP server, whether its executable
|
|
4
|
+
// is on PATH, an install hint, and whether a project LSP config references it.
|
|
5
|
+
|
|
6
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs"
|
|
7
|
+
import { delimiter, extname, join, sep } from "node:path"
|
|
8
|
+
import process from "node:process"
|
|
9
|
+
|
|
10
|
+
import { LANGUAGES, type LanguageServer, PROJECT_CONFIG_FILES } from "./lsp-server-table"
|
|
11
|
+
|
|
12
|
+
const SKIP_DIRECTORIES = new Set<string>([
|
|
13
|
+
"node_modules",
|
|
14
|
+
".git",
|
|
15
|
+
"dist",
|
|
16
|
+
"build",
|
|
17
|
+
".next",
|
|
18
|
+
"out",
|
|
19
|
+
"target",
|
|
20
|
+
".venv",
|
|
21
|
+
"venv",
|
|
22
|
+
"vendor",
|
|
23
|
+
".cache",
|
|
24
|
+
"__pycache__",
|
|
25
|
+
".turbo",
|
|
26
|
+
"coverage",
|
|
27
|
+
])
|
|
28
|
+
|
|
29
|
+
const MAX_FILES = 50_000
|
|
30
|
+
|
|
31
|
+
// Mirrors effectiveExtension() in packages/lsp-tools-mcp/src/lsp/effective-extension.ts:
|
|
32
|
+
// extensionless Dockerfile/Containerfile resolve to .dockerfile (exact-case basenames).
|
|
33
|
+
const BASENAME_EXTENSIONS: Record<string, string> = {
|
|
34
|
+
Dockerfile: ".dockerfile",
|
|
35
|
+
Containerfile: ".dockerfile",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface ConfigFileState {
|
|
39
|
+
readonly path: string
|
|
40
|
+
readonly exists: boolean
|
|
41
|
+
readonly serverIds: readonly string[]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface DetectionResult {
|
|
45
|
+
readonly server: LanguageServer
|
|
46
|
+
readonly executable: string
|
|
47
|
+
readonly installed: boolean
|
|
48
|
+
readonly resolvedPath: string | null
|
|
49
|
+
readonly configuredIn: readonly string[]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function collectExtensions(root: string): ReadonlySet<string> {
|
|
53
|
+
const found = new Set<string>()
|
|
54
|
+
const stack: string[] = [root]
|
|
55
|
+
let visited = 0
|
|
56
|
+
|
|
57
|
+
while (stack.length > 0) {
|
|
58
|
+
const current = stack.pop()
|
|
59
|
+
if (current === undefined) break
|
|
60
|
+
|
|
61
|
+
let entries: string[]
|
|
62
|
+
try {
|
|
63
|
+
entries = readdirSync(current)
|
|
64
|
+
} catch {
|
|
65
|
+
continue
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
if (visited >= MAX_FILES) return found
|
|
70
|
+
const fullPath = join(current, entry)
|
|
71
|
+
|
|
72
|
+
let kind: "dir" | "file" | "other" = "other"
|
|
73
|
+
try {
|
|
74
|
+
const stat = statSync(fullPath)
|
|
75
|
+
kind = stat.isDirectory() ? "dir" : stat.isFile() ? "file" : "other"
|
|
76
|
+
} catch {
|
|
77
|
+
continue
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (kind === "dir") {
|
|
81
|
+
if (!SKIP_DIRECTORIES.has(entry)) stack.push(fullPath)
|
|
82
|
+
} else if (kind === "file") {
|
|
83
|
+
visited += 1
|
|
84
|
+
const ext = (BASENAME_EXTENSIONS[entry] ?? extname(entry)).toLowerCase()
|
|
85
|
+
if (ext.length > 0) found.add(ext)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return found
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function pathDirectories(): readonly string[] {
|
|
94
|
+
return (process.env["PATH"] ?? "").split(delimiter).filter((dir: string) => dir.length > 0)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function resolveExecutable(command: string): string | null {
|
|
98
|
+
const extensions =
|
|
99
|
+
process.platform === "win32" ? (process.env["PATHEXT"]?.split(";") ?? [".EXE", ".CMD", ".BAT"]) : [""]
|
|
100
|
+
const bases = command.includes("/") || command.includes(sep) ? [command] : pathDirectories().map((dir: string) => join(dir, command))
|
|
101
|
+
|
|
102
|
+
for (const base of bases) {
|
|
103
|
+
for (const ext of extensions) {
|
|
104
|
+
const candidate = ext.length > 0 ? `${base}${ext}` : base
|
|
105
|
+
try {
|
|
106
|
+
if (existsSync(candidate) && statSync(candidate).isFile()) return candidate
|
|
107
|
+
} catch {
|
|
108
|
+
continue
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return null
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
116
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function parseConfiguredServerIds(path: string): readonly string[] {
|
|
120
|
+
let parsed: unknown
|
|
121
|
+
try {
|
|
122
|
+
parsed = JSON.parse(readFileSync(path, "utf-8"))
|
|
123
|
+
} catch {
|
|
124
|
+
return []
|
|
125
|
+
}
|
|
126
|
+
if (!isRecord(parsed)) return []
|
|
127
|
+
const lsp = parsed["lsp"]
|
|
128
|
+
return isRecord(lsp) ? Object.keys(lsp) : []
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function readConfigState(root: string): readonly ConfigFileState[] {
|
|
132
|
+
return PROJECT_CONFIG_FILES.map((relative: string): ConfigFileState => {
|
|
133
|
+
const path = join(root, relative)
|
|
134
|
+
if (!existsSync(path)) return { path: relative, exists: false, serverIds: [] }
|
|
135
|
+
return { path: relative, exists: true, serverIds: parseConfiguredServerIds(path) }
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function detect(root: string, configState: readonly ConfigFileState[]): readonly DetectionResult[] {
|
|
140
|
+
const extensions = collectExtensions(root)
|
|
141
|
+
const results: DetectionResult[] = []
|
|
142
|
+
|
|
143
|
+
for (const server of LANGUAGES) {
|
|
144
|
+
if (!server.extensions.some((ext: string) => extensions.has(ext))) continue
|
|
145
|
+
|
|
146
|
+
const executable = server.command[0] ?? server.serverId
|
|
147
|
+
const resolvedPath = resolveExecutable(executable)
|
|
148
|
+
const configuredIn = configState
|
|
149
|
+
.filter((state) => state.serverIds.includes(server.serverId))
|
|
150
|
+
.map((state) => state.path)
|
|
151
|
+
|
|
152
|
+
results.push({ server, executable, installed: resolvedPath !== null, resolvedPath, configuredIn })
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return results
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function renderReport(root: string, results: readonly DetectionResult[], configState: readonly ConfigFileState[]): string {
|
|
159
|
+
const lines: string[] = [`LSP setup scan: ${root}`]
|
|
160
|
+
const configSummary = configState
|
|
161
|
+
.map((state) => `${state.path} (${state.exists ? `present: ${state.serverIds.length} server(s)` : "absent"})`)
|
|
162
|
+
.join(", ")
|
|
163
|
+
lines.push(`Config files: ${configSummary}`, "")
|
|
164
|
+
|
|
165
|
+
if (results.length === 0) {
|
|
166
|
+
lines.push("No languages with a builtin LSP server were detected here.")
|
|
167
|
+
return lines.join("\n")
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
lines.push("DETECTED LANGUAGES (primary builtin server per language)")
|
|
171
|
+
for (const result of results) {
|
|
172
|
+
const mark = result.installed ? "OK " : "MISS"
|
|
173
|
+
const state = result.installed ? `installed (${result.resolvedPath})` : "NOT installed"
|
|
174
|
+
const config = result.configuredIn.length > 0 ? `configured in ${result.configuredIn.join(", ")}` : "builtin-default"
|
|
175
|
+
lines.push(`[${mark}] ${result.server.language.padEnd(12)} server=${result.server.serverId} exe=${result.executable} ${state} ${config}`)
|
|
176
|
+
if (!result.installed) lines.push(` install: ${result.server.installHint}`)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const missing = results.filter((result) => !result.installed)
|
|
180
|
+
lines.push(
|
|
181
|
+
"",
|
|
182
|
+
missing.length === 0
|
|
183
|
+
? `All ${results.length} detected server(s) installed.`
|
|
184
|
+
: `${missing.length}/${results.length} server(s) NOT installed: ${missing.map((m) => m.server.language).join(", ")}`,
|
|
185
|
+
"Next: read references/<language>/README.md, then configure .codex/lsp-client.json AND .opencode/lsp.json.",
|
|
186
|
+
)
|
|
187
|
+
return lines.join("\n")
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function main(): void {
|
|
191
|
+
const args = process.argv.slice(2)
|
|
192
|
+
const wantsJson = args.includes("--json")
|
|
193
|
+
const root = args.find((arg: string) => !arg.startsWith("--")) ?? process.cwd()
|
|
194
|
+
|
|
195
|
+
if (!existsSync(root)) {
|
|
196
|
+
process.stderr.write(`detect-lsp: target directory does not exist: ${root}\n`)
|
|
197
|
+
process.exit(2)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const configState = readConfigState(root)
|
|
201
|
+
const results = detect(root, configState)
|
|
202
|
+
|
|
203
|
+
if (wantsJson) {
|
|
204
|
+
process.stdout.write(`${JSON.stringify({ root, configState, results }, null, 2)}\n`)
|
|
205
|
+
return
|
|
206
|
+
}
|
|
207
|
+
process.stdout.write(`${renderReport(root, results, configState)}\n`)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
main()
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// SOURCE OF TRUTH: packages/lsp-tools-mcp/src/lsp/server-definitions.ts
|
|
2
|
+
// (BUILTIN_SERVERS + LSP_INSTALL_HINTS). This is a hand-maintained snapshot of
|
|
3
|
+
// the primary builtin server per reference language, embedded so detect-lsp.ts
|
|
4
|
+
// runs standalone in any user project. Mirror command/extensions when that file
|
|
5
|
+
// changes.
|
|
6
|
+
|
|
7
|
+
export interface LanguageServer {
|
|
8
|
+
readonly language: string
|
|
9
|
+
readonly serverId: string
|
|
10
|
+
readonly command: readonly string[]
|
|
11
|
+
readonly extensions: readonly string[]
|
|
12
|
+
readonly installHint: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const LANGUAGES: readonly LanguageServer[] = [
|
|
16
|
+
{
|
|
17
|
+
language: "typescript",
|
|
18
|
+
serverId: "typescript",
|
|
19
|
+
command: ["typescript-language-server", "--stdio"],
|
|
20
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"],
|
|
21
|
+
installHint: "npm install -g typescript-language-server typescript",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
language: "python",
|
|
25
|
+
serverId: "basedpyright",
|
|
26
|
+
command: ["basedpyright-langserver", "--stdio"],
|
|
27
|
+
extensions: [".py", ".pyi"],
|
|
28
|
+
installHint: "pip install basedpyright (or: uv tool install basedpyright)",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
language: "go",
|
|
32
|
+
serverId: "gopls",
|
|
33
|
+
command: ["gopls"],
|
|
34
|
+
extensions: [".go"],
|
|
35
|
+
installHint: "go install golang.org/x/tools/gopls@latest",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
language: "rust",
|
|
39
|
+
serverId: "rust",
|
|
40
|
+
command: ["rust-analyzer"],
|
|
41
|
+
extensions: [".rs"],
|
|
42
|
+
installHint: "rustup component add rust-analyzer",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
language: "c-cpp",
|
|
46
|
+
serverId: "clangd",
|
|
47
|
+
command: ["clangd", "--background-index", "--clang-tidy"],
|
|
48
|
+
extensions: [".c", ".cpp", ".cc", ".cxx", ".c++", ".h", ".hpp", ".hh", ".hxx", ".h++"],
|
|
49
|
+
installHint: "macOS: brew install llvm | Linux: apt install clangd | https://clangd.llvm.org/installation",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
language: "java",
|
|
53
|
+
serverId: "jdtls",
|
|
54
|
+
command: ["jdtls"],
|
|
55
|
+
extensions: [".java"],
|
|
56
|
+
installHint: "macOS: brew install jdtls | https://github.com/eclipse-jdtls/eclipse.jdt.ls",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
language: "kotlin",
|
|
60
|
+
serverId: "kotlin-ls",
|
|
61
|
+
command: ["kotlin-lsp"],
|
|
62
|
+
extensions: [".kt", ".kts"],
|
|
63
|
+
installHint: "https://github.com/Kotlin/kotlin-lsp",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
language: "csharp",
|
|
67
|
+
serverId: "csharp",
|
|
68
|
+
command: ["csharp-ls"],
|
|
69
|
+
extensions: [".cs"],
|
|
70
|
+
installHint: "dotnet tool install -g csharp-ls",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
language: "razor",
|
|
74
|
+
serverId: "razor",
|
|
75
|
+
command: ["roslyn-language-server", "--stdio"],
|
|
76
|
+
extensions: [".razor", ".cshtml"],
|
|
77
|
+
installHint: "dotnet tool install -g roslyn-language-server --prerelease (see references/csharp/README.md)",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
language: "swift",
|
|
81
|
+
serverId: "sourcekit-lsp",
|
|
82
|
+
command: ["sourcekit-lsp"],
|
|
83
|
+
extensions: [".swift", ".objc", ".objcpp"],
|
|
84
|
+
installHint: "Included with Xcode (xcode-select --install) or the Swift toolchain",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
language: "ruby",
|
|
88
|
+
serverId: "ruby-lsp",
|
|
89
|
+
command: ["rubocop", "--lsp"],
|
|
90
|
+
extensions: [".rb", ".rake", ".gemspec", ".ru"],
|
|
91
|
+
installHint: "gem install ruby-lsp (builtin runs `rubocop --lsp`; gem install rubocop)",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
language: "php",
|
|
95
|
+
serverId: "php",
|
|
96
|
+
command: ["intelephense", "--stdio"],
|
|
97
|
+
extensions: [".php"],
|
|
98
|
+
installHint: "npm install -g intelephense",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
language: "dart",
|
|
102
|
+
serverId: "dart",
|
|
103
|
+
command: ["dart", "language-server", "--lsp"],
|
|
104
|
+
extensions: [".dart"],
|
|
105
|
+
installHint: "Included with the Dart/Flutter SDK",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
language: "elixir",
|
|
109
|
+
serverId: "elixir-ls",
|
|
110
|
+
command: ["elixir-ls"],
|
|
111
|
+
extensions: [".ex", ".exs"],
|
|
112
|
+
installHint: "https://github.com/elixir-lsp/elixir-ls",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
language: "zig",
|
|
116
|
+
serverId: "zls",
|
|
117
|
+
command: ["zls"],
|
|
118
|
+
extensions: [".zig", ".zon"],
|
|
119
|
+
installHint: "https://github.com/zigtools/zls (match zls version to your zig version)",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
language: "lua",
|
|
123
|
+
serverId: "lua-ls",
|
|
124
|
+
command: ["lua-language-server"],
|
|
125
|
+
extensions: [".lua"],
|
|
126
|
+
installHint: "macOS: brew install lua-language-server | https://github.com/LuaLS/lua-language-server",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
language: "bash",
|
|
130
|
+
serverId: "bash",
|
|
131
|
+
command: ["bash-language-server", "start"],
|
|
132
|
+
extensions: [".sh", ".bash", ".zsh", ".ksh"],
|
|
133
|
+
installHint: "npm install -g bash-language-server",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
language: "yaml",
|
|
137
|
+
serverId: "yaml-ls",
|
|
138
|
+
command: ["yaml-language-server", "--stdio"],
|
|
139
|
+
extensions: [".yaml", ".yml"],
|
|
140
|
+
installHint: "npm install -g yaml-language-server",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
language: "terraform",
|
|
144
|
+
serverId: "terraform",
|
|
145
|
+
command: ["terraform-ls", "serve"],
|
|
146
|
+
extensions: [".tf", ".tfvars"],
|
|
147
|
+
installHint: "macOS: brew install hashicorp/tap/terraform-ls | https://github.com/hashicorp/terraform-ls",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
language: "dockerfile",
|
|
151
|
+
serverId: "dockerfile",
|
|
152
|
+
command: ["docker-langserver", "--stdio"],
|
|
153
|
+
extensions: [".dockerfile"],
|
|
154
|
+
installHint: "npm install -g dockerfile-language-server-nodejs",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
language: "haskell",
|
|
158
|
+
serverId: "haskell-language-server",
|
|
159
|
+
command: ["haskell-language-server-wrapper", "--lsp"],
|
|
160
|
+
extensions: [".hs", ".lhs"],
|
|
161
|
+
installHint: "ghcup install hls",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
language: "julia",
|
|
165
|
+
serverId: "julials",
|
|
166
|
+
command: ["julia", "--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"],
|
|
167
|
+
extensions: [".jl"],
|
|
168
|
+
installHint: "julia -e 'using Pkg; Pkg.add(\"LanguageServer\")' (see references/julia/README.md)",
|
|
169
|
+
},
|
|
170
|
+
] as const
|
|
171
|
+
|
|
172
|
+
export const PROJECT_CONFIG_FILES: readonly string[] = [
|
|
173
|
+
".codex/lsp-client.json",
|
|
174
|
+
".opencode/lsp.json",
|
|
175
|
+
".omo/lsp.json",
|
|
176
|
+
".omo/lsp-client.json",
|
|
177
|
+
] as const
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noUncheckedIndexedAccess": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"lib": ["ESNext"],
|
|
14
|
+
"types": ["bun-types"]
|
|
15
|
+
},
|
|
16
|
+
"include": ["*.ts"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// verify-lsp.ts <file> [--timeout=ms] — perform a real LSP diagnostics roundtrip
|
|
3
|
+
// for <file> through the lsp-tools-mcp engine and report ok/fail with error text.
|
|
4
|
+
// The engine source is located by walking up from this script and the cwd, so
|
|
5
|
+
// run it inside the omo repo/worktree (where packages/lsp-tools-mcp/src exists).
|
|
6
|
+
|
|
7
|
+
import { existsSync, statSync } from "node:fs"
|
|
8
|
+
import { dirname, isAbsolute, join, resolve } from "node:path"
|
|
9
|
+
import process from "node:process"
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url"
|
|
11
|
+
|
|
12
|
+
const ENGINE_TOOLS = "packages/lsp-tools-mcp/src/tools.ts"
|
|
13
|
+
const ENGINE_CONTEXT = "packages/lsp-tools-mcp/src/request-context.ts"
|
|
14
|
+
const ENGINE_MANAGER = "packages/lsp-tools-mcp/src/lsp/manager.ts"
|
|
15
|
+
const DEFAULT_TIMEOUT_MS = 60_000
|
|
16
|
+
|
|
17
|
+
interface ToolExecutionResult {
|
|
18
|
+
readonly content: ReadonlyArray<{ readonly type: "text"; readonly text: string }>
|
|
19
|
+
readonly isError?: boolean
|
|
20
|
+
readonly details?: unknown
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface DiagnosticsDetails {
|
|
24
|
+
readonly mode: "file" | "directory"
|
|
25
|
+
readonly totalDiagnostics: number
|
|
26
|
+
readonly error?: string
|
|
27
|
+
readonly errorKind?: "missing_dependency" | "no_files" | "invalid_path"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface ToolsModule {
|
|
31
|
+
readonly executeLspDiagnostics: (params: Record<string, unknown>, signal?: AbortSignal) => Promise<ToolExecutionResult>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface ContextModule {
|
|
35
|
+
readonly runWithRequestContext: <T>(context: { cwd?: string; env?: Record<string, string> }, fn: () => T) => T
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface ManagerModule {
|
|
39
|
+
readonly disposeDefaultLspManager: () => Promise<void>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function findUp(relativeTarget: string): string | null {
|
|
43
|
+
const starts = [dirname(fileURLToPath(import.meta.url)), process.cwd()]
|
|
44
|
+
for (const start of starts) {
|
|
45
|
+
let current = start
|
|
46
|
+
while (true) {
|
|
47
|
+
const candidate = join(current, relativeTarget)
|
|
48
|
+
if (existsSync(candidate)) return candidate
|
|
49
|
+
const parent = dirname(current)
|
|
50
|
+
if (parent === current) break
|
|
51
|
+
current = parent
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function buildEnv(): Record<string, string> {
|
|
58
|
+
const env: Record<string, string> = {}
|
|
59
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
60
|
+
if (value !== undefined) env[key] = value
|
|
61
|
+
}
|
|
62
|
+
return env
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isDiagnosticsDetails(value: unknown): value is DiagnosticsDetails {
|
|
66
|
+
return typeof value === "object" && value !== null && "mode" in value && "totalDiagnostics" in value
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function loadModule<T>(relativeTarget: string): Promise<T> {
|
|
70
|
+
const path = findUp(relativeTarget)
|
|
71
|
+
if (path === null) {
|
|
72
|
+
throw new EngineNotFoundError(relativeTarget)
|
|
73
|
+
}
|
|
74
|
+
return (await import(pathToFileURL(path).href)) as T
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
class EngineNotFoundError extends Error {
|
|
78
|
+
constructor(public readonly target: string) {
|
|
79
|
+
super(`lsp-tools-mcp engine not found (looked for ${target}). Run verify-lsp.ts inside the omo repo/worktree.`)
|
|
80
|
+
this.name = "EngineNotFoundError"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function parseTimeout(args: readonly string[]): number {
|
|
85
|
+
const flag = args.find((arg) => arg.startsWith("--timeout="))
|
|
86
|
+
if (flag === undefined) return DEFAULT_TIMEOUT_MS
|
|
87
|
+
const parsed = Number.parseInt(flag.slice("--timeout=".length), 10)
|
|
88
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_TIMEOUT_MS
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function run(filePath: string, timeoutMs: number): Promise<number> {
|
|
92
|
+
const tools = await loadModule<ToolsModule>(ENGINE_TOOLS)
|
|
93
|
+
const context = await loadModule<ContextModule>(ENGINE_CONTEXT)
|
|
94
|
+
const manager = await loadModule<ManagerModule>(ENGINE_MANAGER)
|
|
95
|
+
const absolute = isAbsolute(filePath) ? filePath : resolve(process.cwd(), filePath)
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const signal = AbortSignal.timeout(timeoutMs)
|
|
99
|
+
const result = await context.runWithRequestContext({ cwd: process.cwd(), env: buildEnv() }, () =>
|
|
100
|
+
tools.executeLspDiagnostics({ filePath: absolute, severity: "all" }, signal),
|
|
101
|
+
)
|
|
102
|
+
const details = isDiagnosticsDetails(result.details) ? result.details : null
|
|
103
|
+
const text = result.content.map((part) => part.text).join("\n")
|
|
104
|
+
|
|
105
|
+
if (details?.errorKind === "missing_dependency") {
|
|
106
|
+
process.stdout.write(`FAIL ${absolute}: language server not installed\n${text}\n`)
|
|
107
|
+
return 1
|
|
108
|
+
}
|
|
109
|
+
if (result.isError === true || details?.errorKind === "invalid_path" || details?.errorKind === "no_files") {
|
|
110
|
+
process.stdout.write(`FAIL ${absolute}: ${details?.error ?? text}\n`)
|
|
111
|
+
return 1
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const count = details?.totalDiagnostics ?? 0
|
|
115
|
+
process.stdout.write(`OK ${absolute}: LSP roundtrip succeeded (${count} diagnostic(s))\n${text}\n`)
|
|
116
|
+
return 0
|
|
117
|
+
} finally {
|
|
118
|
+
await manager.disposeDefaultLspManager()
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async function main(): Promise<void> {
|
|
123
|
+
const args = process.argv.slice(2)
|
|
124
|
+
const filePath = args.find((arg) => !arg.startsWith("--"))
|
|
125
|
+
if (filePath === undefined) {
|
|
126
|
+
process.stderr.write("Usage: bun verify-lsp.ts <file> [--timeout=ms]\n")
|
|
127
|
+
process.exit(2)
|
|
128
|
+
}
|
|
129
|
+
if (!existsSync(filePath) || !statSync(filePath).isFile()) {
|
|
130
|
+
process.stderr.write(`verify-lsp: not a file: ${filePath}\n`)
|
|
131
|
+
process.exit(2)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
const code = await run(filePath, parseTimeout(args))
|
|
136
|
+
process.exit(code)
|
|
137
|
+
} catch (error) {
|
|
138
|
+
if (error instanceof EngineNotFoundError) {
|
|
139
|
+
process.stderr.write(`SKIP: ${error.message}\n`)
|
|
140
|
+
process.exit(3)
|
|
141
|
+
}
|
|
142
|
+
process.stderr.write(`FAIL ${filePath}: ${error instanceof Error ? error.message : String(error)}\n`)
|
|
143
|
+
process.exit(1)
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
await main()
|
|
@@ -193,7 +193,7 @@ For each skipped issue, give reason.
|
|
|
193
193
|
)
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
**Batch failure handling**: a `wait_agent` timeout only means no new mailbox update arrived, not that a `deep` agent failed. For long passes, require each child to send `WORKING: <file> - <current phase>` and `BLOCKED: <reason>` only when it cannot progress.
|
|
196
|
+
**Batch failure handling**: a `multi_agent_v1.wait_agent` timeout only means no new mailbox update arrived, not that a `deep` agent failed. For long passes, require each child to send `WORKING: <file> - <current phase>` and `BLOCKED: <reason>` only when it cannot progress. Treat a running child as alive. Mark a file for retry only when the child is completed without the deliverable, ack-only after followup, explicitly `BLOCKED:`, or no longer running. Do NOT block the remaining 4 in that batch; collect successful results and retry the failed file once later. If retry also fails, escalate that file under "Issues Found & Fixed" in the final report.
|
|
197
197
|
|
|
198
198
|
### Phase 5: Verify with quality gates + critical review
|
|
199
199
|
|
|
@@ -20,15 +20,14 @@ Codex full-history forks inherit parent context, so role-specific behavior must
|
|
|
20
20
|
|
|
21
21
|
## Codex Subagent Reliability
|
|
22
22
|
|
|
23
|
-
Every `spawn_agent` message must be self-contained. Start with
|
|
23
|
+
Every `multi_agent_v1.spawn_agent` message must be self-contained. Start with
|
|
24
24
|
`TASK: <imperative assignment>`, then name `DELIVERABLE`, `SCOPE`, and
|
|
25
25
|
`VERIFY`. State that it is an executable assignment, not a context
|
|
26
|
-
handoff. Role or specialty instructions belong inside `message
|
|
27
|
-
|
|
28
|
-
Prefer `fork_turns: "none"` unless full history is truly
|
|
26
|
+
handoff. Role or specialty instructions belong inside `message`.
|
|
27
|
+
Use `fork_context: false` unless full history is truly
|
|
29
28
|
required; paste only the review context that worker needs.
|
|
30
29
|
|
|
31
|
-
Plan and reviewer agents may run for a long time; spawn them in the background, keep doing independent root work, and poll with short wait_agent cycles sized to the work. Never use a single long blocking wait for them, and never spin on tiny timeouts as a failure budget.
|
|
30
|
+
Plan and reviewer agents may run for a long time; spawn them in the background, keep doing independent root work, and poll with short `multi_agent_v1.wait_agent` cycles sized to the work. Never use a single long blocking wait for them, and never spin on tiny timeouts as a failure budget.
|
|
32
31
|
|
|
33
32
|
Treat child status as a progress signal, not a timeout counter. For
|
|
34
33
|
work likely to exceed one wait cycle, require the child to send
|
|
@@ -37,16 +36,13 @@ review passes, and `BLOCKED: <reason>` only when it cannot progress.
|
|
|
37
36
|
While any child is active, keep the parent visibly alive with active
|
|
38
37
|
subagent count, agent names, latest `WORKING:` phase, and whether the
|
|
39
38
|
parent is waiting for mailbox updates. Track spawned agent names
|
|
40
|
-
locally. Use `wait_agent` for mailbox signals, not proof of completion.
|
|
41
|
-
A timeout only means no new mailbox update arrived
|
|
42
|
-
|
|
43
|
-
reassurance. If it is running or its latest message is `WORKING:`,
|
|
44
|
-
treat it as alive. Do not use `list_agents` as a polling loop or status
|
|
45
|
-
feed; it can replay large payloads. Fallback only when the child is
|
|
39
|
+
locally. Use `multi_agent_v1.wait_agent` for mailbox signals, not proof of completion.
|
|
40
|
+
A timeout only means no new mailbox update arrived. Treat a running child as alive.
|
|
41
|
+
Fallback only when the child is
|
|
46
42
|
completed without the deliverable, ack-only after followup, explicitly
|
|
47
43
|
`BLOCKED:`, or no longer running. Then mark that review lane
|
|
48
44
|
`INCONCLUSIVE`, do not count it as PASS or approval, close if safe, and
|
|
49
|
-
respawn a smaller `
|
|
45
|
+
respawn a smaller `fork_context: false` reviewer with the missing
|
|
50
46
|
deliverable. Preserve completed lane results immediately. If the retry
|
|
51
47
|
budget is exhausted, keep the lane `INCONCLUSIVE` and still emit a final
|
|
52
48
|
aggregate result.
|
|
@@ -530,7 +526,7 @@ After launching all 5 agents in one turn, wait for completions in bounded
|
|
|
530
526
|
cycles. Do not treat a timeout, ack-only reply, or empty child result as
|
|
531
527
|
a PASS.
|
|
532
528
|
|
|
533
|
-
As each completes, collect via the Codex mapping above (`wait_agent`,
|
|
529
|
+
As each completes, collect via the Codex mapping above (`multi_agent_v1.wait_agent`,
|
|
534
530
|
then the child's substantive final result). Preserve completed lane
|
|
535
531
|
results immediately; never lose a PASS/FAIL because another lane is
|
|
536
532
|
still running. Store each verdict independently:
|
|
@@ -550,7 +546,7 @@ inconclusive and respawn a smaller reviewer/worker for that exact lane.
|
|
|
550
546
|
If it still remains unfinished after that retry, close the still-running
|
|
551
547
|
agent if safe, keep the lane INCONCLUSIVE, and emit the final aggregate
|
|
552
548
|
review result with the incomplete lane named. Do not spin in repeated
|
|
553
|
-
wait/followup cycles. Do not use `
|
|
549
|
+
wait/followup cycles. Do not use `multi_agent_v1.send_input` as an interrupt; queued
|
|
554
550
|
followups are not cancellation.
|
|
555
551
|
|
|
556
552
|
---
|