@tyvm/knowhow 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +14 -0
- package/CONFIG.md +336 -0
- package/README.md +49 -0
- package/autodoc/chat.mdx +20 -0
- package/autodoc/cli.mdx +11 -0
- package/autodoc/plugins/asana.mdx +47 -0
- package/autodoc/plugins/downloader/downloader.mdx +38 -0
- package/autodoc/plugins/downloader/plugin.mdx +37 -0
- package/autodoc/plugins/downloader/types.mdx +42 -0
- package/autodoc/plugins/embedding.mdx +41 -0
- package/autodoc/plugins/figma.mdx +45 -0
- package/autodoc/plugins/github.mdx +40 -0
- package/autodoc/plugins/jira.mdx +46 -0
- package/autodoc/plugins/language.mdx +37 -0
- package/autodoc/plugins/linear.mdx +35 -0
- package/autodoc/plugins/notion.mdx +38 -0
- package/autodoc/plugins/plugins.mdx +59 -0
- package/autodoc/plugins/types.mdx +51 -0
- package/autodoc/plugins/vim.mdx +39 -0
- package/autodoc/tools/addInternalTools.mdx +1 -0
- package/autodoc/tools/agentCall.mdx +1 -0
- package/autodoc/tools/asana/definitions.mdx +10 -0
- package/autodoc/tools/asana/index.mdx +12 -0
- package/autodoc/tools/askHuman.mdx +1 -0
- package/autodoc/tools/callPlugin.mdx +1 -0
- package/autodoc/tools/embeddingSearch.mdx +1 -0
- package/autodoc/tools/execCommand.mdx +1 -0
- package/autodoc/tools/fileSearch.mdx +1 -0
- package/autodoc/tools/finalAnswer.mdx +1 -0
- package/autodoc/tools/github/definitions.mdx +6 -0
- package/autodoc/tools/github/index.mdx +8 -0
- package/autodoc/tools/index.mdx +14 -0
- package/autodoc/tools/lintFile.mdx +7 -0
- package/autodoc/tools/list.mdx +16 -0
- package/autodoc/tools/modifyFile.mdx +7 -0
- package/autodoc/tools/patch.mdx +9 -0
- package/autodoc/tools/readBlocks.mdx +1 -0
- package/autodoc/tools/readFile.mdx +1 -0
- package/autodoc/tools/scanFile.mdx +1 -0
- package/autodoc/tools/textSearch.mdx +6 -0
- package/autodoc/tools/types/fileblock.mdx +1 -0
- package/autodoc/tools/visionTool.mdx +1 -0
- package/autodoc/tools/writeFile.mdx +1 -0
- package/jest.config.js +18 -0
- package/package.json +89 -0
- package/src/agents/base/base.ts +619 -0
- package/src/agents/base/prompt.ts +26 -0
- package/src/agents/configurable/ConfigAgent.ts +23 -0
- package/src/agents/developer/developer.ts +69 -0
- package/src/agents/index.ts +8 -0
- package/src/agents/interface.ts +11 -0
- package/src/agents/patcher/codebase.md +27 -0
- package/src/agents/patcher/patcher.ts +110 -0
- package/src/agents/researcher/researcher.ts +109 -0
- package/src/agents/tools/addInternalTools.ts +21 -0
- package/src/agents/tools/agentCall.ts +18 -0
- package/src/agents/tools/aiClient.ts +36 -0
- package/src/agents/tools/asana/definitions.ts +199 -0
- package/src/agents/tools/asana/index.ts +108 -0
- package/src/agents/tools/askHuman.ts +8 -0
- package/src/agents/tools/callPlugin.ts +4 -0
- package/src/agents/tools/embeddingSearch.ts +5 -0
- package/src/agents/tools/execCommand.ts +26 -0
- package/src/agents/tools/fileSearch.ts +33 -0
- package/src/agents/tools/finalAnswer.ts +4 -0
- package/src/agents/tools/github/definitions.ts +89 -0
- package/src/agents/tools/github/index.ts +67 -0
- package/src/agents/tools/googleSearch.ts +242 -0
- package/src/agents/tools/index.ts +24 -0
- package/src/agents/tools/language/definitions.ts +97 -0
- package/src/agents/tools/language/index.ts +19 -0
- package/src/agents/tools/lintFile.ts +17 -0
- package/src/agents/tools/list.ts +514 -0
- package/src/agents/tools/loadWebpage.ts +129 -0
- package/src/agents/tools/modifyFile.ts +53 -0
- package/src/agents/tools/patch.ts +672 -0
- package/src/agents/tools/readBlocks.ts +41 -0
- package/src/agents/tools/readFile.ts +39 -0
- package/src/agents/tools/scanFile.ts +16 -0
- package/src/agents/tools/textSearch.ts +21 -0
- package/src/agents/tools/types/fileblock.ts +5 -0
- package/src/agents/tools/visionTool.ts +5 -0
- package/src/agents/tools/writeFile.ts +46 -0
- package/src/agents/vim/vim.ts +153 -0
- package/src/ai.ts +167 -0
- package/src/chat.ts +412 -0
- package/src/cli.ts +85 -0
- package/src/clients/anthropic.ts +399 -0
- package/src/clients/gemini.ts +486 -0
- package/src/clients/http.ts +107 -0
- package/src/clients/index.ts +183 -0
- package/src/clients/knowhow.ts +33 -0
- package/src/clients/openai.ts +253 -0
- package/src/clients/types.ts +91 -0
- package/src/clients/xai.ts +132 -0
- package/src/config.ts +211 -0
- package/src/conversion.ts +140 -0
- package/src/dataset/diffs/README.md +12 -0
- package/src/dataset/diffs/debug-errors.ts +29 -0
- package/src/dataset/diffs/debug.ts +64 -0
- package/src/dataset/diffs/generate.ts +71 -0
- package/src/dataset/diffs/jsonl.ts +54 -0
- package/src/dataset/diffs/test.ts +193 -0
- package/src/embeddings.ts +411 -0
- package/src/hashes.ts +67 -0
- package/src/index.ts +376 -0
- package/src/login.ts +78 -0
- package/src/microphone.ts +136 -0
- package/src/modules/index.ts +37 -0
- package/src/modules/types.ts +48 -0
- package/src/plugins/asana.ts +134 -0
- package/src/plugins/downloader/downloader.ts +204 -0
- package/src/plugins/downloader/plugin.ts +85 -0
- package/src/plugins/downloader/types.ts +85 -0
- package/src/plugins/embedding.ts +42 -0
- package/src/plugins/figma.ts +137 -0
- package/src/plugins/github.ts +153 -0
- package/src/plugins/jira.ts +104 -0
- package/src/plugins/language.ts +100 -0
- package/src/plugins/linear.ts +219 -0
- package/src/plugins/notion.ts +170 -0
- package/src/plugins/plugins.ts +56 -0
- package/src/plugins/types.ts +5 -0
- package/src/plugins/url.ts +63 -0
- package/src/plugins/vim.ts +73 -0
- package/src/prompts/BasicCodeDocumenter.ts +1 -0
- package/src/prompts/BasicProjectDocumenter.ts +1 -0
- package/src/prompts/EmbeddingSeachHelper.ts +1 -0
- package/src/prompts/index.ts +9 -0
- package/src/server/index.ts +14 -0
- package/src/services/AgentService.ts +98 -0
- package/src/services/EmbeddingService.ts +410 -0
- package/src/services/EventService.ts +20 -0
- package/src/services/GitHub.ts +60 -0
- package/src/services/KnowhowClient.ts +113 -0
- package/src/services/Mcp.ts +270 -0
- package/src/services/McpServer.ts +119 -0
- package/src/services/McpWebsocketTransport.ts +64 -0
- package/src/services/S3.ts +126 -0
- package/src/services/Tools.ts +65 -0
- package/src/services/flags.ts +52 -0
- package/src/services/index.ts +8 -0
- package/src/types.ts +225 -0
- package/src/utils/index.ts +108 -0
- package/src/worker.ts +80 -0
- package/tests/integration/figma.test.ts +70 -0
- package/tests/integration/fileblocks/readwrite.test.ts +95 -0
- package/tests/integration/patching/input.txt +145 -0
- package/tests/integration/patching/output.txt +145 -0
- package/tests/integration/patching/patch.txt +15 -0
- package/tests/integration/patching/unseen.txt +80 -0
- package/tests/integration/patching.test.ts +136 -0
- package/tests/languagePlugin.test.ts +74 -0
- package/tests/patching/corrupted.test.ts +78 -0
- package/tests/patching/imports.patch.txt +11 -0
- package/tests/patching/imports.test.ts +43 -0
- package/tests/patching/imports.txt +11 -0
- package/tests/patching/interface.patch.txt +15 -0
- package/tests/patching/interface.txt +7 -0
- package/tests/test.spec.ts +132 -0
- package/ts_build/src/agents/base/base.d.ts +88 -0
- package/ts_build/src/agents/base/base.js +464 -0
- package/ts_build/src/agents/base/base.js.map +1 -0
- package/ts_build/src/agents/base/prompt.d.ts +1 -0
- package/ts_build/src/agents/base/prompt.js +30 -0
- package/ts_build/src/agents/base/prompt.js.map +1 -0
- package/ts_build/src/agents/configurable/ConfigAgent.d.ts +10 -0
- package/ts_build/src/agents/configurable/ConfigAgent.js +25 -0
- package/ts_build/src/agents/configurable/ConfigAgent.js.map +1 -0
- package/ts_build/src/agents/configurable/OpenAIAgent.d.ts +0 -0
- package/ts_build/src/agents/configurable/OpenAIAgent.js +1 -0
- package/ts_build/src/agents/configurable/OpenAIAgent.js.map +1 -0
- package/ts_build/src/agents/developer/developer.d.ts +9 -0
- package/ts_build/src/agents/developer/developer.js +69 -0
- package/ts_build/src/agents/developer/developer.js.map +1 -0
- package/ts_build/src/agents/index.d.ts +7 -0
- package/ts_build/src/agents/index.js +38 -0
- package/ts_build/src/agents/index.js.map +1 -0
- package/ts_build/src/agents/interface.d.ts +10 -0
- package/ts_build/src/agents/interface.js +3 -0
- package/ts_build/src/agents/interface.js.map +1 -0
- package/ts_build/src/agents/patcher/patcher.d.ts +9 -0
- package/ts_build/src/agents/patcher/patcher.js +106 -0
- package/ts_build/src/agents/patcher/patcher.js.map +1 -0
- package/ts_build/src/agents/researcher/researcher.d.ts +9 -0
- package/ts_build/src/agents/researcher/researcher.js +107 -0
- package/ts_build/src/agents/researcher/researcher.js.map +1 -0
- package/ts_build/src/agents/tools/addInternalTools.d.ts +5 -0
- package/ts_build/src/agents/tools/addInternalTools.js +18 -0
- package/ts_build/src/agents/tools/addInternalTools.js.map +1 -0
- package/ts_build/src/agents/tools/agentCall.d.ts +1 -0
- package/ts_build/src/agents/tools/agentCall.js +21 -0
- package/ts_build/src/agents/tools/agentCall.js.map +1 -0
- package/ts_build/src/agents/tools/aiClient.d.ts +6 -0
- package/ts_build/src/agents/tools/aiClient.js +25 -0
- package/ts_build/src/agents/tools/aiClient.js.map +1 -0
- package/ts_build/src/agents/tools/asana/definitions.d.ts +202 -0
- package/ts_build/src/agents/tools/asana/definitions.js +197 -0
- package/ts_build/src/agents/tools/asana/definitions.js.map +1 -0
- package/ts_build/src/agents/tools/asana/index.d.ts +8 -0
- package/ts_build/src/agents/tools/asana/index.js +98 -0
- package/ts_build/src/agents/tools/asana/index.js.map +1 -0
- package/ts_build/src/agents/tools/askHuman.d.ts +1 -0
- package/ts_build/src/agents/tools/askHuman.js +15 -0
- package/ts_build/src/agents/tools/askHuman.js.map +1 -0
- package/ts_build/src/agents/tools/callPlugin.d.ts +1 -0
- package/ts_build/src/agents/tools/callPlugin.js +9 -0
- package/ts_build/src/agents/tools/callPlugin.js.map +1 -0
- package/ts_build/src/agents/tools/client.d.ts +5 -0
- package/ts_build/src/agents/tools/client.js +21 -0
- package/ts_build/src/agents/tools/client.js.map +1 -0
- package/ts_build/src/agents/tools/embeddingSearch.d.ts +1 -0
- package/ts_build/src/agents/tools/embeddingSearch.js +9 -0
- package/ts_build/src/agents/tools/embeddingSearch.js.map +1 -0
- package/ts_build/src/agents/tools/execCommand.d.ts +1 -0
- package/ts_build/src/agents/tools/execCommand.js +25 -0
- package/ts_build/src/agents/tools/execCommand.js.map +1 -0
- package/ts_build/src/agents/tools/fileSearch.d.ts +1 -0
- package/ts_build/src/agents/tools/fileSearch.js +31 -0
- package/ts_build/src/agents/tools/fileSearch.js.map +1 -0
- package/ts_build/src/agents/tools/finalAnswer.d.ts +1 -0
- package/ts_build/src/agents/tools/finalAnswer.js +8 -0
- package/ts_build/src/agents/tools/finalAnswer.js.map +1 -0
- package/ts_build/src/agents/tools/github/definitions.d.ts +47 -0
- package/ts_build/src/agents/tools/github/definitions.js +86 -0
- package/ts_build/src/agents/tools/github/definitions.js.map +1 -0
- package/ts_build/src/agents/tools/github/index.d.ts +789 -0
- package/ts_build/src/agents/tools/github/index.js +56 -0
- package/ts_build/src/agents/tools/github/index.js.map +1 -0
- package/ts_build/src/agents/tools/googleSearch.d.ts +93 -0
- package/ts_build/src/agents/tools/googleSearch.js +117 -0
- package/ts_build/src/agents/tools/googleSearch.js.map +1 -0
- package/ts_build/src/agents/tools/googleSearchTypes.d.ts +74 -0
- package/ts_build/src/agents/tools/googleSearchTypes.js +3 -0
- package/ts_build/src/agents/tools/googleSearchTypes.js.map +1 -0
- package/ts_build/src/agents/tools/index.d.ts +24 -0
- package/ts_build/src/agents/tools/index.js +41 -0
- package/ts_build/src/agents/tools/index.js.map +1 -0
- package/ts_build/src/agents/tools/language/definitions.d.ts +89 -0
- package/ts_build/src/agents/tools/language/definitions.js +95 -0
- package/ts_build/src/agents/tools/language/definitions.js.map +1 -0
- package/ts_build/src/agents/tools/language/index.d.ts +4 -0
- package/ts_build/src/agents/tools/language/index.js +22 -0
- package/ts_build/src/agents/tools/language/index.js.map +1 -0
- package/ts_build/src/agents/tools/lintFile.d.ts +1 -0
- package/ts_build/src/agents/tools/lintFile.js +22 -0
- package/ts_build/src/agents/tools/lintFile.js.map +1 -0
- package/ts_build/src/agents/tools/list.d.ts +2 -0
- package/ts_build/src/agents/tools/list.js +505 -0
- package/ts_build/src/agents/tools/list.js.map +1 -0
- package/ts_build/src/agents/tools/loadWebpage.d.ts +8 -0
- package/ts_build/src/agents/tools/loadWebpage.js +97 -0
- package/ts_build/src/agents/tools/loadWebpage.js.map +1 -0
- package/ts_build/src/agents/tools/modifyFile.d.ts +2 -0
- package/ts_build/src/agents/tools/modifyFile.js +74 -0
- package/ts_build/src/agents/tools/modifyFile.js.map +1 -0
- package/ts_build/src/agents/tools/patch.d.ts +21 -0
- package/ts_build/src/agents/tools/patch.js +443 -0
- package/ts_build/src/agents/tools/patch.js.map +1 -0
- package/ts_build/src/agents/tools/readBlocks.d.ts +2 -0
- package/ts_build/src/agents/tools/readBlocks.js +59 -0
- package/ts_build/src/agents/tools/readBlocks.js.map +1 -0
- package/ts_build/src/agents/tools/readFile.d.ts +1 -0
- package/ts_build/src/agents/tools/readFile.js +46 -0
- package/ts_build/src/agents/tools/readFile.js.map +1 -0
- package/ts_build/src/agents/tools/scanFile.d.ts +1 -0
- package/ts_build/src/agents/tools/scanFile.js +36 -0
- package/ts_build/src/agents/tools/scanFile.js.map +1 -0
- package/ts_build/src/agents/tools/textSearch.d.ts +1 -0
- package/ts_build/src/agents/tools/textSearch.js +22 -0
- package/ts_build/src/agents/tools/textSearch.js.map +1 -0
- package/ts_build/src/agents/tools/types/fileblock.d.ts +5 -0
- package/ts_build/src/agents/tools/types/fileblock.js +3 -0
- package/ts_build/src/agents/tools/types/fileblock.js.map +1 -0
- package/ts_build/src/agents/tools/visionTool.d.ts +1 -0
- package/ts_build/src/agents/tools/visionTool.js +9 -0
- package/ts_build/src/agents/tools/visionTool.js.map +1 -0
- package/ts_build/src/agents/tools/writeFile.d.ts +2 -0
- package/ts_build/src/agents/tools/writeFile.js +61 -0
- package/ts_build/src/agents/tools/writeFile.js.map +1 -0
- package/ts_build/src/agents/vim/vim.d.ts +14 -0
- package/ts_build/src/agents/vim/vim.js +171 -0
- package/ts_build/src/agents/vim/vim.js.map +1 -0
- package/ts_build/src/ai.d.ts +10 -0
- package/ts_build/src/ai.js +102 -0
- package/ts_build/src/ai.js.map +1 -0
- package/ts_build/src/chat.d.ts +13 -0
- package/ts_build/src/chat.js +319 -0
- package/ts_build/src/chat.js.map +1 -0
- package/ts_build/src/cli.d.ts +2 -0
- package/ts_build/src/cli.js +98 -0
- package/ts_build/src/cli.js.map +1 -0
- package/ts_build/src/clients/anthropic.d.ts +31 -0
- package/ts_build/src/clients/anthropic.js +344 -0
- package/ts_build/src/clients/anthropic.js.map +1 -0
- package/ts_build/src/clients/gemini.d.ts +20 -0
- package/ts_build/src/clients/gemini.js +347 -0
- package/ts_build/src/clients/gemini.js.map +1 -0
- package/ts_build/src/clients/http.d.ts +12 -0
- package/ts_build/src/clients/http.js +91 -0
- package/ts_build/src/clients/http.js.map +1 -0
- package/ts_build/src/clients/index.d.ts +47 -0
- package/ts_build/src/clients/index.js +143 -0
- package/ts_build/src/clients/index.js.map +1 -0
- package/ts_build/src/clients/knowhow.d.ts +10 -0
- package/ts_build/src/clients/knowhow.js +24 -0
- package/ts_build/src/clients/knowhow.js.map +1 -0
- package/ts_build/src/clients/openai.d.ts +20 -0
- package/ts_build/src/clients/openai.js +221 -0
- package/ts_build/src/clients/openai.js.map +1 -0
- package/ts_build/src/clients/types.d.ts +89 -0
- package/ts_build/src/clients/types.js +3 -0
- package/ts_build/src/clients/types.js.map +1 -0
- package/ts_build/src/clients/xai.d.ts +22 -0
- package/ts_build/src/clients/xai.js +108 -0
- package/ts_build/src/clients/xai.js.map +1 -0
- package/ts_build/src/config.d.ts +9 -0
- package/ts_build/src/config.js +216 -0
- package/ts_build/src/config.js.map +1 -0
- package/ts_build/src/conversion.d.ts +7 -0
- package/ts_build/src/conversion.js +114 -0
- package/ts_build/src/conversion.js.map +1 -0
- package/ts_build/src/dataset/diffs/debug-errors.d.ts +1 -0
- package/ts_build/src/dataset/diffs/debug-errors.js +28 -0
- package/ts_build/src/dataset/diffs/debug-errors.js.map +1 -0
- package/ts_build/src/dataset/diffs/debug.d.ts +1 -0
- package/ts_build/src/dataset/diffs/debug.js +50 -0
- package/ts_build/src/dataset/diffs/debug.js.map +1 -0
- package/ts_build/src/dataset/diffs/generate.d.ts +1 -0
- package/ts_build/src/dataset/diffs/generate.js +70 -0
- package/ts_build/src/dataset/diffs/generate.js.map +1 -0
- package/ts_build/src/dataset/diffs/jsonl.d.ts +1 -0
- package/ts_build/src/dataset/diffs/jsonl.js +47 -0
- package/ts_build/src/dataset/diffs/jsonl.js.map +1 -0
- package/ts_build/src/dataset/diffs/test.d.ts +1 -0
- package/ts_build/src/dataset/diffs/test.js +114 -0
- package/ts_build/src/dataset/diffs/test.js.map +1 -0
- package/ts_build/src/embeddings.d.ts +19 -0
- package/ts_build/src/embeddings.js +322 -0
- package/ts_build/src/embeddings.js.map +1 -0
- package/ts_build/src/hashes.d.ts +6 -0
- package/ts_build/src/hashes.js +78 -0
- package/ts_build/src/hashes.js.map +1 -0
- package/ts_build/src/index.d.ts +14 -0
- package/ts_build/src/index.js +258 -0
- package/ts_build/src/index.js.map +1 -0
- package/ts_build/src/login.d.ts +2 -0
- package/ts_build/src/login.js +63 -0
- package/ts_build/src/login.js.map +1 -0
- package/ts_build/src/microphone.d.ts +9 -0
- package/ts_build/src/microphone.js +131 -0
- package/ts_build/src/microphone.js.map +1 -0
- package/ts_build/src/modules/index.d.ts +3 -0
- package/ts_build/src/modules/index.js +34 -0
- package/ts_build/src/modules/index.js.map +1 -0
- package/ts_build/src/modules/types.d.ts +37 -0
- package/ts_build/src/modules/types.js +3 -0
- package/ts_build/src/modules/types.js.map +1 -0
- package/ts_build/src/plugins/asana.d.ts +16 -0
- package/ts_build/src/plugins/asana.js +114 -0
- package/ts_build/src/plugins/asana.js.map +1 -0
- package/ts_build/src/plugins/downloader/downloader.d.ts +12 -0
- package/ts_build/src/plugins/downloader/downloader.js +174 -0
- package/ts_build/src/plugins/downloader/downloader.js.map +1 -0
- package/ts_build/src/plugins/downloader/index.d.ts +3 -0
- package/ts_build/src/plugins/downloader/index.js +41 -0
- package/ts_build/src/plugins/downloader/index.js.map +1 -0
- package/ts_build/src/plugins/downloader/plugin.d.ts +8 -0
- package/ts_build/src/plugins/downloader/plugin.js +83 -0
- package/ts_build/src/plugins/downloader/plugin.js.map +1 -0
- package/ts_build/src/plugins/downloader/types.d.ts +82 -0
- package/ts_build/src/plugins/downloader/types.js +79 -0
- package/ts_build/src/plugins/downloader/types.js.map +1 -0
- package/ts_build/src/plugins/embedding.d.ts +5 -0
- package/ts_build/src/plugins/embedding.js +28 -0
- package/ts_build/src/plugins/embedding.js.map +1 -0
- package/ts_build/src/plugins/figma.d.ts +20 -0
- package/ts_build/src/plugins/figma.js +94 -0
- package/ts_build/src/plugins/figma.js.map +1 -0
- package/ts_build/src/plugins/github.d.ts +1223 -0
- package/ts_build/src/plugins/github.js +115 -0
- package/ts_build/src/plugins/github.js.map +1 -0
- package/ts_build/src/plugins/jira.d.ts +15 -0
- package/ts_build/src/plugins/jira.js +94 -0
- package/ts_build/src/plugins/jira.js.map +1 -0
- package/ts_build/src/plugins/language.d.ts +8 -0
- package/ts_build/src/plugins/language.js +69 -0
- package/ts_build/src/plugins/language.js.map +1 -0
- package/ts_build/src/plugins/linear.d.ts +23 -0
- package/ts_build/src/plugins/linear.js +184 -0
- package/ts_build/src/plugins/linear.js.map +1 -0
- package/ts_build/src/plugins/notion.d.ts +32 -0
- package/ts_build/src/plugins/notion.js +131 -0
- package/ts_build/src/plugins/notion.js.map +1 -0
- package/ts_build/src/plugins/plugins.d.ts +11 -0
- package/ts_build/src/plugins/plugins.js +51 -0
- package/ts_build/src/plugins/plugins.js.map +1 -0
- package/ts_build/src/plugins/types.d.ts +5 -0
- package/ts_build/src/plugins/types.js +3 -0
- package/ts_build/src/plugins/types.js.map +1 -0
- package/ts_build/src/plugins/url.d.ts +8 -0
- package/ts_build/src/plugins/url.js +50 -0
- package/ts_build/src/plugins/url.js.map +1 -0
- package/ts_build/src/plugins/vim.d.ts +11 -0
- package/ts_build/src/plugins/vim.js +63 -0
- package/ts_build/src/plugins/vim.js.map +1 -0
- package/ts_build/src/prompts/BasicCodeDocumenter.d.ts +2 -0
- package/ts_build/src/prompts/BasicCodeDocumenter.js +4 -0
- package/ts_build/src/prompts/BasicCodeDocumenter.js.map +1 -0
- package/ts_build/src/prompts/BasicProjectDocumenter.d.ts +2 -0
- package/ts_build/src/prompts/BasicProjectDocumenter.js +4 -0
- package/ts_build/src/prompts/BasicProjectDocumenter.js.map +1 -0
- package/ts_build/src/prompts/EmbeddingSeachHelper.d.ts +2 -0
- package/ts_build/src/prompts/EmbeddingSeachHelper.js +4 -0
- package/ts_build/src/prompts/EmbeddingSeachHelper.js.map +1 -0
- package/ts_build/src/prompts/index.d.ts +13 -0
- package/ts_build/src/prompts/index.js +15 -0
- package/ts_build/src/prompts/index.js.map +1 -0
- package/ts_build/src/server/index.d.ts +1 -0
- package/ts_build/src/server/index.js +17 -0
- package/ts_build/src/server/index.js.map +1 -0
- package/ts_build/src/services/AgentService.d.ts +14 -0
- package/ts_build/src/services/AgentService.js +87 -0
- package/ts_build/src/services/AgentService.js.map +1 -0
- package/ts_build/src/services/EmbeddingService.d.ts +39 -0
- package/ts_build/src/services/EmbeddingService.js +307 -0
- package/ts_build/src/services/EmbeddingService.js.map +1 -0
- package/ts_build/src/services/EventService.d.ts +9 -0
- package/ts_build/src/services/EventService.js +20 -0
- package/ts_build/src/services/EventService.js.map +1 -0
- package/ts_build/src/services/GitHub.d.ts +11 -0
- package/ts_build/src/services/GitHub.js +52 -0
- package/ts_build/src/services/GitHub.js.map +1 -0
- package/ts_build/src/services/KnowhowClient.d.ts +18 -0
- package/ts_build/src/services/KnowhowClient.js +85 -0
- package/ts_build/src/services/KnowhowClient.js.map +1 -0
- package/ts_build/src/services/Mcp.d.ts +377 -0
- package/ts_build/src/services/Mcp.js +221 -0
- package/ts_build/src/services/Mcp.js.map +1 -0
- package/ts_build/src/services/McpServer.d.ts +19 -0
- package/ts_build/src/services/McpServer.js +104 -0
- package/ts_build/src/services/McpServer.js.map +1 -0
- package/ts_build/src/services/McpWebsocketTransport.d.ts +13 -0
- package/ts_build/src/services/McpWebsocketTransport.js +59 -0
- package/ts_build/src/services/McpWebsocketTransport.js.map +1 -0
- package/ts_build/src/services/S3.d.ts +9 -0
- package/ts_build/src/services/S3.js +116 -0
- package/ts_build/src/services/S3.js.map +1 -0
- package/ts_build/src/services/Tools.d.ts +19 -0
- package/ts_build/src/services/Tools.js +51 -0
- package/ts_build/src/services/Tools.js.map +1 -0
- package/ts_build/src/services/flags.d.ts +13 -0
- package/ts_build/src/services/flags.js +48 -0
- package/ts_build/src/services/flags.js.map +1 -0
- package/ts_build/src/services/index.d.ts +8 -0
- package/ts_build/src/services/index.js +38 -0
- package/ts_build/src/services/index.js.map +1 -0
- package/ts_build/src/terminal.d.ts +1 -0
- package/ts_build/src/terminal.js +35 -0
- package/ts_build/src/terminal.js.map +1 -0
- package/ts_build/src/types.d.ts +181 -0
- package/ts_build/src/types.js +94 -0
- package/ts_build/src/types.js.map +1 -0
- package/ts_build/src/utils/index.d.ts +24 -0
- package/ts_build/src/utils/index.js +116 -0
- package/ts_build/src/utils/index.js.map +1 -0
- package/ts_build/src/worker.d.ts +1 -0
- package/ts_build/src/worker.js +68 -0
- package/ts_build/src/worker.js.map +1 -0
- package/ts_build/tests/integration/figma.test.d.ts +1 -0
- package/ts_build/tests/integration/figma.test.js +47 -0
- package/ts_build/tests/integration/figma.test.js.map +1 -0
- package/ts_build/tests/integration/fileblocks/readwrite.test.d.ts +1 -0
- package/ts_build/tests/integration/fileblocks/readwrite.test.js +95 -0
- package/ts_build/tests/integration/fileblocks/readwrite.test.js.map +1 -0
- package/ts_build/tests/integration/patching.test.d.ts +1 -0
- package/ts_build/tests/integration/patching.test.js +117 -0
- package/ts_build/tests/integration/patching.test.js.map +1 -0
- package/ts_build/tests/languagePlugin.test.d.ts +1 -0
- package/ts_build/tests/languagePlugin.test.js +78 -0
- package/ts_build/tests/languagePlugin.test.js.map +1 -0
- package/ts_build/tests/patching/corrupted.test.d.ts +1 -0
- package/ts_build/tests/patching/corrupted.test.js +53 -0
- package/ts_build/tests/patching/corrupted.test.js.map +1 -0
- package/ts_build/tests/patching/imports.test.d.ts +1 -0
- package/ts_build/tests/patching/imports.test.js +61 -0
- package/ts_build/tests/patching/imports.test.js.map +1 -0
- package/ts_build/tests/test.spec.d.ts +1 -0
- package/ts_build/tests/test.spec.js +101 -0
- package/ts_build/tests/test.spec.js.map +1 -0
- package/tsconfig.json +31 -0
- package/tslint.json +11 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPullRequestBuildFailureLogs = exports.getRunLogs = exports.getPullRequestBuildStatuses = exports.getPullRequest = void 0;
|
|
4
|
+
const rest_1 = require("@octokit/rest");
|
|
5
|
+
const execCommand_1 = require("../execCommand");
|
|
6
|
+
const octokit = new rest_1.Octokit({
|
|
7
|
+
auth: process.env.GITHUB_TOKEN,
|
|
8
|
+
});
|
|
9
|
+
async function getPullRequest(url) {
|
|
10
|
+
const [owner, repo, _, pullNumber] = url.split("/").slice(-4);
|
|
11
|
+
const pullRequest = await octokit.rest.pulls.get({
|
|
12
|
+
owner,
|
|
13
|
+
repo,
|
|
14
|
+
pull_number: parseInt(pullNumber, 10),
|
|
15
|
+
});
|
|
16
|
+
return pullRequest;
|
|
17
|
+
}
|
|
18
|
+
exports.getPullRequest = getPullRequest;
|
|
19
|
+
async function getPullRequestBuildStatuses(url) {
|
|
20
|
+
const [owner, repo, _, pullNumber] = url.split("/").slice(-4);
|
|
21
|
+
const pullRequest = await octokit.rest.pulls.get({
|
|
22
|
+
owner,
|
|
23
|
+
repo,
|
|
24
|
+
pull_number: parseInt(pullNumber, 10),
|
|
25
|
+
});
|
|
26
|
+
const { data: statuses } = await octokit.rest.checks.listForRef({
|
|
27
|
+
owner,
|
|
28
|
+
repo,
|
|
29
|
+
ref: pullRequest.data.head.sha,
|
|
30
|
+
});
|
|
31
|
+
return statuses;
|
|
32
|
+
}
|
|
33
|
+
exports.getPullRequestBuildStatuses = getPullRequestBuildStatuses;
|
|
34
|
+
async function getRunLogs(runId, owner, repo) {
|
|
35
|
+
const logs = await (0, execCommand_1.execCommand)(`gh run view ${runId} -R ${owner}/${repo} --log`);
|
|
36
|
+
return logs;
|
|
37
|
+
}
|
|
38
|
+
exports.getRunLogs = getRunLogs;
|
|
39
|
+
async function getPullRequestBuildFailureLogs(url) {
|
|
40
|
+
const [owner, repo, _, pullNumber] = url.split("/").slice(-4);
|
|
41
|
+
const statuses = await getPullRequestBuildStatuses(url);
|
|
42
|
+
const failures = statuses.check_runs.filter((status) => status.conclusion === "failure");
|
|
43
|
+
if (failures.length === 0) {
|
|
44
|
+
return "No failures found";
|
|
45
|
+
}
|
|
46
|
+
const allLogs = [];
|
|
47
|
+
for (const fail of failures) {
|
|
48
|
+
const [runId, __, jobId] = fail.details_url.split("/").slice(-3);
|
|
49
|
+
const logs = await (0, execCommand_1.execCommand)(`gh run view ${runId} -R ${owner}/${repo} --log | grep -E 'FAIL|ERROR' -A 25 -B 25`);
|
|
50
|
+
return logs;
|
|
51
|
+
allLogs.push(logs);
|
|
52
|
+
}
|
|
53
|
+
return allLogs;
|
|
54
|
+
}
|
|
55
|
+
exports.getPullRequestBuildFailureLogs = getPullRequestBuildFailureLogs;
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/agents/tools/github/index.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AAExC,gDAA6C;AAE7C,MAAM,OAAO,GAAG,IAAI,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ilter?: "e" | "i";
|
|
8
|
+
sort?: string;
|
|
9
|
+
start?: number;
|
|
10
|
+
lr?: string;
|
|
11
|
+
num?: number;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
interface GoogleSearchUrlTemplate {
|
|
15
|
+
type: string;
|
|
16
|
+
template: string;
|
|
17
|
+
}
|
|
18
|
+
interface GoogleSearchQuery {
|
|
19
|
+
title: string;
|
|
20
|
+
totalResults: string;
|
|
21
|
+
searchTerms: string;
|
|
22
|
+
count: number;
|
|
23
|
+
startIndex: number;
|
|
24
|
+
startPage: number;
|
|
25
|
+
language: string;
|
|
26
|
+
inputEncoding: string;
|
|
27
|
+
outputEncoding: string;
|
|
28
|
+
safe: string;
|
|
29
|
+
cx: string;
|
|
30
|
+
sort: string;
|
|
31
|
+
filter: string;
|
|
32
|
+
gl: string;
|
|
33
|
+
cr: string;
|
|
34
|
+
googleHost: string;
|
|
35
|
+
disableCnTwTranslation: string;
|
|
36
|
+
hq: string;
|
|
37
|
+
hl: string;
|
|
38
|
+
siteSearch: string;
|
|
39
|
+
siteSearchFilter: string;
|
|
40
|
+
exactTerms: string;
|
|
41
|
+
excludeTerms: string;
|
|
42
|
+
linkSite: string;
|
|
43
|
+
orTerms: string;
|
|
44
|
+
relatedSite: string;
|
|
45
|
+
dateRestrict: string;
|
|
46
|
+
lowRange: string;
|
|
47
|
+
highRange: string;
|
|
48
|
+
fileType: string;
|
|
49
|
+
rights: string;
|
|
50
|
+
searchType: string;
|
|
51
|
+
imgSize: string;
|
|
52
|
+
imgType: string;
|
|
53
|
+
imgColorType: string;
|
|
54
|
+
imgDominantColor: string;
|
|
55
|
+
}
|
|
56
|
+
interface GoogleSearchQueries {
|
|
57
|
+
previousPage: GoogleSearchQuery[];
|
|
58
|
+
request: GoogleSearchQuery[];
|
|
59
|
+
nextPage: GoogleSearchQuery[];
|
|
60
|
+
}
|
|
61
|
+
interface GoogleSearchInformation {
|
|
62
|
+
searchTime: number;
|
|
63
|
+
formattedSearchTime: string;
|
|
64
|
+
totalResults: string;
|
|
65
|
+
formattedTotalResults: string;
|
|
66
|
+
}
|
|
67
|
+
interface GoogleSearchSpelling {
|
|
68
|
+
correctedQuery: string;
|
|
69
|
+
htmlCorrectedQuery: string;
|
|
70
|
+
}
|
|
71
|
+
export interface GoogleSearchResponse {
|
|
72
|
+
kind: string;
|
|
73
|
+
url: GoogleSearchUrlTemplate;
|
|
74
|
+
queries: GoogleSearchQueries;
|
|
75
|
+
promotions?: any[];
|
|
76
|
+
context?: any;
|
|
77
|
+
searchInformation: GoogleSearchInformation;
|
|
78
|
+
spelling?: GoogleSearchSpelling;
|
|
79
|
+
items?: any[];
|
|
80
|
+
}
|
|
81
|
+
interface LlmRelevantSearchResult {
|
|
82
|
+
title: string;
|
|
83
|
+
link: string;
|
|
84
|
+
snippet: string;
|
|
85
|
+
source?: string;
|
|
86
|
+
}
|
|
87
|
+
export declare function googleSearch(params: GoogleSearchParams): Promise<{
|
|
88
|
+
searchQuery: string;
|
|
89
|
+
totalResults: string;
|
|
90
|
+
results: LlmRelevantSearchResult[];
|
|
91
|
+
}>;
|
|
92
|
+
export declare const googleSearchDefinition: Tool;
|
|
93
|
+
export default googleSearch;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.googleSearchDefinition = exports.googleSearch = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
function transformGoogleSearchResponseForLLM(apiResponse) {
|
|
9
|
+
const searchQuery = apiResponse.queries?.request?.[0]?.searchTerms || "Unknown query";
|
|
10
|
+
const totalResults = apiResponse.searchInformation?.totalResults;
|
|
11
|
+
const relevantItems = (apiResponse.items || []).map((item) => {
|
|
12
|
+
let bestSnippet = item.snippet || "";
|
|
13
|
+
const metaTags = item.pagemap?.metatags?.[0];
|
|
14
|
+
if (metaTags) {
|
|
15
|
+
const ogDescription = metaTags["og:description"];
|
|
16
|
+
const twitterDescription = metaTags["twitter:description"];
|
|
17
|
+
const genericDescription = metaTags?.description;
|
|
18
|
+
if (ogDescription && ogDescription.length > bestSnippet.length) {
|
|
19
|
+
bestSnippet = ogDescription;
|
|
20
|
+
}
|
|
21
|
+
else if (twitterDescription &&
|
|
22
|
+
twitterDescription.length > bestSnippet.length) {
|
|
23
|
+
bestSnippet = twitterDescription;
|
|
24
|
+
}
|
|
25
|
+
else if (genericDescription &&
|
|
26
|
+
genericDescription.length > bestSnippet.length) {
|
|
27
|
+
bestSnippet = genericDescription;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
title: item.title,
|
|
32
|
+
link: item.link,
|
|
33
|
+
snippet: bestSnippet,
|
|
34
|
+
source: item.displayLink,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
searchQuery,
|
|
39
|
+
totalResults,
|
|
40
|
+
results: relevantItems,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async function googleSearch(params) {
|
|
44
|
+
const apiKey = process.env.GOOGLE_SEARCH_API_KEY;
|
|
45
|
+
const cx = process.env.GOOGLE_SEARCH_CX;
|
|
46
|
+
if (!apiKey) {
|
|
47
|
+
throw new Error("GOOGLE_SEARCH_API_KEY environment variable is not set");
|
|
48
|
+
}
|
|
49
|
+
if (!cx) {
|
|
50
|
+
throw new Error("GOOGLE_SEARCH_CX environment variable is not set");
|
|
51
|
+
}
|
|
52
|
+
const baseUrl = "https://www.googleapis.com/customsearch/v1";
|
|
53
|
+
const url = new URL(baseUrl);
|
|
54
|
+
url.searchParams.append("key", apiKey);
|
|
55
|
+
url.searchParams.append("cx", cx);
|
|
56
|
+
for (const [key, value] of Object.entries(params)) {
|
|
57
|
+
if (value !== undefined) {
|
|
58
|
+
url.searchParams.append(key, value.toString());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const response = await axios_1.default.get(url.toString());
|
|
63
|
+
return transformGoogleSearchResponseForLLM(response.data);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.error("Error performing Google search:", error);
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.googleSearch = googleSearch;
|
|
71
|
+
exports.googleSearchDefinition = {
|
|
72
|
+
type: "function",
|
|
73
|
+
function: {
|
|
74
|
+
name: "googleSearch",
|
|
75
|
+
description: "Perform a Google search using the Custom Search API",
|
|
76
|
+
parameters: {
|
|
77
|
+
type: "object",
|
|
78
|
+
properties: {
|
|
79
|
+
q: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "The search query",
|
|
82
|
+
},
|
|
83
|
+
num: {
|
|
84
|
+
type: "number",
|
|
85
|
+
description: "The number of search results to return (optional, default is 10, max is 10)",
|
|
86
|
+
},
|
|
87
|
+
start: {
|
|
88
|
+
type: "number",
|
|
89
|
+
description: "The index of the first result to return (optional, default is 1)",
|
|
90
|
+
},
|
|
91
|
+
dateRestrict: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "Restricts results to URLs based on date. Format: [d|w|m|y]NUMBER. Example: 'd10' for past 10 days",
|
|
94
|
+
},
|
|
95
|
+
siteSearch: {
|
|
96
|
+
type: "string",
|
|
97
|
+
description: "Specifies a site to search within",
|
|
98
|
+
},
|
|
99
|
+
siteSearchFilter: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Controls whether to include or exclude results from the site specified in siteSearch. 'e' to exclude, 'i' to include",
|
|
102
|
+
},
|
|
103
|
+
sort: {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "The sort expression to apply to the results, e.g., 'date'",
|
|
106
|
+
},
|
|
107
|
+
lr: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "Restricts the search to documents written in a particular language (e.g., lr=lang_ja)",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
required: ["q"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
exports.default = googleSearch;
|
|
117
|
+
//# sourceMappingURL=googleSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"googleSearch.js","sourceRoot":"","sources":["../../../../src/agents/tools/googleSearch.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AA8G1B,SAAS,mCAAmC,CAC1C,WAAiC;IAEjC,MAAM,WAAW,GACf,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,IAAI,eAAe,CAAC;IACpE,MAAM,YAAY,GAAG,WAAW,CAAC,iBAAiB,EAAE,YAAY,CAAC;IAEjE,MAAM,aAAa,GAA8B,CAC/C,WAAW,CAAC,KAAK,IAAI,EAAE,CACxB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACb,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,QAAQ,EAAE;YACZ,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;YACjD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;YAC3D,MAAM,kBAAkB,GAAG,QAAQ,EAAE,WAAW,CAAC;YAGjD,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE;gBAC9D,WAAW,GAAG,aAAa,CAAC;aAC7B;iBAAM,IACL,kBAAkB;gBAClB,kBAAkB,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,EAC9C;gBACA,WAAW,GAAG,kBAAkB,CAAC;aAClC;iBAAM,IACL,kBAAkB;gBAClB,kBAAkB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}
|
|
5
|
+
interface GoogleSearchQuery {
|
|
6
|
+
title: string;
|
|
7
|
+
totalResults: string;
|
|
8
|
+
searchTerms: string;
|
|
9
|
+
count: number;
|
|
10
|
+
startIndex: number;
|
|
11
|
+
startPage: number;
|
|
12
|
+
language: string;
|
|
13
|
+
inputEncoding: string;
|
|
14
|
+
outputEncoding: string;
|
|
15
|
+
safe: string;
|
|
16
|
+
cx: string;
|
|
17
|
+
sort: string;
|
|
18
|
+
filter: string;
|
|
19
|
+
gl: string;
|
|
20
|
+
cr: string;
|
|
21
|
+
googleHost: string;
|
|
22
|
+
disableCnTwTranslation: string;
|
|
23
|
+
hq: string;
|
|
24
|
+
hl: string;
|
|
25
|
+
siteSearch: string;
|
|
26
|
+
siteSearchFilter: string;
|
|
27
|
+
exactTerms: string;
|
|
28
|
+
excludeTerms: string;
|
|
29
|
+
linkSite: string;
|
|
30
|
+
orTerms: string;
|
|
31
|
+
relatedSite: string;
|
|
32
|
+
dateRestrict: string;
|
|
33
|
+
lowRange: string;
|
|
34
|
+
highRange: string;
|
|
35
|
+
fileType: string;
|
|
36
|
+
rights: string;
|
|
37
|
+
searchType: string;
|
|
38
|
+
imgSize: string;
|
|
39
|
+
imgType: string;
|
|
40
|
+
imgColorType: string;
|
|
41
|
+
imgDominantColor: string;
|
|
42
|
+
}
|
|
43
|
+
interface GoogleSearchQueries {
|
|
44
|
+
previousPage: GoogleSearchQuery[];
|
|
45
|
+
request: GoogleSearchQuery[];
|
|
46
|
+
nextPage: GoogleSearchQuery[];
|
|
47
|
+
}
|
|
48
|
+
interface GoogleSearchPromotion {
|
|
49
|
+
}
|
|
50
|
+
interface GoogleSearchContext {
|
|
51
|
+
}
|
|
52
|
+
interface GoogleSearchInformation {
|
|
53
|
+
searchTime: number;
|
|
54
|
+
formattedSearchTime: string;
|
|
55
|
+
totalResults: string;
|
|
56
|
+
formattedTotalResults: string;
|
|
57
|
+
}
|
|
58
|
+
interface GoogleSearchSpelling {
|
|
59
|
+
correctedQuery: string;
|
|
60
|
+
htmlCorrectedQuery: string;
|
|
61
|
+
}
|
|
62
|
+
interface GoogleSearchResult {
|
|
63
|
+
}
|
|
64
|
+
export interface GoogleSearchResponse {
|
|
65
|
+
kind: string;
|
|
66
|
+
url: GoogleSearchUrlTemplate;
|
|
67
|
+
queries: GoogleSearchQueries;
|
|
68
|
+
promotions?: GoogleSearchPromotion[];
|
|
69
|
+
context?: GoogleSearchContext;
|
|
70
|
+
searchInformation: GoogleSearchInformation;
|
|
71
|
+
spelling?: GoogleSearchSpelling;
|
|
72
|
+
items?: GoogleSearchResult[];
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"googleSearchTypes.js","sourceRoot":"","sources":["../../../../src/agents/tools/googleSearchTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from "./addInternalTools";
|
|
2
|
+
export * from "./agentCall";
|
|
3
|
+
export * from "./callPlugin";
|
|
4
|
+
export * from "./embeddingSearch";
|
|
5
|
+
export * from "./execCommand";
|
|
6
|
+
export * from "./finalAnswer";
|
|
7
|
+
export * from "./index";
|
|
8
|
+
export * from "./lintFile";
|
|
9
|
+
export * from "./modifyFile";
|
|
10
|
+
export * from "./patch";
|
|
11
|
+
export * from "./readBlocks";
|
|
12
|
+
export * from "./readFile";
|
|
13
|
+
export * from "./scanFile";
|
|
14
|
+
export * from "./textSearch";
|
|
15
|
+
export * from "./visionTool";
|
|
16
|
+
export * from "./writeFile";
|
|
17
|
+
export * from "./asana";
|
|
18
|
+
export * from "./github";
|
|
19
|
+
export * from "./fileSearch";
|
|
20
|
+
export * from "./language";
|
|
21
|
+
export * from "./askHuman";
|
|
22
|
+
export * from "./aiClient";
|
|
23
|
+
export * from "./googleSearch";
|
|
24
|
+
export * from "./loadWebpage";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./addInternalTools"), exports);
|
|
18
|
+
__exportStar(require("./agentCall"), exports);
|
|
19
|
+
__exportStar(require("./callPlugin"), exports);
|
|
20
|
+
__exportStar(require("./embeddingSearch"), exports);
|
|
21
|
+
__exportStar(require("./execCommand"), exports);
|
|
22
|
+
__exportStar(require("./finalAnswer"), exports);
|
|
23
|
+
__exportStar(require("./index"), exports);
|
|
24
|
+
__exportStar(require("./lintFile"), exports);
|
|
25
|
+
__exportStar(require("./modifyFile"), exports);
|
|
26
|
+
__exportStar(require("./patch"), exports);
|
|
27
|
+
__exportStar(require("./readBlocks"), exports);
|
|
28
|
+
__exportStar(require("./readFile"), exports);
|
|
29
|
+
__exportStar(require("./scanFile"), exports);
|
|
30
|
+
__exportStar(require("./textSearch"), exports);
|
|
31
|
+
__exportStar(require("./visionTool"), exports);
|
|
32
|
+
__exportStar(require("./writeFile"), exports);
|
|
33
|
+
__exportStar(require("./asana"), exports);
|
|
34
|
+
__exportStar(require("./github"), exports);
|
|
35
|
+
__exportStar(require("./fileSearch"), exports);
|
|
36
|
+
__exportStar(require("./language"), exports);
|
|
37
|
+
__exportStar(require("./askHuman"), exports);
|
|
38
|
+
__exportStar(require("./aiClient"), exports);
|
|
39
|
+
__exportStar(require("./googleSearch"), exports);
|
|
40
|
+
__exportStar(require("./loadWebpage"), exports);
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/agents/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,8CAA4B;AAC5B,+CAA6B;AAC7B,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,0CAAwB;AACxB,6CAA2B;AAC3B,+CAA6B;AAC7B,0CAAwB;AACxB,+CAA6B;AAC7B,6CAA2B;AAC3B,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,0CAAwB;AACxB,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,6CAA2B;AAC3B,6CAA2B;AAC3B,iDAA+B;AAC/B,gDAA8B"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export declare const definitions: ({
|
|
2
|
+
type: string;
|
|
3
|
+
function: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: string;
|
|
8
|
+
positional: boolean;
|
|
9
|
+
properties: {
|
|
10
|
+
term: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
sources: {
|
|
15
|
+
type: string;
|
|
16
|
+
items: {
|
|
17
|
+
type: string;
|
|
18
|
+
properties: {
|
|
19
|
+
kind: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
data: {
|
|
24
|
+
type: string;
|
|
25
|
+
items: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
required: string[];
|
|
32
|
+
};
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
required: string[];
|
|
37
|
+
};
|
|
38
|
+
returns: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
items?: undefined;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
type: string;
|
|
46
|
+
function: {
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
parameters: {
|
|
50
|
+
type: string;
|
|
51
|
+
positional: boolean;
|
|
52
|
+
properties: {
|
|
53
|
+
term?: undefined;
|
|
54
|
+
sources?: undefined;
|
|
55
|
+
};
|
|
56
|
+
required: any[];
|
|
57
|
+
};
|
|
58
|
+
returns: {
|
|
59
|
+
type: string;
|
|
60
|
+
items: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
} | {
|
|
67
|
+
type: string;
|
|
68
|
+
function: {
|
|
69
|
+
name: string;
|
|
70
|
+
description: string;
|
|
71
|
+
parameters: {
|
|
72
|
+
type: string;
|
|
73
|
+
positional: boolean;
|
|
74
|
+
properties: {
|
|
75
|
+
term: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
sources?: undefined;
|
|
80
|
+
};
|
|
81
|
+
required: string[];
|
|
82
|
+
};
|
|
83
|
+
returns: {
|
|
84
|
+
type: string;
|
|
85
|
+
description: string;
|
|
86
|
+
items?: undefined;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
})[];
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.definitions = void 0;
|
|
4
|
+
const plugins_1 = require("../../../plugins/plugins");
|
|
5
|
+
exports.definitions = [
|
|
6
|
+
{
|
|
7
|
+
type: "function",
|
|
8
|
+
function: {
|
|
9
|
+
name: "addLanguageTerm",
|
|
10
|
+
description: "Add a new language term to the language config, which can help load context for given terms in the future.",
|
|
11
|
+
parameters: {
|
|
12
|
+
type: "object",
|
|
13
|
+
positional: true,
|
|
14
|
+
properties: {
|
|
15
|
+
term: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "The trigger word(s) that should load the given context",
|
|
18
|
+
},
|
|
19
|
+
sources: {
|
|
20
|
+
type: "array",
|
|
21
|
+
items: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
kind: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: `The type of datasource, options are "file", "url", "text" or the name of a plugin: ${plugins_1.Plugins.listPlugins()}
|
|
27
|
+
For files you must use the full relative path. For plugins you must use the name of the plugin associated with the data.
|
|
28
|
+
Always use a plugin as the kind, if a plugin name is in the url.
|
|
29
|
+
`,
|
|
30
|
+
},
|
|
31
|
+
data: {
|
|
32
|
+
type: "array",
|
|
33
|
+
items: {
|
|
34
|
+
type: "string",
|
|
35
|
+
},
|
|
36
|
+
description: "An array of strings that will be loaded when a language term is used in a user prompt. If the kind was a plugin, then we'll call the plugin with each string as input. Strings of the same kind should be grouped together in one array of data.",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ["kind", "data"],
|
|
40
|
+
},
|
|
41
|
+
description: "The sources to be loaded for the given term",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ["term"],
|
|
45
|
+
},
|
|
46
|
+
returns: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "The response from the human.",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "function",
|
|
54
|
+
function: {
|
|
55
|
+
name: "getAllLanguageTerms",
|
|
56
|
+
description: "Retrieves all language terms from the language configuration.",
|
|
57
|
+
parameters: {
|
|
58
|
+
type: "object",
|
|
59
|
+
positional: true,
|
|
60
|
+
properties: {},
|
|
61
|
+
required: [],
|
|
62
|
+
},
|
|
63
|
+
returns: {
|
|
64
|
+
type: "array",
|
|
65
|
+
items: {
|
|
66
|
+
type: "string",
|
|
67
|
+
},
|
|
68
|
+
description: "An array of all language terms in the configuration.",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "function",
|
|
74
|
+
function: {
|
|
75
|
+
name: "lookupLanguageTerm",
|
|
76
|
+
description: "Looks up a specific language term and calls the language plugin with it.",
|
|
77
|
+
parameters: {
|
|
78
|
+
type: "object",
|
|
79
|
+
positional: true,
|
|
80
|
+
properties: {
|
|
81
|
+
term: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "The language term to look up",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ["term"],
|
|
87
|
+
},
|
|
88
|
+
returns: {
|
|
89
|
+
type: "any",
|
|
90
|
+
description: "The result of calling the language plugin with the specified term.",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../../../src/agents/tools/language/definitions.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AACtC,QAAA,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,iBAAiB;YACvB,WAAW,EACT,4GAA4G;YAC9G,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,IAAI;gBAChB,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,wDAAwD;qBAC3D;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACV,IAAI,EAAE;oC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,4 @@
|
|
|
1
|
+
import { IDatasource } from "../../../types";
|
|
2
|
+
export declare function addLanguageTerm(term: string, sources: IDatasource[]): Promise<void>;
|
|
3
|
+
export declare function getAllLanguageTerms(): Promise<string[]>;
|
|
4
|
+
export declare function lookupLanguageTerm(term: string): Promise<string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lookupLanguageTerm = exports.getAllLanguageTerms = exports.addLanguageTerm = void 0;
|
|
4
|
+
const plugins_1 = require("../../../plugins/plugins");
|
|
5
|
+
const config_1 = require("../../../config");
|
|
6
|
+
async function addLanguageTerm(term, sources) {
|
|
7
|
+
const language = await (0, config_1.getLanguageConfig)();
|
|
8
|
+
language[term] = { sources };
|
|
9
|
+
await (0, config_1.updateLanguageConfig)(language);
|
|
10
|
+
}
|
|
11
|
+
exports.addLanguageTerm = addLanguageTerm;
|
|
12
|
+
async function getAllLanguageTerms() {
|
|
13
|
+
const language = await (0, config_1.getLanguageConfig)();
|
|
14
|
+
return Object.keys(language);
|
|
15
|
+
}
|
|
16
|
+
exports.getAllLanguageTerms = getAllLanguageTerms;
|
|
17
|
+
async function lookupLanguageTerm(term) {
|
|
18
|
+
const language = await (0, config_1.getLanguageConfig)();
|
|
19
|
+
return plugins_1.Plugins.call("language", term);
|
|
20
|
+
}
|
|
21
|
+
exports.lookupLanguageTerm = lookupLanguageTerm;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/agents/tools/language/index.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AACnD,4CAA0E;AAGnE,KAAK,UAAU,eAAe,CAAC,IAAY,EAAE,OAAsB;IACxE,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,GAAE,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC;IAC7B,MAAM,IAAA,6BAAoB,EAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AAJD,0CAIC;AAEM,KAAK,UAAU,mBAAmB;IACvC,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,GAAE,CAAC;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAHD,kDAGC;AAEM,KAAK,UAAU,kBAAkB,CAAC,IAAY;IACnD,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,GAAE,CAAC;IAC3C,OAAO,iBAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAHD,gDAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function lintFile(filePath: string): Promise<string>;
|