@office-ai/aioncli-core 0.2.3 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -3
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/src/agents/codebase-investigator.d.ts +46 -0
- package/dist/src/agents/codebase-investigator.js +132 -0
- package/dist/src/agents/codebase-investigator.js.map +1 -0
- package/dist/src/agents/codebase-investigator.test.js +35 -0
- package/dist/src/agents/codebase-investigator.test.js.map +1 -0
- package/dist/src/agents/executor.d.ts +114 -0
- package/dist/src/agents/executor.js +779 -0
- package/dist/src/agents/executor.js.map +1 -0
- package/dist/src/agents/executor.test.js +1362 -0
- package/dist/src/agents/executor.test.js.map +1 -0
- package/dist/src/agents/invocation.d.ts +46 -0
- package/dist/src/agents/invocation.js +102 -0
- package/dist/src/agents/invocation.js.map +1 -0
- package/dist/src/agents/invocation.test.js +215 -0
- package/dist/src/agents/invocation.test.js.map +1 -0
- package/dist/src/agents/registry.d.ts +40 -0
- package/dist/src/agents/registry.js +105 -0
- package/dist/src/agents/registry.js.map +1 -0
- package/dist/src/agents/registry.test.d.ts +6 -0
- package/dist/src/agents/registry.test.js +160 -0
- package/dist/src/agents/registry.test.js.map +1 -0
- package/dist/src/agents/schema-utils.d.ts +39 -0
- package/dist/src/agents/schema-utils.js +57 -0
- package/dist/src/agents/schema-utils.js.map +1 -0
- package/dist/src/agents/schema-utils.test.d.ts +6 -0
- package/dist/src/agents/schema-utils.test.js +144 -0
- package/dist/src/agents/schema-utils.test.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.d.ts +38 -0
- package/dist/src/agents/subagent-tool-wrapper.js +48 -0
- package/dist/src/agents/subagent-tool-wrapper.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.test.d.ts +6 -0
- package/dist/src/agents/subagent-tool-wrapper.test.js +110 -0
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -0
- package/dist/src/agents/types.d.ts +146 -0
- package/dist/src/agents/types.js +19 -0
- package/dist/src/agents/types.js.map +1 -0
- package/dist/src/agents/utils.d.ts +15 -0
- package/dist/src/agents/utils.js +29 -0
- package/dist/src/agents/utils.js.map +1 -0
- package/dist/src/agents/utils.test.d.ts +6 -0
- package/dist/src/agents/utils.test.js +87 -0
- package/dist/src/agents/utils.test.js.map +1 -0
- package/dist/src/code_assist/codeAssist.d.ts +6 -3
- package/dist/src/code_assist/codeAssist.js +13 -1
- package/dist/src/code_assist/codeAssist.js.map +1 -1
- package/dist/src/code_assist/codeAssist.test.d.ts +6 -0
- package/dist/src/code_assist/codeAssist.test.js +99 -0
- package/dist/src/code_assist/codeAssist.test.js.map +1 -0
- package/dist/src/code_assist/converter.d.ts +5 -1
- package/dist/src/code_assist/converter.js +39 -5
- package/dist/src/code_assist/converter.js.map +1 -1
- package/dist/src/code_assist/converter.test.js +112 -0
- package/dist/src/code_assist/converter.test.js.map +1 -1
- package/dist/src/code_assist/experiments/client_metadata.d.ts +12 -0
- package/dist/src/code_assist/experiments/client_metadata.js +50 -0
- package/dist/src/code_assist/experiments/client_metadata.js.map +1 -0
- package/dist/src/code_assist/experiments/client_metadata.test.d.ts +6 -0
- package/dist/src/code_assist/experiments/client_metadata.test.js +99 -0
- package/dist/src/code_assist/experiments/client_metadata.test.js.map +1 -0
- package/dist/src/code_assist/experiments/experiments.d.ts +17 -0
- package/dist/src/code_assist/experiments/experiments.js +36 -0
- package/dist/src/code_assist/experiments/experiments.js.map +1 -0
- package/dist/src/code_assist/experiments/experiments.test.d.ts +6 -0
- package/dist/src/code_assist/experiments/experiments.test.js +92 -0
- package/dist/src/code_assist/experiments/experiments.test.js.map +1 -0
- package/dist/src/code_assist/experiments/flagNames.d.ts +13 -0
- package/dist/src/code_assist/experiments/flagNames.js +13 -0
- package/dist/src/code_assist/experiments/flagNames.js.map +1 -0
- package/dist/src/code_assist/experiments/types.d.ts +35 -0
- package/dist/src/code_assist/experiments/types.js +7 -0
- package/dist/src/code_assist/experiments/types.js.map +1 -0
- package/dist/src/code_assist/oauth-credential-storage.d.ts +25 -0
- package/dist/src/code_assist/oauth-credential-storage.js +110 -0
- package/dist/src/code_assist/oauth-credential-storage.js.map +1 -0
- package/dist/src/code_assist/oauth-credential-storage.test.d.ts +6 -0
- package/dist/src/code_assist/oauth-credential-storage.test.js +198 -0
- package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +3 -3
- package/dist/src/code_assist/oauth2.js +252 -125
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +788 -350
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.d.ts +8 -6
- package/dist/src/code_assist/server.js +41 -10
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +151 -28
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/setup.d.ts +2 -2
- package/dist/src/code_assist/setup.js +5 -3
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/code_assist/setup.test.js.map +1 -1
- package/dist/src/code_assist/types.d.ts +18 -3
- package/dist/src/code_assist/types.js.map +1 -1
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +9 -0
- package/dist/src/commands/extensions.js.map +1 -0
- package/dist/src/commands/extensions.test.d.ts +6 -0
- package/dist/src/commands/extensions.test.js +19 -0
- package/dist/src/commands/extensions.test.js.map +1 -0
- package/dist/src/config/config.d.ts +282 -60
- package/dist/src/config/config.js +677 -129
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +1020 -146
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/constants.d.ts +11 -0
- package/dist/src/config/constants.js +16 -0
- package/dist/src/config/constants.js.map +1 -0
- package/dist/src/config/defaultModelConfigs.d.ts +7 -0
- package/dist/src/config/defaultModelConfigs.js +185 -0
- package/dist/src/config/defaultModelConfigs.js.map +1 -0
- package/dist/src/config/models.d.ts +37 -0
- package/dist/src/config/models.js +72 -0
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/models.test.d.ts +6 -0
- package/dist/src/config/models.test.js +116 -0
- package/dist/src/config/models.test.js.map +1 -0
- package/dist/src/config/storage.d.ts +36 -0
- package/dist/src/config/storage.js +115 -0
- package/dist/src/config/storage.js.map +1 -0
- package/dist/src/config/storage.test.d.ts +6 -0
- package/dist/src/config/storage.test.js +48 -0
- package/dist/src/config/storage.test.js.map +1 -0
- package/dist/src/confirmation-bus/index.d.ts +7 -0
- package/dist/src/confirmation-bus/index.js +8 -0
- package/dist/src/confirmation-bus/index.js.map +1 -0
- package/dist/src/confirmation-bus/message-bus.d.ts +18 -0
- package/dist/src/confirmation-bus/message-bus.js +87 -0
- package/dist/src/confirmation-bus/message-bus.js.map +1 -0
- package/dist/src/confirmation-bus/message-bus.test.d.ts +6 -0
- package/dist/src/confirmation-bus/message-bus.test.js +170 -0
- package/dist/src/confirmation-bus/message-bus.test.js.map +1 -0
- package/dist/src/confirmation-bus/types.d.ts +49 -0
- package/dist/src/confirmation-bus/types.js +16 -0
- package/dist/src/confirmation-bus/types.js.map +1 -0
- package/dist/src/core/apiKeyCredentialStorage.d.ts +17 -0
- package/dist/src/core/apiKeyCredentialStorage.js +64 -0
- package/dist/src/core/apiKeyCredentialStorage.js.map +1 -0
- package/dist/src/core/apiKeyCredentialStorage.test.d.ts +6 -0
- package/dist/src/core/apiKeyCredentialStorage.test.js +71 -0
- package/dist/src/core/apiKeyCredentialStorage.test.js.map +1 -0
- package/dist/src/core/baseLlmClient.d.ts +50 -0
- package/dist/src/core/baseLlmClient.js +185 -0
- package/dist/src/core/baseLlmClient.js.map +1 -0
- package/dist/src/core/baseLlmClient.test.d.ts +6 -0
- package/dist/src/core/baseLlmClient.test.js +311 -0
- package/dist/src/core/baseLlmClient.test.js.map +1 -0
- package/dist/src/core/client.d.ts +30 -42
- package/dist/src/core/client.js +178 -477
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +739 -617
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.d.ts +7 -6
- package/dist/src/core/contentGenerator.js +59 -45
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +50 -4
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolScheduler.d.ts +28 -11
- package/dist/src/core/coreToolScheduler.js +493 -161
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +995 -163
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/fakeContentGenerator.d.ts +33 -0
- package/dist/src/core/fakeContentGenerator.js +58 -0
- package/dist/src/core/fakeContentGenerator.js.map +1 -0
- package/dist/src/core/fakeContentGenerator.test.d.ts +6 -0
- package/dist/src/core/fakeContentGenerator.test.js +127 -0
- package/dist/src/core/fakeContentGenerator.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +61 -55
- package/dist/src/core/geminiChat.js +388 -366
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +1600 -355
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiRequest.js +1 -0
- package/dist/src/core/geminiRequest.js.map +1 -1
- package/dist/src/core/logger.d.ts +11 -4
- package/dist/src/core/logger.js +39 -30
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/logger.test.js +62 -45
- package/dist/src/core/logger.test.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.d.ts +4 -3
- package/dist/src/core/loggingContentGenerator.js +116 -37
- package/dist/src/core/loggingContentGenerator.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.test.d.ts +6 -0
- package/dist/src/core/loggingContentGenerator.test.js +180 -0
- package/dist/src/core/loggingContentGenerator.test.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +4 -5
- package/dist/src/core/nonInteractiveToolExecutor.js +17 -120
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +168 -84
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/openaiContentGenerator.d.ts +4 -3
- package/dist/src/core/openaiContentGenerator.js +49 -19
- package/dist/src/core/openaiContentGenerator.js.map +1 -1
- package/dist/src/core/openaiContentGenerator.test.js +1 -0
- package/dist/src/core/openaiContentGenerator.test.js.map +1 -1
- package/dist/src/core/prompts.d.ts +7 -1
- package/dist/src/core/prompts.js +198 -195
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +172 -104
- package/dist/src/core/prompts.test.js.map +1 -1
- package/dist/src/core/recordingContentGenerator.d.ts +18 -0
- package/dist/src/core/recordingContentGenerator.js +77 -0
- package/dist/src/core/recordingContentGenerator.js.map +1 -0
- package/dist/src/core/recordingContentGenerator.test.d.ts +6 -0
- package/dist/src/core/recordingContentGenerator.test.js +101 -0
- package/dist/src/core/recordingContentGenerator.test.js.map +1 -0
- package/dist/src/core/subagent.d.ts +24 -18
- package/dist/src/core/subagent.js +125 -90
- package/dist/src/core/subagent.js.map +1 -1
- package/dist/src/core/subagent.test.js +59 -44
- package/dist/src/core/subagent.test.js.map +1 -1
- package/dist/src/core/tokenLimits.test.d.ts +6 -0
- package/dist/src/core/tokenLimits.test.js +26 -0
- package/dist/src/core/tokenLimits.test.js.map +1 -0
- package/dist/src/core/turn.d.ts +57 -13
- package/dist/src/core/turn.js +79 -35
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +373 -120
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/fallback/handler.d.ts +7 -0
- package/dist/src/fallback/handler.js +181 -0
- package/dist/src/fallback/handler.js.map +1 -0
- package/dist/src/fallback/handler.test.d.ts +6 -0
- package/dist/src/fallback/handler.test.js +245 -0
- package/dist/src/fallback/handler.test.js.map +1 -0
- package/dist/src/fallback/types.d.ts +14 -0
- package/dist/src/fallback/types.js +7 -0
- package/dist/src/fallback/types.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/hooks/hookAggregator.d.ts +68 -0
- package/dist/src/hooks/hookAggregator.js +262 -0
- package/dist/src/hooks/hookAggregator.js.map +1 -0
- package/dist/src/hooks/hookAggregator.test.d.ts +6 -0
- package/dist/src/hooks/hookAggregator.test.js +387 -0
- package/dist/src/hooks/hookAggregator.test.js.map +1 -0
- package/dist/src/hooks/hookPlanner.d.ts +46 -0
- package/dist/src/hooks/hookPlanner.js +108 -0
- package/dist/src/hooks/hookPlanner.js.map +1 -0
- package/dist/src/hooks/hookPlanner.test.d.ts +6 -0
- package/dist/src/hooks/hookPlanner.test.js +255 -0
- package/dist/src/hooks/hookPlanner.test.js.map +1 -0
- package/dist/src/hooks/hookRegistry.d.ts +87 -0
- package/dist/src/hooks/hookRegistry.js +198 -0
- package/dist/src/hooks/hookRegistry.js.map +1 -0
- package/dist/src/hooks/hookRegistry.test.d.ts +6 -0
- package/dist/src/hooks/hookRegistry.test.js +341 -0
- package/dist/src/hooks/hookRegistry.test.js.map +1 -0
- package/dist/src/hooks/hookRunner.d.ts +42 -0
- package/dist/src/hooks/hookRunner.js +272 -0
- package/dist/src/hooks/hookRunner.js.map +1 -0
- package/dist/src/hooks/hookRunner.test.d.ts +6 -0
- package/dist/src/hooks/hookRunner.test.js +468 -0
- package/dist/src/hooks/hookRunner.test.js.map +1 -0
- package/dist/src/hooks/hookTranslator.d.ts +113 -0
- package/dist/src/hooks/hookTranslator.js +232 -0
- package/dist/src/hooks/hookTranslator.js.map +1 -0
- package/dist/src/hooks/hookTranslator.test.d.ts +6 -0
- package/dist/src/hooks/hookTranslator.test.js +192 -0
- package/dist/src/hooks/hookTranslator.test.js.map +1 -0
- package/dist/src/hooks/types.d.ts +384 -0
- package/dist/src/hooks/types.js +284 -0
- package/dist/src/hooks/types.js.map +1 -0
- package/dist/src/hooks/types.test.d.ts +6 -0
- package/dist/src/hooks/types.test.js +313 -0
- package/dist/src/hooks/types.test.js.map +1 -0
- package/dist/src/ide/constants.d.ts +3 -0
- package/dist/src/ide/constants.js +3 -0
- package/dist/src/ide/constants.js.map +1 -1
- package/dist/src/ide/detect-ide.d.ts +52 -12
- package/dist/src/ide/detect-ide.js +51 -65
- package/dist/src/ide/detect-ide.js.map +1 -1
- package/dist/src/ide/detect-ide.test.js +95 -52
- package/dist/src/ide/detect-ide.test.js.map +1 -1
- package/dist/src/ide/ide-client.d.ts +72 -24
- package/dist/src/ide/ide-client.js +380 -84
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-client.test.js +539 -35
- package/dist/src/ide/ide-client.test.js.map +1 -1
- package/dist/src/ide/ide-installer.d.ts +2 -2
- package/dist/src/ide/ide-installer.js +93 -35
- package/dist/src/ide/ide-installer.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +157 -26
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/ide/ideContext.d.ts +35 -365
- package/dist/src/ide/ideContext.js +60 -106
- package/dist/src/ide/ideContext.js.map +1 -1
- package/dist/src/ide/ideContext.test.js +152 -24
- package/dist/src/ide/ideContext.test.js.map +1 -1
- package/dist/src/ide/process-utils.d.ts +7 -5
- package/dist/src/ide/process-utils.js +108 -67
- package/dist/src/ide/process-utils.js.map +1 -1
- package/dist/src/ide/process-utils.test.d.ts +6 -0
- package/dist/src/ide/process-utils.test.js +151 -0
- package/dist/src/ide/process-utils.test.js.map +1 -0
- package/dist/src/ide/types.d.ts +486 -0
- package/dist/src/ide/types.js +138 -0
- package/dist/src/ide/types.js.map +1 -0
- package/dist/src/index.d.ts +41 -2
- package/dist/src/index.js +44 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.d.ts +5 -3
- package/dist/src/mcp/google-auth-provider.js +21 -3
- package/dist/src/mcp/google-auth-provider.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.test.js +42 -9
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +25 -18
- package/dist/src/mcp/oauth-provider.js +194 -97
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +581 -39
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.d.ts +14 -32
- package/dist/src/mcp/oauth-token-storage.js +58 -28
- package/dist/src/mcp/oauth-token-storage.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.test.js +262 -162
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +16 -1
- package/dist/src/mcp/oauth-utils.js +68 -33
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +86 -3
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/mcp/sa-impersonation-provider.d.ts +27 -0
- package/dist/src/mcp/sa-impersonation-provider.js +113 -0
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -0
- package/dist/src/mcp/sa-impersonation-provider.test.d.ts +6 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js +117 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js.map +1 -0
- package/dist/src/mcp/token-storage/base-token-storage.d.ts +19 -0
- package/dist/src/mcp/token-storage/base-token-storage.js +36 -0
- package/dist/src/mcp/token-storage/base-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.js +151 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/file-token-storage.d.ts +24 -0
- package/dist/src/mcp/token-storage/file-token-storage.js +145 -0
- package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/file-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/file-token-storage.test.js +238 -0
- package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.d.ts +23 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.js +78 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.js +193 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/index.d.ts +11 -0
- package/dist/src/mcp/token-storage/index.js +12 -0
- package/dist/src/mcp/token-storage/index.js.map +1 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.d.ts +35 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.js +246 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js +305 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/types.d.ts +44 -0
- package/dist/src/mcp/token-storage/types.js +11 -0
- package/dist/src/mcp/token-storage/types.js.map +1 -0
- package/dist/src/output/json-formatter.d.ts +11 -0
- package/dist/src/output/json-formatter.js +30 -0
- package/dist/src/output/json-formatter.js.map +1 -0
- package/dist/src/output/json-formatter.test.d.ts +6 -0
- package/dist/src/output/json-formatter.test.js +266 -0
- package/dist/src/output/json-formatter.test.js.map +1 -0
- package/dist/src/output/stream-json-formatter.d.ts +32 -0
- package/dist/src/output/stream-json-formatter.js +52 -0
- package/dist/src/output/stream-json-formatter.js.map +1 -0
- package/dist/src/output/stream-json-formatter.test.d.ts +6 -0
- package/dist/src/output/stream-json-formatter.test.js +479 -0
- package/dist/src/output/stream-json-formatter.test.js.map +1 -0
- package/dist/src/output/types.d.ts +82 -0
- package/dist/src/output/types.js +22 -0
- package/dist/src/output/types.js.map +1 -0
- package/dist/src/policy/config.d.ts +31 -0
- package/dist/src/policy/config.js +199 -0
- package/dist/src/policy/config.js.map +1 -0
- package/dist/src/policy/config.test.d.ts +6 -0
- package/dist/src/policy/config.test.js +538 -0
- package/dist/src/policy/config.test.js.map +1 -0
- package/dist/src/policy/index.d.ts +9 -0
- package/dist/src/policy/index.js +10 -0
- package/dist/src/policy/index.js.map +1 -0
- package/dist/src/policy/policies/discovered.toml +8 -0
- package/dist/src/policy/policies/read-only.toml +56 -0
- package/dist/src/policy/policies/write.toml +73 -0
- package/dist/src/policy/policies/yolo.toml +31 -0
- package/dist/src/policy/policy-engine.d.ts +39 -0
- package/dist/src/policy/policy-engine.js +158 -0
- package/dist/src/policy/policy-engine.js.map +1 -0
- package/dist/src/policy/policy-engine.test.d.ts +6 -0
- package/dist/src/policy/policy-engine.test.js +899 -0
- package/dist/src/policy/policy-engine.test.js.map +1 -0
- package/dist/src/policy/stable-stringify.d.ts +58 -0
- package/dist/src/policy/stable-stringify.js +122 -0
- package/dist/src/policy/stable-stringify.js.map +1 -0
- package/dist/src/policy/toml-loader.d.ts +47 -0
- package/dist/src/policy/toml-loader.js +411 -0
- package/dist/src/policy/toml-loader.js.map +1 -0
- package/dist/src/policy/toml-loader.test.d.ts +6 -0
- package/dist/src/policy/toml-loader.test.js +376 -0
- package/dist/src/policy/toml-loader.test.js.map +1 -0
- package/dist/src/policy/types.d.ts +130 -0
- package/dist/src/policy/types.js +22 -0
- package/dist/src/policy/types.js.map +1 -0
- package/dist/src/prompts/mcp-prompts.d.ts +2 -2
- package/dist/src/prompts/mcp-prompts.test.d.ts +6 -0
- package/dist/src/prompts/mcp-prompts.test.js +39 -0
- package/dist/src/prompts/mcp-prompts.test.js.map +1 -0
- package/dist/src/prompts/prompt-registry.d.ts +1 -1
- package/dist/src/prompts/prompt-registry.js +2 -1
- package/dist/src/prompts/prompt-registry.js.map +1 -1
- package/dist/src/prompts/prompt-registry.test.d.ts +6 -0
- package/dist/src/prompts/prompt-registry.test.js +96 -0
- package/dist/src/prompts/prompt-registry.test.js.map +1 -0
- package/dist/src/routing/modelRouterService.d.ts +23 -0
- package/dist/src/routing/modelRouterService.js +85 -0
- package/dist/src/routing/modelRouterService.js.map +1 -0
- package/dist/src/routing/modelRouterService.test.d.ts +6 -0
- package/dist/src/routing/modelRouterService.test.js +160 -0
- package/dist/src/routing/modelRouterService.test.js.map +1 -0
- package/dist/src/routing/routingStrategy.d.ts +62 -0
- package/dist/src/routing/routingStrategy.js +7 -0
- package/dist/src/routing/routingStrategy.js.map +1 -0
- package/dist/src/routing/strategies/classifierStrategy.d.ts +12 -0
- package/dist/src/routing/strategies/classifierStrategy.js +166 -0
- package/dist/src/routing/strategies/classifierStrategy.js.map +1 -0
- package/dist/src/routing/strategies/classifierStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/classifierStrategy.test.js +196 -0
- package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -0
- package/dist/src/routing/strategies/compositeStrategy.d.ts +26 -0
- package/dist/src/routing/strategies/compositeStrategy.js +68 -0
- package/dist/src/routing/strategies/compositeStrategy.js.map +1 -0
- package/dist/src/routing/strategies/compositeStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/compositeStrategy.test.js +123 -0
- package/dist/src/routing/strategies/compositeStrategy.test.js.map +1 -0
- package/dist/src/routing/strategies/defaultStrategy.d.ts +12 -0
- package/dist/src/routing/strategies/defaultStrategy.js +20 -0
- package/dist/src/routing/strategies/defaultStrategy.js.map +1 -0
- package/dist/src/routing/strategies/defaultStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/defaultStrategy.test.js +26 -0
- package/dist/src/routing/strategies/defaultStrategy.test.js.map +1 -0
- package/dist/src/routing/strategies/fallbackStrategy.d.ts +12 -0
- package/dist/src/routing/strategies/fallbackStrategy.js +25 -0
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -0
- package/dist/src/routing/strategies/fallbackStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/fallbackStrategy.test.js +59 -0
- package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -0
- package/dist/src/routing/strategies/overrideStrategy.d.ts +15 -0
- package/dist/src/routing/strategies/overrideStrategy.js +28 -0
- package/dist/src/routing/strategies/overrideStrategy.js.map +1 -0
- package/dist/src/routing/strategies/overrideStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/overrideStrategy.test.js +45 -0
- package/dist/src/routing/strategies/overrideStrategy.test.js.map +1 -0
- package/dist/src/safety/built-in.d.ts +21 -0
- package/dist/src/safety/built-in.js +106 -0
- package/dist/src/safety/built-in.js.map +1 -0
- package/dist/src/safety/built-in.test.d.ts +6 -0
- package/dist/src/safety/built-in.test.js +199 -0
- package/dist/src/safety/built-in.test.js.map +1 -0
- package/dist/src/safety/checker-runner.d.ts +48 -0
- package/dist/src/safety/checker-runner.js +208 -0
- package/dist/src/safety/checker-runner.js.map +1 -0
- package/dist/src/safety/checker-runner.test.d.ts +6 -0
- package/dist/src/safety/checker-runner.test.js +238 -0
- package/dist/src/safety/checker-runner.test.js.map +1 -0
- package/dist/src/safety/context-builder.d.ts +23 -0
- package/dist/src/safety/context-builder.js +47 -0
- package/dist/src/safety/context-builder.js.map +1 -0
- package/dist/src/safety/context-builder.test.d.ts +6 -0
- package/dist/src/safety/context-builder.test.js +49 -0
- package/dist/src/safety/context-builder.test.js.map +1 -0
- package/dist/src/safety/protocol.d.ts +88 -0
- package/dist/src/safety/protocol.js +15 -0
- package/dist/src/safety/protocol.js.map +1 -0
- package/dist/src/safety/registry.d.ts +26 -0
- package/dist/src/safety/registry.js +65 -0
- package/dist/src/safety/registry.js.map +1 -0
- package/dist/src/safety/registry.test.d.ts +6 -0
- package/dist/src/safety/registry.test.js +31 -0
- package/dist/src/safety/registry.test.js.map +1 -0
- package/dist/src/services/chatCompressionService.d.ts +32 -0
- package/dist/src/services/chatCompressionService.js +162 -0
- package/dist/src/services/chatCompressionService.js.map +1 -0
- package/dist/src/services/chatCompressionService.test.d.ts +6 -0
- package/dist/src/services/chatCompressionService.test.js +210 -0
- package/dist/src/services/chatCompressionService.test.js.map +1 -0
- package/dist/src/services/chatRecordingService.d.ts +10 -15
- package/dist/src/services/chatRecordingService.js +43 -29
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/chatRecordingService.test.js +69 -25
- package/dist/src/services/chatRecordingService.test.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.d.ts +8 -10
- package/dist/src/services/fileDiscoveryService.js +31 -53
- package/dist/src/services/fileDiscoveryService.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.test.js +94 -14
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
- package/dist/src/services/fileSystemService.d.ts +9 -0
- package/dist/src/services/fileSystemService.js +12 -1
- package/dist/src/services/fileSystemService.js.map +1 -1
- package/dist/src/services/fileSystemService.test.js +1 -1
- package/dist/src/services/fileSystemService.test.js.map +1 -1
- package/dist/src/services/gitService.d.ts +3 -1
- package/dist/src/services/gitService.js +30 -24
- package/dist/src/services/gitService.js.map +1 -1
- package/dist/src/services/gitService.test.js +30 -37
- package/dist/src/services/gitService.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.d.ts +12 -3
- package/dist/src/services/loopDetectionService.js +148 -55
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +280 -21
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- package/dist/src/services/modelConfig.golden.test.d.ts +6 -0
- package/dist/src/services/modelConfig.golden.test.js +42 -0
- package/dist/src/services/modelConfig.golden.test.js.map +1 -0
- package/dist/src/services/modelConfig.integration.test.d.ts +6 -0
- package/dist/src/services/modelConfig.integration.test.js +247 -0
- package/dist/src/services/modelConfig.integration.test.js.map +1 -0
- package/dist/src/services/modelConfigService.d.ts +48 -0
- package/dist/src/services/modelConfigService.js +151 -0
- package/dist/src/services/modelConfigService.js.map +1 -0
- package/dist/src/services/modelConfigService.test.d.ts +6 -0
- package/dist/src/services/modelConfigService.test.js +531 -0
- package/dist/src/services/modelConfigService.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.d.ts +37 -2
- package/dist/src/services/shellExecutionService.js +361 -67
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +333 -71
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/services/test-data/resolved-aliases.golden.json +202 -0
- package/dist/src/telemetry/activity-detector.d.ts +41 -0
- package/dist/src/telemetry/activity-detector.js +61 -0
- package/dist/src/telemetry/activity-detector.js.map +1 -0
- package/dist/src/telemetry/activity-detector.test.d.ts +6 -0
- package/dist/src/telemetry/activity-detector.test.js +136 -0
- package/dist/src/telemetry/activity-detector.test.js.map +1 -0
- package/dist/src/telemetry/activity-monitor.d.ts +116 -0
- package/dist/src/telemetry/activity-monitor.js +209 -0
- package/dist/src/telemetry/activity-monitor.js.map +1 -0
- package/dist/src/telemetry/activity-monitor.test.d.ts +6 -0
- package/dist/src/telemetry/activity-monitor.test.js +251 -0
- package/dist/src/telemetry/activity-monitor.test.js.map +1 -0
- package/dist/src/telemetry/activity-types.d.ts +19 -0
- package/dist/src/telemetry/activity-types.js +21 -0
- package/dist/src/telemetry/activity-types.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +53 -5
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +581 -56
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +2 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +467 -31
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +75 -4
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +182 -6
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/config.d.ts +31 -0
- package/dist/src/telemetry/config.js +76 -0
- package/dist/src/telemetry/config.js.map +1 -0
- package/dist/src/telemetry/config.test.d.ts +6 -0
- package/dist/src/telemetry/config.test.js +124 -0
- package/dist/src/telemetry/config.test.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +0 -18
- package/dist/src/telemetry/constants.js +0 -18
- package/dist/src/telemetry/constants.js.map +1 -1
- package/dist/src/telemetry/file-exporters.d.ts +5 -4
- package/dist/src/telemetry/file-exporters.js +1 -1
- package/dist/src/telemetry/file-exporters.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.d.ts +34 -0
- package/dist/src/telemetry/gcp-exporters.js +116 -0
- package/dist/src/telemetry/gcp-exporters.js.map +1 -0
- package/dist/src/telemetry/gcp-exporters.test.d.ts +6 -0
- package/dist/src/telemetry/gcp-exporters.test.js +318 -0
- package/dist/src/telemetry/gcp-exporters.test.js.map +1 -0
- package/dist/src/telemetry/high-water-mark-tracker.d.ts +43 -0
- package/dist/src/telemetry/high-water-mark-tracker.js +88 -0
- package/dist/src/telemetry/high-water-mark-tracker.js.map +1 -0
- package/dist/src/telemetry/high-water-mark-tracker.test.d.ts +6 -0
- package/dist/src/telemetry/high-water-mark-tracker.test.js +152 -0
- package/dist/src/telemetry/high-water-mark-tracker.test.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +16 -2
- package/dist/src/telemetry/index.js +25 -2
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +25 -3
- package/dist/src/telemetry/loggers.js +333 -154
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +3 -4
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +868 -63
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/memory-monitor.d.ts +149 -0
- package/dist/src/telemetry/memory-monitor.js +335 -0
- package/dist/src/telemetry/memory-monitor.js.map +1 -0
- package/dist/src/telemetry/memory-monitor.test.d.ts +6 -0
- package/dist/src/telemetry/memory-monitor.test.js +472 -0
- package/dist/src/telemetry/memory-monitor.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +498 -11
- package/dist/src/telemetry/metrics.js +729 -84
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +964 -101
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/rate-limiter.d.ts +48 -0
- package/dist/src/telemetry/rate-limiter.js +100 -0
- package/dist/src/telemetry/rate-limiter.js.map +1 -0
- package/dist/src/telemetry/rate-limiter.test.d.ts +6 -0
- package/dist/src/telemetry/rate-limiter.test.js +207 -0
- package/dist/src/telemetry/rate-limiter.test.js.map +1 -0
- package/dist/src/telemetry/sdk.d.ts +1 -1
- package/dist/src/telemetry/sdk.js +23 -4
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/telemetry/sdk.test.js +108 -0
- package/dist/src/telemetry/sdk.test.js.map +1 -1
- package/dist/src/telemetry/semantic.d.ts +82 -0
- package/dist/src/telemetry/semantic.js +269 -0
- package/dist/src/telemetry/semantic.js.map +1 -0
- package/dist/src/telemetry/semantic.test.d.ts +6 -0
- package/dist/src/telemetry/semantic.test.js +387 -0
- package/dist/src/telemetry/semantic.test.js.map +1 -0
- package/dist/src/telemetry/telemetry-utils.d.ts +6 -0
- package/dist/src/telemetry/telemetry-utils.js +14 -0
- package/dist/src/telemetry/telemetry-utils.js.map +1 -0
- package/dist/src/telemetry/telemetry-utils.test.d.ts +6 -0
- package/dist/src/telemetry/telemetry-utils.test.js +41 -0
- package/dist/src/telemetry/telemetry-utils.test.js.map +1 -0
- package/dist/src/telemetry/telemetryAttributes.d.ts +8 -0
- package/dist/src/telemetry/telemetryAttributes.js +19 -0
- package/dist/src/telemetry/telemetryAttributes.js.map +1 -0
- package/dist/src/telemetry/trace.d.ts +46 -0
- package/dist/src/telemetry/trace.js +121 -0
- package/dist/src/telemetry/trace.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +351 -25
- package/dist/src/telemetry/types.js +1071 -63
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +4 -4
- package/dist/src/telemetry/uiTelemetry.js +14 -15
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +122 -96
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/config.d.ts +3 -2
- package/dist/src/test-utils/config.js +1 -1
- package/dist/src/test-utils/config.js.map +1 -1
- package/dist/src/test-utils/index.d.ts +6 -0
- package/dist/src/test-utils/index.js +7 -0
- package/dist/src/test-utils/index.js.map +1 -0
- package/dist/src/test-utils/mock-tool.d.ts +66 -0
- package/dist/src/test-utils/{tools.js → mock-tool.js} +45 -29
- package/dist/src/test-utils/mock-tool.js.map +1 -0
- package/dist/src/test-utils/mockWorkspaceContext.d.ts +1 -1
- package/dist/src/tools/base-tool-invocation.test.d.ts +6 -0
- package/dist/src/tools/base-tool-invocation.test.js +85 -0
- package/dist/src/tools/base-tool-invocation.test.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +1 -1
- package/dist/src/tools/diffOptions.js +21 -13
- package/dist/src/tools/diffOptions.js.map +1 -1
- package/dist/src/tools/diffOptions.test.js +58 -22
- package/dist/src/tools/diffOptions.test.js.map +1 -1
- package/dist/src/tools/edit.d.ts +10 -8
- package/dist/src/tools/edit.js +100 -79
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +429 -163
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/glob.d.ts +11 -5
- package/dist/src/tools/glob.js +58 -42
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/glob.test.js +249 -166
- package/dist/src/tools/glob.test.js.map +1 -1
- package/dist/src/tools/grep.d.ts +7 -5
- package/dist/src/tools/grep.js +66 -40
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +41 -15
- package/dist/src/tools/grep.test.js.map +1 -1
- package/dist/src/tools/ls.d.ts +7 -5
- package/dist/src/tools/ls.js +54 -68
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/ls.test.js +150 -293
- package/dist/src/tools/ls.test.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.d.ts +52 -12
- package/dist/src/tools/mcp-client-manager.js +196 -27
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +139 -13
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +28 -24
- package/dist/src/tools/mcp-client.js +338 -351
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +380 -193
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/mcp-tool.d.ts +11 -5
- package/dist/src/tools/mcp-tool.js +66 -17
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/mcp-tool.test.js +278 -211
- package/dist/src/tools/mcp-tool.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +10 -7
- package/dist/src/tools/memoryTool.js +28 -49
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +26 -13
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/message-bus-integration.test.d.ts +6 -0
- package/dist/src/tools/message-bus-integration.test.js +196 -0
- package/dist/src/tools/message-bus-integration.test.js.map +1 -0
- package/dist/src/tools/modifiable-tool.d.ts +7 -3
- package/dist/src/tools/modifiable-tool.js +41 -19
- package/dist/src/tools/modifiable-tool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.test.js +70 -35
- package/dist/src/tools/modifiable-tool.test.js.map +1 -1
- package/dist/src/tools/read-file.d.ts +9 -7
- package/dist/src/tools/read-file.js +39 -60
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +103 -36
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.d.ts +9 -14
- package/dist/src/tools/read-many-files.js +71 -155
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +98 -44
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/ripGrep.d.ts +73 -0
- package/dist/src/tools/ripGrep.js +395 -0
- package/dist/src/tools/ripGrep.js.map +1 -0
- package/dist/src/tools/ripGrep.test.d.ts +6 -0
- package/dist/src/tools/ripGrep.test.js +1305 -0
- package/dist/src/tools/ripGrep.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +19 -6
- package/dist/src/tools/shell.js +92 -56
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +176 -103
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/smart-edit.d.ts +78 -0
- package/dist/src/tools/smart-edit.js +717 -0
- package/dist/src/tools/smart-edit.js.map +1 -0
- package/dist/src/tools/smart-edit.test.d.ts +6 -0
- package/dist/src/tools/smart-edit.test.js +592 -0
- package/dist/src/tools/smart-edit.test.js.map +1 -0
- package/dist/src/tools/tool-error.d.ts +39 -1
- package/dist/src/tools/tool-error.js +54 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +17 -0
- package/dist/src/tools/tool-names.js +21 -0
- package/dist/src/tools/tool-names.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +38 -20
- package/dist/src/tools/tool-registry.js +134 -77
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +218 -58
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +49 -17
- package/dist/src/tools/tools.js +150 -8
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/tools.test.js +1 -2
- package/dist/src/tools/tools.test.js.map +1 -1
- package/dist/src/tools/web-fetch.d.ts +14 -5
- package/dist/src/tools/web-fetch.js +90 -44
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +388 -20
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/web-search.d.ts +8 -6
- package/dist/src/tools/web-search.js +40 -15
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/web-search.test.js +75 -1
- package/dist/src/tools/web-search.test.js.map +1 -1
- package/dist/src/tools/write-file.d.ts +7 -5
- package/dist/src/tools/write-file.js +54 -54
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +237 -146
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/tools/write-todos.d.ts +50 -0
- package/dist/src/tools/write-todos.js +193 -0
- package/dist/src/tools/write-todos.js.map +1 -0
- package/dist/src/tools/write-todos.test.d.ts +6 -0
- package/dist/src/tools/write-todos.test.js +89 -0
- package/dist/src/tools/write-todos.test.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.d.ts +2 -2
- package/dist/src/utils/bfsFileSearch.js +16 -9
- package/dist/src/utils/bfsFileSearch.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.test.js +3 -3
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -1
- package/dist/src/utils/channel.d.ts +19 -0
- package/dist/src/utils/channel.js +49 -0
- package/dist/src/utils/channel.js.map +1 -0
- package/dist/src/utils/channel.test.d.ts +6 -0
- package/dist/src/utils/channel.test.js +170 -0
- package/dist/src/utils/channel.test.js.map +1 -0
- package/dist/src/utils/debugLogger.d.ts +25 -0
- package/dist/src/utils/debugLogger.js +33 -0
- package/dist/src/utils/debugLogger.js.map +1 -0
- package/dist/src/utils/debugLogger.test.d.ts +6 -0
- package/dist/src/utils/debugLogger.test.js +69 -0
- package/dist/src/utils/debugLogger.test.js.map +1 -0
- package/dist/src/utils/delay.d.ts +16 -0
- package/dist/src/utils/delay.js +43 -0
- package/dist/src/utils/delay.js.map +1 -0
- package/dist/src/utils/delay.test.d.ts +6 -0
- package/dist/src/utils/delay.test.js +88 -0
- package/dist/src/utils/delay.test.js.map +1 -0
- package/dist/src/utils/editCorrector.d.ts +9 -8
- package/dist/src/utils/editCorrector.js +62 -34
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editCorrector.test.js +52 -87
- package/dist/src/utils/editCorrector.test.js.map +1 -1
- package/dist/src/utils/editor.d.ts +4 -2
- package/dist/src/utils/editor.js +56 -55
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/editor.test.js +47 -88
- package/dist/src/utils/editor.test.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +3 -2
- package/dist/src/utils/environmentContext.js +20 -33
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +6 -34
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/errorParsing.d.ts +1 -1
- package/dist/src/utils/errorParsing.js +5 -33
- package/dist/src/utils/errorParsing.js.map +1 -1
- package/dist/src/utils/errorParsing.test.js +0 -88
- package/dist/src/utils/errorParsing.test.js.map +1 -1
- package/dist/src/utils/errorReporting.d.ts +1 -1
- package/dist/src/utils/errors.d.ts +28 -0
- package/dist/src/utils/errors.js +48 -0
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/events.d.ts +121 -0
- package/dist/src/utils/events.js +84 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/events.test.d.ts +6 -0
- package/dist/src/utils/events.test.js +212 -0
- package/dist/src/utils/events.test.js.map +1 -0
- package/dist/src/utils/extensionLoader.d.ts +86 -0
- package/dist/src/utils/extensionLoader.js +208 -0
- package/dist/src/utils/extensionLoader.js.map +1 -0
- package/dist/src/utils/extensionLoader.test.d.ts +6 -0
- package/dist/src/utils/extensionLoader.test.js +154 -0
- package/dist/src/utils/extensionLoader.test.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +1 -0
- package/dist/src/utils/fetch.js +5 -1
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/fileUtils.d.ts +28 -12
- package/dist/src/utils/fileUtils.js +204 -81
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +426 -82
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/filesearch/crawler.d.ts +1 -1
- package/dist/src/utils/filesearch/crawler.test.js +2 -2
- package/dist/src/utils/filesearch/crawler.test.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.d.ts +1 -0
- package/dist/src/utils/filesearch/fileSearch.js +14 -9
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.test.js +90 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -1
- package/dist/src/utils/flashFallback.test.d.ts +6 -0
- package/dist/src/utils/flashFallback.test.js +103 -0
- package/dist/src/utils/flashFallback.test.js.map +1 -0
- package/dist/src/utils/formatters.d.ts +1 -0
- package/dist/src/utils/formatters.js +2 -1
- package/dist/src/utils/formatters.js.map +1 -1
- package/dist/src/utils/formatters.test.d.ts +6 -0
- package/dist/src/utils/formatters.test.js +26 -0
- package/dist/src/utils/formatters.test.js.map +1 -0
- package/dist/src/utils/geminiIgnoreParser.d.ts +18 -0
- package/dist/src/utils/geminiIgnoreParser.js +61 -0
- package/dist/src/utils/geminiIgnoreParser.js.map +1 -0
- package/dist/src/utils/geminiIgnoreParser.test.d.ts +6 -0
- package/dist/src/utils/geminiIgnoreParser.test.js +50 -0
- package/dist/src/utils/geminiIgnoreParser.test.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.d.ts +1 -2
- package/dist/src/utils/generateContentResponseUtilities.js +1 -13
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.test.js +2 -40
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -1
- package/dist/src/utils/getFolderStructure.d.ts +2 -2
- package/dist/src/utils/getFolderStructure.js +12 -20
- package/dist/src/utils/getFolderStructure.js.map +1 -1
- package/dist/src/utils/getFolderStructure.test.js +11 -10
- package/dist/src/utils/getFolderStructure.test.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.d.ts +7 -8
- package/dist/src/utils/gitIgnoreParser.js +145 -36
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.test.js +127 -38
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
- package/dist/src/utils/gitUtils.js +2 -2
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/googleErrors.d.ts +104 -0
- package/dist/src/utils/googleErrors.js +152 -0
- package/dist/src/utils/googleErrors.js.map +1 -0
- package/dist/src/utils/googleErrors.test.d.ts +6 -0
- package/dist/src/utils/googleErrors.test.js +301 -0
- package/dist/src/utils/googleErrors.test.js.map +1 -0
- package/dist/src/utils/googleQuotaErrors.d.ts +37 -0
- package/dist/src/utils/googleQuotaErrors.js +157 -0
- package/dist/src/utils/googleQuotaErrors.js.map +1 -0
- package/dist/src/utils/googleQuotaErrors.test.d.ts +6 -0
- package/dist/src/utils/googleQuotaErrors.test.js +311 -0
- package/dist/src/utils/googleQuotaErrors.test.js.map +1 -0
- package/dist/src/utils/httpErrors.d.ts +18 -0
- package/dist/src/utils/httpErrors.js +36 -0
- package/dist/src/utils/httpErrors.js.map +1 -0
- package/dist/src/utils/ignorePatterns.d.ts +103 -0
- package/dist/src/utils/ignorePatterns.js +220 -0
- package/dist/src/utils/ignorePatterns.js.map +1 -0
- package/dist/src/utils/ignorePatterns.test.d.ts +6 -0
- package/dist/src/utils/ignorePatterns.test.js +246 -0
- package/dist/src/utils/ignorePatterns.test.js.map +1 -0
- package/dist/src/utils/installationManager.d.ts +16 -0
- package/dist/src/utils/installationManager.js +51 -0
- package/dist/src/utils/installationManager.js.map +1 -0
- package/dist/src/utils/installationManager.test.d.ts +6 -0
- package/dist/src/utils/installationManager.test.js +85 -0
- package/dist/src/utils/installationManager.test.js.map +1 -0
- package/dist/src/utils/language-detection.d.ts +6 -0
- package/dist/src/utils/language-detection.js +101 -0
- package/dist/src/utils/language-detection.js.map +1 -0
- package/dist/src/utils/llm-edit-fixer.d.ts +26 -0
- package/dist/src/utils/llm-edit-fixer.js +155 -0
- package/dist/src/utils/llm-edit-fixer.js.map +1 -0
- package/dist/src/utils/llm-edit-fixer.test.d.ts +6 -0
- package/dist/src/utils/llm-edit-fixer.test.js +223 -0
- package/dist/src/utils/llm-edit-fixer.test.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.d.ts +26 -6
- package/dist/src/utils/memoryDiscovery.js +239 -40
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +365 -44
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.js +19 -25
- package/dist/src/utils/memoryImportProcessor.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.test.js +24 -155
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
- package/dist/src/utils/messageInspectors.d.ts +1 -1
- package/dist/src/utils/nextSpeakerChecker.d.ts +3 -3
- package/dist/src/utils/nextSpeakerChecker.js +10 -4
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.test.js +85 -66
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
- package/dist/src/utils/package.d.ts +12 -0
- package/dist/src/utils/package.js +15 -0
- package/dist/src/utils/package.js.map +1 -0
- package/dist/src/utils/partUtils.d.ts +22 -1
- package/dist/src/utils/partUtils.js +68 -0
- package/dist/src/utils/partUtils.js.map +1 -1
- package/dist/src/utils/partUtils.test.js +112 -1
- package/dist/src/utils/partUtils.test.js.map +1 -1
- package/dist/src/utils/pathCorrector.d.ts +25 -0
- package/dist/src/utils/pathCorrector.js +33 -0
- package/dist/src/utils/pathCorrector.js.map +1 -0
- package/dist/src/utils/pathCorrector.test.d.ts +6 -0
- package/dist/src/utils/pathCorrector.test.js +83 -0
- package/dist/src/utils/pathCorrector.test.js.map +1 -0
- package/dist/src/utils/pathReader.d.ts +17 -0
- package/dist/src/utils/pathReader.js +92 -0
- package/dist/src/utils/pathReader.js.map +1 -0
- package/dist/src/utils/pathReader.test.d.ts +6 -0
- package/dist/src/utils/pathReader.test.js +406 -0
- package/dist/src/utils/pathReader.test.js.map +1 -0
- package/dist/src/utils/paths.d.ts +1 -18
- package/dist/src/utils/paths.js +133 -57
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/paths.test.js +200 -68
- package/dist/src/utils/paths.test.js.map +1 -1
- package/dist/src/utils/promptIdContext.d.ts +7 -0
- package/dist/src/utils/promptIdContext.js +8 -0
- package/dist/src/utils/promptIdContext.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +1 -3
- package/dist/src/utils/quotaErrorDetection.js +0 -46
- package/dist/src/utils/quotaErrorDetection.js.map +1 -1
- package/dist/src/utils/retry.d.ts +5 -10
- package/dist/src/utils/retry.js +114 -197
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +196 -130
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/safeJsonStringify.d.ts +4 -4
- package/dist/src/utils/safeJsonStringify.js +31 -7
- package/dist/src/utils/safeJsonStringify.js.map +1 -1
- package/dist/src/utils/schemaValidator.js +15 -1
- package/dist/src/utils/schemaValidator.js.map +1 -1
- package/dist/src/utils/schemaValidator.test.d.ts +6 -0
- package/dist/src/utils/schemaValidator.test.js +113 -0
- package/dist/src/utils/schemaValidator.test.js.map +1 -0
- package/dist/src/utils/session.js +1 -1
- package/dist/src/utils/session.js.map +1 -1
- package/dist/src/utils/shell-utils.d.ts +21 -3
- package/dist/src/utils/shell-utils.js +427 -159
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +250 -59
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/stdio.d.ts +32 -0
- package/dist/src/utils/stdio.js +85 -0
- package/dist/src/utils/stdio.js.map +1 -0
- package/dist/src/utils/stdio.test.d.ts +6 -0
- package/dist/src/utils/stdio.test.js +47 -0
- package/dist/src/utils/stdio.test.js.map +1 -0
- package/dist/src/utils/summarizer.d.ts +6 -4
- package/dist/src/utils/summarizer.js +8 -9
- package/dist/src/utils/summarizer.js.map +1 -1
- package/dist/src/utils/summarizer.test.js +32 -12
- package/dist/src/utils/summarizer.test.js.map +1 -1
- package/dist/src/utils/systemEncoding.js +7 -6
- package/dist/src/utils/systemEncoding.js.map +1 -1
- package/dist/src/utils/systemEncoding.test.js +4 -3
- package/dist/src/utils/systemEncoding.test.js.map +1 -1
- package/dist/src/utils/terminal.d.ts +14 -0
- package/dist/src/utils/terminal.js +38 -0
- package/dist/src/utils/terminal.js.map +1 -0
- package/dist/src/utils/terminalSerializer.d.ts +25 -0
- package/dist/src/utils/terminalSerializer.js +432 -0
- package/dist/src/utils/terminalSerializer.js.map +1 -0
- package/dist/src/utils/terminalSerializer.test.d.ts +6 -0
- package/dist/src/utils/terminalSerializer.test.js +176 -0
- package/dist/src/utils/terminalSerializer.test.js.map +1 -0
- package/dist/src/utils/textUtils.d.ts +5 -0
- package/dist/src/utils/textUtils.js +14 -0
- package/dist/src/utils/textUtils.js.map +1 -1
- package/dist/src/utils/textUtils.test.d.ts +6 -0
- package/dist/src/utils/textUtils.test.js +59 -0
- package/dist/src/utils/textUtils.test.js.map +1 -0
- package/dist/src/utils/thoughtUtils.d.ts +21 -0
- package/dist/src/utils/thoughtUtils.js +39 -0
- package/dist/src/utils/thoughtUtils.js.map +1 -0
- package/dist/src/utils/thoughtUtils.test.d.ts +6 -0
- package/dist/src/utils/thoughtUtils.test.js +78 -0
- package/dist/src/utils/thoughtUtils.test.js.map +1 -0
- package/dist/src/utils/tool-utils.d.ts +19 -0
- package/dist/src/utils/tool-utils.js +67 -0
- package/dist/src/utils/tool-utils.js.map +1 -0
- package/dist/src/utils/tool-utils.test.d.ts +6 -0
- package/dist/src/utils/tool-utils.test.js +69 -0
- package/dist/src/utils/tool-utils.test.js.map +1 -0
- package/dist/src/utils/userAccountManager.d.ts +20 -0
- package/dist/src/utils/userAccountManager.js +115 -0
- package/dist/src/utils/userAccountManager.js.map +1 -0
- package/dist/src/utils/userAccountManager.test.d.ts +6 -0
- package/dist/src/utils/{user_account.test.js → userAccountManager.test.js} +41 -36
- package/dist/src/utils/userAccountManager.test.js.map +1 -0
- package/dist/src/utils/workspaceContext.d.ts +4 -3
- package/dist/src/utils/workspaceContext.js +23 -17
- package/dist/src/utils/workspaceContext.js.map +1 -1
- package/dist/src/utils/workspaceContext.test.js +45 -19
- package/dist/src/utils/workspaceContext.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -10
- package/dist/src/core/modelCheck.d.ts +0 -14
- package/dist/src/core/modelCheck.js +0 -62
- package/dist/src/core/modelCheck.js.map +0 -1
- package/dist/src/test-utils/tools.d.ts +0 -44
- package/dist/src/test-utils/tools.js.map +0 -1
- package/dist/src/utils/flashFallback.integration.test.js +0 -118
- package/dist/src/utils/flashFallback.integration.test.js.map +0 -1
- package/dist/src/utils/user_account.d.ts +0 -9
- package/dist/src/utils/user_account.js +0 -109
- package/dist/src/utils/user_account.js.map +0 -1
- package/dist/src/utils/user_account.test.js.map +0 -1
- package/dist/src/utils/user_id.d.ts +0 -11
- package/dist/src/utils/user_id.js +0 -49
- package/dist/src/utils/user_id.js.map +0 -1
- package/dist/src/utils/user_id.test.js +0 -21
- package/dist/src/utils/user_id.test.js.map +0 -1
- /package/dist/src/{utils/flashFallback.integration.test.d.ts → agents/codebase-investigator.test.d.ts} +0 -0
- /package/dist/src/{utils/user_account.test.d.ts → agents/executor.test.d.ts} +0 -0
- /package/dist/src/{utils/user_id.test.d.ts → agents/invocation.test.d.ts} +0 -0
|
@@ -4,49 +4,60 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import * as path from 'node:path';
|
|
7
|
+
import { inspect } from 'node:util';
|
|
7
8
|
import process from 'node:process';
|
|
8
|
-
import { AuthType, createContentGeneratorConfig, } from '../core/contentGenerator.js';
|
|
9
|
+
import { AuthType, createContentGenerator, createContentGeneratorConfig, } from '../core/contentGenerator.js';
|
|
9
10
|
import { PromptRegistry } from '../prompts/prompt-registry.js';
|
|
10
11
|
import { ToolRegistry } from '../tools/tool-registry.js';
|
|
11
12
|
import { LSTool } from '../tools/ls.js';
|
|
12
13
|
import { ReadFileTool } from '../tools/read-file.js';
|
|
13
14
|
import { GrepTool } from '../tools/grep.js';
|
|
15
|
+
import { canUseRipgrep, RipGrepTool } from '../tools/ripGrep.js';
|
|
14
16
|
import { GlobTool } from '../tools/glob.js';
|
|
15
17
|
import { EditTool } from '../tools/edit.js';
|
|
18
|
+
import { SmartEditTool } from '../tools/smart-edit.js';
|
|
16
19
|
import { ShellTool } from '../tools/shell.js';
|
|
17
20
|
import { WriteFileTool } from '../tools/write-file.js';
|
|
18
21
|
import { WebFetchTool } from '../tools/web-fetch.js';
|
|
19
|
-
import {
|
|
20
|
-
import { MemoryTool, setGeminiMdFilename, GEMINI_CONFIG_DIR as GEMINI_DIR, } from '../tools/memoryTool.js';
|
|
22
|
+
import { MemoryTool, setGeminiMdFilename } from '../tools/memoryTool.js';
|
|
21
23
|
import { WebSearchTool } from '../tools/web-search.js';
|
|
22
24
|
import { GeminiClient } from '../core/client.js';
|
|
25
|
+
import { BaseLlmClient } from '../core/baseLlmClient.js';
|
|
23
26
|
import { FileDiscoveryService } from '../services/fileDiscoveryService.js';
|
|
24
27
|
import { GitService } from '../services/gitService.js';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
+
import { initializeTelemetry, DEFAULT_TELEMETRY_TARGET, DEFAULT_OTLP_ENDPOINT, uiTelemetryService, } from '../telemetry/index.js';
|
|
29
|
+
import { coreEvents } from '../utils/events.js';
|
|
30
|
+
import { tokenLimit } from '../core/tokenLimits.js';
|
|
31
|
+
import { DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_MODEL_AUTO, DEFAULT_THINKING_MODE, } from './models.js';
|
|
28
32
|
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
+
import { ideContextStore } from '../ide/ideContext.js';
|
|
34
|
+
import { WriteTodosTool } from '../tools/write-todos.js';
|
|
35
|
+
import { StandardFileSystemService } from '../services/fileSystemService.js';
|
|
36
|
+
import { logRipgrepFallback } from '../telemetry/loggers.js';
|
|
37
|
+
import { RipgrepFallbackEvent } from '../telemetry/types.js';
|
|
38
|
+
import { ModelRouterService } from '../routing/modelRouterService.js';
|
|
39
|
+
import { OutputFormat } from '../output/types.js';
|
|
40
|
+
import { ModelConfigService } from '../services/modelConfigService.js';
|
|
41
|
+
import { DEFAULT_MODEL_CONFIGS } from './defaultModelConfigs.js';
|
|
33
42
|
import { WorkspaceContext } from '../utils/workspaceContext.js';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
43
|
+
import { Storage } from './storage.js';
|
|
44
|
+
import { FileExclusions } from '../utils/ignorePatterns.js';
|
|
45
|
+
import { MessageBus } from '../confirmation-bus/message-bus.js';
|
|
46
|
+
import { PolicyEngine } from '../policy/policy-engine.js';
|
|
47
|
+
import { getCodeAssistServer } from '../code_assist/codeAssist.js';
|
|
48
|
+
import { AgentRegistry } from '../agents/registry.js';
|
|
49
|
+
import { setGlobalProxy } from '../utils/fetch.js';
|
|
50
|
+
import { SubagentToolWrapper } from '../agents/subagent-tool-wrapper.js';
|
|
51
|
+
import { getExperiments } from '../code_assist/experiments/experiments.js';
|
|
52
|
+
import { ExperimentFlags } from '../code_assist/experiments/flagNames.js';
|
|
53
|
+
import { debugLogger } from '../utils/debugLogger.js';
|
|
54
|
+
import { ApprovalMode } from '../policy/types.js';
|
|
55
|
+
import { DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, } from './constants.js';
|
|
56
|
+
import { SimpleExtensionLoader, } from '../utils/extensionLoader.js';
|
|
57
|
+
import { McpClientManager } from '../tools/mcp-client-manager.js';
|
|
58
|
+
export { DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, };
|
|
59
|
+
export const DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD = 4_000_000;
|
|
60
|
+
export const DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES = 1000;
|
|
50
61
|
export class MCPServerConfig {
|
|
51
62
|
command;
|
|
52
63
|
args;
|
|
@@ -61,9 +72,11 @@ export class MCPServerConfig {
|
|
|
61
72
|
description;
|
|
62
73
|
includeTools;
|
|
63
74
|
excludeTools;
|
|
64
|
-
|
|
75
|
+
extension;
|
|
65
76
|
oauth;
|
|
66
77
|
authProviderType;
|
|
78
|
+
targetAudience;
|
|
79
|
+
targetServiceAccount;
|
|
67
80
|
constructor(
|
|
68
81
|
// For stdio transport
|
|
69
82
|
command, args, env, cwd,
|
|
@@ -76,9 +89,14 @@ export class MCPServerConfig {
|
|
|
76
89
|
// Common
|
|
77
90
|
timeout, trust,
|
|
78
91
|
// Metadata
|
|
79
|
-
description, includeTools, excludeTools,
|
|
92
|
+
description, includeTools, excludeTools, extension,
|
|
80
93
|
// OAuth configuration
|
|
81
|
-
oauth, authProviderType
|
|
94
|
+
oauth, authProviderType,
|
|
95
|
+
// Service Account Configuration
|
|
96
|
+
/* targetAudience format: CLIENT_ID.apps.googleusercontent.com */
|
|
97
|
+
targetAudience,
|
|
98
|
+
/* targetServiceAccount format: <service-account-name>@<project-num>.iam.gserviceaccount.com */
|
|
99
|
+
targetServiceAccount) {
|
|
82
100
|
this.command = command;
|
|
83
101
|
this.args = args;
|
|
84
102
|
this.env = env;
|
|
@@ -92,30 +110,39 @@ export class MCPServerConfig {
|
|
|
92
110
|
this.description = description;
|
|
93
111
|
this.includeTools = includeTools;
|
|
94
112
|
this.excludeTools = excludeTools;
|
|
95
|
-
this.
|
|
113
|
+
this.extension = extension;
|
|
96
114
|
this.oauth = oauth;
|
|
97
115
|
this.authProviderType = authProviderType;
|
|
116
|
+
this.targetAudience = targetAudience;
|
|
117
|
+
this.targetServiceAccount = targetServiceAccount;
|
|
98
118
|
}
|
|
99
119
|
}
|
|
100
120
|
export var AuthProviderType;
|
|
101
121
|
(function (AuthProviderType) {
|
|
102
122
|
AuthProviderType["DYNAMIC_DISCOVERY"] = "dynamic_discovery";
|
|
103
123
|
AuthProviderType["GOOGLE_CREDENTIALS"] = "google_credentials";
|
|
124
|
+
AuthProviderType["SERVICE_ACCOUNT_IMPERSONATION"] = "service_account_impersonation";
|
|
104
125
|
})(AuthProviderType || (AuthProviderType = {}));
|
|
105
126
|
export class Config {
|
|
106
127
|
toolRegistry;
|
|
128
|
+
mcpClientManager;
|
|
129
|
+
allowedMcpServers;
|
|
130
|
+
blockedMcpServers;
|
|
107
131
|
promptRegistry;
|
|
132
|
+
agentRegistry;
|
|
108
133
|
sessionId;
|
|
109
134
|
fileSystemService;
|
|
110
135
|
contentGeneratorConfig;
|
|
136
|
+
contentGenerator;
|
|
137
|
+
modelConfigService;
|
|
111
138
|
embeddingModel;
|
|
112
139
|
sandbox;
|
|
113
140
|
targetDir;
|
|
114
141
|
workspaceContext;
|
|
115
142
|
debugMode;
|
|
116
143
|
question;
|
|
117
|
-
fullContext;
|
|
118
144
|
coreTools;
|
|
145
|
+
allowedTools;
|
|
119
146
|
excludeTools;
|
|
120
147
|
toolDiscoveryCommand;
|
|
121
148
|
toolCallCommand;
|
|
@@ -123,12 +150,15 @@ export class Config {
|
|
|
123
150
|
mcpServers;
|
|
124
151
|
userMemory;
|
|
125
152
|
geminiMdFileCount;
|
|
153
|
+
geminiMdFilePaths;
|
|
126
154
|
approvalMode;
|
|
127
155
|
showMemoryUsage;
|
|
128
156
|
accessibility;
|
|
129
157
|
telemetrySettings;
|
|
130
158
|
usageStatisticsEnabled;
|
|
131
159
|
geminiClient;
|
|
160
|
+
baseLlmClient;
|
|
161
|
+
modelRouterService;
|
|
132
162
|
fileFiltering;
|
|
133
163
|
fileDiscoveryService = null;
|
|
134
164
|
gitService = undefined;
|
|
@@ -137,28 +167,65 @@ export class Config {
|
|
|
137
167
|
cwd;
|
|
138
168
|
bugCommand;
|
|
139
169
|
model;
|
|
140
|
-
|
|
170
|
+
previewFeatures;
|
|
141
171
|
noBrowser;
|
|
142
|
-
folderTrustFeature;
|
|
143
172
|
folderTrust;
|
|
144
173
|
ideMode;
|
|
145
|
-
ideClient;
|
|
146
174
|
inFallbackMode = false;
|
|
147
175
|
maxSessionTurns;
|
|
176
|
+
listSessions;
|
|
177
|
+
deleteSession;
|
|
148
178
|
listExtensions;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
179
|
+
_extensionLoader;
|
|
180
|
+
_enabledExtensions;
|
|
181
|
+
enableExtensionReloading;
|
|
182
|
+
fallbackModelHandler;
|
|
152
183
|
quotaErrorOccurred = false;
|
|
153
184
|
summarizeToolOutput;
|
|
154
185
|
experimentalZedIntegration = false;
|
|
155
186
|
loadMemoryFromIncludeDirectories = false;
|
|
156
|
-
|
|
187
|
+
importFormat;
|
|
188
|
+
discoveryMaxDirs;
|
|
189
|
+
compressionThreshold;
|
|
157
190
|
interactive;
|
|
191
|
+
ptyInfo;
|
|
158
192
|
trustedFolder;
|
|
159
|
-
|
|
193
|
+
useRipgrep;
|
|
194
|
+
enableInteractiveShell;
|
|
160
195
|
skipNextSpeakerCheck;
|
|
196
|
+
shellExecutionConfig;
|
|
197
|
+
extensionManagement = true;
|
|
198
|
+
enablePromptCompletion = false;
|
|
199
|
+
truncateToolOutputThreshold;
|
|
200
|
+
truncateToolOutputLines;
|
|
201
|
+
enableToolOutputTruncation;
|
|
161
202
|
initialized = false;
|
|
203
|
+
storage;
|
|
204
|
+
fileExclusions;
|
|
205
|
+
eventEmitter;
|
|
206
|
+
useSmartEdit;
|
|
207
|
+
useWriteTodos;
|
|
208
|
+
messageBus;
|
|
209
|
+
policyEngine;
|
|
210
|
+
outputSettings;
|
|
211
|
+
useModelRouter;
|
|
212
|
+
initialUseModelRouter;
|
|
213
|
+
disableModelRouterForAuth;
|
|
214
|
+
enableMessageBusIntegration;
|
|
215
|
+
codebaseInvestigatorSettings;
|
|
216
|
+
continueOnFailedApiCall;
|
|
217
|
+
retryFetchErrors;
|
|
218
|
+
enableShellOutputEfficiency;
|
|
219
|
+
fakeResponses;
|
|
220
|
+
recordResponses;
|
|
221
|
+
disableYoloMode;
|
|
222
|
+
pendingIncludeDirectories;
|
|
223
|
+
enableHooks;
|
|
224
|
+
hooks;
|
|
225
|
+
experiments;
|
|
226
|
+
experimentsPromise;
|
|
227
|
+
previewModelFallbackMode = false;
|
|
228
|
+
previewModelBypassMode = false;
|
|
162
229
|
constructor(params) {
|
|
163
230
|
this.sessionId = params.sessionId;
|
|
164
231
|
this.embeddingModel =
|
|
@@ -166,18 +233,23 @@ export class Config {
|
|
|
166
233
|
this.fileSystemService = new StandardFileSystemService();
|
|
167
234
|
this.sandbox = params.sandbox;
|
|
168
235
|
this.targetDir = path.resolve(params.targetDir);
|
|
169
|
-
this.
|
|
236
|
+
this.folderTrust = params.folderTrust ?? false;
|
|
237
|
+
this.workspaceContext = new WorkspaceContext(this.targetDir, []);
|
|
238
|
+
this.pendingIncludeDirectories = params.includeDirectories ?? [];
|
|
170
239
|
this.debugMode = params.debugMode;
|
|
171
240
|
this.question = params.question;
|
|
172
|
-
this.fullContext = params.fullContext ?? false;
|
|
173
241
|
this.coreTools = params.coreTools;
|
|
242
|
+
this.allowedTools = params.allowedTools;
|
|
174
243
|
this.excludeTools = params.excludeTools;
|
|
175
244
|
this.toolDiscoveryCommand = params.toolDiscoveryCommand;
|
|
176
245
|
this.toolCallCommand = params.toolCallCommand;
|
|
177
246
|
this.mcpServerCommand = params.mcpServerCommand;
|
|
178
247
|
this.mcpServers = params.mcpServers;
|
|
248
|
+
this.allowedMcpServers = params.allowedMcpServers ?? [];
|
|
249
|
+
this.blockedMcpServers = params.blockedMcpServers ?? [];
|
|
179
250
|
this.userMemory = params.userMemory ?? '';
|
|
180
251
|
this.geminiMdFileCount = params.geminiMdFileCount ?? 0;
|
|
252
|
+
this.geminiMdFilePaths = params.geminiMdFilePaths ?? [];
|
|
181
253
|
this.approvalMode = params.approvalMode ?? ApprovalMode.DEFAULT;
|
|
182
254
|
this.showMemoryUsage = params.showMemoryUsage ?? false;
|
|
183
255
|
this.accessibility = params.accessibility ?? {};
|
|
@@ -188,12 +260,16 @@ export class Config {
|
|
|
188
260
|
otlpProtocol: params.telemetry?.otlpProtocol,
|
|
189
261
|
logPrompts: params.telemetry?.logPrompts ?? true,
|
|
190
262
|
outfile: params.telemetry?.outfile,
|
|
263
|
+
useCollector: params.telemetry?.useCollector,
|
|
191
264
|
};
|
|
192
265
|
this.usageStatisticsEnabled = params.usageStatisticsEnabled ?? true;
|
|
193
266
|
this.fileFiltering = {
|
|
194
|
-
respectGitIgnore: params.fileFiltering?.respectGitIgnore ??
|
|
195
|
-
|
|
267
|
+
respectGitIgnore: params.fileFiltering?.respectGitIgnore ??
|
|
268
|
+
DEFAULT_FILE_FILTERING_OPTIONS.respectGitIgnore,
|
|
269
|
+
respectGeminiIgnore: params.fileFiltering?.respectGeminiIgnore ??
|
|
270
|
+
DEFAULT_FILE_FILTERING_OPTIONS.respectGeminiIgnore,
|
|
196
271
|
enableRecursiveFileSearch: params.fileFiltering?.enableRecursiveFileSearch ?? true,
|
|
272
|
+
disableFuzzySearch: params.fileFiltering?.disableFuzzySearch ?? false,
|
|
197
273
|
};
|
|
198
274
|
this.checkpointing = params.checkpointing ?? false;
|
|
199
275
|
this.proxy = params.proxy;
|
|
@@ -201,33 +277,117 @@ export class Config {
|
|
|
201
277
|
this.fileDiscoveryService = params.fileDiscoveryService ?? null;
|
|
202
278
|
this.bugCommand = params.bugCommand;
|
|
203
279
|
this.model = params.model;
|
|
204
|
-
this.
|
|
280
|
+
this.previewFeatures = params.previewFeatures ?? undefined;
|
|
205
281
|
this.maxSessionTurns = params.maxSessionTurns ?? -1;
|
|
206
282
|
this.experimentalZedIntegration =
|
|
207
283
|
params.experimentalZedIntegration ?? false;
|
|
284
|
+
this.listSessions = params.listSessions ?? false;
|
|
285
|
+
this.deleteSession = params.deleteSession;
|
|
208
286
|
this.listExtensions = params.listExtensions ?? false;
|
|
209
|
-
this.
|
|
210
|
-
|
|
287
|
+
this._extensionLoader =
|
|
288
|
+
params.extensionLoader ?? new SimpleExtensionLoader([]);
|
|
289
|
+
this._enabledExtensions = params.enabledExtensions ?? [];
|
|
211
290
|
this.noBrowser = params.noBrowser ?? false;
|
|
212
291
|
this.summarizeToolOutput = params.summarizeToolOutput;
|
|
213
|
-
this.folderTrustFeature = params.folderTrustFeature ?? false;
|
|
214
292
|
this.folderTrust = params.folderTrust ?? false;
|
|
215
293
|
this.ideMode = params.ideMode ?? false;
|
|
216
|
-
this.ideClient = IdeClient.getInstance();
|
|
217
294
|
this.loadMemoryFromIncludeDirectories =
|
|
218
295
|
params.loadMemoryFromIncludeDirectories ?? false;
|
|
219
|
-
this.
|
|
296
|
+
this.importFormat = params.importFormat ?? 'tree';
|
|
297
|
+
this.discoveryMaxDirs = params.discoveryMaxDirs ?? 200;
|
|
298
|
+
this.compressionThreshold = params.compressionThreshold;
|
|
220
299
|
this.interactive = params.interactive ?? false;
|
|
300
|
+
this.ptyInfo = params.ptyInfo ?? 'child_process';
|
|
221
301
|
this.trustedFolder = params.trustedFolder;
|
|
222
|
-
this.
|
|
223
|
-
this.
|
|
302
|
+
this.useRipgrep = params.useRipgrep ?? true;
|
|
303
|
+
this.enableInteractiveShell = params.enableInteractiveShell ?? false;
|
|
304
|
+
this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? true;
|
|
305
|
+
this.shellExecutionConfig = {
|
|
306
|
+
terminalWidth: params.shellExecutionConfig?.terminalWidth ?? 80,
|
|
307
|
+
terminalHeight: params.shellExecutionConfig?.terminalHeight ?? 24,
|
|
308
|
+
showColor: params.shellExecutionConfig?.showColor ?? false,
|
|
309
|
+
pager: params.shellExecutionConfig?.pager ?? 'cat',
|
|
310
|
+
};
|
|
311
|
+
this.truncateToolOutputThreshold =
|
|
312
|
+
params.truncateToolOutputThreshold ??
|
|
313
|
+
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD;
|
|
314
|
+
this.truncateToolOutputLines =
|
|
315
|
+
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
|
316
|
+
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
|
317
|
+
this.useSmartEdit = params.useSmartEdit ?? true;
|
|
318
|
+
this.useWriteTodos = params.useWriteTodos ?? true;
|
|
319
|
+
this.initialUseModelRouter = params.useModelRouter ?? false;
|
|
320
|
+
this.useModelRouter = this.initialUseModelRouter;
|
|
321
|
+
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
|
322
|
+
this.enableHooks = params.enableHooks ?? false;
|
|
323
|
+
// Enable MessageBus integration if:
|
|
324
|
+
// 1. Explicitly enabled via setting, OR
|
|
325
|
+
// 2. Hooks are enabled and hooks are configured
|
|
326
|
+
const hasHooks = params.hooks && Object.keys(params.hooks).length > 0;
|
|
327
|
+
const hooksNeedMessageBus = this.enableHooks && hasHooks;
|
|
328
|
+
this.enableMessageBusIntegration =
|
|
329
|
+
params.enableMessageBusIntegration ??
|
|
330
|
+
(hooksNeedMessageBus ? true : false);
|
|
331
|
+
this.codebaseInvestigatorSettings = {
|
|
332
|
+
enabled: params.codebaseInvestigatorSettings?.enabled ?? true,
|
|
333
|
+
maxNumTurns: params.codebaseInvestigatorSettings?.maxNumTurns ?? 10,
|
|
334
|
+
maxTimeMinutes: params.codebaseInvestigatorSettings?.maxTimeMinutes ?? 3,
|
|
335
|
+
thinkingBudget: params.codebaseInvestigatorSettings?.thinkingBudget ??
|
|
336
|
+
DEFAULT_THINKING_MODE,
|
|
337
|
+
model: params.codebaseInvestigatorSettings?.model ?? DEFAULT_GEMINI_MODEL,
|
|
338
|
+
};
|
|
339
|
+
this.continueOnFailedApiCall = params.continueOnFailedApiCall ?? true;
|
|
340
|
+
this.enableShellOutputEfficiency =
|
|
341
|
+
params.enableShellOutputEfficiency ?? true;
|
|
342
|
+
this.extensionManagement = params.extensionManagement ?? true;
|
|
343
|
+
this.enableExtensionReloading = params.enableExtensionReloading ?? false;
|
|
344
|
+
this.storage = new Storage(this.targetDir);
|
|
345
|
+
this.fakeResponses = params.fakeResponses;
|
|
346
|
+
this.recordResponses = params.recordResponses;
|
|
347
|
+
this.enablePromptCompletion = params.enablePromptCompletion ?? false;
|
|
348
|
+
this.fileExclusions = new FileExclusions(this);
|
|
349
|
+
this.eventEmitter = params.eventEmitter;
|
|
350
|
+
this.policyEngine = new PolicyEngine(params.policyEngineConfig);
|
|
351
|
+
this.messageBus = new MessageBus(this.policyEngine, this.debugMode);
|
|
352
|
+
this.outputSettings = {
|
|
353
|
+
format: params.output?.format ?? OutputFormat.TEXT,
|
|
354
|
+
};
|
|
355
|
+
this.retryFetchErrors = params.retryFetchErrors ?? false;
|
|
356
|
+
this.disableYoloMode = params.disableYoloMode ?? false;
|
|
357
|
+
this.hooks = params.hooks;
|
|
358
|
+
this.experiments = params.experiments;
|
|
224
359
|
if (params.contextFileName) {
|
|
225
360
|
setGeminiMdFilename(params.contextFileName);
|
|
226
361
|
}
|
|
227
362
|
if (this.telemetrySettings.enabled) {
|
|
228
363
|
initializeTelemetry(this);
|
|
229
364
|
}
|
|
230
|
-
|
|
365
|
+
const proxy = this.getProxy();
|
|
366
|
+
if (proxy) {
|
|
367
|
+
try {
|
|
368
|
+
setGlobalProxy(proxy);
|
|
369
|
+
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
coreEvents.emitFeedback('error', 'Invalid proxy configuration detected. Check debug drawer for more details (F12)', error);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
this.geminiClient = new GeminiClient(this);
|
|
375
|
+
this.modelRouterService = new ModelRouterService(this);
|
|
376
|
+
// HACK: The settings loading logic doesn't currently merge the default
|
|
377
|
+
// generation config with the user's settings. This means if a user provides
|
|
378
|
+
// any `generation` settings (e.g., just `overrides`), the default `aliases`
|
|
379
|
+
// are lost. This hack manually merges the default aliases back in if they
|
|
380
|
+
// are missing from the user's config.
|
|
381
|
+
// TODO(12593): Fix the settings loading logic to properly merge defaults and
|
|
382
|
+
// remove this hack.
|
|
383
|
+
let modelConfigServiceConfig = params.modelConfigServiceConfig;
|
|
384
|
+
if (modelConfigServiceConfig && !modelConfigServiceConfig.aliases) {
|
|
385
|
+
modelConfigServiceConfig = {
|
|
386
|
+
...modelConfigServiceConfig,
|
|
387
|
+
aliases: DEFAULT_MODEL_CONFIGS.aliases,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
this.modelConfigService = new ModelConfigService(modelConfigServiceConfig ?? DEFAULT_MODEL_CONFIGS);
|
|
231
391
|
}
|
|
232
392
|
/**
|
|
233
393
|
* Must only be called once, throws if called again.
|
|
@@ -243,35 +403,83 @@ export class Config {
|
|
|
243
403
|
await this.getGitService();
|
|
244
404
|
}
|
|
245
405
|
this.promptRegistry = new PromptRegistry();
|
|
406
|
+
this.agentRegistry = new AgentRegistry(this);
|
|
407
|
+
await this.agentRegistry.initialize();
|
|
246
408
|
this.toolRegistry = await this.createToolRegistry();
|
|
409
|
+
this.mcpClientManager = new McpClientManager(this.toolRegistry, this, this.eventEmitter);
|
|
410
|
+
await Promise.all([
|
|
411
|
+
await this.mcpClientManager.startConfiguredMcpServers(),
|
|
412
|
+
await this.getExtensionLoader().start(this),
|
|
413
|
+
]);
|
|
414
|
+
await this.geminiClient.initialize();
|
|
415
|
+
}
|
|
416
|
+
getContentGenerator() {
|
|
417
|
+
return this.contentGenerator;
|
|
247
418
|
}
|
|
248
419
|
async refreshAuth(authMethod) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
420
|
+
this.useModelRouter = this.initialUseModelRouter;
|
|
421
|
+
if (this.disableModelRouterForAuth?.includes(authMethod)) {
|
|
422
|
+
this.useModelRouter = false;
|
|
423
|
+
if (this.model === DEFAULT_GEMINI_MODEL_AUTO) {
|
|
424
|
+
this.model = DEFAULT_GEMINI_MODEL;
|
|
425
|
+
}
|
|
253
426
|
}
|
|
254
|
-
// Create new content generator config
|
|
255
|
-
const newContentGeneratorConfig = createContentGeneratorConfig(this, authMethod);
|
|
256
|
-
// Create and initialize new client in local variable first
|
|
257
|
-
const newGeminiClient = new GeminiClient(this);
|
|
258
|
-
await newGeminiClient.initialize(newContentGeneratorConfig);
|
|
259
427
|
// Vertex and Genai have incompatible encryption and sending history with
|
|
260
|
-
//
|
|
261
|
-
|
|
262
|
-
authMethod
|
|
428
|
+
// thoughtSignature from Genai to Vertex will fail, we need to strip them
|
|
429
|
+
if (this.contentGeneratorConfig?.authType === AuthType.USE_GEMINI &&
|
|
430
|
+
authMethod !== AuthType.USE_GEMINI) {
|
|
431
|
+
// Restore the conversation history to the new client
|
|
432
|
+
this.geminiClient.stripThoughtsFromHistory();
|
|
433
|
+
}
|
|
434
|
+
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod);
|
|
435
|
+
this.contentGenerator = await createContentGenerator(newContentGeneratorConfig, this, this.getSessionId());
|
|
263
436
|
// Only assign to instance properties after successful initialization
|
|
264
437
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
438
|
+
// Initialize BaseLlmClient now that the ContentGenerator is available
|
|
439
|
+
this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);
|
|
440
|
+
const previewFeatures = this.getPreviewFeatures();
|
|
441
|
+
const codeAssistServer = getCodeAssistServer(this);
|
|
442
|
+
if (codeAssistServer) {
|
|
443
|
+
this.experimentsPromise = getExperiments(codeAssistServer)
|
|
444
|
+
.then((experiments) => {
|
|
445
|
+
this.setExperiments(experiments);
|
|
446
|
+
// If preview features have not been set and the user authenticated through Google, we enable preview based on remote config only if it's true
|
|
447
|
+
if (previewFeatures === undefined) {
|
|
448
|
+
const remotePreviewFeatures = experiments.flags[ExperimentFlags.ENABLE_PREVIEW]?.boolValue;
|
|
449
|
+
if (remotePreviewFeatures === true) {
|
|
450
|
+
this.setPreviewFeatures(remotePreviewFeatures);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
})
|
|
454
|
+
.catch((e) => {
|
|
455
|
+
debugLogger.error('Failed to fetch experiments', e);
|
|
270
456
|
});
|
|
271
457
|
}
|
|
458
|
+
else {
|
|
459
|
+
this.experiments = undefined;
|
|
460
|
+
this.experimentsPromise = undefined;
|
|
461
|
+
}
|
|
272
462
|
// Reset the session flag since we're explicitly changing auth and using default model
|
|
273
463
|
this.inFallbackMode = false;
|
|
274
464
|
}
|
|
465
|
+
getUserTier() {
|
|
466
|
+
return this.contentGenerator?.userTier;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Provides access to the BaseLlmClient for stateless LLM operations.
|
|
470
|
+
*/
|
|
471
|
+
getBaseLlmClient() {
|
|
472
|
+
if (!this.baseLlmClient) {
|
|
473
|
+
// Handle cases where initialization might be deferred or authentication failed
|
|
474
|
+
if (this.contentGenerator) {
|
|
475
|
+
this.baseLlmClient = new BaseLlmClient(this.getContentGenerator(), this);
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
throw new Error('BaseLlmClient not initialized. Ensure authentication has occurred and ContentGenerator is ready.');
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return this.baseLlmClient;
|
|
482
|
+
}
|
|
275
483
|
getSessionId() {
|
|
276
484
|
return this.sessionId;
|
|
277
485
|
}
|
|
@@ -281,16 +489,24 @@ export class Config {
|
|
|
281
489
|
shouldLoadMemoryFromIncludeDirectories() {
|
|
282
490
|
return this.loadMemoryFromIncludeDirectories;
|
|
283
491
|
}
|
|
492
|
+
getImportFormat() {
|
|
493
|
+
return this.importFormat;
|
|
494
|
+
}
|
|
495
|
+
getDiscoveryMaxDirs() {
|
|
496
|
+
return this.discoveryMaxDirs;
|
|
497
|
+
}
|
|
284
498
|
getContentGeneratorConfig() {
|
|
285
499
|
return this.contentGeneratorConfig;
|
|
286
500
|
}
|
|
287
501
|
getModel() {
|
|
288
|
-
return this.
|
|
502
|
+
return this.model;
|
|
289
503
|
}
|
|
290
504
|
setModel(newModel) {
|
|
291
|
-
if (this.
|
|
292
|
-
this.
|
|
505
|
+
if (this.model !== newModel || this.inFallbackMode) {
|
|
506
|
+
this.model = newModel;
|
|
507
|
+
coreEvents.emitModelChanged(newModel);
|
|
293
508
|
}
|
|
509
|
+
this.setFallbackMode(false);
|
|
294
510
|
}
|
|
295
511
|
isInFallbackMode() {
|
|
296
512
|
return this.inFallbackMode;
|
|
@@ -298,10 +514,23 @@ export class Config {
|
|
|
298
514
|
setFallbackMode(active) {
|
|
299
515
|
this.inFallbackMode = active;
|
|
300
516
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
517
|
+
setFallbackModelHandler(handler) {
|
|
518
|
+
this.fallbackModelHandler = handler;
|
|
519
|
+
}
|
|
520
|
+
getFallbackModelHandler() {
|
|
521
|
+
return this.fallbackModelHandler;
|
|
522
|
+
}
|
|
523
|
+
isPreviewModelFallbackMode() {
|
|
524
|
+
return this.previewModelFallbackMode;
|
|
525
|
+
}
|
|
526
|
+
setPreviewModelFallbackMode(active) {
|
|
527
|
+
this.previewModelFallbackMode = active;
|
|
528
|
+
}
|
|
529
|
+
isPreviewModelBypassMode() {
|
|
530
|
+
return this.previewModelBypassMode;
|
|
531
|
+
}
|
|
532
|
+
setPreviewModelBypassMode(active) {
|
|
533
|
+
this.previewModelBypassMode = active;
|
|
305
534
|
}
|
|
306
535
|
getMaxSessionTurns() {
|
|
307
536
|
return this.maxSessionTurns;
|
|
@@ -335,6 +564,9 @@ export class Config {
|
|
|
335
564
|
getWorkspaceContext() {
|
|
336
565
|
return this.workspaceContext;
|
|
337
566
|
}
|
|
567
|
+
getAgentRegistry() {
|
|
568
|
+
return this.agentRegistry;
|
|
569
|
+
}
|
|
338
570
|
getToolRegistry() {
|
|
339
571
|
return this.toolRegistry;
|
|
340
572
|
}
|
|
@@ -347,14 +579,35 @@ export class Config {
|
|
|
347
579
|
getQuestion() {
|
|
348
580
|
return this.question;
|
|
349
581
|
}
|
|
350
|
-
|
|
351
|
-
return this.
|
|
582
|
+
getPreviewFeatures() {
|
|
583
|
+
return this.previewFeatures;
|
|
584
|
+
}
|
|
585
|
+
setPreviewFeatures(previewFeatures) {
|
|
586
|
+
this.previewFeatures = previewFeatures;
|
|
352
587
|
}
|
|
353
588
|
getCoreTools() {
|
|
354
589
|
return this.coreTools;
|
|
355
590
|
}
|
|
591
|
+
getAllowedTools() {
|
|
592
|
+
return this.allowedTools;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* All the excluded tools from static configuration, loaded extensions, or
|
|
596
|
+
* other sources.
|
|
597
|
+
*
|
|
598
|
+
* May change over time.
|
|
599
|
+
*/
|
|
356
600
|
getExcludeTools() {
|
|
357
|
-
|
|
601
|
+
const excludeToolsSet = new Set([...(this.excludeTools ?? [])]);
|
|
602
|
+
for (const extension of this.getExtensionLoader().getExtensions()) {
|
|
603
|
+
if (!extension.isActive) {
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
for (const tool of extension.excludeTools || []) {
|
|
607
|
+
excludeToolsSet.add(tool);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return excludeToolsSet;
|
|
358
611
|
}
|
|
359
612
|
getToolDiscoveryCommand() {
|
|
360
613
|
return this.toolDiscoveryCommand;
|
|
@@ -365,9 +618,26 @@ export class Config {
|
|
|
365
618
|
getMcpServerCommand() {
|
|
366
619
|
return this.mcpServerCommand;
|
|
367
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* The user configured MCP servers (via gemini settings files).
|
|
623
|
+
*
|
|
624
|
+
* Does NOT include mcp servers configured by extensions.
|
|
625
|
+
*/
|
|
368
626
|
getMcpServers() {
|
|
369
627
|
return this.mcpServers;
|
|
370
628
|
}
|
|
629
|
+
getMcpClientManager() {
|
|
630
|
+
return this.mcpClientManager;
|
|
631
|
+
}
|
|
632
|
+
getAllowedMcpServers() {
|
|
633
|
+
return this.allowedMcpServers;
|
|
634
|
+
}
|
|
635
|
+
getBlockedMcpServers() {
|
|
636
|
+
return this.blockedMcpServers;
|
|
637
|
+
}
|
|
638
|
+
setMcpServers(mcpServers) {
|
|
639
|
+
this.mcpServers = mcpServers;
|
|
640
|
+
}
|
|
371
641
|
getUserMemory() {
|
|
372
642
|
return this.userMemory;
|
|
373
643
|
}
|
|
@@ -380,12 +650,30 @@ export class Config {
|
|
|
380
650
|
setGeminiMdFileCount(count) {
|
|
381
651
|
this.geminiMdFileCount = count;
|
|
382
652
|
}
|
|
653
|
+
getGeminiMdFilePaths() {
|
|
654
|
+
return this.geminiMdFilePaths;
|
|
655
|
+
}
|
|
656
|
+
setGeminiMdFilePaths(paths) {
|
|
657
|
+
this.geminiMdFilePaths = paths;
|
|
658
|
+
}
|
|
383
659
|
getApprovalMode() {
|
|
384
660
|
return this.approvalMode;
|
|
385
661
|
}
|
|
386
662
|
setApprovalMode(mode) {
|
|
663
|
+
if (!this.isTrustedFolder() && mode !== ApprovalMode.DEFAULT) {
|
|
664
|
+
throw new Error('Cannot enable privileged approval modes in an untrusted folder.');
|
|
665
|
+
}
|
|
387
666
|
this.approvalMode = mode;
|
|
388
667
|
}
|
|
668
|
+
isYoloModeDisabled() {
|
|
669
|
+
return this.disableYoloMode || !this.isTrustedFolder();
|
|
670
|
+
}
|
|
671
|
+
getPendingIncludeDirectories() {
|
|
672
|
+
return this.pendingIncludeDirectories;
|
|
673
|
+
}
|
|
674
|
+
clearPendingIncludeDirectories() {
|
|
675
|
+
this.pendingIncludeDirectories = [];
|
|
676
|
+
}
|
|
389
677
|
getShowMemoryUsage() {
|
|
390
678
|
return this.showMemoryUsage;
|
|
391
679
|
}
|
|
@@ -410,18 +698,31 @@ export class Config {
|
|
|
410
698
|
getTelemetryOutfile() {
|
|
411
699
|
return this.telemetrySettings.outfile;
|
|
412
700
|
}
|
|
701
|
+
getTelemetryUseCollector() {
|
|
702
|
+
return this.telemetrySettings.useCollector ?? false;
|
|
703
|
+
}
|
|
413
704
|
getGeminiClient() {
|
|
414
705
|
return this.geminiClient;
|
|
415
706
|
}
|
|
416
|
-
|
|
417
|
-
|
|
707
|
+
/**
|
|
708
|
+
* Updates the system instruction with the latest user memory.
|
|
709
|
+
* Whenever the user memory (GEMINI.md files) is updated.
|
|
710
|
+
*/
|
|
711
|
+
async updateSystemInstructionIfInitialized() {
|
|
712
|
+
const geminiClient = this.getGeminiClient();
|
|
713
|
+
if (geminiClient?.isInitialized()) {
|
|
714
|
+
await geminiClient.updateSystemInstruction();
|
|
715
|
+
}
|
|
418
716
|
}
|
|
419
|
-
|
|
420
|
-
return
|
|
717
|
+
getModelRouterService() {
|
|
718
|
+
return this.modelRouterService;
|
|
421
719
|
}
|
|
422
720
|
getEnableRecursiveFileSearch() {
|
|
423
721
|
return this.fileFiltering.enableRecursiveFileSearch;
|
|
424
722
|
}
|
|
723
|
+
getFileFilteringDisableFuzzySearch() {
|
|
724
|
+
return this.fileFiltering.disableFuzzySearch;
|
|
725
|
+
}
|
|
425
726
|
getFileFilteringRespectGitIgnore() {
|
|
426
727
|
return this.fileFiltering.respectGitIgnore;
|
|
427
728
|
}
|
|
@@ -434,6 +735,20 @@ export class Config {
|
|
|
434
735
|
respectGeminiIgnore: this.fileFiltering.respectGeminiIgnore,
|
|
435
736
|
};
|
|
436
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* Gets custom file exclusion patterns from configuration.
|
|
740
|
+
* TODO: This is a placeholder implementation. In the future, this could
|
|
741
|
+
* read from settings files, CLI arguments, or environment variables.
|
|
742
|
+
*/
|
|
743
|
+
getCustomExcludes() {
|
|
744
|
+
// Placeholder implementation - returns empty array for now
|
|
745
|
+
// Future implementation could read from:
|
|
746
|
+
// - User settings file
|
|
747
|
+
// - Project-specific configuration
|
|
748
|
+
// - Environment variables
|
|
749
|
+
// - CLI arguments
|
|
750
|
+
return [];
|
|
751
|
+
}
|
|
437
752
|
getCheckpointingEnabled() {
|
|
438
753
|
return this.checkpointing;
|
|
439
754
|
}
|
|
@@ -455,20 +770,34 @@ export class Config {
|
|
|
455
770
|
getUsageStatisticsEnabled() {
|
|
456
771
|
return this.usageStatisticsEnabled;
|
|
457
772
|
}
|
|
458
|
-
getExtensionContextFilePaths() {
|
|
459
|
-
return this.extensionContextFilePaths;
|
|
460
|
-
}
|
|
461
773
|
getExperimentalZedIntegration() {
|
|
462
774
|
return this.experimentalZedIntegration;
|
|
463
775
|
}
|
|
464
776
|
getListExtensions() {
|
|
465
777
|
return this.listExtensions;
|
|
466
778
|
}
|
|
779
|
+
getListSessions() {
|
|
780
|
+
return this.listSessions;
|
|
781
|
+
}
|
|
782
|
+
getDeleteSession() {
|
|
783
|
+
return this.deleteSession;
|
|
784
|
+
}
|
|
785
|
+
getExtensionManagement() {
|
|
786
|
+
return this.extensionManagement;
|
|
787
|
+
}
|
|
467
788
|
getExtensions() {
|
|
468
|
-
return this.
|
|
789
|
+
return this._extensionLoader.getExtensions();
|
|
469
790
|
}
|
|
470
|
-
|
|
471
|
-
return this.
|
|
791
|
+
getExtensionLoader() {
|
|
792
|
+
return this._extensionLoader;
|
|
793
|
+
}
|
|
794
|
+
// The list of explicitly enabled extensions, if any were given, may contain
|
|
795
|
+
// the string "none".
|
|
796
|
+
getEnabledExtensions() {
|
|
797
|
+
return this._enabledExtensions;
|
|
798
|
+
}
|
|
799
|
+
getEnableExtensionReloading() {
|
|
800
|
+
return this.enableExtensionReloading;
|
|
472
801
|
}
|
|
473
802
|
getNoBrowser() {
|
|
474
803
|
return this.noBrowser;
|
|
@@ -482,31 +811,36 @@ export class Config {
|
|
|
482
811
|
getIdeMode() {
|
|
483
812
|
return this.ideMode;
|
|
484
813
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
814
|
+
/**
|
|
815
|
+
* Returns 'true' if the folder trust feature is enabled.
|
|
816
|
+
*/
|
|
488
817
|
getFolderTrust() {
|
|
489
818
|
return this.folderTrust;
|
|
490
819
|
}
|
|
820
|
+
/**
|
|
821
|
+
* Returns 'true' if the workspace is considered "trusted".
|
|
822
|
+
* 'false' for untrusted.
|
|
823
|
+
*/
|
|
491
824
|
isTrustedFolder() {
|
|
492
|
-
|
|
825
|
+
// isWorkspaceTrusted in cli/src/config/trustedFolder.js returns undefined
|
|
826
|
+
// when the file based trust value is unavailable, since it is mainly used
|
|
827
|
+
// in the initialization for trust dialogs, etc. Here we return true since
|
|
828
|
+
// config.isTrustedFolder() is used for the main business logic of blocking
|
|
829
|
+
// tool calls etc in the rest of the application.
|
|
830
|
+
//
|
|
831
|
+
// Default value is true since we load with trusted settings to avoid
|
|
832
|
+
// restarts in the more common path. If the user chooses to mark the folder
|
|
833
|
+
// as untrusted, the CLI will restart and we will have the trust value
|
|
834
|
+
// reloaded.
|
|
835
|
+
const context = ideContextStore.get();
|
|
836
|
+
if (context?.workspaceState?.isTrusted !== undefined) {
|
|
837
|
+
return context.workspaceState.isTrusted;
|
|
838
|
+
}
|
|
839
|
+
return this.trustedFolder ?? true;
|
|
493
840
|
}
|
|
494
841
|
setIdeMode(value) {
|
|
495
842
|
this.ideMode = value;
|
|
496
843
|
}
|
|
497
|
-
async setIdeModeAndSyncConnection(value) {
|
|
498
|
-
this.ideMode = value;
|
|
499
|
-
if (value) {
|
|
500
|
-
await this.ideClient.connect();
|
|
501
|
-
logIdeConnection(this, new IdeConnectionEvent(IdeConnectionType.SESSION));
|
|
502
|
-
}
|
|
503
|
-
else {
|
|
504
|
-
await this.ideClient.disconnect();
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
getIdeClient() {
|
|
508
|
-
return this.ideClient;
|
|
509
|
-
}
|
|
510
844
|
/**
|
|
511
845
|
* Get the current FileSystemService
|
|
512
846
|
*/
|
|
@@ -519,66 +853,280 @@ export class Config {
|
|
|
519
853
|
setFileSystemService(fileSystemService) {
|
|
520
854
|
this.fileSystemService = fileSystemService;
|
|
521
855
|
}
|
|
522
|
-
|
|
523
|
-
|
|
856
|
+
async getCompressionThreshold() {
|
|
857
|
+
if (this.compressionThreshold) {
|
|
858
|
+
return this.compressionThreshold;
|
|
859
|
+
}
|
|
860
|
+
await this.ensureExperimentsLoaded();
|
|
861
|
+
const remoteThreshold = this.experiments?.flags[ExperimentFlags.CONTEXT_COMPRESSION_THRESHOLD]
|
|
862
|
+
?.floatValue;
|
|
863
|
+
if (remoteThreshold === 0) {
|
|
864
|
+
return undefined;
|
|
865
|
+
}
|
|
866
|
+
return remoteThreshold;
|
|
867
|
+
}
|
|
868
|
+
async getUserCaching() {
|
|
869
|
+
await this.ensureExperimentsLoaded();
|
|
870
|
+
return this.experiments?.flags[ExperimentFlags.USER_CACHING]?.boolValue;
|
|
871
|
+
}
|
|
872
|
+
async getBannerTextNoCapacityIssues() {
|
|
873
|
+
await this.ensureExperimentsLoaded();
|
|
874
|
+
return (this.experiments?.flags[ExperimentFlags.BANNER_TEXT_NO_CAPACITY_ISSUES]
|
|
875
|
+
?.stringValue ?? '');
|
|
876
|
+
}
|
|
877
|
+
async getBannerTextCapacityIssues() {
|
|
878
|
+
await this.ensureExperimentsLoaded();
|
|
879
|
+
return (this.experiments?.flags[ExperimentFlags.BANNER_TEXT_CAPACITY_ISSUES]
|
|
880
|
+
?.stringValue ?? '');
|
|
881
|
+
}
|
|
882
|
+
async ensureExperimentsLoaded() {
|
|
883
|
+
if (!this.experimentsPromise) {
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
try {
|
|
887
|
+
await this.experimentsPromise;
|
|
888
|
+
}
|
|
889
|
+
catch (e) {
|
|
890
|
+
debugLogger.debug('Failed to fetch experiments', e);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
isInteractiveShellEnabled() {
|
|
894
|
+
return (this.interactive &&
|
|
895
|
+
this.ptyInfo !== 'child_process' &&
|
|
896
|
+
this.enableInteractiveShell);
|
|
524
897
|
}
|
|
525
898
|
isInteractive() {
|
|
526
899
|
return this.interactive;
|
|
527
900
|
}
|
|
528
|
-
|
|
529
|
-
return this.
|
|
901
|
+
getUseRipgrep() {
|
|
902
|
+
return this.useRipgrep;
|
|
903
|
+
}
|
|
904
|
+
getEnableInteractiveShell() {
|
|
905
|
+
return this.enableInteractiveShell;
|
|
530
906
|
}
|
|
531
907
|
getSkipNextSpeakerCheck() {
|
|
532
908
|
return this.skipNextSpeakerCheck;
|
|
533
909
|
}
|
|
910
|
+
getContinueOnFailedApiCall() {
|
|
911
|
+
return this.continueOnFailedApiCall;
|
|
912
|
+
}
|
|
913
|
+
getRetryFetchErrors() {
|
|
914
|
+
return this.retryFetchErrors;
|
|
915
|
+
}
|
|
916
|
+
getEnableShellOutputEfficiency() {
|
|
917
|
+
return this.enableShellOutputEfficiency;
|
|
918
|
+
}
|
|
919
|
+
getShellExecutionConfig() {
|
|
920
|
+
return this.shellExecutionConfig;
|
|
921
|
+
}
|
|
922
|
+
setShellExecutionConfig(config) {
|
|
923
|
+
this.shellExecutionConfig = {
|
|
924
|
+
terminalWidth: config.terminalWidth ?? this.shellExecutionConfig.terminalWidth,
|
|
925
|
+
terminalHeight: config.terminalHeight ?? this.shellExecutionConfig.terminalHeight,
|
|
926
|
+
showColor: config.showColor ?? this.shellExecutionConfig.showColor,
|
|
927
|
+
pager: config.pager ?? this.shellExecutionConfig.pager,
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
getScreenReader() {
|
|
931
|
+
return this.accessibility.screenReader ?? false;
|
|
932
|
+
}
|
|
933
|
+
getEnablePromptCompletion() {
|
|
934
|
+
return this.enablePromptCompletion;
|
|
935
|
+
}
|
|
936
|
+
getEnableToolOutputTruncation() {
|
|
937
|
+
return this.enableToolOutputTruncation;
|
|
938
|
+
}
|
|
939
|
+
getTruncateToolOutputThreshold() {
|
|
940
|
+
return Math.min(
|
|
941
|
+
// Estimate remaining context window in characters (1 token ~= 4 chars).
|
|
942
|
+
4 *
|
|
943
|
+
(tokenLimit(this.model) - uiTelemetryService.getLastPromptTokenCount()), this.truncateToolOutputThreshold);
|
|
944
|
+
}
|
|
945
|
+
getTruncateToolOutputLines() {
|
|
946
|
+
return this.truncateToolOutputLines;
|
|
947
|
+
}
|
|
948
|
+
getUseSmartEdit() {
|
|
949
|
+
return this.useSmartEdit;
|
|
950
|
+
}
|
|
951
|
+
getUseWriteTodos() {
|
|
952
|
+
return this.useWriteTodos;
|
|
953
|
+
}
|
|
954
|
+
getOutputFormat() {
|
|
955
|
+
return this.outputSettings?.format
|
|
956
|
+
? this.outputSettings.format
|
|
957
|
+
: OutputFormat.TEXT;
|
|
958
|
+
}
|
|
959
|
+
getUseModelRouter() {
|
|
960
|
+
return this.useModelRouter;
|
|
961
|
+
}
|
|
534
962
|
async getGitService() {
|
|
535
963
|
if (!this.gitService) {
|
|
536
|
-
this.gitService = new GitService(this.targetDir);
|
|
964
|
+
this.gitService = new GitService(this.targetDir, this.storage);
|
|
537
965
|
await this.gitService.initialize();
|
|
538
966
|
}
|
|
539
967
|
return this.gitService;
|
|
540
968
|
}
|
|
969
|
+
getFileExclusions() {
|
|
970
|
+
return this.fileExclusions;
|
|
971
|
+
}
|
|
972
|
+
getMessageBus() {
|
|
973
|
+
return this.messageBus;
|
|
974
|
+
}
|
|
975
|
+
getPolicyEngine() {
|
|
976
|
+
return this.policyEngine;
|
|
977
|
+
}
|
|
978
|
+
getEnableMessageBusIntegration() {
|
|
979
|
+
return this.enableMessageBusIntegration;
|
|
980
|
+
}
|
|
981
|
+
getEnableHooks() {
|
|
982
|
+
return this.enableHooks;
|
|
983
|
+
}
|
|
984
|
+
getCodebaseInvestigatorSettings() {
|
|
985
|
+
return this.codebaseInvestigatorSettings;
|
|
986
|
+
}
|
|
541
987
|
async createToolRegistry() {
|
|
542
988
|
const registry = new ToolRegistry(this);
|
|
989
|
+
// Set message bus on tool registry before discovery so MCP tools can access it
|
|
990
|
+
if (this.getEnableMessageBusIntegration()) {
|
|
991
|
+
registry.setMessageBus(this.messageBus);
|
|
992
|
+
}
|
|
543
993
|
// helper to create & register core tools that are enabled
|
|
544
994
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
545
995
|
const registerCoreTool = (ToolClass, ...args) => {
|
|
546
996
|
const className = ToolClass.name;
|
|
547
997
|
const toolName = ToolClass.Name || className;
|
|
548
998
|
const coreTools = this.getCoreTools();
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
if
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
tool
|
|
557
|
-
tool.startsWith(`${className}(`) ||
|
|
558
|
-
tool.startsWith(`${toolName}(`));
|
|
559
|
-
}
|
|
560
|
-
if (excludeTools?.includes(className) ||
|
|
561
|
-
excludeTools?.includes(toolName)) {
|
|
562
|
-
isEnabled = false;
|
|
999
|
+
// On some platforms, the className can be minified to _ClassName.
|
|
1000
|
+
const normalizedClassName = className.replace(/^_+/, '');
|
|
1001
|
+
let isEnabled = true; // Enabled by default if coreTools is not set.
|
|
1002
|
+
if (coreTools) {
|
|
1003
|
+
isEnabled = coreTools.some((tool) => tool === toolName ||
|
|
1004
|
+
tool === normalizedClassName ||
|
|
1005
|
+
tool.startsWith(`${toolName}(`) ||
|
|
1006
|
+
tool.startsWith(`${normalizedClassName}(`));
|
|
563
1007
|
}
|
|
564
1008
|
if (isEnabled) {
|
|
565
|
-
|
|
1009
|
+
// Pass message bus to tools when feature flag is enabled
|
|
1010
|
+
// This first implementation is only focused on the general case of
|
|
1011
|
+
// the tool registry.
|
|
1012
|
+
const messageBusEnabled = this.getEnableMessageBusIntegration();
|
|
1013
|
+
const toolArgs = messageBusEnabled
|
|
1014
|
+
? [...args, this.getMessageBus()]
|
|
1015
|
+
: args;
|
|
1016
|
+
registry.registerTool(new ToolClass(...toolArgs));
|
|
566
1017
|
}
|
|
567
1018
|
};
|
|
568
1019
|
registerCoreTool(LSTool, this);
|
|
569
1020
|
registerCoreTool(ReadFileTool, this);
|
|
570
|
-
|
|
1021
|
+
if (this.getUseRipgrep()) {
|
|
1022
|
+
let useRipgrep = false;
|
|
1023
|
+
let errorString = undefined;
|
|
1024
|
+
try {
|
|
1025
|
+
useRipgrep = await canUseRipgrep();
|
|
1026
|
+
}
|
|
1027
|
+
catch (error) {
|
|
1028
|
+
errorString = String(error);
|
|
1029
|
+
}
|
|
1030
|
+
if (useRipgrep) {
|
|
1031
|
+
registerCoreTool(RipGrepTool, this);
|
|
1032
|
+
}
|
|
1033
|
+
else {
|
|
1034
|
+
logRipgrepFallback(this, new RipgrepFallbackEvent(errorString));
|
|
1035
|
+
registerCoreTool(GrepTool, this);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
else {
|
|
1039
|
+
registerCoreTool(GrepTool, this);
|
|
1040
|
+
}
|
|
571
1041
|
registerCoreTool(GlobTool, this);
|
|
572
|
-
|
|
1042
|
+
if (this.getUseSmartEdit()) {
|
|
1043
|
+
registerCoreTool(SmartEditTool, this);
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
registerCoreTool(EditTool, this);
|
|
1047
|
+
}
|
|
573
1048
|
registerCoreTool(WriteFileTool, this);
|
|
574
1049
|
registerCoreTool(WebFetchTool, this);
|
|
575
|
-
registerCoreTool(ReadManyFilesTool, this);
|
|
576
1050
|
registerCoreTool(ShellTool, this);
|
|
577
1051
|
registerCoreTool(MemoryTool);
|
|
578
1052
|
registerCoreTool(WebSearchTool, this);
|
|
1053
|
+
if (this.getUseWriteTodos()) {
|
|
1054
|
+
registerCoreTool(WriteTodosTool, this);
|
|
1055
|
+
}
|
|
1056
|
+
// Register Subagents as Tools
|
|
1057
|
+
if (this.getCodebaseInvestigatorSettings().enabled) {
|
|
1058
|
+
const definition = this.agentRegistry.getDefinition('codebase_investigator');
|
|
1059
|
+
if (definition) {
|
|
1060
|
+
// We must respect the main allowed/exclude lists for agents too.
|
|
1061
|
+
const allowedTools = this.getAllowedTools();
|
|
1062
|
+
const isAllowed = !allowedTools || allowedTools.includes(definition.name);
|
|
1063
|
+
if (isAllowed) {
|
|
1064
|
+
const messageBusEnabled = this.getEnableMessageBusIntegration();
|
|
1065
|
+
const wrapper = new SubagentToolWrapper(definition, this, messageBusEnabled ? this.getMessageBus() : undefined);
|
|
1066
|
+
registry.registerTool(wrapper);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
579
1070
|
await registry.discoverAllTools();
|
|
1071
|
+
registry.sortTools();
|
|
580
1072
|
return registry;
|
|
581
1073
|
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Get hooks configuration
|
|
1076
|
+
*/
|
|
1077
|
+
getHooks() {
|
|
1078
|
+
return this.hooks;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Get experiments configuration
|
|
1082
|
+
*/
|
|
1083
|
+
getExperiments() {
|
|
1084
|
+
return this.experiments;
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Set experiments configuration
|
|
1088
|
+
*/
|
|
1089
|
+
setExperiments(experiments) {
|
|
1090
|
+
this.experiments = experiments;
|
|
1091
|
+
const flagSummaries = Object.entries(experiments.flags ?? {})
|
|
1092
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
1093
|
+
.map(([flagId, flag]) => {
|
|
1094
|
+
const summary = { flagId };
|
|
1095
|
+
if (flag.boolValue !== undefined) {
|
|
1096
|
+
summary['boolValue'] = flag.boolValue;
|
|
1097
|
+
}
|
|
1098
|
+
if (flag.floatValue !== undefined) {
|
|
1099
|
+
summary['floatValue'] = flag.floatValue;
|
|
1100
|
+
}
|
|
1101
|
+
if (flag.intValue !== undefined) {
|
|
1102
|
+
summary['intValue'] = flag.intValue;
|
|
1103
|
+
}
|
|
1104
|
+
if (flag.stringValue !== undefined) {
|
|
1105
|
+
summary['stringValue'] = flag.stringValue;
|
|
1106
|
+
}
|
|
1107
|
+
const int32Length = flag.int32ListValue?.values?.length ?? 0;
|
|
1108
|
+
if (int32Length > 0) {
|
|
1109
|
+
summary['int32ListLength'] = int32Length;
|
|
1110
|
+
}
|
|
1111
|
+
const stringListLength = flag.stringListValue?.values?.length ?? 0;
|
|
1112
|
+
if (stringListLength > 0) {
|
|
1113
|
+
summary['stringListLength'] = stringListLength;
|
|
1114
|
+
}
|
|
1115
|
+
return summary;
|
|
1116
|
+
});
|
|
1117
|
+
const summary = {
|
|
1118
|
+
experimentIds: experiments.experimentIds ?? [],
|
|
1119
|
+
flags: flagSummaries,
|
|
1120
|
+
};
|
|
1121
|
+
const summaryString = inspect(summary, {
|
|
1122
|
+
depth: null,
|
|
1123
|
+
maxArrayLength: null,
|
|
1124
|
+
maxStringLength: null,
|
|
1125
|
+
breakLength: 80,
|
|
1126
|
+
compact: false,
|
|
1127
|
+
});
|
|
1128
|
+
debugLogger.debug('Experiments loaded', summaryString);
|
|
1129
|
+
}
|
|
582
1130
|
}
|
|
583
1131
|
// Export model constants for use in CLI
|
|
584
1132
|
export { DEFAULT_GEMINI_FLASH_MODEL };
|