@tyvm/knowhow 0.0.32 → 0.0.34
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 +147 -21
- 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 +980 -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/embeddings.ts +79 -23
- package/src/login.ts +26 -9
- package/src/microphone.ts +0 -1
- package/src/plugins/downloader/downloader.ts +72 -24
- 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 +14 -1
- package/ts_build/src/agents/base/base.js +91 -17
- 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 +56 -0
- package/ts_build/src/chat/modules/AgentModule.js +705 -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/embeddings.d.ts +2 -1
- package/ts_build/src/embeddings.js +62 -17
- package/ts_build/src/embeddings.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 +4 -5
- package/ts_build/src/plugins/downloader/downloader.js +55 -26
- 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,150 @@
|
|
|
1
|
+
#!/usr/bin/env npx tsx
|
|
2
|
+
|
|
3
|
+
import { ycmdCompletion, ycmdGoTo } from '../../../src/agents/tools/ycmd/index';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
|
|
7
|
+
async function finalValidationTest(): Promise<void> {
|
|
8
|
+
console.log('\n=== Final Validation Test ===\n');
|
|
9
|
+
|
|
10
|
+
// Create a simple test file
|
|
11
|
+
const testFile = path.resolve('./test-final-validation.ts');
|
|
12
|
+
const testContent = `
|
|
13
|
+
interface User {
|
|
14
|
+
name: string;
|
|
15
|
+
email: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const user: User = {
|
|
19
|
+
name: 'Test',
|
|
20
|
+
email: 'test@example.com'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Test completion here
|
|
24
|
+
console.log(user.na); // Should complete to 'name'
|
|
25
|
+
`.trim();
|
|
26
|
+
|
|
27
|
+
let testsPassed = 0;
|
|
28
|
+
let totalTests = 0;
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
fs.writeFileSync(testFile, testContent);
|
|
32
|
+
console.log(`✅ Created test file: ${testFile}`);
|
|
33
|
+
|
|
34
|
+
console.log('\n1. Testing completion on "user.na" (should complete to "name")...');
|
|
35
|
+
totalTests++;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const completionResult = await ycmdCompletion({
|
|
39
|
+
filepath: testFile,
|
|
40
|
+
line: 11,
|
|
41
|
+
column: 16,
|
|
42
|
+
contents: testContent
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
console.log('Completion response received');
|
|
46
|
+
|
|
47
|
+
if (completionResult.success) {
|
|
48
|
+
console.log('✅ Completion request succeeded - No "No Project" error!');
|
|
49
|
+
testsPassed++;
|
|
50
|
+
|
|
51
|
+
if (completionResult.completions && completionResult.completions.length > 0) {
|
|
52
|
+
console.log(`✅ Found ${completionResult.completions.length} completions`);
|
|
53
|
+
const hasNameCompletion = completionResult.completions.some((c: any) =>
|
|
54
|
+
(c.insertion_text || c.text || c.label || '').includes('name')
|
|
55
|
+
);
|
|
56
|
+
if (hasNameCompletion) {
|
|
57
|
+
console.log('✅ Found "name" completion as expected');
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
console.log('⚠️ No completions found (but request succeeded)');
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
console.log('❌ Completion request failed');
|
|
64
|
+
console.log('Error:', completionResult.message || 'Unknown error');
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.log('❌ Completion test threw error:', error);
|
|
68
|
+
if (error instanceof Error && error.message.includes('No Project')) {
|
|
69
|
+
console.log('❌ "No Project" error still occurring!');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
console.log('\n2. Testing go-to-definition on "User" interface...');
|
|
74
|
+
totalTests++;
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
const gotoResult = await ycmdGoTo({
|
|
78
|
+
filepath: testFile,
|
|
79
|
+
line: 7,
|
|
80
|
+
column: 13, // On "User" in "const user: User"
|
|
81
|
+
command: 'GoTo',
|
|
82
|
+
contents: testContent
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
console.log('Go-to-definition response received');
|
|
86
|
+
|
|
87
|
+
if (gotoResult.success) {
|
|
88
|
+
console.log('✅ Go-to-definition request succeeded - No "No Project" error!');
|
|
89
|
+
testsPassed++;
|
|
90
|
+
|
|
91
|
+
if (gotoResult.locations && gotoResult.locations.length > 0) {
|
|
92
|
+
console.log(`✅ Found ${gotoResult.locations.length} definition locations`);
|
|
93
|
+
gotoResult.locations.forEach((loc: any, idx: number) => {
|
|
94
|
+
console.log(` Location ${idx + 1}: Line ${loc.line_num}, Column ${loc.column_num}`);
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
console.log('⚠️ No definition locations found (but request succeeded)');
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
console.log('❌ Go-to-definition request failed');
|
|
101
|
+
console.log('Error:', gotoResult.message || 'Unknown error');
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.log('❌ Go-to-definition test threw error:', error);
|
|
105
|
+
if (error instanceof Error && error.message.includes('No Project')) {
|
|
106
|
+
console.log('❌ "No Project" error still occurring!');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.log('\n=== Final Test Results ===');
|
|
111
|
+
console.log(`Tests passed: ${testsPassed}/${totalTests}`);
|
|
112
|
+
|
|
113
|
+
if (testsPassed === totalTests) {
|
|
114
|
+
console.log('\n🎉 ALL TESTS PASSED!');
|
|
115
|
+
console.log('✅ The "No Project" error has been successfully resolved');
|
|
116
|
+
console.log('✅ ycmd tools are working properly with TypeScript files');
|
|
117
|
+
console.log('✅ Both completions and go-to-definition functionality are operational');
|
|
118
|
+
} else if (testsPassed > 0) {
|
|
119
|
+
console.log('\n⚠️ PARTIAL SUCCESS');
|
|
120
|
+
console.log('✅ Some functionality is working, "No Project" error appears resolved');
|
|
121
|
+
} else {
|
|
122
|
+
console.log('\n❌ TESTS FAILED');
|
|
123
|
+
console.log('❌ Issues still remain with ycmd TypeScript functionality');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.error('❌ Test setup failed:', error);
|
|
128
|
+
} finally {
|
|
129
|
+
// Clean up test file
|
|
130
|
+
try {
|
|
131
|
+
if (fs.existsSync(testFile)) {
|
|
132
|
+
fs.unlinkSync(testFile);
|
|
133
|
+
console.log(`\n🧹 Cleaned up test file: ${testFile}`);
|
|
134
|
+
}
|
|
135
|
+
} catch (err) {
|
|
136
|
+
console.log('Could not clean up test file:', err);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
console.log('\nTest completed.');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Handle graceful shutdown
|
|
144
|
+
process.on('SIGINT', () => {
|
|
145
|
+
console.log('\nShutting down...');
|
|
146
|
+
process.exit(0);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Run the test
|
|
150
|
+
finalValidationTest().catch(console.error);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Simple test to verify the ycmd string-based implementation works
|
|
2
|
+
const { getLocations, ycmdCompletion } = require('./src/agents/tools/ycmd');
|
|
3
|
+
|
|
4
|
+
async function testImplementation() {
|
|
5
|
+
console.log('Testing getLocations tool...');
|
|
6
|
+
|
|
7
|
+
// Create a simple test file
|
|
8
|
+
const testFileContent = `
|
|
9
|
+
function userService() {
|
|
10
|
+
return {
|
|
11
|
+
getName: () => 'test',
|
|
12
|
+
getEmail: () => 'test@example.com'
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const user = userService();
|
|
17
|
+
user.getName();
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
// Test getLocations directly
|
|
22
|
+
const result = await getLocations({
|
|
23
|
+
filepath: './test_file.js',
|
|
24
|
+
searchString: 'userService',
|
|
25
|
+
fileContents: testFileContent,
|
|
26
|
+
matchType: 'exact'
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log('getLocations result:', JSON.stringify(result, null, 2));
|
|
30
|
+
|
|
31
|
+
if (result.success && result.locations.length > 0) {
|
|
32
|
+
console.log('✅ getLocations test passed!');
|
|
33
|
+
} else {
|
|
34
|
+
console.log('❌ getLocations test failed!');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error('Test failed with error:', error.message);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
testImplementation();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env ts-node
|
|
2
|
+
|
|
3
|
+
import { ycmdGoTo } from '../../../src/agents/tools/ycmd/tools/goto';
|
|
4
|
+
|
|
5
|
+
async function testIndividualYcmdTool() {
|
|
6
|
+
console.log('Testing individual ycmdGoTo tool with enhanced serverManager...');
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const result = await ycmdGoTo({
|
|
10
|
+
filepath: 'src/agents/tools/ycmd/utils/pathUtils.ts',
|
|
11
|
+
line: 40,
|
|
12
|
+
column: 17,
|
|
13
|
+
command: 'GoToReferences'
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log('Full result object:', JSON.stringify(result, null, 2));
|
|
17
|
+
|
|
18
|
+
if (result.success) {
|
|
19
|
+
console.log('✅ ycmdGoTo successful!');
|
|
20
|
+
if (result.locations && Array.isArray(result.locations)) {
|
|
21
|
+
console.log(`🎉 Found ${result.locations.length} references for findProjectRoot`);
|
|
22
|
+
result.locations.forEach((ref, index) => {
|
|
23
|
+
console.log(` ${index + 1}. ${ref.filepath}:${ref.line}:${ref.column} - ${ref.description}`);
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
console.log('Result format:', typeof result.locations, result.locations);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
console.log('❌ ycmdGoTo failed:', result.message);
|
|
30
|
+
}
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('❌ Test failed with error:', error);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Force exit to prevent hanging
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
testIndividualYcmdTool();
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ycmdServerManager } from '../../../src/agents/tools/ycmd/serverManager';
|
|
2
|
+
|
|
3
|
+
async function testServerManagerWorkflow() {
|
|
4
|
+
console.log('Testing ycmd server manager workflow...');
|
|
5
|
+
|
|
6
|
+
const filepath = './src/agents/tools/ycmd/utils/pathUtils.ts';
|
|
7
|
+
|
|
8
|
+
console.log('\n1. Setting up client and notifying file...');
|
|
9
|
+
const setupResult = await ycmdServerManager.setupClientAndNotifyFile({
|
|
10
|
+
filepath: filepath
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
if (!setupResult.success) {
|
|
14
|
+
console.error('Setup failed:', setupResult.message);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
console.log('✅ Setup successful:', setupResult.message);
|
|
19
|
+
console.log('File types detected:', setupResult.filetypes);
|
|
20
|
+
|
|
21
|
+
console.log('\n2. Testing GoToReferences for findProjectRoot function...');
|
|
22
|
+
try {
|
|
23
|
+
// findProjectRoot is at line 40, column 17 in pathUtils.ts
|
|
24
|
+
const references = await setupResult.client.goToReferences(
|
|
25
|
+
setupResult.resolvedFilePath,
|
|
26
|
+
40,
|
|
27
|
+
17,
|
|
28
|
+
setupResult.contents,
|
|
29
|
+
setupResult.filetypes
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
console.log('✅ GoToReferences successful!');
|
|
33
|
+
console.log('References found:', JSON.stringify(references, null, 2));
|
|
34
|
+
|
|
35
|
+
if (references && references.length > 0) {
|
|
36
|
+
console.log(`\n🎉 SUCCESS: Found ${references.length} references for findProjectRoot`);
|
|
37
|
+
} else {
|
|
38
|
+
console.log('\n⚠️ WARNING: No references found, but no error occurred');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error('❌ GoToReferences failed:', error);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
console.log('\n🎉 Server manager workflow test completed successfully!');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Run the test
|
|
50
|
+
testServerManagerWorkflow().catch(console.error).finally(() => {
|
|
51
|
+
process.exit(0);
|
|
52
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env npx tsx
|
|
2
|
+
|
|
3
|
+
import { ycmdCompletion } from '../../../src/agents/tools/ycmd/index';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
|
|
7
|
+
async function simpleDebugTest(): Promise<void> {
|
|
8
|
+
console.log('\n=== Simple Debug Test ===\n');
|
|
9
|
+
|
|
10
|
+
const testFile = path.resolve('./test-simple.ts');
|
|
11
|
+
const testContent = `
|
|
12
|
+
const message = "Hello World";
|
|
13
|
+
console.log(message);
|
|
14
|
+
`.trim();
|
|
15
|
+
|
|
16
|
+
let success = false;
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
fs.writeFileSync(testFile, testContent);
|
|
20
|
+
console.log(`✅ Created test file: ${testFile}`);
|
|
21
|
+
|
|
22
|
+
console.log('\n1. Testing basic completion...');
|
|
23
|
+
|
|
24
|
+
const completionResult = await ycmdCompletion({
|
|
25
|
+
filepath: testFile,
|
|
26
|
+
line: 2,
|
|
27
|
+
column: 15,
|
|
28
|
+
contents: testContent
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
console.log('Completion result:', JSON.stringify(completionResult, null, 2));
|
|
32
|
+
|
|
33
|
+
if (completionResult.success) {
|
|
34
|
+
console.log('✅ SUCCESS: No "No Project" error!');
|
|
35
|
+
success = true;
|
|
36
|
+
} else {
|
|
37
|
+
console.log('❌ FAILED: Request failed');
|
|
38
|
+
if (completionResult.message && completionResult.message.includes('No Project')) {
|
|
39
|
+
console.log('❌ "No Project" error still occurring!');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error('❌ Test failed with error:', error);
|
|
45
|
+
if (error instanceof Error && error.message.includes('No Project')) {
|
|
46
|
+
console.log('❌ "No Project" error caught in exception!');
|
|
47
|
+
}
|
|
48
|
+
} finally {
|
|
49
|
+
// Clean up test file
|
|
50
|
+
try {
|
|
51
|
+
if (fs.existsSync(testFile)) {
|
|
52
|
+
fs.unlinkSync(testFile);
|
|
53
|
+
console.log(`\n🧹 Cleaned up test file: ${testFile}`);
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.log('Could not clean up test file:', err);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Force process exit
|
|
60
|
+
console.log('\n=== Test Results ===');
|
|
61
|
+
if (success) {
|
|
62
|
+
console.log('✅ Test PASSED - "No Project" error resolved!');
|
|
63
|
+
process.exit(0);
|
|
64
|
+
} else {
|
|
65
|
+
console.log('❌ Test FAILED - "No Project" error still exists');
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Handle graceful shutdown
|
|
72
|
+
process.on('SIGINT', () => {
|
|
73
|
+
console.log('\nForced shutdown...');
|
|
74
|
+
process.exit(1);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
process.on('SIGTERM', () => {
|
|
78
|
+
console.log('\nTerminated...');
|
|
79
|
+
process.exit(1);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Run the test
|
|
83
|
+
simpleDebugTest().catch((error) => {
|
|
84
|
+
console.error('Unhandled error:', error);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const { YcmdClient } = require('./src/agents/tools/ycmd/client');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
async function testTSServerWorkflow() {
|
|
5
|
+
const serverInfo = {
|
|
6
|
+
host: '127.0.0.1',
|
|
7
|
+
port: 8086,
|
|
8
|
+
hmacSecret: '', // Will be filled from server
|
|
9
|
+
status: 'running'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const client = new YcmdClient(serverInfo);
|
|
14
|
+
|
|
15
|
+
// Test if server is ready
|
|
16
|
+
console.log('Checking server status...');
|
|
17
|
+
const isReady = await client.isReady();
|
|
18
|
+
console.log('Server ready:', isReady);
|
|
19
|
+
|
|
20
|
+
if (!isReady) {
|
|
21
|
+
console.log('Server is not ready, exiting');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const filePath = path.resolve('./src/agents/tools/ycmd/utils/pathUtils.ts');
|
|
26
|
+
const workspaceRoot = process.cwd();
|
|
27
|
+
|
|
28
|
+
console.log('File path:', filePath);
|
|
29
|
+
console.log('Workspace root:', workspaceRoot);
|
|
30
|
+
|
|
31
|
+
// Step 1: Event notification to open the file
|
|
32
|
+
console.log('\n1. Opening file in TSServer...');
|
|
33
|
+
const eventData = {
|
|
34
|
+
event_name: 'BufferVisit',
|
|
35
|
+
filepath: filePath,
|
|
36
|
+
filetype: 'typescript'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
await client.eventNotification(eventData);
|
|
41
|
+
console.log('File opened successfully');
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.log('File open error:', error.message);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Step 2: Try to get diagnostics to verify project recognition
|
|
47
|
+
console.log('\n2. Getting diagnostics...');
|
|
48
|
+
const diagData = {
|
|
49
|
+
filepath: filePath,
|
|
50
|
+
line_num: 39,
|
|
51
|
+
column_num: 17,
|
|
52
|
+
filetype: 'typescript'
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const diagnostics = await client.getDiagnostics(diagData);
|
|
57
|
+
console.log('Diagnostics:', diagnostics);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.log('Diagnostics error:', error.message);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Step 3: Try to find references
|
|
63
|
+
console.log('\n3. Finding references...');
|
|
64
|
+
const refData = {
|
|
65
|
+
filepath: filePath,
|
|
66
|
+
line_num: 39,
|
|
67
|
+
column_num: 17,
|
|
68
|
+
filetype: 'typescript'
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
const references = await client.goTo(refData, 'GoToReferences');
|
|
73
|
+
console.log('References found:', references);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.log('References error:', error.message);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error('Test failed:', error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
testTSServerWorkflow().catch(console.error);
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { YcmdClient } from '../../../src/agents/tools/ycmd/client';
|
|
2
|
+
import { YcmdServerInfo } from '../../../src/agents/tools/ycmd/server';
|
|
3
|
+
import { ycmdServerManager } from '../../../src/agents/tools/ycmd/serverManager';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
|
|
7
|
+
async function testTSServerWorkflow() {
|
|
8
|
+
console.log('Testing TSServer workflow...');
|
|
9
|
+
|
|
10
|
+
// Get server info from server manager
|
|
11
|
+
console.log('Getting server info from manager...');
|
|
12
|
+
let serverInfo = ycmdServerManager.getServerInfo();
|
|
13
|
+
|
|
14
|
+
if (!serverInfo) {
|
|
15
|
+
console.log('No server info found, checking if server is running...');
|
|
16
|
+
const isRunning = await ycmdServerManager.isRunning();
|
|
17
|
+
console.log('Server running status:', isRunning);
|
|
18
|
+
serverInfo = ycmdServerManager.getServerInfo();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!serverInfo) {
|
|
22
|
+
console.log('Still no server info, trying to start server...');
|
|
23
|
+
serverInfo = await ycmdServerManager.start(process.cwd());
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
console.log('Using server info:', {
|
|
27
|
+
host: serverInfo.host,
|
|
28
|
+
port: serverInfo.port,
|
|
29
|
+
hasSecret: !!serverInfo.hmacSecret,
|
|
30
|
+
status: serverInfo.status
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// File to test
|
|
34
|
+
const testFile = path.resolve(process.cwd(), 'src/agents/tools/ycmd/utils/pathUtils.ts');
|
|
35
|
+
console.log('Testing file:', testFile);
|
|
36
|
+
const fileContents = fs.readFileSync(testFile, 'utf8');
|
|
37
|
+
|
|
38
|
+
const filetypes = ['typescript'];
|
|
39
|
+
console.log('\n1. Creating YcmdClient...');
|
|
40
|
+
const client = new YcmdClient(serverInfo);
|
|
41
|
+
|
|
42
|
+
console.log('\n2. Checking if server is ready...');
|
|
43
|
+
try {
|
|
44
|
+
const isReady = await client.isReady();
|
|
45
|
+
console.log('Server ready:', isReady);
|
|
46
|
+
if (!isReady) {
|
|
47
|
+
throw new Error('Server is not ready');
|
|
48
|
+
}
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error('Server readiness check failed:', error);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.log('\n2.5. Opening tsconfig.json to help TSServer recognize project...');
|
|
55
|
+
try {
|
|
56
|
+
const tsconfigPath = path.resolve(process.cwd(), 'tsconfig.json');
|
|
57
|
+
const tsconfigContents = fs.readFileSync(tsconfigPath, 'utf8');
|
|
58
|
+
await client.notifyFileEvent('BufferVisit', tsconfigPath, tsconfigContents, ['json']);
|
|
59
|
+
console.log('tsconfig.json BufferVisit successful');
|
|
60
|
+
|
|
61
|
+
// Give TSServer a moment to process the config
|
|
62
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error('tsconfig.json BufferVisit failed:', error);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
console.log('\n3. Opening file via BufferVisit...');
|
|
68
|
+
try {
|
|
69
|
+
await client.notifyFileEvent('BufferVisit', testFile, fileContents, filetypes);
|
|
70
|
+
console.log('BufferVisit successful');
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error('BufferVisit failed:', error);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
console.log('\n4. Getting diagnostics to ensure project is loaded...');
|
|
77
|
+
try {
|
|
78
|
+
const diagnostics = await client.getDiagnostics(testFile, fileContents, filetypes);
|
|
79
|
+
console.log('Diagnostics response:', diagnostics);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.error('Diagnostics failed:', error);
|
|
82
|
+
// Continue anyway - diagnostics might fail but references could still work
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
console.log('\n4.5. Opening file that references findProjectRoot...');
|
|
86
|
+
try {
|
|
87
|
+
const referencingFile = path.resolve(process.cwd(), 'src/agents/tools/ycmd/tools/start.ts');
|
|
88
|
+
const referencingFileContents = fs.readFileSync(referencingFile, 'utf8');
|
|
89
|
+
await client.notifyFileEvent('BufferVisit', referencingFile, referencingFileContents, filetypes);
|
|
90
|
+
console.log('Referencing file BufferVisit successful');
|
|
91
|
+
|
|
92
|
+
// Give TSServer a moment to process
|
|
93
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error('Referencing file BufferVisit failed:', error);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
console.log('\n5. Testing GoToReferences for findProjectRoot function...');
|
|
99
|
+
try {
|
|
100
|
+
// findProjectRoot is at line 40, column 17 in pathUtils.ts
|
|
101
|
+
const references = await client.goToReferences(testFile, 40, 17, fileContents, filetypes);
|
|
102
|
+
console.log('GoToReferences successful!');
|
|
103
|
+
console.log('References found:', JSON.stringify(references, null, 2));
|
|
104
|
+
|
|
105
|
+
if (references && references.length > 0) {
|
|
106
|
+
console.log(`\n✅ SUCCESS: Found ${references.length} references for findProjectRoot`);
|
|
107
|
+
} else {
|
|
108
|
+
console.log('\n⚠️ WARNING: No references found, but no error occurred');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
} catch (error) {
|
|
112
|
+
console.error('GoToReferences failed:', error);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
console.log('\n🎉 TSServer workflow test completed successfully!');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Run the test
|
|
120
|
+
testTSServerWorkflow().catch(console.error).finally(() => {
|
|
121
|
+
process.exit(0);
|
|
122
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ycmdStart, ycmdCompletion } from '../../../src/agents/tools/ycmd';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
|
|
5
|
+
async function quickTypeScriptTest() {
|
|
6
|
+
console.log('=== Quick TypeScript "No Project" Test ===\n');
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
console.log('1. Checking if we already have a running ycmd server...');
|
|
10
|
+
|
|
11
|
+
// Test directly with completion - server should auto-start
|
|
12
|
+
const tsFilepath = path.resolve('./test-typescript-sample.ts');
|
|
13
|
+
console.log('TypeScript file:', tsFilepath);
|
|
14
|
+
console.log('File exists:', fs.existsSync(tsFilepath));
|
|
15
|
+
|
|
16
|
+
console.log('\n2. Testing completion directly (should auto-start server)...');
|
|
17
|
+
const compResult = await ycmdCompletion({
|
|
18
|
+
filepath: tsFilepath,
|
|
19
|
+
line: 25,
|
|
20
|
+
column: 20
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
console.log('Completion result:', JSON.stringify(compResult, null, 2));
|
|
24
|
+
|
|
25
|
+
// Check specifically for "No Project" error
|
|
26
|
+
if (!compResult.success) {
|
|
27
|
+
if (compResult.message.includes('No project') || compResult.message.includes('no project')) {
|
|
28
|
+
console.log('\n🔴 FOUND "No Project" ERROR! This is the issue we need to fix.');
|
|
29
|
+
console.log('Error details:', compResult.message);
|
|
30
|
+
} else {
|
|
31
|
+
console.log('\n⚠️ Got different error:', compResult.message);
|
|
32
|
+
}
|
|
33
|
+
} else if (compResult.success) {
|
|
34
|
+
console.log('\n✅ Completion worked! No "No Project" error found.');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
process.exit(0);
|
|
38
|
+
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error('Error during test:', error);
|
|
41
|
+
if (error instanceof Error) {
|
|
42
|
+
console.error('Error message:', error.message);
|
|
43
|
+
}
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
quickTypeScriptTest();
|