@tyvm/knowhow 0.0.158 → 0.0.160
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/package.json +2 -2
- package/ts_build/package.json +2 -2
- package/ts_build/src/chat/CliChatService.d.ts +2 -1
- package/ts_build/src/chat/CliChatService.js +29 -3
- package/ts_build/src/chat/CliChatService.js.map +1 -1
- package/ts_build/src/chat/modules/AgentModule.js +21 -17
- package/ts_build/src/chat/modules/AgentModule.js.map +1 -1
- package/ts_build/src/chat/renderer/ConsoleRenderer.js +32 -25
- package/ts_build/src/chat/renderer/ConsoleRenderer.js.map +1 -1
- package/ts_build/src/logger.d.ts +1 -0
- package/ts_build/src/logger.js +13 -1
- package/ts_build/src/logger.js.map +1 -1
- package/ts_build/src/utils/InputQueueManager.d.ts +8 -1
- package/ts_build/src/utils/InputQueueManager.js +72 -2
- package/ts_build/src/utils/InputQueueManager.js.map +1 -1
- package/ts_build/src/utils/index.d.ts +3 -1
- package/ts_build/src/utils/index.js +11 -3
- package/ts_build/src/utils/index.js.map +1 -1
- package/CONFIG.md +0 -429
- package/PROCESSING.md +0 -450
- package/WORKER.md +0 -260
- package/autodoc/README.md +0 -324
- package/autodoc/chat-guide.md +0 -444
- package/autodoc/cli-reference.md +0 -720
- package/autodoc/config-reference.md +0 -642
- package/autodoc/embeddings-guide.md +0 -467
- package/autodoc/generate-guide.md +0 -437
- package/autodoc/language-plugin-guide.md +0 -417
- package/autodoc/modules-guide.md +0 -379
- package/autodoc/plugins-guide.md +0 -721
- package/autodoc/quickstart-guide.md +0 -126
- package/autodoc/skills-guide.md +0 -584
- package/autodoc/worker-guide.md +0 -519
- package/docs/input-queue-manager.md +0 -142
- package/docs/multi-worker-management.md +0 -142
- package/docs/shell-commands.md +0 -174
- package/jest.config.js +0 -19
- package/jest.manual.config.js +0 -19
- package/scripts/README.md +0 -119
- package/scripts/build-for-node.sh +0 -148
- package/scripts/cache-miss-debug.ts +0 -365
- package/scripts/check-isolated-deps.sh +0 -69
- package/scripts/check-model-pricing.ts +0 -509
- package/scripts/compare-openrouter-coverage.ts +0 -576
- package/scripts/migrate-usage-json.js +0 -147
- package/scripts/publish.sh +0 -86
- package/scripts/restore_keys.sh +0 -59
- package/scripts/test-repetition-hint.ts +0 -302
- package/scripts/unset_keys.sh +0 -60
- package/src/agents/base/base.ts +0 -1963
- package/src/agents/base/prompt.ts +0 -55
- package/src/agents/configurable/ConfigAgent.ts +0 -24
- package/src/agents/developer/developer.ts +0 -76
- package/src/agents/historyRollback.ts +0 -36
- package/src/agents/index.ts +0 -52
- package/src/agents/interface.ts +0 -11
- package/src/agents/patcher/codebase.md +0 -27
- package/src/agents/patcher/patcher.ts +0 -131
- package/src/agents/researcher/researcher.ts +0 -115
- package/src/agents/setup/setup.ts +0 -63
- package/src/agents/tools/addInternalTools.ts +0 -21
- package/src/agents/tools/agentCall.ts +0 -34
- package/src/agents/tools/aiClient.ts +0 -178
- package/src/agents/tools/askHuman.ts +0 -10
- package/src/agents/tools/callPlugin.ts +0 -10
- package/src/agents/tools/connectAgent.ts +0 -355
- package/src/agents/tools/embeddingSearch.ts +0 -6
- package/src/agents/tools/execCommand.ts +0 -162
- package/src/agents/tools/fileSearch.ts +0 -35
- package/src/agents/tools/finalAnswer.ts +0 -4
- package/src/agents/tools/googleSearch.ts +0 -243
- package/src/agents/tools/index.ts +0 -33
- package/src/agents/tools/language/definitions.ts +0 -105
- package/src/agents/tools/language/index.ts +0 -20
- package/src/agents/tools/lazy/definitions.ts +0 -72
- package/src/agents/tools/lazy/disableTools.ts +0 -16
- package/src/agents/tools/lazy/enableTools.ts +0 -16
- package/src/agents/tools/lazy/index.ts +0 -3
- package/src/agents/tools/lazy/listAvailableTools.ts +0 -17
- package/src/agents/tools/lintFile.ts +0 -19
- package/src/agents/tools/list.ts +0 -739
- package/src/agents/tools/loadImageAsBase64.ts +0 -83
- package/src/agents/tools/loadWebpage.ts +0 -19
- package/src/agents/tools/mcp/connectMcpServer.ts +0 -40
- package/src/agents/tools/mcp/definitions.ts +0 -67
- package/src/agents/tools/mcp/disconnectMcpServer.ts +0 -40
- package/src/agents/tools/mcp/index.ts +0 -3
- package/src/agents/tools/mcp/listAvailableMcpServers.ts +0 -28
- package/src/agents/tools/minimal/callTool.ts +0 -45
- package/src/agents/tools/minimal/definitions.ts +0 -50
- package/src/agents/tools/minimal/index.ts +0 -3
- package/src/agents/tools/minimal/inspectTools.ts +0 -27
- package/src/agents/tools/modifyFile.ts +0 -53
- package/src/agents/tools/observe.ts +0 -247
- package/src/agents/tools/patch.ts +0 -1287
- package/src/agents/tools/readBlocks.ts +0 -83
- package/src/agents/tools/readFile.ts +0 -105
- package/src/agents/tools/replyToParent.ts +0 -123
- package/src/agents/tools/runGenerate.ts +0 -210
- package/src/agents/tools/scanFile.ts +0 -16
- package/src/agents/tools/sendAgentMessage.ts +0 -139
- package/src/agents/tools/skills.ts +0 -79
- package/src/agents/tools/startAgentTask.ts +0 -393
- package/src/agents/tools/stringReplace.ts +0 -105
- package/src/agents/tools/textSearch.ts +0 -128
- package/src/agents/tools/types/fileblock.ts +0 -5
- package/src/agents/tools/visionTool.ts +0 -35
- package/src/agents/tools/waitForAgentCompleted.ts +0 -270
- package/src/agents/tools/writeFile.ts +0 -106
- package/src/agents/tools/ycmd/client.ts +0 -608
- package/src/agents/tools/ycmd/definitions.ts +0 -294
- package/src/agents/tools/ycmd/detection.ts +0 -211
- package/src/agents/tools/ycmd/index.ts +0 -11
- package/src/agents/tools/ycmd/installer.ts +0 -251
- package/src/agents/tools/ycmd/server.ts +0 -545
- package/src/agents/tools/ycmd/serverManager.ts +0 -316
- package/src/agents/tools/ycmd/tools/completion.ts +0 -113
- package/src/agents/tools/ycmd/tools/diagnostics.ts +0 -166
- package/src/agents/tools/ycmd/tools/getLocations.ts +0 -173
- package/src/agents/tools/ycmd/tools/goto.ts +0 -169
- package/src/agents/tools/ycmd/tools/refactor.ts +0 -204
- package/src/agents/tools/ycmd/tools/signature.ts +0 -174
- package/src/agents/tools/ycmd/tools/start.ts +0 -95
- package/src/agents/tools/ycmd/utils/pathUtils.ts +0 -59
- package/src/ai.ts +0 -306
- package/src/auth/browserLogin.ts +0 -406
- package/src/auth/environmentAuth.ts +0 -51
- package/src/auth/errors.ts +0 -6
- package/src/auth/jwtStore.ts +0 -70
- package/src/auth/keyAuth.ts +0 -142
- package/src/auth/keyManager.ts +0 -331
- package/src/auth/registerIdentity.ts +0 -67
- package/src/auth/spinner.ts +0 -23
- package/src/chat/CliChatService.ts +0 -438
- package/src/chat/modules/AgentModule.ts +0 -1664
- package/src/chat/modules/AskModule.ts +0 -98
- package/src/chat/modules/BaseChatModule.ts +0 -65
- package/src/chat/modules/ClipboardImageModule.ts +0 -136
- package/src/chat/modules/CustomCommandsModule.ts +0 -80
- package/src/chat/modules/InternalChatModule.ts +0 -216
- package/src/chat/modules/RemoteSyncModule.ts +0 -482
- package/src/chat/modules/RendererModule.ts +0 -139
- package/src/chat/modules/SearchModule.ts +0 -168
- package/src/chat/modules/SessionsModule.ts +0 -969
- package/src/chat/modules/SetupModule.ts +0 -185
- package/src/chat/modules/ShellCommandModule.ts +0 -98
- package/src/chat/modules/SystemModule.ts +0 -161
- package/src/chat/modules/ToolCommandModule.ts +0 -102
- package/src/chat/modules/VoiceModule.ts +0 -70
- package/src/chat/modules/index.ts +0 -8
- package/src/chat/renderer/CompactRenderer.ts +0 -229
- package/src/chat/renderer/ConsoleRenderer.ts +0 -160
- package/src/chat/renderer/FancyRenderer.ts +0 -440
- package/src/chat/renderer/PlainRenderer.ts +0 -218
- package/src/chat/renderer/index.ts +0 -6
- package/src/chat/renderer/loadRenderer.ts +0 -316
- package/src/chat/renderer/messagesToRenderEvents.ts +0 -96
- package/src/chat/renderer/types.ts +0 -99
- package/src/chat/types.ts +0 -146
- package/src/chat.ts +0 -140
- package/src/cli.ts +0 -180
- package/src/clients/anthropic.ts +0 -772
- package/src/clients/attribution.ts +0 -53
- package/src/clients/cerebras.ts +0 -10
- package/src/clients/contextLimits.ts +0 -263
- package/src/clients/copilot.ts +0 -23
- package/src/clients/deepseek.ts +0 -16
- package/src/clients/fireworks.ts +0 -71
- package/src/clients/gemini.ts +0 -1169
- package/src/clients/github.ts +0 -16
- package/src/clients/groq.ts +0 -15
- package/src/clients/http.ts +0 -719
- package/src/clients/index.ts +0 -1153
- package/src/clients/knowhow.ts +0 -130
- package/src/clients/knowhowMcp.ts +0 -118
- package/src/clients/llama.ts +0 -16
- package/src/clients/meta.ts +0 -27
- package/src/clients/mistral.ts +0 -16
- package/src/clients/nvidia.ts +0 -16
- package/src/clients/openai.ts +0 -1186
- package/src/clients/openrouter.ts +0 -24
- package/src/clients/pricing/anthropic.ts +0 -149
- package/src/clients/pricing/cerebras.ts +0 -11
- package/src/clients/pricing/copilot.ts +0 -60
- package/src/clients/pricing/deepseek.ts +0 -15
- package/src/clients/pricing/fireworks.ts +0 -182
- package/src/clients/pricing/github.ts +0 -69
- package/src/clients/pricing/google.ts +0 -385
- package/src/clients/pricing/groq.ts +0 -56
- package/src/clients/pricing/index.ts +0 -44
- package/src/clients/pricing/llama.ts +0 -18
- package/src/clients/pricing/meta.ts +0 -12
- package/src/clients/pricing/mistral.ts +0 -34
- package/src/clients/pricing/models.ts +0 -25
- package/src/clients/pricing/nvidia.ts +0 -102
- package/src/clients/pricing/openai.ts +0 -409
- package/src/clients/pricing/openrouter.ts +0 -36
- package/src/clients/pricing/qwen.ts +0 -80
- package/src/clients/pricing/types.ts +0 -125
- package/src/clients/pricing/xai.ts +0 -137
- package/src/clients/qwen.ts +0 -16
- package/src/clients/responseMetadata.ts +0 -221
- package/src/clients/types.ts +0 -531
- package/src/clients/withRetry.ts +0 -89
- package/src/clients/xai.ts +0 -693
- package/src/cloudWorker.ts +0 -394
- package/src/commands/agent.ts +0 -342
- package/src/commands/agents.ts +0 -1037
- package/src/commands/behaviors.ts +0 -47
- package/src/commands/convert.ts +0 -291
- package/src/commands/hash.ts +0 -179
- package/src/commands/mcp.ts +0 -743
- package/src/commands/misc.ts +0 -373
- package/src/commands/modules.ts +0 -704
- package/src/commands/processes.ts +0 -248
- package/src/commands/remote.ts +0 -77
- package/src/commands/replay.ts +0 -503
- package/src/commands/sandbox.ts +0 -566
- package/src/commands/services.ts +0 -168
- package/src/commands/skills.ts +0 -107
- package/src/commands/workers.ts +0 -168
- package/src/config.ts +0 -468
- package/src/conversion.ts +0 -69
- package/src/dataset/diffs/README.md +0 -12
- package/src/dataset/diffs/debug-errors.ts +0 -29
- package/src/dataset/diffs/debug.ts +0 -64
- package/src/dataset/diffs/generate.ts +0 -71
- package/src/dataset/diffs/jsonl.ts +0 -53
- package/src/dataset/diffs/test.ts +0 -194
- package/src/embeddings.ts +0 -494
- package/src/fileSync.ts +0 -369
- package/src/generate.ts +0 -529
- package/src/hashes.ts +0 -180
- package/src/index.ts +0 -261
- package/src/logger.ts +0 -197
- package/src/login.ts +0 -209
- package/src/microphone.ts +0 -141
- package/src/migrations.ts +0 -151
- package/src/plugins/AgentsMdPlugin.ts +0 -118
- package/src/plugins/GitPlugin.ts +0 -598
- package/src/plugins/LinterPlugin.ts +0 -214
- package/src/plugins/PluginBase.ts +0 -70
- package/src/plugins/SkillsPlugin.ts +0 -37
- package/src/plugins/embedding.ts +0 -82
- package/src/plugins/exec.ts +0 -70
- package/src/plugins/language.ts +0 -290
- package/src/plugins/plugins.ts +0 -175
- package/src/plugins/tmux.ts +0 -132
- package/src/plugins/types.ts +0 -36
- package/src/plugins/url.ts +0 -101
- package/src/plugins/vim.ts +0 -89
- package/src/processes/ProcessManager.ts +0 -96
- package/src/processes/managedProcessShim.ts +0 -138
- package/src/processors/Base64ImageDetector.ts +0 -502
- package/src/processors/CustomVariables.ts +0 -693
- package/src/processors/GemmaToolProcessor.ts +0 -163
- package/src/processors/HarmonyToolProcessor.ts +0 -264
- package/src/processors/JsonCompressor.ts +0 -510
- package/src/processors/MinimalToolsMessageProcessor.ts +0 -113
- package/src/processors/TokenCompressor.ts +0 -620
- package/src/processors/ToolResponseCache.ts +0 -322
- package/src/processors/XmlToolCallProcessor.ts +0 -533
- package/src/processors/index.ts +0 -14
- package/src/processors/tools/boundedToolResponse.ts +0 -49
- package/src/processors/tools/grepToolResponse.ts +0 -230
- package/src/processors/tools/index.ts +0 -23
- package/src/processors/tools/jqToolResponse.ts +0 -159
- package/src/processors/tools/listStoredToolResponses.ts +0 -124
- package/src/processors/tools/tailToolResponse.ts +0 -148
- package/src/prompts/BasicCodeDocumenter.ts +0 -1
- package/src/prompts/BasicProjectDocumenter.ts +0 -1
- package/src/prompts/EmbeddingSeachHelper.ts +0 -1
- package/src/prompts/KnowhowConfigExamples.ts +0 -376
- package/src/prompts/index.ts +0 -9
- package/src/remotes.ts +0 -110
- package/src/server/index.ts +0 -16
- package/src/services/AgentService.ts +0 -134
- package/src/services/AgentSyncFs.ts +0 -775
- package/src/services/AgentSyncKnowhowWeb.ts +0 -389
- package/src/services/BehaviorsService.ts +0 -466
- package/src/services/DockerService.ts +0 -511
- package/src/services/EmbeddingService.ts +0 -427
- package/src/services/EmbeddingsService.ts +0 -73
- package/src/services/EventService.ts +0 -279
- package/src/services/ExtensionsService.ts +0 -25
- package/src/services/KnowhowClient.ts +0 -928
- package/src/services/LazyToolsService.ts +0 -210
- package/src/services/Mcp.ts +0 -727
- package/src/services/McpServer.ts +0 -155
- package/src/services/McpWebsocketTransport.ts +0 -87
- package/src/services/MediaProcessorService.ts +0 -669
- package/src/services/MessageProcessor.ts +0 -114
- package/src/services/MinimalToolsService.ts +0 -177
- package/src/services/RuntimeReloadService.ts +0 -31
- package/src/services/S3.ts +0 -61
- package/src/services/SessionManager.ts +0 -358
- package/src/services/SkillsService.ts +0 -822
- package/src/services/SyncedAgentWatcher.ts +0 -124
- package/src/services/SyncerService.ts +0 -191
- package/src/services/TaskRegistry.ts +0 -110
- package/src/services/Tools.ts +0 -580
- package/src/services/TracingService.ts +0 -116
- package/src/services/conversion/ConversionService.ts +0 -757
- package/src/services/conversion/index.ts +0 -2
- package/src/services/conversion/types.ts +0 -87
- package/src/services/flags.ts +0 -51
- package/src/services/index.ts +0 -117
- package/src/services/modules/computerUse.ts +0 -218
- package/src/services/modules/index.ts +0 -314
- package/src/services/modules/types.ts +0 -109
- package/src/services/types.ts +0 -60
- package/src/services/watchers/FsSyncer.ts +0 -199
- package/src/services/watchers/RemoteSyncer.ts +0 -196
- package/src/services/watchers/index.ts +0 -2
- package/src/tunnel.ts +0 -243
- package/src/types.ts +0 -282
- package/src/util/Trace.ts +0 -236
- package/src/utils/InputQueueManager.ts +0 -493
- package/src/utils/errors.ts +0 -0
- package/src/utils/http.ts +0 -150
- package/src/utils/index.ts +0 -111
- package/src/worker.ts +0 -696
- package/src/workerRegistry.ts +0 -152
- package/src/workers/auth/PasskeySetup.ts +0 -181
- package/src/workers/auth/WorkerPasskeyAuth.ts +0 -190
- package/src/workers/auth/WsMiddleware.ts +0 -99
- package/src/workers/auth/authMiddleware.ts +0 -104
- package/src/workers/auth/types.ts +0 -70
- package/src/workers/tools/getChallenge.ts +0 -33
- package/src/workers/tools/index.ts +0 -20
- package/src/workers/tools/listAllowedPorts.ts +0 -30
- package/src/workers/tools/lock.ts +0 -31
- package/src/workers/tools/reloadConfig.ts +0 -84
- package/src/workers/tools/unlock.ts +0 -116
- package/tests/XmlToolCallProcessor.test.ts +0 -468
- package/tests/agents/interrupt.test.ts +0 -200
- package/tests/agents/observe-base.test.ts +0 -183
- package/tests/agents/tools/connectAgent.test.ts +0 -138
- package/tests/agents/tools/observe.test.ts +0 -179
- package/tests/agents/tools/readFile.test.ts +0 -88
- package/tests/agents/tools/replyToParent.test.ts +0 -125
- package/tests/agents/tools/sendAgentMessage.test.ts +0 -99
- package/tests/agents/tools/waitForAgentCompleted.test.ts +0 -147
- package/tests/chat/detach-attach-rendering.test.ts +0 -315
- package/tests/clients/AIClient.test.ts +0 -668
- package/tests/clients/anthropic.test.ts +0 -202
- package/tests/clients/contextLimits.test.ts +0 -97
- package/tests/clients/fireworks.test.ts +0 -65
- package/tests/clients/openai.images.test.ts +0 -105
- package/tests/clients/pricing.test.ts +0 -206
- package/tests/clients/reasoningEffort.test.ts +0 -140
- package/tests/compressor/bigstring.test.ts +0 -450
- package/tests/compressor/bigstring.txt +0 -1
- package/tests/compressor/githubjson.txt +0 -1
- package/tests/compressor/toolResponseCache.test.ts +0 -304
- package/tests/compressor/usageBase64.json +0 -159
- package/tests/compressor/usageBase64.test.ts +0 -175
- package/tests/fixtures/fake-secret.txt +0 -1
- package/tests/manual/agent-events/run-test.ts +0 -203
- package/tests/manual/browser-login/README.md +0 -189
- package/tests/manual/browser-login/test_browser_login_basic.ts +0 -115
- package/tests/manual/browser-login/test_cli_integration.ts +0 -169
- package/tests/manual/browser-login/test_cross_platform_browser.ts +0 -186
- package/tests/manual/browser-login/test_error_scenarios.ts +0 -223
- package/tests/manual/cli/no-env.sh +0 -274
- package/tests/manual/clients/completions.json +0 -1151
- package/tests/manual/clients/completions.test.ts +0 -198
- package/tests/manual/file-edits/figma.test.ts +0 -3
- package/tests/manual/file-edits/fileblocks/readwrite.test.ts +0 -100
- package/tests/manual/file-edits/patching/input.txt +0 -145
- package/tests/manual/file-edits/patching/output.txt +0 -145
- package/tests/manual/file-edits/patching/patch.txt +0 -15
- package/tests/manual/file-edits/patching/unseen.txt +0 -80
- package/tests/manual/file-edits/patching.test.ts +0 -139
- package/tests/manual/modalities/README.md +0 -157
- package/tests/manual/modalities/google.modalities.test.ts +0 -335
- package/tests/manual/modalities/openai.modalities.test.ts +0 -329
- package/tests/manual/modalities/streaming.test.ts +0 -260
- package/tests/manual/modalities/xai.modalities.test.ts +0 -294
- package/tests/manual/test-concurrent-ask.ts +0 -43
- package/tests/manual/ycmd/debug_diagnostics_test.ts +0 -127
- package/tests/manual/ycmd/fixtures/debug_diagnostics.ts +0 -26
- package/tests/manual/ycmd/fixtures/file_change_test.ts +0 -17
- package/tests/manual/ycmd/minimal_advanced_test.ts +0 -108
- package/tests/manual/ycmd/simple_diagnostics_test.ts +0 -61
- package/tests/manual/ycmd/simple_test.ts +0 -74
- package/tests/manual/ycmd/test-typescript-sample.ts +0 -34
- package/tests/manual/ycmd/test_advanced_features.ts +0 -407
- package/tests/manual/ycmd/test_advanced_with_tools.ts +0 -320
- package/tests/manual/ycmd/test_comprehensive_typescript.ts +0 -179
- package/tests/manual/ycmd/test_diagnostics_file_changes.ts +0 -249
- package/tests/manual/ycmd/test_diagnostics_fix.ts +0 -99
- package/tests/manual/ycmd/test_diagnostics_simple.ts +0 -100
- package/tests/manual/ycmd/test_diagnostics_timing.ts +0 -120
- package/tests/manual/ycmd/test_discover_commands.ts +0 -310
- package/tests/manual/ycmd/test_endpoints.ts +0 -115
- package/tests/manual/ycmd/test_final_comprehensive.ts +0 -218
- package/tests/manual/ycmd/test_final_validation.ts +0 -150
- package/tests/manual/ycmd/test_implementation.js +0 -42
- package/tests/manual/ycmd/test_individual_ycmd_tool.ts +0 -39
- package/tests/manual/ycmd/test_server_manager.ts +0 -52
- package/tests/manual/ycmd/test_simple_debug.ts +0 -86
- package/tests/manual/ycmd/test_tsserver_workflow.js +0 -83
- package/tests/manual/ycmd/test_tsserver_workflow.ts +0 -122
- package/tests/manual/ycmd/test_typescript_simple.ts +0 -48
- package/tests/manual/ycmd/test_typescript_ycmd.ts +0 -105
- package/tests/manual/ycmd/test_workspace_config.ts +0 -90
- package/tests/manual/ycmd/test_ycmd_auto_start.ts +0 -137
- package/tests/manual/ycmd/test_ycmd_comprehensive.ts +0 -73
- package/tests/manual/ycmd/test_ycmd_connection.py +0 -10
- package/tests/manual/ycmd/test_ycmd_direct.ts +0 -142
- package/tests/manual/ycmd/test_ycmd_experiment.ts +0 -48
- package/tests/manual/ycmd/test_ycmd_final.ts +0 -200
- package/tests/manual/ycmd/test_ycmd_fixed.py +0 -18
- package/tests/manual/ycmd/test_ycmd_integration.ts +0 -112
- package/tests/manual/ycmd/test_ycmd_simple.ts +0 -45
- package/tests/manual/ycmd/test_ycmd_usage.py +0 -27
- package/tests/manual/ycmd/working_simple_test.ts +0 -134
- package/tests/patching/corrupted.test.ts +0 -78
- package/tests/patching/fixtures/transcript-mangles/agent-sync-fs-nested-catch.json +0 -9
- package/tests/patching/fixtures/transcript-mangles/automation-functions-crossed.json +0 -9
- package/tests/patching/fixtures/transcript-mangles/fruit-ninja-confirmed-retirement.json +0 -8
- package/tests/patching/imports.patch.txt +0 -11
- package/tests/patching/imports.test.ts +0 -43
- package/tests/patching/imports.txt +0 -11
- package/tests/patching/interface.patch.txt +0 -15
- package/tests/patching/interface.txt +0 -7
- package/tests/patching/patchFileOutput.test.ts +0 -328
- package/tests/patching/regression-2026.test.ts +0 -752
- package/tests/patching/transcriptMangleRegression.test.ts +0 -125
- package/tests/plugins/language/languagePlugin-content-triggers.test.ts +0 -346
- package/tests/plugins/language/languagePlugin-integration.test.ts +0 -471
- package/tests/plugins/language/languagePlugin.test.ts +0 -385
- package/tests/processes/managedProcessShim.test.ts +0 -59
- package/tests/processors/Base64ImageDetector.test.ts +0 -979
- package/tests/processors/CustomVariables.test.ts +0 -981
- package/tests/processors/CustomVariablesBenchmark.test.ts +0 -237
- package/tests/processors/HarmonyToolProcessor.test.ts +0 -490
- package/tests/processors/TokenCompressor.test.ts +0 -674
- package/tests/processors/ToolResponseCache.test.ts +0 -864
- package/tests/processors/tools/boundedRetrievalTools.test.ts +0 -68
- package/tests/processors/tools/grepToolResponse.test.ts +0 -159
- package/tests/services/ConversionService.test.ts +0 -154
- package/tests/services/DockerService.test.ts +0 -24
- package/tests/services/Tools.test.ts +0 -1738
- package/tests/services/ToolsService.setFunction.test.ts +0 -68
- package/tests/services/WorkerReloadConfig.test.ts +0 -141
- package/tests/test.spec.ts +0 -163
- package/tests/unit/InputQueueManager.test.ts +0 -174
- package/tests/unit/McpWebsocketTransport.test.ts +0 -56
- package/tests/unit/agents/historyRollback.test.ts +0 -53
- package/tests/unit/agents/tools/loadImageAsBase64.test.ts +0 -44
- package/tests/unit/auth/jwtStore.test.ts +0 -55
- package/tests/unit/auth/keyAuth.test.ts +0 -152
- package/tests/unit/auth/keyManager.test.ts +0 -130
- package/tests/unit/auth/registerIdentity.test.ts +0 -99
- package/tests/unit/chat/ToolCommandModule.test.ts +0 -71
- package/tests/unit/chat/historyCommandArgs.test.ts +0 -37
- package/tests/unit/clients/AIClient.test.ts +0 -454
- package/tests/unit/clients/anthropic.responseMetadata.test.ts +0 -81
- package/tests/unit/clients/attribution.test.ts +0 -185
- package/tests/unit/clients/http.responseMetadata.test.ts +0 -86
- package/tests/unit/clients/openai.responseMetadata.test.ts +0 -90
- package/tests/unit/clients/responseMetadata.test.ts +0 -123
- package/tests/unit/clients/withRetry.test.ts +0 -319
- package/tests/unit/commands/agents.test.ts +0 -111
- package/tests/unit/commands/github-credentials.test.ts +0 -210
- package/tests/unit/commands/misc.test.ts +0 -85
- package/tests/unit/commands/remote.test.ts +0 -79
- package/tests/unit/commands/sandbox.test.ts +0 -350
- package/tests/unit/hashes.test.ts +0 -23
- package/tests/unit/input-queue.test.ts +0 -80
- package/tests/unit/login.test.ts +0 -218
- package/tests/unit/modules/moduleLoading.test.ts +0 -305
- package/tests/unit/plugins/pluginLoading.test.ts +0 -97
- package/tests/unit/services/AgentSyncKnowhowWeb.test.ts +0 -38
- package/tests/unit/services/KnowhowClient.test.ts +0 -84
- package/tests/unit/services/LazyToolsService.test.ts +0 -53
- package/tests/unit/services/Mcp.test.ts +0 -56
- package/tests/unit/services/MinimalToolsService.test.ts +0 -424
- package/tests/unit/services/RuntimeReloadService.test.ts +0 -29
- package/tests/unit/services/SessionManager.test.ts +0 -43
- package/tests/unit/services/SyncedAgentWatcher.test.ts +0 -89
- package/tests/unit/services/SyncerService.test.ts +0 -45
- package/tests/unit/tunnel.test.ts +0 -51
- package/tests/unit/util/Trace.test.ts +0 -119
- package/tests/unit/utils/http.test.ts +0 -43
- package/ts_build/tests/XmlToolCallProcessor.test.d.ts +0 -1
- package/ts_build/tests/XmlToolCallProcessor.test.js +0 -376
- package/ts_build/tests/XmlToolCallProcessor.test.js.map +0 -1
- package/ts_build/tests/agents/interrupt.test.d.ts +0 -14
- package/ts_build/tests/agents/interrupt.test.js +0 -136
- package/ts_build/tests/agents/interrupt.test.js.map +0 -1
- package/ts_build/tests/agents/observe-base.test.d.ts +0 -1
- package/ts_build/tests/agents/observe-base.test.js +0 -149
- package/ts_build/tests/agents/observe-base.test.js.map +0 -1
- package/ts_build/tests/agents/tools/connectAgent.test.d.ts +0 -1
- package/ts_build/tests/agents/tools/connectAgent.test.js +0 -142
- package/ts_build/tests/agents/tools/connectAgent.test.js.map +0 -1
- package/ts_build/tests/agents/tools/observe.test.d.ts +0 -1
- package/ts_build/tests/agents/tools/observe.test.js +0 -148
- package/ts_build/tests/agents/tools/observe.test.js.map +0 -1
- package/ts_build/tests/agents/tools/readFile.test.d.ts +0 -1
- package/ts_build/tests/agents/tools/readFile.test.js +0 -90
- package/ts_build/tests/agents/tools/readFile.test.js.map +0 -1
- package/ts_build/tests/agents/tools/replyToParent.test.d.ts +0 -1
- package/ts_build/tests/agents/tools/replyToParent.test.js +0 -116
- package/ts_build/tests/agents/tools/replyToParent.test.js.map +0 -1
- package/ts_build/tests/agents/tools/sendAgentMessage.test.d.ts +0 -1
- package/ts_build/tests/agents/tools/sendAgentMessage.test.js +0 -112
- package/ts_build/tests/agents/tools/sendAgentMessage.test.js.map +0 -1
- package/ts_build/tests/agents/tools/waitForAgentCompleted.test.d.ts +0 -1
- package/ts_build/tests/agents/tools/waitForAgentCompleted.test.js +0 -147
- package/ts_build/tests/agents/tools/waitForAgentCompleted.test.js.map +0 -1
- package/ts_build/tests/chat/detach-attach-rendering.test.d.ts +0 -1
- package/ts_build/tests/chat/detach-attach-rendering.test.js +0 -168
- package/ts_build/tests/chat/detach-attach-rendering.test.js.map +0 -1
- package/ts_build/tests/clients/AIClient.test.d.ts +0 -1
- package/ts_build/tests/clients/AIClient.test.js +0 -483
- package/ts_build/tests/clients/AIClient.test.js.map +0 -1
- package/ts_build/tests/clients/anthropic.test.d.ts +0 -1
- package/ts_build/tests/clients/anthropic.test.js +0 -159
- package/ts_build/tests/clients/anthropic.test.js.map +0 -1
- package/ts_build/tests/clients/contextLimits.test.d.ts +0 -1
- package/ts_build/tests/clients/contextLimits.test.js +0 -69
- package/ts_build/tests/clients/contextLimits.test.js.map +0 -1
- package/ts_build/tests/clients/fireworks.test.d.ts +0 -1
- package/ts_build/tests/clients/fireworks.test.js +0 -65
- package/ts_build/tests/clients/fireworks.test.js.map +0 -1
- package/ts_build/tests/clients/openai.images.test.d.ts +0 -1
- package/ts_build/tests/clients/openai.images.test.js +0 -94
- package/ts_build/tests/clients/openai.images.test.js.map +0 -1
- package/ts_build/tests/clients/pricing.test.d.ts +0 -1
- package/ts_build/tests/clients/pricing.test.js +0 -124
- package/ts_build/tests/clients/pricing.test.js.map +0 -1
- package/ts_build/tests/clients/reasoningEffort.test.d.ts +0 -1
- package/ts_build/tests/clients/reasoningEffort.test.js +0 -116
- package/ts_build/tests/clients/reasoningEffort.test.js.map +0 -1
- package/ts_build/tests/compressor/bigstring.test.d.ts +0 -1
- package/ts_build/tests/compressor/bigstring.test.js +0 -275
- package/ts_build/tests/compressor/bigstring.test.js.map +0 -1
- package/ts_build/tests/compressor/toolResponseCache.test.d.ts +0 -1
- package/ts_build/tests/compressor/toolResponseCache.test.js +0 -250
- package/ts_build/tests/compressor/toolResponseCache.test.js.map +0 -1
- package/ts_build/tests/compressor/usageBase64.test.d.ts +0 -1
- package/ts_build/tests/compressor/usageBase64.test.js +0 -109
- package/ts_build/tests/compressor/usageBase64.test.js.map +0 -1
- package/ts_build/tests/manual/agent-events/run-test.d.ts +0 -2
- package/ts_build/tests/manual/agent-events/run-test.js +0 -148
- package/ts_build/tests/manual/agent-events/run-test.js.map +0 -1
- package/ts_build/tests/manual/browser-login/test_browser_login_basic.d.ts +0 -2
- package/ts_build/tests/manual/browser-login/test_browser_login_basic.js +0 -118
- package/ts_build/tests/manual/browser-login/test_browser_login_basic.js.map +0 -1
- package/ts_build/tests/manual/browser-login/test_cli_integration.d.ts +0 -2
- package/ts_build/tests/manual/browser-login/test_cli_integration.js +0 -163
- package/ts_build/tests/manual/browser-login/test_cli_integration.js.map +0 -1
- package/ts_build/tests/manual/browser-login/test_cross_platform_browser.d.ts +0 -2
- package/ts_build/tests/manual/browser-login/test_cross_platform_browser.js +0 -169
- package/ts_build/tests/manual/browser-login/test_cross_platform_browser.js.map +0 -1
- package/ts_build/tests/manual/browser-login/test_error_scenarios.d.ts +0 -2
- package/ts_build/tests/manual/browser-login/test_error_scenarios.js +0 -207
- package/ts_build/tests/manual/browser-login/test_error_scenarios.js.map +0 -1
- package/ts_build/tests/manual/clients/completions.test.d.ts +0 -1
- package/ts_build/tests/manual/clients/completions.test.js +0 -151
- package/ts_build/tests/manual/clients/completions.test.js.map +0 -1
- package/ts_build/tests/manual/file-edits/figma.test.d.ts +0 -0
- package/ts_build/tests/manual/file-edits/figma.test.js +0 -2
- package/ts_build/tests/manual/file-edits/figma.test.js.map +0 -1
- package/ts_build/tests/manual/file-edits/fileblocks/readwrite.test.d.ts +0 -1
- package/ts_build/tests/manual/file-edits/fileblocks/readwrite.test.js +0 -110
- package/ts_build/tests/manual/file-edits/fileblocks/readwrite.test.js.map +0 -1
- package/ts_build/tests/manual/file-edits/patching.test.d.ts +0 -1
- package/ts_build/tests/manual/file-edits/patching.test.js +0 -129
- package/ts_build/tests/manual/file-edits/patching.test.js.map +0 -1
- package/ts_build/tests/manual/modalities/google.modalities.test.d.ts +0 -1
- package/ts_build/tests/manual/modalities/google.modalities.test.js +0 -262
- package/ts_build/tests/manual/modalities/google.modalities.test.js.map +0 -1
- package/ts_build/tests/manual/modalities/openai.modalities.test.d.ts +0 -1
- package/ts_build/tests/manual/modalities/openai.modalities.test.js +0 -262
- package/ts_build/tests/manual/modalities/openai.modalities.test.js.map +0 -1
- package/ts_build/tests/manual/modalities/streaming.test.d.ts +0 -1
- package/ts_build/tests/manual/modalities/streaming.test.js +0 -216
- package/ts_build/tests/manual/modalities/streaming.test.js.map +0 -1
- package/ts_build/tests/manual/modalities/xai.modalities.test.d.ts +0 -1
- package/ts_build/tests/manual/modalities/xai.modalities.test.js +0 -219
- package/ts_build/tests/manual/modalities/xai.modalities.test.js.map +0 -1
- package/ts_build/tests/manual/test-concurrent-ask.d.ts +0 -1
- package/ts_build/tests/manual/test-concurrent-ask.js +0 -22
- package/ts_build/tests/manual/test-concurrent-ask.js.map +0 -1
- package/ts_build/tests/manual/ycmd/debug_diagnostics_test.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/debug_diagnostics_test.js +0 -124
- package/ts_build/tests/manual/ycmd/debug_diagnostics_test.js.map +0 -1
- package/ts_build/tests/manual/ycmd/minimal_advanced_test.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/minimal_advanced_test.js +0 -114
- package/ts_build/tests/manual/ycmd/minimal_advanced_test.js.map +0 -1
- package/ts_build/tests/manual/ycmd/simple_diagnostics_test.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/simple_diagnostics_test.js +0 -84
- package/ts_build/tests/manual/ycmd/simple_diagnostics_test.js.map +0 -1
- package/ts_build/tests/manual/ycmd/simple_test.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/simple_test.js +0 -92
- package/ts_build/tests/manual/ycmd/simple_test.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test-typescript-sample.d.ts +0 -14
- package/ts_build/tests/manual/ycmd/test-typescript-sample.js +0 -20
- package/ts_build/tests/manual/ycmd/test-typescript-sample.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_advanced_features.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_advanced_features.js +0 -306
- package/ts_build/tests/manual/ycmd/test_advanced_features.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_advanced_with_tools.d.ts +0 -3
- package/ts_build/tests/manual/ycmd/test_advanced_with_tools.js +0 -271
- package/ts_build/tests/manual/ycmd/test_advanced_with_tools.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_comprehensive_typescript.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_comprehensive_typescript.js +0 -196
- package/ts_build/tests/manual/ycmd/test_comprehensive_typescript.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_diagnostics_file_changes.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_diagnostics_file_changes.js +0 -184
- package/ts_build/tests/manual/ycmd/test_diagnostics_file_changes.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_diagnostics_fix.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_diagnostics_fix.js +0 -116
- package/ts_build/tests/manual/ycmd/test_diagnostics_fix.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_diagnostics_simple.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_diagnostics_simple.js +0 -114
- package/ts_build/tests/manual/ycmd/test_diagnostics_simple.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_diagnostics_timing.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_diagnostics_timing.js +0 -129
- package/ts_build/tests/manual/ycmd/test_diagnostics_timing.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_discover_commands.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_discover_commands.js +0 -252
- package/ts_build/tests/manual/ycmd/test_discover_commands.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_endpoints.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_endpoints.js +0 -130
- package/ts_build/tests/manual/ycmd/test_endpoints.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_final_comprehensive.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_final_comprehensive.js +0 -231
- package/ts_build/tests/manual/ycmd/test_final_comprehensive.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_final_validation.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_final_validation.js +0 -170
- package/ts_build/tests/manual/ycmd/test_final_validation.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_individual_ycmd_tool.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_individual_ycmd_tool.js +0 -37
- package/ts_build/tests/manual/ycmd/test_individual_ycmd_tool.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_server_manager.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_server_manager.js +0 -38
- package/ts_build/tests/manual/ycmd/test_server_manager.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_simple_debug.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_simple_debug.js +0 -109
- package/ts_build/tests/manual/ycmd/test_simple_debug.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_tsserver_workflow.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_tsserver_workflow.js +0 -138
- package/ts_build/tests/manual/ycmd/test_tsserver_workflow.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_typescript_simple.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_typescript_simple.js +0 -76
- package/ts_build/tests/manual/ycmd/test_typescript_simple.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_typescript_ycmd.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_typescript_ycmd.js +0 -115
- package/ts_build/tests/manual/ycmd/test_typescript_ycmd.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_workspace_config.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_workspace_config.js +0 -99
- package/ts_build/tests/manual/ycmd/test_workspace_config.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_auto_start.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_ycmd_auto_start.js +0 -140
- package/ts_build/tests/manual/ycmd/test_ycmd_auto_start.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_comprehensive.d.ts +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_comprehensive.js +0 -93
- package/ts_build/tests/manual/ycmd/test_ycmd_comprehensive.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_direct.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_ycmd_direct.js +0 -159
- package/ts_build/tests/manual/ycmd/test_ycmd_direct.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_experiment.d.ts +0 -15
- package/ts_build/tests/manual/ycmd/test_ycmd_experiment.js +0 -68
- package/ts_build/tests/manual/ycmd/test_ycmd_experiment.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_final.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_ycmd_final.js +0 -205
- package/ts_build/tests/manual/ycmd/test_ycmd_final.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_integration.d.ts +0 -3
- package/ts_build/tests/manual/ycmd/test_ycmd_integration.js +0 -119
- package/ts_build/tests/manual/ycmd/test_ycmd_integration.js.map +0 -1
- package/ts_build/tests/manual/ycmd/test_ycmd_simple.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/test_ycmd_simple.js +0 -36
- package/ts_build/tests/manual/ycmd/test_ycmd_simple.js.map +0 -1
- package/ts_build/tests/manual/ycmd/working_simple_test.d.ts +0 -2
- package/ts_build/tests/manual/ycmd/working_simple_test.js +0 -144
- package/ts_build/tests/manual/ycmd/working_simple_test.js.map +0 -1
- package/ts_build/tests/patching/corrupted.test.d.ts +0 -1
- package/ts_build/tests/patching/corrupted.test.js +0 -53
- package/ts_build/tests/patching/corrupted.test.js.map +0 -1
- package/ts_build/tests/patching/imports.test.d.ts +0 -1
- package/ts_build/tests/patching/imports.test.js +0 -71
- package/ts_build/tests/patching/imports.test.js.map +0 -1
- package/ts_build/tests/patching/patchFileOutput.test.d.ts +0 -1
- package/ts_build/tests/patching/patchFileOutput.test.js +0 -269
- package/ts_build/tests/patching/patchFileOutput.test.js.map +0 -1
- package/ts_build/tests/patching/regression-2026.test.d.ts +0 -1
- package/ts_build/tests/patching/regression-2026.test.js +0 -528
- package/ts_build/tests/patching/regression-2026.test.js.map +0 -1
- package/ts_build/tests/patching/transcriptMangleRegression.test.d.ts +0 -1
- package/ts_build/tests/patching/transcriptMangleRegression.test.js +0 -104
- package/ts_build/tests/patching/transcriptMangleRegression.test.js.map +0 -1
- package/ts_build/tests/plugins/language/languagePlugin-content-triggers.test.d.ts +0 -1
- package/ts_build/tests/plugins/language/languagePlugin-content-triggers.test.js +0 -294
- package/ts_build/tests/plugins/language/languagePlugin-content-triggers.test.js.map +0 -1
- package/ts_build/tests/plugins/language/languagePlugin-integration.test.d.ts +0 -1
- package/ts_build/tests/plugins/language/languagePlugin-integration.test.js +0 -343
- package/ts_build/tests/plugins/language/languagePlugin-integration.test.js.map +0 -1
- package/ts_build/tests/plugins/language/languagePlugin.test.d.ts +0 -1
- package/ts_build/tests/plugins/language/languagePlugin.test.js +0 -315
- package/ts_build/tests/plugins/language/languagePlugin.test.js.map +0 -1
- package/ts_build/tests/processes/managedProcessShim.test.d.ts +0 -1
- package/ts_build/tests/processes/managedProcessShim.test.js +0 -92
- package/ts_build/tests/processes/managedProcessShim.test.js.map +0 -1
- package/ts_build/tests/processors/Base64ImageDetector.test.d.ts +0 -1
- package/ts_build/tests/processors/Base64ImageDetector.test.js +0 -792
- package/ts_build/tests/processors/Base64ImageDetector.test.js.map +0 -1
- package/ts_build/tests/processors/CustomVariables.test.d.ts +0 -1
- package/ts_build/tests/processors/CustomVariables.test.js +0 -764
- package/ts_build/tests/processors/CustomVariables.test.js.map +0 -1
- package/ts_build/tests/processors/CustomVariablesBenchmark.test.d.ts +0 -1
- package/ts_build/tests/processors/CustomVariablesBenchmark.test.js +0 -179
- package/ts_build/tests/processors/CustomVariablesBenchmark.test.js.map +0 -1
- package/ts_build/tests/processors/HarmonyToolProcessor.test.d.ts +0 -1
- package/ts_build/tests/processors/HarmonyToolProcessor.test.js +0 -382
- package/ts_build/tests/processors/HarmonyToolProcessor.test.js.map +0 -1
- package/ts_build/tests/processors/TokenCompressor.test.d.ts +0 -1
- package/ts_build/tests/processors/TokenCompressor.test.js +0 -473
- package/ts_build/tests/processors/TokenCompressor.test.js.map +0 -1
- package/ts_build/tests/processors/ToolResponseCache.test.d.ts +0 -1
- package/ts_build/tests/processors/ToolResponseCache.test.js +0 -657
- package/ts_build/tests/processors/ToolResponseCache.test.js.map +0 -1
- package/ts_build/tests/processors/tools/boundedRetrievalTools.test.d.ts +0 -1
- package/ts_build/tests/processors/tools/boundedRetrievalTools.test.js +0 -57
- package/ts_build/tests/processors/tools/boundedRetrievalTools.test.js.map +0 -1
- package/ts_build/tests/processors/tools/grepToolResponse.test.d.ts +0 -1
- package/ts_build/tests/processors/tools/grepToolResponse.test.js +0 -77
- package/ts_build/tests/processors/tools/grepToolResponse.test.js.map +0 -1
- package/ts_build/tests/services/ConversionService.test.d.ts +0 -1
- package/ts_build/tests/services/ConversionService.test.js +0 -154
- package/ts_build/tests/services/ConversionService.test.js.map +0 -1
- package/ts_build/tests/services/DockerService.test.d.ts +0 -1
- package/ts_build/tests/services/DockerService.test.js +0 -22
- package/ts_build/tests/services/DockerService.test.js.map +0 -1
- package/ts_build/tests/services/Tools.test.d.ts +0 -1
- package/ts_build/tests/services/Tools.test.js +0 -1365
- package/ts_build/tests/services/Tools.test.js.map +0 -1
- package/ts_build/tests/services/ToolsService.setFunction.test.d.ts +0 -1
- package/ts_build/tests/services/ToolsService.setFunction.test.js +0 -51
- package/ts_build/tests/services/ToolsService.setFunction.test.js.map +0 -1
- package/ts_build/tests/services/WorkerReloadConfig.test.d.ts +0 -1
- package/ts_build/tests/services/WorkerReloadConfig.test.js +0 -86
- package/ts_build/tests/services/WorkerReloadConfig.test.js.map +0 -1
- package/ts_build/tests/test.spec.d.ts +0 -1
- package/ts_build/tests/test.spec.js +0 -139
- package/ts_build/tests/test.spec.js.map +0 -1
- package/ts_build/tests/unit/InputQueueManager.test.d.ts +0 -1
- package/ts_build/tests/unit/InputQueueManager.test.js +0 -104
- package/ts_build/tests/unit/InputQueueManager.test.js.map +0 -1
- package/ts_build/tests/unit/McpWebsocketTransport.test.d.ts +0 -1
- package/ts_build/tests/unit/McpWebsocketTransport.test.js +0 -47
- package/ts_build/tests/unit/McpWebsocketTransport.test.js.map +0 -1
- package/ts_build/tests/unit/agents/historyRollback.test.d.ts +0 -1
- package/ts_build/tests/unit/agents/historyRollback.test.js +0 -42
- package/ts_build/tests/unit/agents/historyRollback.test.js.map +0 -1
- package/ts_build/tests/unit/agents/tools/loadImageAsBase64.test.d.ts +0 -1
- package/ts_build/tests/unit/agents/tools/loadImageAsBase64.test.js +0 -67
- package/ts_build/tests/unit/agents/tools/loadImageAsBase64.test.js.map +0 -1
- package/ts_build/tests/unit/auth/jwtStore.test.d.ts +0 -1
- package/ts_build/tests/unit/auth/jwtStore.test.js +0 -46
- package/ts_build/tests/unit/auth/jwtStore.test.js.map +0 -1
- package/ts_build/tests/unit/auth/keyAuth.test.d.ts +0 -1
- package/ts_build/tests/unit/auth/keyAuth.test.js +0 -118
- package/ts_build/tests/unit/auth/keyAuth.test.js.map +0 -1
- package/ts_build/tests/unit/auth/keyManager.test.d.ts +0 -1
- package/ts_build/tests/unit/auth/keyManager.test.js +0 -96
- package/ts_build/tests/unit/auth/keyManager.test.js.map +0 -1
- package/ts_build/tests/unit/auth/registerIdentity.test.d.ts +0 -1
- package/ts_build/tests/unit/auth/registerIdentity.test.js +0 -92
- package/ts_build/tests/unit/auth/registerIdentity.test.js.map +0 -1
- package/ts_build/tests/unit/chat/ToolCommandModule.test.d.ts +0 -1
- package/ts_build/tests/unit/chat/ToolCommandModule.test.js +0 -61
- package/ts_build/tests/unit/chat/ToolCommandModule.test.js.map +0 -1
- package/ts_build/tests/unit/chat/historyCommandArgs.test.d.ts +0 -1
- package/ts_build/tests/unit/chat/historyCommandArgs.test.js +0 -29
- package/ts_build/tests/unit/chat/historyCommandArgs.test.js.map +0 -1
- package/ts_build/tests/unit/clients/AIClient.test.d.ts +0 -1
- package/ts_build/tests/unit/clients/AIClient.test.js +0 -342
- package/ts_build/tests/unit/clients/AIClient.test.js.map +0 -1
- package/ts_build/tests/unit/clients/anthropic.responseMetadata.test.d.ts +0 -1
- package/ts_build/tests/unit/clients/anthropic.responseMetadata.test.js +0 -77
- package/ts_build/tests/unit/clients/anthropic.responseMetadata.test.js.map +0 -1
- package/ts_build/tests/unit/clients/attribution.test.d.ts +0 -1
- package/ts_build/tests/unit/clients/attribution.test.js +0 -153
- package/ts_build/tests/unit/clients/attribution.test.js.map +0 -1
- package/ts_build/tests/unit/clients/http.responseMetadata.test.d.ts +0 -1
- package/ts_build/tests/unit/clients/http.responseMetadata.test.js +0 -77
- package/ts_build/tests/unit/clients/http.responseMetadata.test.js.map +0 -1
- package/ts_build/tests/unit/clients/openai.responseMetadata.test.d.ts +0 -1
- package/ts_build/tests/unit/clients/openai.responseMetadata.test.js +0 -86
- package/ts_build/tests/unit/clients/openai.responseMetadata.test.js.map +0 -1
- package/ts_build/tests/unit/clients/responseMetadata.test.d.ts +0 -1
- package/ts_build/tests/unit/clients/responseMetadata.test.js +0 -96
- package/ts_build/tests/unit/clients/responseMetadata.test.js.map +0 -1
- package/ts_build/tests/unit/clients/withRetry.test.d.ts +0 -1
- package/ts_build/tests/unit/clients/withRetry.test.js +0 -225
- package/ts_build/tests/unit/clients/withRetry.test.js.map +0 -1
- package/ts_build/tests/unit/commands/agents.test.d.ts +0 -1
- package/ts_build/tests/unit/commands/agents.test.js +0 -119
- package/ts_build/tests/unit/commands/agents.test.js.map +0 -1
- package/ts_build/tests/unit/commands/github-credentials.test.d.ts +0 -1
- package/ts_build/tests/unit/commands/github-credentials.test.js +0 -145
- package/ts_build/tests/unit/commands/github-credentials.test.js.map +0 -1
- package/ts_build/tests/unit/commands/misc.test.d.ts +0 -1
- package/ts_build/tests/unit/commands/misc.test.js +0 -70
- package/ts_build/tests/unit/commands/misc.test.js.map +0 -1
- package/ts_build/tests/unit/commands/remote.test.d.ts +0 -1
- package/ts_build/tests/unit/commands/remote.test.js +0 -70
- package/ts_build/tests/unit/commands/remote.test.js.map +0 -1
- package/ts_build/tests/unit/commands/sandbox.test.d.ts +0 -1
- package/ts_build/tests/unit/commands/sandbox.test.js +0 -258
- package/ts_build/tests/unit/commands/sandbox.test.js.map +0 -1
- package/ts_build/tests/unit/hashes.test.d.ts +0 -1
- package/ts_build/tests/unit/hashes.test.js +0 -25
- package/ts_build/tests/unit/hashes.test.js.map +0 -1
- package/ts_build/tests/unit/input-queue.test.d.ts +0 -1
- package/ts_build/tests/unit/input-queue.test.js +0 -32
- package/ts_build/tests/unit/input-queue.test.js.map +0 -1
- package/ts_build/tests/unit/login.test.d.ts +0 -1
- package/ts_build/tests/unit/login.test.js +0 -166
- package/ts_build/tests/unit/login.test.js.map +0 -1
- package/ts_build/tests/unit/modules/moduleLoading.test.d.ts +0 -1
- package/ts_build/tests/unit/modules/moduleLoading.test.js +0 -272
- package/ts_build/tests/unit/modules/moduleLoading.test.js.map +0 -1
- package/ts_build/tests/unit/plugins/pluginLoading.test.d.ts +0 -1
- package/ts_build/tests/unit/plugins/pluginLoading.test.js +0 -117
- package/ts_build/tests/unit/plugins/pluginLoading.test.js.map +0 -1
- package/ts_build/tests/unit/services/AgentSyncKnowhowWeb.test.d.ts +0 -1
- package/ts_build/tests/unit/services/AgentSyncKnowhowWeb.test.js +0 -32
- package/ts_build/tests/unit/services/AgentSyncKnowhowWeb.test.js.map +0 -1
- package/ts_build/tests/unit/services/KnowhowClient.test.d.ts +0 -1
- package/ts_build/tests/unit/services/KnowhowClient.test.js +0 -69
- package/ts_build/tests/unit/services/KnowhowClient.test.js.map +0 -1
- package/ts_build/tests/unit/services/LazyToolsService.test.d.ts +0 -1
- package/ts_build/tests/unit/services/LazyToolsService.test.js +0 -47
- package/ts_build/tests/unit/services/LazyToolsService.test.js.map +0 -1
- package/ts_build/tests/unit/services/Mcp.test.d.ts +0 -1
- package/ts_build/tests/unit/services/Mcp.test.js +0 -45
- package/ts_build/tests/unit/services/Mcp.test.js.map +0 -1
- package/ts_build/tests/unit/services/MinimalToolsService.test.d.ts +0 -1
- package/ts_build/tests/unit/services/MinimalToolsService.test.js +0 -320
- package/ts_build/tests/unit/services/MinimalToolsService.test.js.map +0 -1
- package/ts_build/tests/unit/services/RuntimeReloadService.test.d.ts +0 -1
- package/ts_build/tests/unit/services/RuntimeReloadService.test.js +0 -26
- package/ts_build/tests/unit/services/RuntimeReloadService.test.js.map +0 -1
- package/ts_build/tests/unit/services/SessionManager.test.d.ts +0 -1
- package/ts_build/tests/unit/services/SessionManager.test.js +0 -72
- package/ts_build/tests/unit/services/SessionManager.test.js.map +0 -1
- package/ts_build/tests/unit/services/SyncedAgentWatcher.test.d.ts +0 -1
- package/ts_build/tests/unit/services/SyncedAgentWatcher.test.js +0 -78
- package/ts_build/tests/unit/services/SyncedAgentWatcher.test.js.map +0 -1
- package/ts_build/tests/unit/services/SyncerService.test.d.ts +0 -1
- package/ts_build/tests/unit/services/SyncerService.test.js +0 -40
- package/ts_build/tests/unit/services/SyncerService.test.js.map +0 -1
- package/ts_build/tests/unit/tunnel.test.d.ts +0 -1
- package/ts_build/tests/unit/tunnel.test.js +0 -47
- package/ts_build/tests/unit/tunnel.test.js.map +0 -1
- package/ts_build/tests/unit/util/Trace.test.d.ts +0 -1
- package/ts_build/tests/unit/util/Trace.test.js +0 -107
- package/ts_build/tests/unit/util/Trace.test.js.map +0 -1
- package/ts_build/tests/unit/utils/http.test.d.ts +0 -1
- package/ts_build/tests/unit/utils/http.test.js +0 -69
- package/ts_build/tests/unit/utils/http.test.js.map +0 -1
- package/tsconfig.json +0 -34
- package/tslint.json +0 -11
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export const BASE_PROMPT = `
|
|
2
|
-
#Knowhow Codebase Agent.
|
|
3
|
-
You use the tools to read and write code, to help the developer implement features faster.
|
|
4
|
-
|
|
5
|
-
# Completing your work
|
|
6
|
-
|
|
7
|
-
You may answer questions and provide requested information directly in your assistant message content. Content responses are valid and visible to the user; you do not need to use a tool merely to answer a question.
|
|
8
|
-
Call finalAnswer only once the overall task is complete and you are ready to end the agent run. Put your final result or completion summary in that tool call.
|
|
9
|
-
As an agent you may receive multiple rounds of input before you call finalAnswer.
|
|
10
|
-
You are not able to request feedback from the user, so proceed with your plans and the developer will contact you afterwards if they need more help.
|
|
11
|
-
|
|
12
|
-
## Modification Guidelines
|
|
13
|
-
|
|
14
|
-
After modifying files, you will read them to ensure they look correct before calling finalAnswer.
|
|
15
|
-
You always check your modifications for syntax errors or bugs.
|
|
16
|
-
You always use writeFileChunk for small files, and for larger files you use the patchFile tool, if available, to make the smallest modifications required to files, rather than outputting the entire file.
|
|
17
|
-
You think step by step about the blocks of code you're modifying.
|
|
18
|
-
You may use the execCommand tool to navigate the filesystem and to create new folders if needed.
|
|
19
|
-
You may use the execCommand tool to use git to view which changes have been made so far via git diff and git status.
|
|
20
|
-
|
|
21
|
-
# Creative Tool Usage Examples
|
|
22
|
-
|
|
23
|
-
Beyond basic file editing, consider these powerful tool combinations:
|
|
24
|
-
|
|
25
|
-
## String Replace Tool
|
|
26
|
-
- **Bulk renaming**: Use stringReplace across multiple files to rename variables, functions, or imports
|
|
27
|
-
- **Configuration updates**: Replace API endpoints, version numbers, or feature flags across the codebase
|
|
28
|
-
- **Dependency updates**: Update import paths when reorganizing code structure
|
|
29
|
-
|
|
30
|
-
## YCMD Language Server Integration
|
|
31
|
-
- **Find all references**: Use ycmdGoTo with GoToReferences to find every usage of a function before refactoring
|
|
32
|
-
- **Auto-complete exploration**: Use ycmdCompletion to discover available methods/properties on objects
|
|
33
|
-
- **Smart navigation**: Use ycmdGoTo with GoToDefinition to understand code structure before making changes
|
|
34
|
-
- **Error-driven development**: Use ycmdDiagnostics to identify compilation errors and fix them systematically
|
|
35
|
-
- **Intelligent renaming**: Use ycmdRefactor with RefactorRename for safe symbol renaming across files
|
|
36
|
-
|
|
37
|
-
## Search and Analysis Workflows
|
|
38
|
-
- **Impact analysis**: Use textSearch + ycmdGoTo to understand how changes will affect the codebase
|
|
39
|
-
- **Pattern discovery**: Use embeddingSearch to find similar code patterns when implementing new features
|
|
40
|
-
- **Code exploration**: Combine fileSearch + readFile + ycmdCompletion to understand unfamiliar codebases
|
|
41
|
-
|
|
42
|
-
## Advanced Combinations
|
|
43
|
-
- **Refactoring workflow**: ycmdDiagnostics → ycmdGoTo → stringReplace → ycmdDiagnostics (verify fixes)
|
|
44
|
-
- **Feature implementation**: embeddingSearch → ycmdCompletion → patchFile → ycmdDiagnostics
|
|
45
|
-
- **Code cleanup**: textSearch → ycmdRefactor (organize imports) → stringReplace (standardize patterns)
|
|
46
|
-
|
|
47
|
-
Think creatively about tool combinations - each tool can amplify the others' effectiveness!
|
|
48
|
-
|
|
49
|
-
# PLUGINS REMINDER:
|
|
50
|
-
|
|
51
|
-
Plugins are used to automatically expand user input with more context.
|
|
52
|
-
The additional context could be from embeddings, files, pull requests, tickets etc.
|
|
53
|
-
Do not assume the plugin information contains all the information you require to accomplish a task.
|
|
54
|
-
Be sure to consider tools that you may use to supplement what the plugins initially provided.
|
|
55
|
-
`;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AgentContext, BaseAgent } from "../base/base";
|
|
2
|
-
import { Message } from "../../clients/types";
|
|
3
|
-
import { Assistant, Config } from "../../types";
|
|
4
|
-
import { MessageProcessor } from "../../services/MessageProcessor";
|
|
5
|
-
|
|
6
|
-
export class ConfigAgent extends BaseAgent {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
|
|
10
|
-
constructor(private config: Assistant, context: AgentContext) {
|
|
11
|
-
super(context);
|
|
12
|
-
this.name = config.name;
|
|
13
|
-
this.setModelPreferences([
|
|
14
|
-
{ model: config.model, provider: config.provider },
|
|
15
|
-
]);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async getInitialMessages(userInput: string) {
|
|
19
|
-
return [
|
|
20
|
-
{ role: "system", content: this.config.instructions },
|
|
21
|
-
{ role: "user", content: userInput },
|
|
22
|
-
] as Message[];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Models } from "../../ai";
|
|
2
|
-
import { Message } from "../../clients/types";
|
|
3
|
-
import { AgentContext, BaseAgent } from "../base/base";
|
|
4
|
-
import { BASE_PROMPT } from "../base/prompt";
|
|
5
|
-
export class DeveloperAgent extends BaseAgent {
|
|
6
|
-
name = "Developer";
|
|
7
|
-
description = `This agent manages requests and uses tools and delegation via agentCall to accomplish things`;
|
|
8
|
-
|
|
9
|
-
constructor(context: AgentContext) {
|
|
10
|
-
super(context);
|
|
11
|
-
this.setModelPreferences([
|
|
12
|
-
{
|
|
13
|
-
model: Models.anthropic.Sonnet4_6,
|
|
14
|
-
provider: "anthropic",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
model: Models.openai.GPT_56_Sol,
|
|
18
|
-
provider: "openai",
|
|
19
|
-
},
|
|
20
|
-
]);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async getInitialMessages(userInput: string) {
|
|
24
|
-
return [
|
|
25
|
-
{
|
|
26
|
-
role: "system",
|
|
27
|
-
content: `
|
|
28
|
-
${BASE_PROMPT}
|
|
29
|
-
|
|
30
|
-
Specialization: Developer, ${this.description}
|
|
31
|
-
|
|
32
|
-
# Description
|
|
33
|
-
You are a helpful developer assistant that is capable of using tools to assist the user.
|
|
34
|
-
You delegate some tasks to specialized agents. If a request doesn't require the use of a specialized agent, you can handle it yourself.
|
|
35
|
-
|
|
36
|
-
# How to call other agents
|
|
37
|
-
You can use the startAgentTask tool to call other agents.
|
|
38
|
-
This is a wrapper for the shell command knowhow agent --input "your prompt"
|
|
39
|
-
|
|
40
|
-
If sync-fs is active:
|
|
41
|
-
When you start a knowhow agent, it will create a folder in .knowhow/processes/agents/
|
|
42
|
-
For that agent you can use the input.txt file to send it messages.
|
|
43
|
-
|
|
44
|
-
If you send a message to an agent, you can tell it your task directory/input.txt file path and they can write there to respond
|
|
45
|
-
Your task id is:
|
|
46
|
-
${this.currentTaskId}
|
|
47
|
-
|
|
48
|
-
If you need to write a longer task, you can you knowhow agent --prompt-file <filepath>
|
|
49
|
-
This way you can write out specs and launch the agent on that
|
|
50
|
-
|
|
51
|
-
You can use the status.txt to pause an agent, or pause yourself and have another agent unpause you, or you can use shell commands to wait for an agent's status to change, with a timeout
|
|
52
|
-
|
|
53
|
-
# Which Agent to Use:
|
|
54
|
-
Researcher -
|
|
55
|
-
- For answering questions about the codebase
|
|
56
|
-
- For providing context to modifications
|
|
57
|
-
- For figuring out which files to modify
|
|
58
|
-
- General Questions about codebase or file structure
|
|
59
|
-
|
|
60
|
-
Patcher
|
|
61
|
-
- this is the default agent
|
|
62
|
-
- For making modifications to files / code
|
|
63
|
-
- Great for big files
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
If the user has asked you to do multiple things that are parallelizable, you can start an agent for each task
|
|
67
|
-
Each agent will have it's own log files. You can check the logs of each agent to see their progress.
|
|
68
|
-
`,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
role: "user",
|
|
72
|
-
content: userInput,
|
|
73
|
-
},
|
|
74
|
-
] as Message[];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Message } from "../clients/types";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Remove the newest agent interactions from the final persisted thread.
|
|
5
|
-
*
|
|
6
|
-
* An interaction starts with an assistant message and includes every following
|
|
7
|
-
* tool result up to (but not including) the next assistant message. Cutting at
|
|
8
|
-
* the assistant boundary keeps tool_call/tool-result pairs valid and makes
|
|
9
|
-
* `rollback: 1` useful for recovering from a failed final tool-use turn.
|
|
10
|
-
*/
|
|
11
|
-
export function rollbackAgentInteractions(
|
|
12
|
-
threads: Message[][],
|
|
13
|
-
rollback: number = 0
|
|
14
|
-
): Message[][] {
|
|
15
|
-
if (!Number.isInteger(rollback) || rollback < 0) {
|
|
16
|
-
throw new Error("rollback must be a non-negative integer");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const cloned = threads.map((thread) => thread.map((message) => ({ ...message })));
|
|
20
|
-
if (rollback === 0 || cloned.length === 0) return cloned;
|
|
21
|
-
|
|
22
|
-
const lastThread = cloned[cloned.length - 1];
|
|
23
|
-
const assistantIndexes = lastThread
|
|
24
|
-
.map((message, index) => (message.role === "assistant" ? index : -1))
|
|
25
|
-
.filter((index) => index >= 0);
|
|
26
|
-
|
|
27
|
-
if (rollback > assistantIndexes.length) {
|
|
28
|
-
throw new Error(
|
|
29
|
-
`Cannot rollback ${rollback} interaction(s); the latest thread only has ${assistantIndexes.length} assistant interaction(s).`
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const cutIndex = assistantIndexes[assistantIndexes.length - rollback];
|
|
34
|
-
cloned[cloned.length - 1] = lastThread.slice(0, cutIndex);
|
|
35
|
-
return cloned;
|
|
36
|
-
}
|
package/src/agents/index.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { services } from "../services";
|
|
2
|
-
import { AgentContext } from "./base/base";
|
|
3
|
-
import { DeveloperAgent } from "./developer/developer";
|
|
4
|
-
import { PatchingAgent } from "./patcher/patcher";
|
|
5
|
-
import { ResearcherAgent } from "./researcher/researcher";
|
|
6
|
-
import { SetupAgent } from "./setup/setup";
|
|
7
|
-
|
|
8
|
-
export { BaseAgent } from "./base/base";
|
|
9
|
-
export { ConfigAgent } from "./configurable/ConfigAgent";
|
|
10
|
-
export { DeveloperAgent };
|
|
11
|
-
export { PatchingAgent };
|
|
12
|
-
export { AgentContext };
|
|
13
|
-
|
|
14
|
-
export * from "./researcher/researcher";
|
|
15
|
-
|
|
16
|
-
export * as tools from "./tools";
|
|
17
|
-
export { includedTools } from "./tools/list";
|
|
18
|
-
|
|
19
|
-
export type AgentName = "Developer" | "Patcher" | "Researcher" | "Setup";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Registry of agent constructors (not instances).
|
|
23
|
-
* Use createAgent() to get a fresh instance per task, avoiding stale event listener issues.
|
|
24
|
-
*/
|
|
25
|
-
export const agentConstructors: Record<AgentName, new (context: AgentContext) => any> = {
|
|
26
|
-
Developer: DeveloperAgent,
|
|
27
|
-
Patcher: PatchingAgent,
|
|
28
|
-
Researcher: ResearcherAgent,
|
|
29
|
-
Setup: SetupAgent,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Create a fresh agent instance by name.
|
|
34
|
-
* Always returns a new instance to avoid shared state / stale listeners between tasks.
|
|
35
|
-
*/
|
|
36
|
-
export function createAgent(agentName: AgentName, agentContext: AgentContext = services()) {
|
|
37
|
-
const AgentClass = agentConstructors[agentName];
|
|
38
|
-
if (!AgentClass) {
|
|
39
|
-
throw new Error(`Agent "${agentName}" not found. Available agents: ${Object.keys(agentConstructors).join(", ")}`);
|
|
40
|
-
}
|
|
41
|
-
return new AgentClass(agentContext);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** @deprecated Use createAgent() for per-task instances to avoid event listener leaks */
|
|
45
|
-
export function agents(agentContext: AgentContext = services()) {
|
|
46
|
-
return {
|
|
47
|
-
Developer: new DeveloperAgent(agentContext),
|
|
48
|
-
Patcher: new PatchingAgent(agentContext),
|
|
49
|
-
Researcher: new ResearcherAgent(agentContext),
|
|
50
|
-
Setup: new SetupAgent(agentContext),
|
|
51
|
-
};
|
|
52
|
-
}
|
package/src/agents/interface.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Message } from "../clients/types";
|
|
2
|
-
|
|
3
|
-
export interface IAgent {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
call: (userInput: string, messages?: Message[]) => Promise<string>;
|
|
7
|
-
getModel(): string;
|
|
8
|
-
getProvider(): string;
|
|
9
|
-
setModel(model: string): void;
|
|
10
|
-
setProvider(provider: string): void;
|
|
11
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Agent Goals
|
|
2
|
-
This agent should receive a user request, collect relevant files that should be read, and then research the request in context of the files, and then output a plan, of which files need to be modified.
|
|
3
|
-
|
|
4
|
-
The agent should also plan to test it's changes. The testing phase can be accomplished through writing automated tests, executing terminal commands to verify things worked etc.
|
|
5
|
-
|
|
6
|
-
# Simple Example Usage
|
|
7
|
-
Codebase Agent: Write a plugin that takes in a user prompt, and then determines a good thing to google would be for that prompt, and then execute the google search returning the top 5 results.
|
|
8
|
-
|
|
9
|
-
The agent should analzye the folder structure via RAG, perhaps multiple shots to find the plugins hiearchy.
|
|
10
|
-
|
|
11
|
-
Once the examples are found the agent should contstruct a development plan for how the plugin should wbe written. Then the agent should use some tools to read/write the files.
|
|
12
|
-
|
|
13
|
-
Search Files - Does a RAG search to try and find relevant files to the AI's goal.
|
|
14
|
-
|
|
15
|
-
Read File - Opens a file and provides the full file as context to the LLM. If the file is too long, then it will be truncated at some point.
|
|
16
|
-
|
|
17
|
-
Scan File - Opens a file, and reads from line A to line B, returning the contents to the LLM, also tells the LLM how many lines there are
|
|
18
|
-
|
|
19
|
-
Write File - Writes the full contents of a file
|
|
20
|
-
|
|
21
|
-
Patch File - The LLM outputs a patchfile which can be applied. This reduces output tokens
|
|
22
|
-
|
|
23
|
-
Exec Command - The LLM should be able to call the cli to test it's changes, perhaps by running npm test (filename), to verify the tests it wrote pass
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# Implementation
|
|
27
|
-
Implement the tools using the fs node module and the patch file tool should use the diff node module to apply the patches. Some configuration may be used to help the Agent know how to test it's work. For instance the agent could read the package.json for the test commands, or we could specify how changes can be tested in the knowhow config, since many projects have different testing patterns.
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { Message } from "../../clients/types";
|
|
2
|
-
import { AgentContext, BaseAgent } from "../base/base";
|
|
3
|
-
import { BASE_PROMPT } from "../base/prompt";
|
|
4
|
-
import { Models } from "../../ai";
|
|
5
|
-
|
|
6
|
-
const example = `
|
|
7
|
-
Index: ./src/agents/base/base.ts
|
|
8
|
-
===================================================================
|
|
9
|
-
--- ./src/agents/base/base.ts
|
|
10
|
-
+++ ./src/agents/base/base.ts
|
|
11
|
-
@@ -186,9 +186,14 @@
|
|
12
|
-
startIndex: number,
|
|
13
|
-
endIndex: number
|
|
14
|
-
) {
|
|
15
|
-
const toCompress = messages.slice(startIndex, endIndex);
|
|
16
|
-
- const toCompressPrompt = \`Summarize what this agent was tasked with, what has been tried so far, and what we're about to do next. This summary will become the agent's only memory of the past, all other messages will be dropped: \n\n\${JSON.stringify(
|
|
17
|
-
+ const toCompressPrompt = \`Summarize:
|
|
18
|
-
+ 1. Initial Request - what this agent was tasked with.
|
|
19
|
-
+ 2. Progress - what has been tried so far,
|
|
20
|
-
+ 3. Next Steps - what we're about to do next to continue the user's original request.
|
|
21
|
-
+
|
|
22
|
-
+ This summary will become the agent's only memory of the past, all other messages will be dropped: \n\n\${JSON.stringify(
|
|
23
|
-
toCompress
|
|
24
|
-
)}\`;
|
|
25
|
-
|
|
26
|
-
const model = this.getModel();
|
|
27
|
-
@@ -202,9 +207,12 @@
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
+ const systemMesasges = toCompress.filter((m) => m.role === "system");
|
|
33
|
-
+
|
|
34
|
-
const newMessages = [
|
|
35
|
-
+ ...systemMesasges,
|
|
36
|
-
...response.choices.map((c) => c.message),
|
|
37
|
-
...messages.slice(endIndex),
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
const systemReminder = `# Patch Tool Rules:
|
|
43
|
-
Here's an example of a correctly formatted patch:
|
|
44
|
-
${example}
|
|
45
|
-
|
|
46
|
-
Be sure to preserve sytanx, delete the correct lines of code, and insert new lines of code in the correct locations.
|
|
47
|
-
|
|
48
|
-
The user's patch tool needs CORRECT patches that apply cleanly against the current contents of the file!
|
|
49
|
-
Think carefully and make sure you include and mark all lines that need to be removed or changed as \`-\` lines.
|
|
50
|
-
Make sure you mark all new or modified lines with \`+\`.
|
|
51
|
-
Don't leave out any lines or the diff patch won't apply correctly.
|
|
52
|
-
|
|
53
|
-
Indentation matters in the diffs!
|
|
54
|
-
|
|
55
|
-
Start a new hunk for each section of the file that needs changes.
|
|
56
|
-
|
|
57
|
-
Only output hunks that specify changes with \`+\` or \`-\` lines.
|
|
58
|
-
Skip any hunks that are entirely unchanging \` \` lines.
|
|
59
|
-
|
|
60
|
-
Output hunks in whatever order makes the most sense.
|
|
61
|
-
Hunks don't need to be in any particular order.
|
|
62
|
-
|
|
63
|
-
Hunks should have a context of 3 lines before and after the change, which match exactly from the source.
|
|
64
|
-
|
|
65
|
-
When editing a function, method, loop, etc use a hunk to replace the *entire* code block.
|
|
66
|
-
Delete the entire existing version with \`-\` lines and then add a new, updated version with \`+\` lines.
|
|
67
|
-
This will help you generate correct code and correct diffs.
|
|
68
|
-
|
|
69
|
-
To move code within a file, use 2 hunks: 1 to delete it from its current location, 1 to insert it in the new location.
|
|
70
|
-
|
|
71
|
-
You should attempt to apply one hunk at a time, as an error in one hunk can cause the entire patch to fail to apply.
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
export class PatchingAgent extends BaseAgent {
|
|
75
|
-
name = "Patcher";
|
|
76
|
-
description = `This agent is prepared to work on the codebase by leveraging patches`;
|
|
77
|
-
|
|
78
|
-
constructor(context: AgentContext) {
|
|
79
|
-
super(context);
|
|
80
|
-
|
|
81
|
-
this.setModelPreferences([
|
|
82
|
-
{ model: Models.anthropic.Sonnet4_6, provider: "anthropic" },
|
|
83
|
-
{ model: Models.openai.GPT_56_Sol, provider: "openai" },
|
|
84
|
-
{ model: Models.xai.Grok4_5, provider: "xai" },
|
|
85
|
-
]);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async getInitialMessages(userInput: string) {
|
|
89
|
-
return [
|
|
90
|
-
{
|
|
91
|
-
role: "system",
|
|
92
|
-
content: `${BASE_PROMPT}
|
|
93
|
-
|
|
94
|
-
${systemReminder}
|
|
95
|
-
|
|
96
|
-
Specialization: Patcher Agent, ${this.description}
|
|
97
|
-
|
|
98
|
-
# Language Server Integration:
|
|
99
|
-
Use ycmd tools (ycmdDiagnostics, ycmdCompletion, ycmdRefactor, ycmdGoTo) to get error diagnostics, code completions, refactor symbols, and navigate definitions before making changes.
|
|
100
|
-
This helps ensure accurate modifications and can suggest fixes for compilation errors.
|
|
101
|
-
|
|
102
|
-
IF you fail twice to patch a file, you may switch using writeFileChunk to rewrite the whole file.
|
|
103
|
-
|
|
104
|
-
If you need to know about a type, you should use the ycmd completion tool to discovery the properties, and fallback to reading the source files if the ycmd tools are not available.
|
|
105
|
-
|
|
106
|
-
# Debugging Workflow
|
|
107
|
-
If a build or test command fails due to compilation errors:
|
|
108
|
-
|
|
109
|
-
ALWAYS start by running ycmdDiagnostics on the file with errors to get a structured list of issues.
|
|
110
|
-
|
|
111
|
-
Address the errors one at a time, from top to bottom.
|
|
112
|
-
|
|
113
|
-
For each error, use ycmdGoTo to find the correct definition or readFile on the relevant source file to understand the correct implementation.
|
|
114
|
-
|
|
115
|
-
If an error is related to properties not being named correctly, you can use ycmdCompletion to get suggestions for the correct property or method names.
|
|
116
|
-
|
|
117
|
-
Apply a small, targeted patch to fix only that single error.
|
|
118
|
-
|
|
119
|
-
After every 2-3 fixes, run ycmdDiagnostics again to confirm progress.
|
|
120
|
-
|
|
121
|
-
# Test Writing Workflow
|
|
122
|
-
When writing tests, you proceed incrementally, writing one test, verifying it compiles and works before moving on to the next test.
|
|
123
|
-
You ALWAYS get to a stable state with tests compiling / running before adding the next test.
|
|
124
|
-
When writing tests, you never change the source code to pass the test, you always change the test to match the existing source code.
|
|
125
|
-
|
|
126
|
-
`,
|
|
127
|
-
},
|
|
128
|
-
{ role: "user", content: userInput },
|
|
129
|
-
] as Message[];
|
|
130
|
-
}
|
|
131
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { Models } from "../../ai";
|
|
2
|
-
import { Message } from "../../clients/types";
|
|
3
|
-
import { AgentContext, BaseAgent } from "../base/base";
|
|
4
|
-
|
|
5
|
-
export class ResearcherAgent extends BaseAgent {
|
|
6
|
-
name = "Researcher";
|
|
7
|
-
description = `This agent is prepared to research a request using the tools available to them. Great for finding answers to questions about the codebase`;
|
|
8
|
-
|
|
9
|
-
constructor(context: AgentContext) {
|
|
10
|
-
super(context);
|
|
11
|
-
// Prefer Gemini for research, but fall back to other registered providers
|
|
12
|
-
// so the agent still runs when GEMINI_API_KEY is not configured. Without
|
|
13
|
-
// fallbacks, an unregistered "google" provider causes the health-check loop
|
|
14
|
-
// to immediately throw "We have exhausted all model preferences."
|
|
15
|
-
this.setModelPreferences([
|
|
16
|
-
{ model: Models.openai.GPT_56_Terra, provider: "openai" },
|
|
17
|
-
{ model: Models.anthropic.Sonnet4_6, provider: "anthropic" },
|
|
18
|
-
{ model: Models.google.Gemini_35_Flash_Lite, provider: "google" },
|
|
19
|
-
]);
|
|
20
|
-
this.disableTool("patchFile");
|
|
21
|
-
this.disableTool("writeFile");
|
|
22
|
-
this.disableTool("writeChunk");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async getInitialMessages(userInput: string) {
|
|
26
|
-
return [
|
|
27
|
-
{
|
|
28
|
-
role: "system",
|
|
29
|
-
content: `
|
|
30
|
-
# Researcher Agent
|
|
31
|
-
|
|
32
|
-
You are a sophisticated research agent designed to investigate and provide comprehensive context for user requests. Your primary goal is to gather relevant information, clarify the scope of the inquiry, and prepare a detailed foundation for further action or implementation.
|
|
33
|
-
|
|
34
|
-
## Core Responsibilities:
|
|
35
|
-
|
|
36
|
-
1. Analyze and break down the user's request into specific, answerable questions.
|
|
37
|
-
2. Conduct thorough research using all the tools to construct precise research.
|
|
38
|
-
3. Provide a comprehensive summary of findings, including relevant code locations, definitions, and contextual information.
|
|
39
|
-
|
|
40
|
-
## Research Process:
|
|
41
|
-
|
|
42
|
-
Follow these steps for each research task:
|
|
43
|
-
|
|
44
|
-
1. **Term and Concept Identification:**
|
|
45
|
-
- Identify key terms and concepts in the request.
|
|
46
|
-
- Use available tools to find and provide clear definitions for unfamiliar terms.
|
|
47
|
-
- This step is crucial for understanding the full scope of the request.
|
|
48
|
-
|
|
49
|
-
2. **Request Breakdown:**
|
|
50
|
-
- Break down the request into specific, answerable questions.
|
|
51
|
-
- Prioritize questions that will lead to a comprehensive understanding of the task.
|
|
52
|
-
|
|
53
|
-
3. **Information Gathering:**
|
|
54
|
-
- For each question, use appropriate tools to find relevant information.
|
|
55
|
-
- Prioritize finding:
|
|
56
|
-
- Main implementation files
|
|
57
|
-
- Related models or data structures
|
|
58
|
-
- Associated services or utilities
|
|
59
|
-
- Relevant configuration files
|
|
60
|
-
- Provide file paths and brief descriptions of their roles in the system.
|
|
61
|
-
|
|
62
|
-
4. **Summarization:**
|
|
63
|
-
- Summarize findings for each question.
|
|
64
|
-
- Cite specific file paths or code snippets where applicable.
|
|
65
|
-
|
|
66
|
-
5. **Synthesis:**
|
|
67
|
-
- Synthesize the information to provide a comprehensive overview of the request's scope and implications.
|
|
68
|
-
|
|
69
|
-
## Scope Clarification:
|
|
70
|
-
|
|
71
|
-
After initial research, clearly outline:
|
|
72
|
-
- The apparent scope of the request based on findings
|
|
73
|
-
- Any ambiguities or areas needing further clarification
|
|
74
|
-
- Potential implications or dependencies not explicitly mentioned in the original request
|
|
75
|
-
|
|
76
|
-
## Tool Usage and Transparency:
|
|
77
|
-
|
|
78
|
-
- For each research step, briefly mention which tools you're using and why.
|
|
79
|
-
|
|
80
|
-
## Iterative Refinement:
|
|
81
|
-
|
|
82
|
-
- After initial research, if the scope or requirements remain unclear, propose follow-up questions or areas for further investigation.
|
|
83
|
-
- Be prepared to iterate on your research based on additional input or clarifications.
|
|
84
|
-
|
|
85
|
-
## Final Answer Format:
|
|
86
|
-
|
|
87
|
-
When calling finalAnswer, provide a structured summary including:
|
|
88
|
-
1. Initial Request: Restate the original task or question.
|
|
89
|
-
2. Key Terms and Definitions: List important terms and their definitions.
|
|
90
|
-
3. Relevant Code Locations: Provide file paths and brief descriptions of key code areas.
|
|
91
|
-
4. Scope and Implications: Outline the understood scope and any potential implications.
|
|
92
|
-
5. Areas for Further Investigation: Highlight any aspects that may need additional clarification or research.
|
|
93
|
-
|
|
94
|
-
## Important Guidelines:
|
|
95
|
-
|
|
96
|
-
- Use all available search tools to ensure a robust set of references.
|
|
97
|
-
- Do not perform modifications; focus solely on research and information gathering.
|
|
98
|
-
- Aim for thoroughness and accuracy in your findings.
|
|
99
|
-
- Call finalAnswer after completing your research, but do not exceed 5 rounds of research without calling finalAnswer.
|
|
100
|
-
- You cannot request feedback from the user during your research process.
|
|
101
|
-
|
|
102
|
-
Remember, your role is to provide a comprehensive foundation of information to facilitate further action or implementation by other agents or developers.
|
|
103
|
-
Expect to use the tools, read files, etc. to construct a precise detailed analysis.
|
|
104
|
-
`,
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
{
|
|
108
|
-
role: "user",
|
|
109
|
-
content: `The user has asked: ${userInput}
|
|
110
|
-
Do not do more than 5 rounds of research without calling finalAnswer.
|
|
111
|
-
`,
|
|
112
|
-
},
|
|
113
|
-
] as Message[];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Message } from "../../clients/types";
|
|
2
|
-
import { AgentContext, BaseAgent } from "../base/base";
|
|
3
|
-
import { BASE_PROMPT } from "../base/prompt";
|
|
4
|
-
import configExamples from "../../prompts/KnowhowConfigExamples";
|
|
5
|
-
import { Models } from "../../ai";
|
|
6
|
-
|
|
7
|
-
export class SetupAgent extends BaseAgent {
|
|
8
|
-
name = "Setup";
|
|
9
|
-
description = `This agent is great for setting up knowhow`;
|
|
10
|
-
|
|
11
|
-
constructor(context: AgentContext) {
|
|
12
|
-
super(context);
|
|
13
|
-
|
|
14
|
-
this.setModelPreferences([
|
|
15
|
-
{ model: Models.anthropic.Sonnet4, provider: "anthropic" },
|
|
16
|
-
{
|
|
17
|
-
model: Models.openai.GPT_41_Mini,
|
|
18
|
-
provider: "openai",
|
|
19
|
-
},
|
|
20
|
-
]);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async getInitialMessages(userInput: string) {
|
|
24
|
-
return [
|
|
25
|
-
{
|
|
26
|
-
role: "system",
|
|
27
|
-
content: `${BASE_PROMPT}
|
|
28
|
-
|
|
29
|
-
You are the Knowhow Setup agent, you work with the user to help setup their config to get the most out of knowhow.
|
|
30
|
-
|
|
31
|
-
Here are some config examples: ${configExamples}
|
|
32
|
-
|
|
33
|
-
Use the tools to analyze the codebase and help the user setup embeddings and mcp servers or any other config features, like linters etc
|
|
34
|
-
|
|
35
|
-
If the user asks about a mcp that we don't have in the config you can google it and figure out what the configuration would look like to add it.
|
|
36
|
-
|
|
37
|
-
If the task is for how to do something, you should ask the user if they want you to do it for them by using the askHuman tool. For isntance, how coul d I hook up this agent to gmail, you would research the mcp options for gmail, and then ask them if they'd like for you to update the config with whatever options you found.
|
|
38
|
-
|
|
39
|
-
Always ask the user to approve what you're going to do to the config, that way you can get feedback via askHuman before modifying the config
|
|
40
|
-
|
|
41
|
-
After using askHuman and them providing their feedback of what you'd like to do, only follow what they say. We want to make the minimum set of changes to the config.
|
|
42
|
-
|
|
43
|
-
For codebase embeddings you don't want to use prompt, as that'd embed a transformation of the code, you want to embed the actual source, so don't use prompt.
|
|
44
|
-
For embeddings prompt would only be used for generating an embedding from transformed data, like if you wanted to summarize a transcript and make embeddings from the summary, then you'd use prompt on the embeddings, otherwise you should not need it.
|
|
45
|
-
|
|
46
|
-
When setting up the language plugin for a user you should come up with phrases they're likely to say, like frontend/backend/schema etc that will signal we should load in guides or rules for that type of task. You should put any of your rules/analses in .knowhow/docs and the language plugin should reference those.
|
|
47
|
-
|
|
48
|
-
The language plugin can only read in files, not directories, so do not add entries to language plugin unless you've first written some markdown files to load in as guidance. The files loaded by the language plugin should give quick tips to any unusual things about the project, commands that should be run to rebuild any auto-generated code, quirks about codebase behavior etc.
|
|
49
|
-
|
|
50
|
-
If a user is vauge about setting up, you should give them some options of what all you could help them setup with a brief explanation of what those setups would enable.
|
|
51
|
-
|
|
52
|
-
Only suggest embeddings that include a folder path with many elements, ie src/**/*.ts, never suggest entries with one element
|
|
53
|
-
|
|
54
|
-
If a user is requesting help with setting up a coding project, you can look at their package.json, or language specific config to setup the lintCommands so that we get feedback on file edits, and embeddings for the source code as those two features are the highest impact
|
|
55
|
-
|
|
56
|
-
If the user just says setup fast, try to get a general idea of the project file structure and setup one source code embedding for the whole codebase and linter commands if possible. Try not do dig too deep if they want fast, just get the highest impact features setup
|
|
57
|
-
|
|
58
|
-
`,
|
|
59
|
-
},
|
|
60
|
-
{ role: "user", content: userInput },
|
|
61
|
-
] as Message[];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Add new internal tools to the existing suite
|
|
2
|
-
export function addInternalTools(fns: {
|
|
3
|
-
[fnName: string]: (...args: any) => any;
|
|
4
|
-
}) {
|
|
5
|
-
const callParallel = (
|
|
6
|
-
fnsToCall: { recipient_name: string; parameters: any }[]
|
|
7
|
-
) => {
|
|
8
|
-
const promises = fnsToCall.map((param) => {
|
|
9
|
-
const name = param.recipient_name.split(".").pop();
|
|
10
|
-
const fn = fns[name];
|
|
11
|
-
const args = Object.values(param.parameters);
|
|
12
|
-
return fn(...args);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return Promise.all(promises);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
fns["multi_tool_use.parallel"] = callParallel;
|
|
19
|
-
|
|
20
|
-
return fns;
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getConfig } from "../../config";
|
|
2
|
-
import { services, ToolsService } from "../../services";
|
|
3
|
-
import { getEnabledPlugins } from "../../types";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Ask another registered agent a question. Resolves with a structured
|
|
7
|
-
* `{ answer, costUsd }` object (via `AgentService.callAgent`) so callers — most
|
|
8
|
-
* importantly the script sandbox — can account the subagent's spend against a
|
|
9
|
-
* budget. `answer` is the target agent's final response.
|
|
10
|
-
*/
|
|
11
|
-
export async function agentCall(agentName: string, userInput: string) {
|
|
12
|
-
return new Promise(async (resolve, reject) => {
|
|
13
|
-
const config = await getConfig();
|
|
14
|
-
const toolService = (
|
|
15
|
-
this instanceof ToolsService ? this : services().Tools
|
|
16
|
-
) as ToolsService;
|
|
17
|
-
|
|
18
|
-
const { Events, Plugins } = toolService.getContext();
|
|
19
|
-
|
|
20
|
-
let fullPrompt = `${userInput}`;
|
|
21
|
-
const enabledPlugins = getEnabledPlugins(config.plugins);
|
|
22
|
-
if (enabledPlugins?.length) {
|
|
23
|
-
const pluginText = await Plugins.callMany(enabledPlugins, userInput);
|
|
24
|
-
fullPrompt += `\n ${pluginText}`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Events.emit("agents:call", {
|
|
28
|
-
name: agentName,
|
|
29
|
-
query: fullPrompt,
|
|
30
|
-
resolve,
|
|
31
|
-
reject,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|