@tyvm/knowhow 0.0.33 → 0.0.35
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/autodoc/plugins/downloader/downloader.mdx +2 -2
- package/benchmarks/.dockerignore +7 -0
- package/benchmarks/README.md +166 -0
- package/benchmarks/docker/Dockerfile +68 -0
- package/benchmarks/example-config.yml +27 -0
- package/benchmarks/jest.config.js +13 -0
- package/benchmarks/package-lock.json +4297 -0
- package/benchmarks/package.json +39 -0
- package/benchmarks/results/4542435/2025-08-05/lms/lms-openai-gpt-oss-20b.json +2814 -0
- package/benchmarks/results/4542435/2025-08-05/lms/lms-qwen-qwen3-30b-a3b-2507.json +2014 -0
- package/benchmarks/results/4fb9125/2025-08-07/anthropic/anthropic-claude-sonnet-4-20250514.json +3121 -0
- package/benchmarks/results/5766aee/2025-08-02/lms-qwen/qwen3-coder-30b.json +98 -0
- package/benchmarks/results/6d73808/2025-08-07/openai/openai-gpt-5.json +3256 -0
- package/benchmarks/results/77bf0a6/2025-08-02/lms-qwen/qwen3-30b-a3b-2507.json +4298 -0
- package/benchmarks/results/8c0d445/2025-08-03/anthropic/anthropic-claude-sonnet-4-20250514.json +3031 -0
- package/benchmarks/results/8c0d445/2025-08-03/openai/openai-gpt-4.1-2025-04-14.json +2990 -0
- package/benchmarks/results/ac6b2ab/2025-08-03/anthropic/anthropic-claude-sonnet-4-20250514.json +3256 -0
- package/benchmarks/results/ac6b2ab/2025-08-03/lms/lms-qwen-qwen3-coder-30b.json +3007 -0
- package/benchmarks/results/ac6b2ab/2025-08-03/openai/openai-gpt-4.1-2025-04-14.json +3256 -0
- package/benchmarks/results/ac6b2ab/2025-08-03/openai/openai-gpt-4.1-mini-2025-04-14.json +3036 -0
- package/benchmarks/results/ac6b2ab/2025-08-03/openai/openai-gpt-4.1-nano-2025-04-14.json +3280 -0
- package/benchmarks/results/adff675/2025-08-04/lms/lms-qwen-qwen3-30b-a3b-2507.json +1920 -0
- package/benchmarks/results/adff675/2025-08-04/lms/lms-qwen-qwen3-coder-30b.json +3281 -0
- package/benchmarks/results/b502ed9/2025-08-03/lms-qwen/qwen3-coder-30b.json +2896 -0
- package/benchmarks/results/d1a8129/2025-08-03/lms/lms-qwen-qwen3-coder-30b.json +3011 -0
- package/benchmarks/results/e60471c/2025-08-03/lms/qwen3-30b-a3b-2507.json +3003 -0
- package/benchmarks/scripts/build-and-run.sh +47 -0
- package/benchmarks/scripts/clone-exercism.sh +92 -0
- package/benchmarks/scripts/validate.sh +48 -0
- package/benchmarks/src/__tests__/runner.test.ts +27 -0
- package/benchmarks/src/cli.ts +90 -0
- package/benchmarks/src/evaluators/EvaluatorRegistry.ts +64 -0
- package/benchmarks/src/evaluators/JavaScriptEvaluator.ts +183 -0
- package/benchmarks/src/evaluators/index.ts +3 -0
- package/benchmarks/src/evaluators/types.ts +22 -0
- package/benchmarks/src/index.ts +3 -0
- package/benchmarks/src/providers.ts +13 -0
- package/benchmarks/src/runner.ts +824 -0
- package/benchmarks/src/types.ts +63 -0
- package/benchmarks/tsconfig.json +19 -0
- package/jest.config.js +2 -1
- package/leaderboard/README.md +148 -0
- package/leaderboard/app/api/benchmark-data/route.ts +131 -0
- package/leaderboard/app/api/benchmark-detail/route.ts +172 -0
- package/leaderboard/app/details/[model]/[provider]/[language]/page.tsx +501 -0
- package/leaderboard/app/exercise/[model]/[provider]/[language]/[exercise]/page.tsx +375 -0
- package/leaderboard/app/globals.css +27 -0
- package/leaderboard/app/layout.tsx +21 -0
- package/leaderboard/app/page.tsx +170 -0
- package/leaderboard/components/LeaderboardTable.tsx +168 -0
- package/leaderboard/components/PerformanceChart.tsx +109 -0
- package/leaderboard/next-env.d.ts +5 -0
- package/leaderboard/next.config.js +4 -0
- package/leaderboard/package-lock.json +6363 -0
- package/leaderboard/package.json +28 -0
- package/leaderboard/postcss.config.js +6 -0
- package/leaderboard/tailwind.config.js +17 -0
- package/leaderboard/tsconfig.json +28 -0
- package/leaderboard/types/benchmark.ts +67 -0
- package/leaderboard/utils/dataProcessor.ts +33 -0
- package/package.json +2 -1
- package/src/agents/base/base.ts +182 -24
- package/src/agents/base/prompt.ts +28 -0
- package/src/agents/index.ts +3 -0
- package/src/agents/patcher/patcher.ts +6 -4
- package/src/agents/setup/setup.ts +56 -0
- package/src/agents/tools/agentCall.ts +6 -2
- package/src/agents/tools/aiClient.ts +74 -8
- package/src/agents/tools/execCommand.ts +13 -14
- package/src/agents/tools/executeScript/README.md +16 -0
- package/src/agents/tools/index.ts +2 -0
- package/src/agents/tools/list.ts +73 -16
- package/src/agents/tools/startAgentTask.ts +109 -0
- package/src/agents/tools/textSearch.ts +1 -1
- package/src/agents/tools/visionTool.ts +31 -2
- package/src/agents/tools/ycmd/client.ts +608 -0
- package/src/agents/tools/ycmd/definitions.ts +294 -0
- package/src/agents/tools/ycmd/detection.ts +211 -0
- package/src/agents/tools/ycmd/index.ts +11 -0
- package/src/agents/tools/ycmd/installer.ts +251 -0
- package/src/agents/tools/ycmd/server.ts +535 -0
- package/src/agents/tools/ycmd/serverManager.ts +316 -0
- package/src/agents/tools/ycmd/tools/completion.ts +113 -0
- package/src/agents/tools/ycmd/tools/diagnostics.ts +155 -0
- package/src/agents/tools/ycmd/tools/getLocations.ts +173 -0
- package/src/agents/tools/ycmd/tools/goto.ts +169 -0
- package/src/agents/tools/ycmd/tools/refactor.ts +204 -0
- package/src/agents/tools/ycmd/tools/signature.ts +174 -0
- package/src/agents/tools/ycmd/tools/start.ts +95 -0
- package/src/agents/tools/ycmd/utils/pathUtils.ts +59 -0
- package/src/ai.ts +15 -0
- package/src/chat/CliChatService.ts +277 -0
- package/src/chat/modules/AgentModule.ts +985 -0
- package/src/chat/modules/AskModule.ts +98 -0
- package/src/chat/modules/BaseChatModule.ts +66 -0
- package/src/chat/modules/InternalChatModule.ts +174 -0
- package/src/chat/modules/SearchModule.ts +166 -0
- package/src/chat/modules/SetupModule.ts +185 -0
- package/src/chat/modules/SystemModule.ts +120 -0
- package/src/chat/modules/VoiceModule.ts +70 -0
- package/src/chat/modules/index.js +5 -0
- package/src/chat/types.ts +97 -0
- package/src/chat.ts +9 -1
- package/src/chat2.ts +62 -0
- package/src/cli.ts +264 -35
- package/src/clients/anthropic.ts +14 -7
- package/src/clients/gemini.ts +15 -7
- package/src/clients/http.ts +17 -7
- package/src/clients/index.ts +117 -4
- package/src/clients/knowhow.ts +7 -2
- package/src/clients/knowhowMcp.ts +118 -0
- package/src/clients/openai.ts +32 -8
- package/src/clients/types.ts +1 -0
- package/src/clients/xai.ts +17 -5
- package/src/config.ts +30 -5
- package/src/conversion.ts +4 -1
- package/src/login.ts +26 -9
- package/src/microphone.ts +0 -1
- package/src/plugins/downloader/downloader.ts +191 -49
- package/src/plugins/downloader/plugin.ts +3 -1
- package/src/plugins/plugins.ts +3 -0
- package/src/processors/CustomVariables.ts +425 -0
- package/src/processors/HarmonyToolProcessor.ts +264 -0
- package/src/processors/XmlToolCallProcessor.ts +533 -0
- package/src/processors/index.ts +3 -0
- package/src/prompts/KnowhowConfigExamples.ts +376 -0
- package/src/services/KnowhowClient.ts +49 -3
- package/src/services/Mcp.ts +42 -3
- package/src/services/McpServer.ts +14 -4
- package/src/services/McpWebsocketTransport.ts +21 -7
- package/src/services/MessageProcessor.ts +10 -5
- package/src/services/index.ts +5 -0
- package/src/services/script-execution/ScriptExecutor.ts +34 -1
- package/src/services/types.ts +17 -14
- package/src/types.ts +17 -0
- package/src/utils/index.ts +138 -0
- package/tests/XmlToolCallProcessor.test.ts +468 -0
- package/tests/manual/ycmd/debug_diagnostics_test.ts +127 -0
- package/tests/manual/ycmd/fixtures/debug_diagnostics.ts +26 -0
- package/tests/manual/ycmd/fixtures/file_change_test.ts +17 -0
- package/tests/manual/ycmd/minimal_advanced_test.ts +108 -0
- package/tests/manual/ycmd/simple_diagnostics_test.ts +61 -0
- package/tests/manual/ycmd/simple_test.ts +74 -0
- package/tests/manual/ycmd/test-typescript-sample.ts +34 -0
- package/tests/manual/ycmd/test_advanced_features.ts +407 -0
- package/tests/manual/ycmd/test_advanced_with_tools.ts +320 -0
- package/tests/manual/ycmd/test_comprehensive_typescript.ts +179 -0
- package/tests/manual/ycmd/test_diagnostics_file_changes.ts +249 -0
- package/tests/manual/ycmd/test_diagnostics_fix.ts +99 -0
- package/tests/manual/ycmd/test_diagnostics_simple.ts +100 -0
- package/tests/manual/ycmd/test_diagnostics_timing.ts +120 -0
- package/tests/manual/ycmd/test_discover_commands.ts +310 -0
- package/tests/manual/ycmd/test_endpoints.ts +115 -0
- package/tests/manual/ycmd/test_final_comprehensive.ts +218 -0
- package/tests/manual/ycmd/test_final_validation.ts +150 -0
- package/tests/manual/ycmd/test_implementation.js +42 -0
- package/tests/manual/ycmd/test_individual_ycmd_tool.ts +39 -0
- package/tests/manual/ycmd/test_server_manager.ts +52 -0
- package/tests/manual/ycmd/test_simple_debug.ts +86 -0
- package/tests/manual/ycmd/test_tsserver_workflow.js +83 -0
- package/tests/manual/ycmd/test_tsserver_workflow.ts +122 -0
- package/tests/manual/ycmd/test_typescript_simple.ts +48 -0
- package/tests/manual/ycmd/test_typescript_ycmd.ts +105 -0
- package/tests/manual/ycmd/test_workspace_config.ts +90 -0
- package/tests/manual/ycmd/test_ycmd_auto_start.ts +137 -0
- package/tests/manual/ycmd/test_ycmd_comprehensive.ts +73 -0
- package/tests/manual/ycmd/test_ycmd_connection.py +10 -0
- package/tests/manual/ycmd/test_ycmd_direct.ts +142 -0
- package/tests/manual/ycmd/test_ycmd_experiment.ts +48 -0
- package/tests/manual/ycmd/test_ycmd_final.ts +200 -0
- package/tests/manual/ycmd/test_ycmd_fixed.py +18 -0
- package/tests/manual/ycmd/test_ycmd_integration.ts +112 -0
- package/tests/manual/ycmd/test_ycmd_simple.ts +45 -0
- package/tests/manual/ycmd/test_ycmd_usage.py +27 -0
- package/tests/manual/ycmd/working_simple_test.ts +134 -0
- package/ts_build/src/agents/base/base.d.ts +15 -1
- package/ts_build/src/agents/base/base.js +121 -20
- package/ts_build/src/agents/base/base.js.map +1 -1
- package/ts_build/src/agents/base/prompt.d.ts +1 -1
- package/ts_build/src/agents/base/prompt.js +28 -0
- package/ts_build/src/agents/base/prompt.js.map +1 -1
- package/ts_build/src/agents/index.d.ts +2 -0
- package/ts_build/src/agents/index.js +2 -0
- package/ts_build/src/agents/index.js.map +1 -1
- package/ts_build/src/agents/patcher/patcher.js +6 -3
- package/ts_build/src/agents/patcher/patcher.js.map +1 -1
- package/ts_build/src/agents/setup/setup.d.ts +8 -0
- package/ts_build/src/agents/setup/setup.js +59 -0
- package/ts_build/src/agents/setup/setup.js.map +1 -0
- package/ts_build/src/agents/tools/agentCall.js +5 -2
- package/ts_build/src/agents/tools/agentCall.js.map +1 -1
- package/ts_build/src/agents/tools/aiClient.d.ts +6 -5
- package/ts_build/src/agents/tools/aiClient.js +37 -6
- package/ts_build/src/agents/tools/aiClient.js.map +1 -1
- package/ts_build/src/agents/tools/execCommand.d.ts +2 -2
- package/ts_build/src/agents/tools/execCommand.js +5 -6
- package/ts_build/src/agents/tools/execCommand.js.map +1 -1
- package/ts_build/src/agents/tools/executeScript/index.d.ts +1 -1
- package/ts_build/src/agents/tools/index.d.ts +2 -0
- package/ts_build/src/agents/tools/index.js +2 -0
- package/ts_build/src/agents/tools/index.js.map +1 -1
- package/ts_build/src/agents/tools/list.js +66 -16
- package/ts_build/src/agents/tools/list.js.map +1 -1
- package/ts_build/src/agents/tools/startAgentTask.d.ts +13 -0
- package/ts_build/src/agents/tools/startAgentTask.js +74 -0
- package/ts_build/src/agents/tools/startAgentTask.js.map +1 -0
- package/ts_build/src/agents/tools/startChatTask.d.ts +13 -0
- package/ts_build/src/agents/tools/startChatTask.js +73 -0
- package/ts_build/src/agents/tools/startChatTask.js.map +1 -0
- package/ts_build/src/agents/tools/textSearch.js +1 -1
- package/ts_build/src/agents/tools/textSearch.js.map +1 -1
- package/ts_build/src/agents/tools/visionTool.d.ts +1 -1
- package/ts_build/src/agents/tools/visionTool.js +23 -3
- package/ts_build/src/agents/tools/visionTool.js.map +1 -1
- package/ts_build/src/agents/tools/ycmd/client.d.ts +93 -0
- package/ts_build/src/agents/tools/ycmd/client.js +355 -0
- package/ts_build/src/agents/tools/ycmd/client.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/definitions.d.ts +345 -0
- package/ts_build/src/agents/tools/ycmd/definitions.js +298 -0
- package/ts_build/src/agents/tools/ycmd/definitions.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/detection.d.ts +11 -0
- package/ts_build/src/agents/tools/ycmd/detection.js +175 -0
- package/ts_build/src/agents/tools/ycmd/detection.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/index.d.ts +8 -0
- package/ts_build/src/agents/tools/ycmd/index.js +20 -0
- package/ts_build/src/agents/tools/ycmd/index.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/installer.d.ts +19 -0
- package/ts_build/src/agents/tools/ycmd/installer.js +196 -0
- package/ts_build/src/agents/tools/ycmd/installer.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/server.d.ts +35 -0
- package/ts_build/src/agents/tools/ycmd/server.js +363 -0
- package/ts_build/src/agents/tools/ycmd/server.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/serverManager.d.ts +39 -0
- package/ts_build/src/agents/tools/ycmd/serverManager.js +210 -0
- package/ts_build/src/agents/tools/ycmd/serverManager.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/tools/completion.d.ts +22 -0
- package/ts_build/src/agents/tools/ycmd/tools/completion.js +72 -0
- package/ts_build/src/agents/tools/ycmd/tools/completion.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/tools/diagnostics.d.ts +42 -0
- package/ts_build/src/agents/tools/ycmd/tools/diagnostics.js +88 -0
- package/ts_build/src/agents/tools/ycmd/tools/diagnostics.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/tools/getLocations.d.ts +22 -0
- package/ts_build/src/agents/tools/ycmd/tools/getLocations.js +142 -0
- package/ts_build/src/agents/tools/ycmd/tools/getLocations.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/tools/goto.d.ts +20 -0
- package/ts_build/src/agents/tools/ycmd/tools/goto.js +101 -0
- package/ts_build/src/agents/tools/ycmd/tools/goto.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/tools/refactor.d.ts +32 -0
- package/ts_build/src/agents/tools/ycmd/tools/refactor.js +123 -0
- package/ts_build/src/agents/tools/ycmd/tools/refactor.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/tools/signature.d.ts +25 -0
- package/ts_build/src/agents/tools/ycmd/tools/signature.js +110 -0
- package/ts_build/src/agents/tools/ycmd/tools/signature.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/tools/start.d.ts +17 -0
- package/ts_build/src/agents/tools/ycmd/tools/start.js +65 -0
- package/ts_build/src/agents/tools/ycmd/tools/start.js.map +1 -0
- package/ts_build/src/agents/tools/ycmd/utils/pathUtils.d.ts +4 -0
- package/ts_build/src/agents/tools/ycmd/utils/pathUtils.js +67 -0
- package/ts_build/src/agents/tools/ycmd/utils/pathUtils.js.map +1 -0
- package/ts_build/src/ai.d.ts +1 -0
- package/ts_build/src/ai.js +40 -1
- package/ts_build/src/ai.js.map +1 -1
- package/ts_build/src/chat/ChatCommandHandler.d.ts +36 -0
- package/ts_build/src/chat/ChatCommandHandler.js +268 -0
- package/ts_build/src/chat/ChatCommandHandler.js.map +1 -0
- package/ts_build/src/chat/ChatInputManager.d.ts +22 -0
- package/ts_build/src/chat/ChatInputManager.js +85 -0
- package/ts_build/src/chat/ChatInputManager.js.map +1 -0
- package/ts_build/src/chat/ChatManager.d.ts +49 -0
- package/ts_build/src/chat/ChatManager.js +271 -0
- package/ts_build/src/chat/ChatManager.js.map +1 -0
- package/ts_build/src/chat/ChatSession.d.ts +32 -0
- package/ts_build/src/chat/ChatSession.js +3 -0
- package/ts_build/src/chat/ChatSession.js.map +1 -0
- package/ts_build/src/chat/ChatSessionManager.d.ts +19 -0
- package/ts_build/src/chat/ChatSessionManager.js +188 -0
- package/ts_build/src/chat/ChatSessionManager.js.map +1 -0
- package/ts_build/src/chat/ChatStateManager.d.ts +58 -0
- package/ts_build/src/chat/ChatStateManager.js +156 -0
- package/ts_build/src/chat/ChatStateManager.js.map +1 -0
- package/ts_build/src/chat/CliChatService.d.ts +35 -0
- package/ts_build/src/chat/CliChatService.js +201 -0
- package/ts_build/src/chat/CliChatService.js.map +1 -0
- package/ts_build/src/chat/InterruptibleInput.d.ts +20 -0
- package/ts_build/src/chat/InterruptibleInput.js +109 -0
- package/ts_build/src/chat/InterruptibleInput.js.map +1 -0
- package/ts_build/src/chat/interfaces/ChatModule.d.ts +6 -0
- package/ts_build/src/chat/interfaces/ChatModule.js +3 -0
- package/ts_build/src/chat/interfaces/ChatModule.js.map +1 -0
- package/ts_build/src/chat/modules/AgentModule.d.ts +57 -0
- package/ts_build/src/chat/modules/AgentModule.js +709 -0
- package/ts_build/src/chat/modules/AgentModule.js.map +1 -0
- package/ts_build/src/chat/modules/AskModule.d.ts +10 -0
- package/ts_build/src/chat/modules/AskModule.js +63 -0
- package/ts_build/src/chat/modules/AskModule.js.map +1 -0
- package/ts_build/src/chat/modules/BaseChatModule.d.ts +14 -0
- package/ts_build/src/chat/modules/BaseChatModule.js +32 -0
- package/ts_build/src/chat/modules/BaseChatModule.js.map +1 -0
- package/ts_build/src/chat/modules/InternalChatModule.d.ts +24 -0
- package/ts_build/src/chat/modules/InternalChatModule.js +127 -0
- package/ts_build/src/chat/modules/InternalChatModule.js.map +1 -0
- package/ts_build/src/chat/modules/SearchModule.d.ts +12 -0
- package/ts_build/src/chat/modules/SearchModule.js +119 -0
- package/ts_build/src/chat/modules/SearchModule.js.map +1 -0
- package/ts_build/src/chat/modules/SetupModule.d.ts +15 -0
- package/ts_build/src/chat/modules/SetupModule.js +147 -0
- package/ts_build/src/chat/modules/SetupModule.js.map +1 -0
- package/ts_build/src/chat/modules/SystemModule.d.ts +14 -0
- package/ts_build/src/chat/modules/SystemModule.js +90 -0
- package/ts_build/src/chat/modules/SystemModule.js.map +1 -0
- package/ts_build/src/chat/modules/VoiceModule.d.ts +11 -0
- package/ts_build/src/chat/modules/VoiceModule.js +57 -0
- package/ts_build/src/chat/modules/VoiceModule.js.map +1 -0
- package/ts_build/src/chat/types.d.ts +83 -0
- package/ts_build/src/chat/types.js +3 -0
- package/ts_build/src/chat/types.js.map +1 -0
- package/ts_build/src/chat.js +7 -1
- package/ts_build/src/chat.js.map +1 -1
- package/ts_build/src/chat2.d.ts +3 -0
- package/ts_build/src/chat2.js +47 -0
- package/ts_build/src/chat2.js.map +1 -0
- package/ts_build/src/cli.js +218 -37
- package/ts_build/src/cli.js.map +1 -1
- package/ts_build/src/clients/anthropic.d.ts +5 -2
- package/ts_build/src/clients/anthropic.js +12 -7
- package/ts_build/src/clients/anthropic.js.map +1 -1
- package/ts_build/src/clients/gemini.d.ts +6 -3
- package/ts_build/src/clients/gemini.js +13 -7
- package/ts_build/src/clients/gemini.js.map +1 -1
- package/ts_build/src/clients/http.d.ts +1 -0
- package/ts_build/src/clients/http.js +12 -5
- package/ts_build/src/clients/http.js.map +1 -1
- package/ts_build/src/clients/index.d.ts +10 -0
- package/ts_build/src/clients/index.js +74 -4
- package/ts_build/src/clients/index.js.map +1 -1
- package/ts_build/src/clients/knowhow.d.ts +3 -1
- package/ts_build/src/clients/knowhow.js +8 -2
- package/ts_build/src/clients/knowhow.js.map +1 -1
- package/ts_build/src/clients/knowhowMcp.d.ts +20 -0
- package/ts_build/src/clients/knowhowMcp.js +86 -0
- package/ts_build/src/clients/knowhowMcp.js.map +1 -0
- package/ts_build/src/clients/openai.d.ts +5 -2
- package/ts_build/src/clients/openai.js +29 -8
- package/ts_build/src/clients/openai.js.map +1 -1
- package/ts_build/src/clients/types.d.ts +1 -0
- package/ts_build/src/clients/xai.d.ts +5 -2
- package/ts_build/src/clients/xai.js +15 -5
- package/ts_build/src/clients/xai.js.map +1 -1
- package/ts_build/src/config.js +24 -3
- package/ts_build/src/config.js.map +1 -1
- package/ts_build/src/conversion.js +6 -4
- package/ts_build/src/conversion.js.map +1 -1
- package/ts_build/src/login.d.ts +1 -1
- package/ts_build/src/login.js +21 -7
- package/ts_build/src/login.js.map +1 -1
- package/ts_build/src/microphone.js.map +1 -1
- package/ts_build/src/plugins/downloader/downloader.d.ts +7 -5
- package/ts_build/src/plugins/downloader/downloader.js +147 -44
- package/ts_build/src/plugins/downloader/downloader.js.map +1 -1
- package/ts_build/src/plugins/downloader/plugin.js +5 -3
- package/ts_build/src/plugins/downloader/plugin.js.map +1 -1
- package/ts_build/src/plugins/plugins.js +3 -0
- package/ts_build/src/plugins/plugins.js.map +1 -1
- package/ts_build/src/processors/CustomVariables.d.ts +32 -0
- package/ts_build/src/processors/CustomVariables.js +297 -0
- package/ts_build/src/processors/CustomVariables.js.map +1 -0
- package/ts_build/src/processors/HarmonyToolProcessor.d.ts +15 -0
- package/ts_build/src/processors/HarmonyToolProcessor.js +154 -0
- package/ts_build/src/processors/HarmonyToolProcessor.js.map +1 -0
- package/ts_build/src/processors/XmlToolCallProcessor.d.ts +14 -0
- package/ts_build/src/processors/XmlToolCallProcessor.js +357 -0
- package/ts_build/src/processors/XmlToolCallProcessor.js.map +1 -0
- package/ts_build/src/processors/index.d.ts +3 -0
- package/ts_build/src/processors/index.js +7 -1
- package/ts_build/src/processors/index.js.map +1 -1
- package/ts_build/src/prompts/KnowhowConfigExamples.d.ts +2 -0
- package/ts_build/src/prompts/KnowhowConfigExamples.js +379 -0
- package/ts_build/src/prompts/KnowhowConfigExamples.js.map +1 -0
- package/ts_build/src/services/KnowhowClient.d.ts +22 -0
- package/ts_build/src/services/KnowhowClient.js +14 -2
- package/ts_build/src/services/KnowhowClient.js.map +1 -1
- package/ts_build/src/services/Mcp.d.ts +1 -0
- package/ts_build/src/services/Mcp.js +20 -3
- package/ts_build/src/services/Mcp.js.map +1 -1
- package/ts_build/src/services/McpServer.d.ts +1 -1
- package/ts_build/src/services/McpServer.js +8 -4
- package/ts_build/src/services/McpServer.js.map +1 -1
- package/ts_build/src/services/McpWebsocketTransport.js +17 -7
- package/ts_build/src/services/McpWebsocketTransport.js.map +1 -1
- package/ts_build/src/services/MessageProcessor.d.ts +1 -1
- package/ts_build/src/services/MessageProcessor.js +4 -4
- package/ts_build/src/services/MessageProcessor.js.map +1 -1
- package/ts_build/src/services/index.d.ts +2 -0
- package/ts_build/src/services/index.js +4 -0
- package/ts_build/src/services/index.js.map +1 -1
- package/ts_build/src/services/script-execution/ScriptExecutor.d.ts +1 -0
- package/ts_build/src/services/script-execution/ScriptExecutor.js +23 -0
- package/ts_build/src/services/script-execution/ScriptExecutor.js.map +1 -1
- package/ts_build/src/services/types.d.ts +2 -6
- package/ts_build/src/services/types.js +4 -4
- package/ts_build/src/services/types.js.map +1 -1
- package/ts_build/src/types.d.ts +11 -0
- package/ts_build/src/types.js +8 -0
- package/ts_build/src/types.js.map +1 -1
- package/ts_build/src/utils/index.d.ts +2 -0
- package/ts_build/src/utils/index.js +102 -1
- package/ts_build/src/utils/index.js.map +1 -1
- package/ts_build/tests/XmlToolCallProcessor.test.d.ts +1 -0
- package/ts_build/tests/XmlToolCallProcessor.test.js +376 -0
- package/ts_build/tests/XmlToolCallProcessor.test.js.map +1 -0
- package/ts_build/tests/manual/ycmd/debug_diagnostics_test.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/debug_diagnostics_test.js +114 -0
- package/ts_build/tests/manual/ycmd/debug_diagnostics_test.js.map +1 -0
- package/ts_build/tests/manual/ycmd/minimal_advanced_test.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/minimal_advanced_test.js +104 -0
- package/ts_build/tests/manual/ycmd/minimal_advanced_test.js.map +1 -0
- package/ts_build/tests/manual/ycmd/simple_diagnostics_test.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/simple_diagnostics_test.js +74 -0
- package/ts_build/tests/manual/ycmd/simple_diagnostics_test.js.map +1 -0
- package/ts_build/tests/manual/ycmd/simple_test.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/simple_test.js +82 -0
- package/ts_build/tests/manual/ycmd/simple_test.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test-typescript-sample.d.ts +14 -0
- package/ts_build/tests/manual/ycmd/test-typescript-sample.js +20 -0
- package/ts_build/tests/manual/ycmd/test-typescript-sample.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_advanced_features.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_advanced_features.js +297 -0
- package/ts_build/tests/manual/ycmd/test_advanced_features.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_advanced_with_tools.d.ts +3 -0
- package/ts_build/tests/manual/ycmd/test_advanced_with_tools.js +262 -0
- package/ts_build/tests/manual/ycmd/test_advanced_with_tools.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_comprehensive_typescript.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_comprehensive_typescript.js +186 -0
- package/ts_build/tests/manual/ycmd/test_comprehensive_typescript.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_file_changes.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_file_changes.js +174 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_file_changes.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_fix.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_fix.js +106 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_fix.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_simple.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_simple.js +104 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_simple.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_timing.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_timing.js +119 -0
- package/ts_build/tests/manual/ycmd/test_diagnostics_timing.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_discover_commands.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_discover_commands.js +243 -0
- package/ts_build/tests/manual/ycmd/test_discover_commands.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_endpoints.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_endpoints.js +120 -0
- package/ts_build/tests/manual/ycmd/test_endpoints.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_final_comprehensive.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_final_comprehensive.js +221 -0
- package/ts_build/tests/manual/ycmd/test_final_comprehensive.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_final_validation.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_final_validation.js +160 -0
- package/ts_build/tests/manual/ycmd/test_final_validation.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_individual_ycmd_tool.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_individual_ycmd_tool.js +37 -0
- package/ts_build/tests/manual/ycmd/test_individual_ycmd_tool.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_server_manager.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_server_manager.js +38 -0
- package/ts_build/tests/manual/ycmd/test_server_manager.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_simple_debug.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_simple_debug.js +99 -0
- package/ts_build/tests/manual/ycmd/test_simple_debug.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_tsserver_workflow.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_tsserver_workflow.js +128 -0
- package/ts_build/tests/manual/ycmd/test_tsserver_workflow.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_typescript_simple.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_typescript_simple.js +66 -0
- package/ts_build/tests/manual/ycmd/test_typescript_simple.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_typescript_ycmd.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_typescript_ycmd.js +105 -0
- package/ts_build/tests/manual/ycmd/test_typescript_ycmd.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_workspace_config.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_workspace_config.js +89 -0
- package/ts_build/tests/manual/ycmd/test_workspace_config.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_auto_start.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_auto_start.js +130 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_auto_start.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_comprehensive.d.ts +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_comprehensive.js +83 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_comprehensive.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_direct.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_direct.js +149 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_direct.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_experiment.d.ts +15 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_experiment.js +58 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_experiment.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_final.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_final.js +195 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_final.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_integration.d.ts +3 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_integration.js +110 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_integration.js.map +1 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_simple.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_simple.js +36 -0
- package/ts_build/tests/manual/ycmd/test_ycmd_simple.js.map +1 -0
- package/ts_build/tests/manual/ycmd/working_simple_test.d.ts +2 -0
- package/ts_build/tests/manual/ycmd/working_simple_test.js +134 -0
- package/ts_build/tests/manual/ycmd/working_simple_test.js.map +1 -0
- package/tsconfig.json +3 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
export const definitions = [
|
|
2
|
+
{
|
|
3
|
+
type: "function",
|
|
4
|
+
function: {
|
|
5
|
+
name: "ycmdStart",
|
|
6
|
+
description: "Start ycmd server with project configuration for code intelligence features",
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
workspaceRoot: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Path to the project root directory. Defaults to current working directory and auto-detects TypeScript/Node.js projects via tsconfig.json or package.json",
|
|
13
|
+
},
|
|
14
|
+
config: {
|
|
15
|
+
type: "object",
|
|
16
|
+
description: "Optional ycmd server configuration",
|
|
17
|
+
properties: {
|
|
18
|
+
port: {
|
|
19
|
+
type: "number",
|
|
20
|
+
description: "Port for ycmd server (0 for auto-assign)",
|
|
21
|
+
},
|
|
22
|
+
logLevel: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Log level: debug, info, warning, error",
|
|
25
|
+
},
|
|
26
|
+
completionTimeout: {
|
|
27
|
+
type: "number",
|
|
28
|
+
description: "Completion timeout in milliseconds",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
required: [],
|
|
34
|
+
},
|
|
35
|
+
returns: {
|
|
36
|
+
type: "object",
|
|
37
|
+
description: "Server information including host, port, and status",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "function",
|
|
43
|
+
function: {
|
|
44
|
+
name: "ycmdCompletion",
|
|
45
|
+
description: "Get code completions at a specific position in a file. You can specify the position either with line/column numbers OR with a searchString that will be located automatically.",
|
|
46
|
+
parameters: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
filepath: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Path to the file. Can be relative (defaults to current working directory) or absolute",
|
|
52
|
+
},
|
|
53
|
+
line: {
|
|
54
|
+
type: "number",
|
|
55
|
+
description: "Line number (1-based). Required if searchString is not provided.",
|
|
56
|
+
},
|
|
57
|
+
column: {
|
|
58
|
+
type: "number",
|
|
59
|
+
description: "Column number (1-based). Required if searchString is not provided.",
|
|
60
|
+
},
|
|
61
|
+
searchString: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "String to search for in the file to determine completion position. Alternative to line/column. Completions will be provided after this string.",
|
|
64
|
+
},
|
|
65
|
+
matchType: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "Type of matching when using searchString: 'exact' for exact match, 'prefix' for prefix matching, 'contains' for substring match",
|
|
68
|
+
enum: ["exact", "prefix", "contains"],
|
|
69
|
+
},
|
|
70
|
+
forceSemantic: {
|
|
71
|
+
type: "boolean",
|
|
72
|
+
description: "Force semantic completions instead of identifier-based completions",
|
|
73
|
+
},
|
|
74
|
+
fileContents: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Current contents of the file (optional if file exists on disk)",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ["filepath"],
|
|
80
|
+
},
|
|
81
|
+
returns: {
|
|
82
|
+
type: "object",
|
|
83
|
+
description: "Completion results with suggestions and metadata",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "function",
|
|
89
|
+
function: {
|
|
90
|
+
name: "ycmdGoTo",
|
|
91
|
+
description: "Navigate to definitions, declarations, or find references for a symbol. You can specify the position either with line/column numbers OR with a searchString that will be located automatically.",
|
|
92
|
+
parameters: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
filepath: {
|
|
96
|
+
type: "string",
|
|
97
|
+
description: "Path to the file. Can be relative (defaults to current working directory) or absolute",
|
|
98
|
+
},
|
|
99
|
+
line: {
|
|
100
|
+
type: "number",
|
|
101
|
+
description: "Line number (1-based). Required if searchString is not provided.",
|
|
102
|
+
},
|
|
103
|
+
column: {
|
|
104
|
+
type: "number",
|
|
105
|
+
description: "Column number (1-based). Required if searchString is not provided.",
|
|
106
|
+
},
|
|
107
|
+
searchString: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "String to search for in the file to determine the symbol position. Alternative to line/column.",
|
|
110
|
+
},
|
|
111
|
+
matchType: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Type of matching when using searchString: 'exact' for exact match, 'prefix' for prefix matching, 'contains' for substring match",
|
|
114
|
+
enum: ["exact", "prefix", "contains"],
|
|
115
|
+
},
|
|
116
|
+
command: {
|
|
117
|
+
type: "string",
|
|
118
|
+
description: "Navigation command: GoToDefinition, GoToDeclaration, GoToReferences, GoToImplementation",
|
|
119
|
+
enum: ["GoToDefinition", "GoToDeclaration", "GoToReferences", "GoToImplementation"],
|
|
120
|
+
},
|
|
121
|
+
fileContents: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Current contents of the file (optional if file exists on disk)",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
required: ["filepath", "command"],
|
|
127
|
+
},
|
|
128
|
+
returns: {
|
|
129
|
+
type: "array",
|
|
130
|
+
description: "Array of locations with file paths, line numbers, and column numbers",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "function",
|
|
136
|
+
function: {
|
|
137
|
+
name: "ycmdDiagnostics",
|
|
138
|
+
description: "Get error and warning diagnostics for a file. You can specify the position either with line/column numbers OR with a searchString that will be located automatically.",
|
|
139
|
+
parameters: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {
|
|
142
|
+
filepath: {
|
|
143
|
+
type: "string",
|
|
144
|
+
description: "Path to the file. Can be relative (defaults to current working directory) or absolute",
|
|
145
|
+
},
|
|
146
|
+
line: {
|
|
147
|
+
type: "number",
|
|
148
|
+
description: "Line number (1-based, optional, defaults to 1). Required if searchString is not provided.",
|
|
149
|
+
},
|
|
150
|
+
column: {
|
|
151
|
+
type: "number",
|
|
152
|
+
description: "Column number (1-based, optional, defaults to 1). Required if searchString is not provided.",
|
|
153
|
+
},
|
|
154
|
+
searchString: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "String to search for in the file to determine the diagnostic position. Alternative to line/column.",
|
|
157
|
+
},
|
|
158
|
+
matchType: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "Type of matching when using searchString: 'exact' for exact match, 'prefix' for prefix matching, 'contains' for substring match",
|
|
161
|
+
enum: ["exact", "prefix", "contains"],
|
|
162
|
+
},
|
|
163
|
+
fileContents: {
|
|
164
|
+
type: "string",
|
|
165
|
+
description: "Current contents of the file (optional if file exists on disk)",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
required: ["filepath"],
|
|
169
|
+
},
|
|
170
|
+
returns: {
|
|
171
|
+
type: "array",
|
|
172
|
+
description: "Array of diagnostic messages with severity, location, and description",
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: "function",
|
|
178
|
+
function: {
|
|
179
|
+
name: "ycmdRefactor",
|
|
180
|
+
description: "Execute refactoring operations like rename, extract method, organize imports",
|
|
181
|
+
parameters: {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
filepath: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Path to the file. Can be relative (defaults to current working directory) or absolute",
|
|
187
|
+
},
|
|
188
|
+
line: {
|
|
189
|
+
type: "number",
|
|
190
|
+
description: "Line number (1-based)",
|
|
191
|
+
},
|
|
192
|
+
column: {
|
|
193
|
+
type: "number",
|
|
194
|
+
description: "Column number (1-based)",
|
|
195
|
+
},
|
|
196
|
+
command: {
|
|
197
|
+
type: "string",
|
|
198
|
+
description: "Refactoring command: RefactorRename, RefactorExtractMethod, RefactorOrganizeImports, RefactorFixIt",
|
|
199
|
+
enum: ["RefactorRename", "RefactorExtractMethod", "RefactorOrganizeImports", "RefactorFixIt"],
|
|
200
|
+
},
|
|
201
|
+
newName: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description: "New name for rename operations",
|
|
204
|
+
},
|
|
205
|
+
fileContents: {
|
|
206
|
+
type: "string",
|
|
207
|
+
description: "Current contents of the file (optional if file exists on disk)",
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
required: ["filepath", "line", "column", "command"],
|
|
211
|
+
},
|
|
212
|
+
returns: {
|
|
213
|
+
type: "object",
|
|
214
|
+
description: "Refactoring result with file changes and status",
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: "function",
|
|
220
|
+
function: {
|
|
221
|
+
name: "ycmdSignatureHelp",
|
|
222
|
+
description: "Get function signature help and parameter information at cursor position",
|
|
223
|
+
parameters: {
|
|
224
|
+
type: "object",
|
|
225
|
+
properties: {
|
|
226
|
+
filepath: {
|
|
227
|
+
type: "string",
|
|
228
|
+
description: "Path to the file. Can be relative (defaults to current working directory) or absolute",
|
|
229
|
+
},
|
|
230
|
+
line: {
|
|
231
|
+
type: "number",
|
|
232
|
+
description: "Line number (1-based)",
|
|
233
|
+
},
|
|
234
|
+
column: {
|
|
235
|
+
type: "number",
|
|
236
|
+
description: "Column number (1-based)",
|
|
237
|
+
},
|
|
238
|
+
fileContents: {
|
|
239
|
+
type: "string",
|
|
240
|
+
description: "Current contents of the file (optional if file exists on disk)",
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
required: ["filepath", "line", "column"],
|
|
244
|
+
},
|
|
245
|
+
returns: {
|
|
246
|
+
type: "object",
|
|
247
|
+
description: "Signature help with function signatures and parameter information",
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
type: "function",
|
|
253
|
+
function: {
|
|
254
|
+
name: "getLocations",
|
|
255
|
+
description: "Find line and column positions for a given string in a file. Useful for locating code elements by name rather than coordinates.",
|
|
256
|
+
parameters: {
|
|
257
|
+
type: "object",
|
|
258
|
+
properties: {
|
|
259
|
+
filepath: {
|
|
260
|
+
type: "string",
|
|
261
|
+
description: "Path to the file. Can be relative (defaults to current working directory) or absolute",
|
|
262
|
+
},
|
|
263
|
+
searchString: {
|
|
264
|
+
type: "string",
|
|
265
|
+
description: "The string to search for in the file",
|
|
266
|
+
},
|
|
267
|
+
fileContents: {
|
|
268
|
+
type: "string",
|
|
269
|
+
description: "Current contents of the file (optional if file exists on disk)",
|
|
270
|
+
},
|
|
271
|
+
matchType: {
|
|
272
|
+
type: "string",
|
|
273
|
+
description: "Type of matching: 'exact' for exact string match, 'prefix' for prefix matching at word boundaries, 'contains' for case-insensitive substring match",
|
|
274
|
+
enum: ["exact", "prefix", "contains"],
|
|
275
|
+
},
|
|
276
|
+
maxResults: {
|
|
277
|
+
type: "number",
|
|
278
|
+
description: "Maximum number of results to return (default: 50)",
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
required: ["filepath", "searchString"],
|
|
282
|
+
},
|
|
283
|
+
returns: {
|
|
284
|
+
type: "object",
|
|
285
|
+
description: "Array of locations with line numbers, column numbers, and context information",
|
|
286
|
+
properties: {
|
|
287
|
+
success: { type: "boolean" },
|
|
288
|
+
locations: { type: "array" },
|
|
289
|
+
message: { type: "string" }
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
];
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Utility class for detecting existing ycmd installations
|
|
8
|
+
*/
|
|
9
|
+
export class YcmdDetection {
|
|
10
|
+
/**
|
|
11
|
+
* Common paths where ycmd might be installed
|
|
12
|
+
*/
|
|
13
|
+
private static readonly COMMON_PATHS = [
|
|
14
|
+
// System-wide installations
|
|
15
|
+
'/usr/local/bin/ycmd',
|
|
16
|
+
'/usr/bin/ycmd',
|
|
17
|
+
'/opt/ycmd',
|
|
18
|
+
// User installations
|
|
19
|
+
path.join(os.homedir(), '.local/bin/ycmd'),
|
|
20
|
+
path.join(os.homedir(), '.vim/plugged/YouCompleteMe/third_party/ycmd'),
|
|
21
|
+
path.join(os.homedir(), '.config/nvim/plugged/YouCompleteMe/third_party/ycmd'),
|
|
22
|
+
// Knowhow installation path
|
|
23
|
+
path.join(os.homedir(), '.knowhow/ycmd'),
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Check if ycmd is available in the system PATH
|
|
28
|
+
*/
|
|
29
|
+
static isInPath(): boolean {
|
|
30
|
+
try {
|
|
31
|
+
execSync('which ycmd', { stdio: 'pipe' });
|
|
32
|
+
return true;
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Find all available ycmd installations
|
|
40
|
+
*/
|
|
41
|
+
static findInstallations(): string[] {
|
|
42
|
+
const installations: string[] = [];
|
|
43
|
+
|
|
44
|
+
// Check common paths
|
|
45
|
+
for (const ycmdPath of this.COMMON_PATHS) {
|
|
46
|
+
if (this.isValidYcmdInstallation(ycmdPath)) {
|
|
47
|
+
installations.push(ycmdPath);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Check if ycmd is in PATH
|
|
52
|
+
if (this.isInPath()) {
|
|
53
|
+
try {
|
|
54
|
+
const pathResult = execSync('which ycmd', { encoding: 'utf8' }).trim();
|
|
55
|
+
if (pathResult && !installations.includes(pathResult)) {
|
|
56
|
+
installations.push(pathResult);
|
|
57
|
+
}
|
|
58
|
+
} catch {
|
|
59
|
+
// Ignore errors
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return installations;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get the preferred ycmd installation path
|
|
68
|
+
*/
|
|
69
|
+
static getPreferredInstallation(): string | null {
|
|
70
|
+
const installations = this.findInstallations();
|
|
71
|
+
|
|
72
|
+
if (installations.length === 0) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Prefer knowhow installation first
|
|
77
|
+
const knowhowPath = path.join(os.homedir(), '.knowhow/ycmd');
|
|
78
|
+
if (installations.includes(knowhowPath)) {
|
|
79
|
+
return knowhowPath;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Then prefer system PATH
|
|
83
|
+
if (this.isInPath()) {
|
|
84
|
+
try {
|
|
85
|
+
return execSync('which ycmd', { encoding: 'utf8' }).trim();
|
|
86
|
+
} catch {
|
|
87
|
+
// Fall through to first installation
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Return first available installation
|
|
92
|
+
return installations[0];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if a path contains a valid ycmd installation
|
|
97
|
+
*/
|
|
98
|
+
static isValidYcmdInstallation(ycmdPath: string): boolean {
|
|
99
|
+
try {
|
|
100
|
+
// Check if directory exists
|
|
101
|
+
if (!fs.existsSync(ycmdPath)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const stat = fs.statSync(ycmdPath);
|
|
106
|
+
|
|
107
|
+
// If it's an executable file (direct ycmd binary)
|
|
108
|
+
if (stat.isFile()) {
|
|
109
|
+
return this.isExecutable(ycmdPath);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// If it's a directory, look for ycmd executable or ycmd.py
|
|
113
|
+
if (stat.isDirectory()) {
|
|
114
|
+
const ycmdBinary = path.join(ycmdPath, 'ycmd');
|
|
115
|
+
const ycmdScript = path.join(ycmdPath, 'ycmd.py');
|
|
116
|
+
const ycmdMainScript = path.join(ycmdPath, 'ycmd', '__main__.py');
|
|
117
|
+
|
|
118
|
+
return fs.existsSync(ycmdBinary) ||
|
|
119
|
+
fs.existsSync(ycmdScript) ||
|
|
120
|
+
fs.existsSync(ycmdMainScript);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return false;
|
|
124
|
+
} catch {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Check if a file is executable
|
|
131
|
+
*/
|
|
132
|
+
private static isExecutable(filePath: string): boolean {
|
|
133
|
+
try {
|
|
134
|
+
fs.accessSync(filePath, fs.constants.F_OK | fs.constants.X_OK);
|
|
135
|
+
return true;
|
|
136
|
+
} catch {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Get the ycmd executable command for a given installation path
|
|
143
|
+
*/
|
|
144
|
+
static getYcmdCommand(ycmdPath: string): string[] {
|
|
145
|
+
if (!this.isValidYcmdInstallation(ycmdPath)) {
|
|
146
|
+
throw new Error(`Invalid ycmd installation: ${ycmdPath}`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const stat = fs.statSync(ycmdPath);
|
|
150
|
+
|
|
151
|
+
// If it's an executable file
|
|
152
|
+
if (stat.isFile() && this.isExecutable(ycmdPath)) {
|
|
153
|
+
return [ycmdPath];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// If it's a directory, determine the appropriate command
|
|
157
|
+
if (stat.isDirectory()) {
|
|
158
|
+
const ycmdBinary = path.join(ycmdPath, 'ycmd');
|
|
159
|
+
const ycmdScript = path.join(ycmdPath, 'ycmd.py');
|
|
160
|
+
const ycmdMainScript = path.join(ycmdPath, 'ycmd', '__main__.py');
|
|
161
|
+
|
|
162
|
+
if (fs.existsSync(ycmdBinary) && this.isExecutable(ycmdBinary)) {
|
|
163
|
+
return [ycmdBinary];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (fs.existsSync(ycmdScript)) {
|
|
167
|
+
return ['python3', ycmdScript];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (fs.existsSync(ycmdMainScript)) {
|
|
171
|
+
return ['python3', '-m', 'ycmd'];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
throw new Error(`Could not determine ycmd command for: ${ycmdPath}`);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Check if Python is available for running ycmd
|
|
180
|
+
*/
|
|
181
|
+
static isPythonAvailable(): boolean {
|
|
182
|
+
try {
|
|
183
|
+
execSync('python3 --version', { stdio: 'pipe' });
|
|
184
|
+
return true;
|
|
185
|
+
} catch {
|
|
186
|
+
try {
|
|
187
|
+
execSync('python --version', { stdio: 'pipe' });
|
|
188
|
+
return true;
|
|
189
|
+
} catch {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Get Python command (python3 or python)
|
|
197
|
+
*/
|
|
198
|
+
static getPythonCommand(): string {
|
|
199
|
+
try {
|
|
200
|
+
execSync('python3 --version', { stdio: 'pipe' });
|
|
201
|
+
return 'python3';
|
|
202
|
+
} catch {
|
|
203
|
+
try {
|
|
204
|
+
execSync('python --version', { stdio: 'pipe' });
|
|
205
|
+
return 'python';
|
|
206
|
+
} catch {
|
|
207
|
+
throw new Error('Python is not available in PATH');
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Import all ycmd tool functions
|
|
2
|
+
export { ycmdStart } from './tools/start';
|
|
3
|
+
export { ycmdCompletion } from './tools/completion';
|
|
4
|
+
export { ycmdGoTo } from './tools/goto';
|
|
5
|
+
export { ycmdDiagnostics } from './tools/diagnostics';
|
|
6
|
+
export { ycmdRefactor } from './tools/refactor';
|
|
7
|
+
export { ycmdSignatureHelp } from './tools/signature';
|
|
8
|
+
export { getLocations } from './tools/getLocations';
|
|
9
|
+
|
|
10
|
+
// Export definitions for tool registration
|
|
11
|
+
export { definitions } from './definitions';
|