@office-ai/aioncli-core 0.8.1 → 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 +8 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/src/agents/codebase-investigator.d.ts +36 -1
- package/dist/src/agents/codebase-investigator.js +93 -34
- package/dist/src/agents/codebase-investigator.js.map +1 -1
- package/dist/src/agents/codebase-investigator.test.d.ts +6 -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 +37 -11
- package/dist/src/agents/executor.js +512 -150
- package/dist/src/agents/executor.js.map +1 -1
- package/dist/src/agents/executor.test.js +1188 -245
- package/dist/src/agents/executor.test.js.map +1 -1
- package/dist/src/agents/invocation.d.ts +5 -2
- package/dist/src/agents/invocation.js +4 -2
- package/dist/src/agents/invocation.js.map +1 -1
- package/dist/src/agents/invocation.test.js +9 -0
- package/dist/src/agents/invocation.test.js.map +1 -1
- package/dist/src/agents/registry.d.ts +6 -1
- package/dist/src/agents/registry.js +51 -4
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +30 -16
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/agents/subagent-tool-wrapper.d.ts +3 -1
- package/dist/src/agents/subagent-tool-wrapper.js +4 -3
- package/dist/src/agents/subagent-tool-wrapper.js.map +1 -1
- package/dist/src/agents/subagent-tool-wrapper.test.js +9 -4
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -1
- package/dist/src/agents/types.d.ts +37 -7
- package/dist/src/agents/types.js +2 -0
- package/dist/src/agents/types.js.map +1 -1
- package/dist/src/code_assist/codeAssist.js +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 +1 -0
- package/dist/src/code_assist/converter.js +1 -0
- package/dist/src/code_assist/converter.js.map +1 -1
- package/dist/src/code_assist/converter.test.js +19 -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.js +6 -5
- package/dist/src/code_assist/oauth-credential-storage.js.map +1 -1
- package/dist/src/code_assist/oauth-credential-storage.test.js +65 -3
- package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -1
- package/dist/src/code_assist/oauth2.d.ts +2 -2
- package/dist/src/code_assist/oauth2.js +161 -93
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +103 -57
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.d.ts +6 -4
- package/dist/src/code_assist/server.js +16 -8
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +126 -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 +4 -2
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/code_assist/types.d.ts +1 -1
- 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 +169 -43
- package/dist/src/config/config.js +418 -79
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +684 -49
- package/dist/src/config/config.test.js.map +1 -1
- 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 +23 -2
- package/dist/src/config/models.js +50 -7
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/models.test.js +71 -10
- package/dist/src/config/models.test.js.map +1 -1
- package/dist/src/config/storage.d.ts +3 -1
- package/dist/src/config/storage.js +22 -2
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/config/storage.test.js +7 -6
- package/dist/src/config/storage.test.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.d.ts +3 -2
- package/dist/src/confirmation-bus/message-bus.js +9 -3
- package/dist/src/confirmation-bus/message-bus.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.test.js +30 -24
- package/dist/src/confirmation-bus/message-bus.test.js.map +1 -1
- package/dist/src/confirmation-bus/types.d.ts +13 -2
- package/dist/src/confirmation-bus/types.js +1 -0
- package/dist/src/confirmation-bus/types.js.map +1 -1
- 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 +4 -8
- package/dist/src/core/baseLlmClient.js +6 -11
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +22 -27
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.d.ts +12 -19
- package/dist/src/core/client.js +104 -206
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +329 -452
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.d.ts +3 -2
- package/dist/src/core/contentGenerator.js +56 -41
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +49 -1
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolScheduler.d.ts +8 -4
- package/dist/src/core/coreToolScheduler.js +348 -179
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +575 -219
- 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 +23 -18
- package/dist/src/core/geminiChat.js +186 -108
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +581 -270
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/logger.d.ts +7 -2
- package/dist/src/core/logger.js +35 -27
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/logger.test.js +45 -29
- package/dist/src/core/logger.test.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.d.ts +1 -0
- package/dist/src/core/loggingContentGenerator.js +113 -33
- 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 +3 -2
- package/dist/src/core/nonInteractiveToolExecutor.js +12 -7
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +12 -8
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/openaiContentGenerator.js +31 -8
- package/dist/src/core/openaiContentGenerator.js.map +1 -1
- package/dist/src/core/prompts.d.ts +2 -1
- package/dist/src/core/prompts.js +135 -154
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +128 -189
- 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/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 +23 -3
- package/dist/src/core/turn.js +18 -9
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +98 -104
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/fallback/handler.js +60 -8
- package/dist/src/fallback/handler.js.map +1 -1
- package/dist/src/fallback/handler.test.js +132 -17
- package/dist/src/fallback/handler.test.js.map +1 -1
- package/dist/src/fallback/types.d.ts +1 -1
- 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/detect-ide.d.ts +4 -0
- package/dist/src/ide/detect-ide.js +6 -1
- package/dist/src/ide/detect-ide.js.map +1 -1
- package/dist/src/ide/detect-ide.test.js +16 -0
- package/dist/src/ide/detect-ide.test.js.map +1 -1
- package/dist/src/ide/ide-client.d.ts +3 -1
- package/dist/src/ide/ide-client.js +12 -10
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-client.test.js +163 -4
- package/dist/src/ide/ide-client.test.js.map +1 -1
- package/dist/src/ide/ide-installer.js +66 -21
- package/dist/src/ide/ide-installer.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +54 -1
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/ide/process-utils.js +85 -75
- package/dist/src/ide/process-utils.js.map +1 -1
- package/dist/src/ide/process-utils.test.js +83 -90
- package/dist/src/ide/process-utils.test.js.map +1 -1
- package/dist/src/ide/types.d.ts +1 -1
- package/dist/src/ide/types.js +1 -1
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.js +24 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.d.ts +2 -0
- 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 +8 -5
- package/dist/src/mcp/oauth-provider.js +140 -55
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +369 -2
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.js +5 -4
- package/dist/src/mcp/oauth-token-storage.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.test.js +17 -11
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +7 -0
- package/dist/src/mcp/oauth-utils.js +28 -8
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +45 -2
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/mcp/sa-impersonation-provider.d.ts +0 -6
- package/dist/src/mcp/sa-impersonation-provider.js +6 -23
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -1
- package/dist/src/mcp/token-storage/base-token-storage.test.js +75 -84
- package/dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.js +3 -2
- package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.test.js +11 -8
- package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.d.ts +6 -2
- package/dist/src/mcp/token-storage/keychain-token-storage.js +63 -7
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js +54 -3
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -1
- package/dist/src/mcp/token-storage/types.d.ts +6 -0
- package/dist/src/mcp/token-storage/types.js.map +1 -1
- 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 +63 -1
- package/dist/src/output/types.js +11 -0
- package/dist/src/output/types.js.map +1 -1
- 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 +2 -0
- package/dist/src/policy/index.js +2 -0
- package/dist/src/policy/index.js.map +1 -1
- 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 +12 -3
- package/dist/src/policy/policy-engine.js +74 -8
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/policy/policy-engine.test.js +460 -76
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- 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 +83 -0
- package/dist/src/policy/types.js +10 -0
- package/dist/src/policy/types.js.map +1 -1
- 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.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.js +15 -0
- package/dist/src/routing/modelRouterService.js.map +1 -1
- package/dist/src/routing/modelRouterService.test.js +62 -0
- package/dist/src/routing/modelRouterService.test.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.d.ts +1 -1
- package/dist/src/routing/strategies/classifierStrategy.js +9 -16
- package/dist/src/routing/strategies/classifierStrategy.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js +17 -13
- package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.test.js +4 -0
- package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/overrideStrategy.js +2 -2
- package/dist/src/routing/strategies/overrideStrategy.js.map +1 -1
- package/dist/src/routing/strategies/overrideStrategy.test.js +3 -0
- package/dist/src/routing/strategies/overrideStrategy.test.js.map +1 -1
- 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 +3 -2
- package/dist/src/services/chatRecordingService.js +11 -9
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.d.ts +2 -14
- package/dist/src/services/fileDiscoveryService.js +19 -55
- package/dist/src/services/fileDiscoveryService.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.test.js +91 -11
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.d.ts +4 -1
- package/dist/src/services/loopDetectionService.js +95 -42
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +220 -12
- 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 +1 -0
- package/dist/src/services/shellExecutionService.js +195 -92
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +137 -14
- 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-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/clearcut-logger/clearcut-logger.d.ts +25 -7
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +294 -76
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +192 -66
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +25 -3
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +59 -5
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/constants.d.ts +0 -28
- package/dist/src/telemetry/constants.js +0 -29
- package/dist/src/telemetry/constants.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.js +0 -1
- package/dist/src/telemetry/gcp-exporters.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.test.js +1 -1
- package/dist/src/telemetry/gcp-exporters.test.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +7 -3
- package/dist/src/telemetry/index.js +13 -4
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +14 -7
- package/dist/src/telemetry/loggers.js +197 -320
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +0 -1
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +460 -59
- 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 +180 -4
- package/dist/src/telemetry/metrics.js +270 -6
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +502 -184
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/sdk.js +3 -2
- package/dist/src/telemetry/sdk.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.test.js +29 -28
- package/dist/src/telemetry/telemetry-utils.test.js.map +1 -1
- 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 +227 -29
- package/dist/src/telemetry/types.js +858 -72
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +1 -1
- package/dist/src/telemetry/uiTelemetry.js +7 -7
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +89 -67
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/config.d.ts +1 -1
- package/dist/src/test-utils/config.js +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/edit.d.ts +4 -3
- package/dist/src/tools/edit.js +50 -47
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +306 -216
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/glob.d.ts +4 -3
- package/dist/src/tools/glob.js +24 -27
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/glob.test.js +212 -205
- package/dist/src/tools/glob.test.js.map +1 -1
- package/dist/src/tools/grep.d.ts +4 -3
- package/dist/src/tools/grep.js +31 -25
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +15 -12
- package/dist/src/tools/grep.test.js.map +1 -1
- package/dist/src/tools/ls.d.ts +4 -3
- package/dist/src/tools/ls.js +29 -35
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/ls.test.js +34 -42
- package/dist/src/tools/ls.test.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.d.ts +49 -11
- package/dist/src/tools/mcp-client-manager.js +191 -31
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +132 -25
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +12 -5
- package/dist/src/tools/mcp-client.js +287 -267
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +352 -45
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/mcp-tool.d.ts +6 -2
- package/dist/src/tools/mcp-tool.js +19 -8
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/mcp-tool.test.js +186 -273
- package/dist/src/tools/mcp-tool.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +7 -5
- package/dist/src/tools/memoryTool.js +14 -12
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +10 -9
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/message-bus-integration.test.js +14 -1
- package/dist/src/tools/message-bus-integration.test.js.map +1 -1
- package/dist/src/tools/modifiable-tool.d.ts +5 -1
- package/dist/src/tools/modifiable-tool.js +38 -16
- package/dist/src/tools/modifiable-tool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.test.js +66 -31
- package/dist/src/tools/modifiable-tool.test.js.map +1 -1
- package/dist/src/tools/read-file.d.ts +6 -5
- package/dist/src/tools/read-file.js +26 -32
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +68 -33
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.d.ts +6 -12
- package/dist/src/tools/read-many-files.js +28 -57
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +37 -36
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/ripGrep.d.ts +28 -10
- package/dist/src/tools/ripGrep.js +195 -193
- package/dist/src/tools/ripGrep.js.map +1 -1
- package/dist/src/tools/ripGrep.test.js +533 -204
- package/dist/src/tools/ripGrep.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +8 -6
- package/dist/src/tools/shell.js +64 -38
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +134 -43
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/smart-edit.d.ts +10 -23
- package/dist/src/tools/smart-edit.js +100 -85
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/smart-edit.test.js +229 -179
- package/dist/src/tools/smart-edit.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +21 -0
- package/dist/src/tools/tool-error.js +27 -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 +32 -20
- package/dist/src/tools/tool-registry.js +122 -78
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +167 -90
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +23 -8
- package/dist/src/tools/tools.js +69 -37
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/web-fetch.d.ts +11 -3
- package/dist/src/tools/web-fetch.js +80 -38
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +338 -9
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/web-search.d.ts +4 -3
- package/dist/src/tools/web-search.js +11 -9
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/web-search.test.js +6 -0
- package/dist/src/tools/web-search.test.js.map +1 -1
- package/dist/src/tools/write-file.d.ts +3 -2
- package/dist/src/tools/write-file.js +41 -40
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +130 -123
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/tools/write-todos.d.ts +34 -9
- package/dist/src/tools/write-todos.js +54 -11
- package/dist/src/tools/write-todos.js.map +1 -1
- package/dist/src/tools/write-todos.test.js +2 -2
- package/dist/src/tools/write-todos.test.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.js +3 -2
- package/dist/src/utils/bfsFileSearch.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.js +10 -25
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editCorrector.test.js +19 -5
- 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 +53 -39
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/editor.test.js +18 -45
- package/dist/src/utils/editor.test.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +2 -1
- 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/errors.d.ts +3 -0
- package/dist/src/utils/errors.js +6 -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 +4 -0
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/fileUtils.d.ts +4 -0
- package/dist/src/utils/fileUtils.js +34 -2
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +87 -61
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.js +1 -1
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/flashFallback.test.js +28 -47
- package/dist/src/utils/flashFallback.test.js.map +1 -1
- 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/getFolderStructure.js +9 -17
- package/dist/src/utils/getFolderStructure.js.map +1 -1
- package/dist/src/utils/getFolderStructure.test.js +7 -6
- package/dist/src/utils/getFolderStructure.test.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.d.ts +4 -1
- package/dist/src/utils/gitIgnoreParser.js +28 -10
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.test.js +58 -0
- package/dist/src/utils/gitIgnoreParser.test.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.test.js +26 -30
- package/dist/src/utils/ignorePatterns.test.js.map +1 -1
- package/dist/src/utils/installationManager.js +2 -1
- package/dist/src/utils/installationManager.js.map +1 -1
- package/dist/src/utils/installationManager.test.js +6 -4
- package/dist/src/utils/installationManager.test.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.d.ts +1 -1
- package/dist/src/utils/llm-edit-fixer.js +33 -9
- package/dist/src/utils/llm-edit-fixer.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.test.js +38 -1
- package/dist/src/utils/llm-edit-fixer.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +20 -1
- package/dist/src/utils/memoryDiscovery.js +176 -12
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +299 -40
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.js +4 -3
- package/dist/src/utils/memoryImportProcessor.js.map +1 -1
- package/dist/src/utils/memoryImportProcessor.test.js +8 -14
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.js +3 -3
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.test.js +13 -5
- 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/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.js +4 -4
- package/dist/src/utils/pathReader.js.map +1 -1
- package/dist/src/utils/pathReader.test.js +44 -1
- package/dist/src/utils/pathReader.test.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -1
- package/dist/src/utils/paths.js +131 -29
- 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/quotaErrorDetection.d.ts +0 -2
- package/dist/src/utils/quotaErrorDetection.js +0 -46
- package/dist/src/utils/quotaErrorDetection.js.map +1 -1
- package/dist/src/utils/retry.d.ts +3 -10
- package/dist/src/utils/retry.js +97 -195
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +179 -145
- 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/shell-utils.d.ts +15 -2
- package/dist/src/utils/shell-utils.js +387 -140
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +244 -62
- 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 +4 -2
- 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 +5 -4
- package/dist/src/utils/systemEncoding.js.map +1 -1
- package/dist/src/utils/systemEncoding.test.js +2 -1
- 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/tool-utils.d.ts +2 -2
- package/dist/src/utils/tool-utils.js +15 -6
- package/dist/src/utils/tool-utils.js.map +1 -1
- package/dist/src/utils/tool-utils.test.js +8 -0
- package/dist/src/utils/tool-utils.test.js.map +1 -1
- package/dist/src/utils/userAccountManager.js +5 -4
- package/dist/src/utils/userAccountManager.js.map +1 -1
- package/dist/src/utils/userAccountManager.test.js +9 -7
- package/dist/src/utils/userAccountManager.test.js.map +1 -1
- package/dist/src/utils/workspaceContext.d.ts +4 -3
- package/dist/src/utils/workspaceContext.js +13 -13
- package/dist/src/utils/workspaceContext.js.map +1 -1
- package/dist/src/utils/workspaceContext.test.js +8 -7
- package/dist/src/utils/workspaceContext.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -7
|
@@ -4,6 +4,7 @@
|
|
|
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
9
|
import { AuthType, createContentGenerator, createContentGeneratorConfig, } from '../core/contentGenerator.js';
|
|
9
10
|
import { PromptRegistry } from '../prompts/prompt-registry.js';
|
|
@@ -18,7 +19,6 @@ import { SmartEditTool } from '../tools/smart-edit.js';
|
|
|
18
19
|
import { ShellTool } from '../tools/shell.js';
|
|
19
20
|
import { WriteFileTool } from '../tools/write-file.js';
|
|
20
21
|
import { WebFetchTool } from '../tools/web-fetch.js';
|
|
21
|
-
import { ReadManyFilesTool } from '../tools/read-many-files.js';
|
|
22
22
|
import { MemoryTool, setGeminiMdFilename } from '../tools/memoryTool.js';
|
|
23
23
|
import { WebSearchTool } from '../tools/web-search.js';
|
|
24
24
|
import { GeminiClient } from '../core/client.js';
|
|
@@ -26,31 +26,36 @@ import { BaseLlmClient } from '../core/baseLlmClient.js';
|
|
|
26
26
|
import { FileDiscoveryService } from '../services/fileDiscoveryService.js';
|
|
27
27
|
import { GitService } from '../services/gitService.js';
|
|
28
28
|
import { initializeTelemetry, DEFAULT_TELEMETRY_TARGET, DEFAULT_OTLP_ENDPOINT, uiTelemetryService, } from '../telemetry/index.js';
|
|
29
|
+
import { coreEvents } from '../utils/events.js';
|
|
29
30
|
import { tokenLimit } from '../core/tokenLimits.js';
|
|
30
|
-
import {
|
|
31
|
-
import { DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_FLASH_MODEL, } from './models.js';
|
|
31
|
+
import { DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_MODEL_AUTO, DEFAULT_THINKING_MODE, } from './models.js';
|
|
32
32
|
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
|
|
33
33
|
import { ideContextStore } from '../ide/ideContext.js';
|
|
34
34
|
import { WriteTodosTool } from '../tools/write-todos.js';
|
|
35
35
|
import { StandardFileSystemService } from '../services/fileSystemService.js';
|
|
36
|
-
import {
|
|
36
|
+
import { logRipgrepFallback } from '../telemetry/loggers.js';
|
|
37
37
|
import { RipgrepFallbackEvent } from '../telemetry/types.js';
|
|
38
38
|
import { ModelRouterService } from '../routing/modelRouterService.js';
|
|
39
39
|
import { OutputFormat } from '../output/types.js';
|
|
40
|
+
import { ModelConfigService } from '../services/modelConfigService.js';
|
|
41
|
+
import { DEFAULT_MODEL_CONFIGS } from './defaultModelConfigs.js';
|
|
40
42
|
import { WorkspaceContext } from '../utils/workspaceContext.js';
|
|
41
43
|
import { Storage } from './storage.js';
|
|
42
44
|
import { FileExclusions } from '../utils/ignorePatterns.js';
|
|
43
45
|
import { MessageBus } from '../confirmation-bus/message-bus.js';
|
|
44
46
|
import { PolicyEngine } from '../policy/policy-engine.js';
|
|
45
|
-
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
import {
|
|
53
|
-
|
|
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, };
|
|
54
59
|
export const DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD = 4_000_000;
|
|
55
60
|
export const DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES = 1000;
|
|
56
61
|
export class MCPServerConfig {
|
|
@@ -67,7 +72,7 @@ export class MCPServerConfig {
|
|
|
67
72
|
description;
|
|
68
73
|
includeTools;
|
|
69
74
|
excludeTools;
|
|
70
|
-
|
|
75
|
+
extension;
|
|
71
76
|
oauth;
|
|
72
77
|
authProviderType;
|
|
73
78
|
targetAudience;
|
|
@@ -84,7 +89,7 @@ export class MCPServerConfig {
|
|
|
84
89
|
// Common
|
|
85
90
|
timeout, trust,
|
|
86
91
|
// Metadata
|
|
87
|
-
description, includeTools, excludeTools,
|
|
92
|
+
description, includeTools, excludeTools, extension,
|
|
88
93
|
// OAuth configuration
|
|
89
94
|
oauth, authProviderType,
|
|
90
95
|
// Service Account Configuration
|
|
@@ -105,7 +110,7 @@ export class MCPServerConfig {
|
|
|
105
110
|
this.description = description;
|
|
106
111
|
this.includeTools = includeTools;
|
|
107
112
|
this.excludeTools = excludeTools;
|
|
108
|
-
this.
|
|
113
|
+
this.extension = extension;
|
|
109
114
|
this.oauth = oauth;
|
|
110
115
|
this.authProviderType = authProviderType;
|
|
111
116
|
this.targetAudience = targetAudience;
|
|
@@ -120,18 +125,22 @@ export var AuthProviderType;
|
|
|
120
125
|
})(AuthProviderType || (AuthProviderType = {}));
|
|
121
126
|
export class Config {
|
|
122
127
|
toolRegistry;
|
|
128
|
+
mcpClientManager;
|
|
129
|
+
allowedMcpServers;
|
|
130
|
+
blockedMcpServers;
|
|
123
131
|
promptRegistry;
|
|
132
|
+
agentRegistry;
|
|
124
133
|
sessionId;
|
|
125
134
|
fileSystemService;
|
|
126
135
|
contentGeneratorConfig;
|
|
127
136
|
contentGenerator;
|
|
137
|
+
modelConfigService;
|
|
128
138
|
embeddingModel;
|
|
129
139
|
sandbox;
|
|
130
140
|
targetDir;
|
|
131
141
|
workspaceContext;
|
|
132
142
|
debugMode;
|
|
133
143
|
question;
|
|
134
|
-
fullContext;
|
|
135
144
|
coreTools;
|
|
136
145
|
allowedTools;
|
|
137
146
|
excludeTools;
|
|
@@ -141,6 +150,7 @@ export class Config {
|
|
|
141
150
|
mcpServers;
|
|
142
151
|
userMemory;
|
|
143
152
|
geminiMdFileCount;
|
|
153
|
+
geminiMdFilePaths;
|
|
144
154
|
approvalMode;
|
|
145
155
|
showMemoryUsage;
|
|
146
156
|
accessibility;
|
|
@@ -157,26 +167,31 @@ export class Config {
|
|
|
157
167
|
cwd;
|
|
158
168
|
bugCommand;
|
|
159
169
|
model;
|
|
160
|
-
|
|
170
|
+
previewFeatures;
|
|
161
171
|
noBrowser;
|
|
162
|
-
folderTrustFeature;
|
|
163
172
|
folderTrust;
|
|
164
173
|
ideMode;
|
|
165
174
|
inFallbackMode = false;
|
|
166
175
|
maxSessionTurns;
|
|
176
|
+
listSessions;
|
|
177
|
+
deleteSession;
|
|
167
178
|
listExtensions;
|
|
168
|
-
|
|
169
|
-
|
|
179
|
+
_extensionLoader;
|
|
180
|
+
_enabledExtensions;
|
|
181
|
+
enableExtensionReloading;
|
|
170
182
|
fallbackModelHandler;
|
|
171
183
|
quotaErrorOccurred = false;
|
|
172
184
|
summarizeToolOutput;
|
|
173
185
|
experimentalZedIntegration = false;
|
|
174
186
|
loadMemoryFromIncludeDirectories = false;
|
|
175
|
-
|
|
187
|
+
importFormat;
|
|
188
|
+
discoveryMaxDirs;
|
|
189
|
+
compressionThreshold;
|
|
176
190
|
interactive;
|
|
191
|
+
ptyInfo;
|
|
177
192
|
trustedFolder;
|
|
178
193
|
useRipgrep;
|
|
179
|
-
|
|
194
|
+
enableInteractiveShell;
|
|
180
195
|
skipNextSpeakerCheck;
|
|
181
196
|
shellExecutionConfig;
|
|
182
197
|
extensionManagement = true;
|
|
@@ -194,7 +209,23 @@ export class Config {
|
|
|
194
209
|
policyEngine;
|
|
195
210
|
outputSettings;
|
|
196
211
|
useModelRouter;
|
|
212
|
+
initialUseModelRouter;
|
|
213
|
+
disableModelRouterForAuth;
|
|
197
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;
|
|
198
229
|
constructor(params) {
|
|
199
230
|
this.sessionId = params.sessionId;
|
|
200
231
|
this.embeddingModel =
|
|
@@ -202,10 +233,11 @@ export class Config {
|
|
|
202
233
|
this.fileSystemService = new StandardFileSystemService();
|
|
203
234
|
this.sandbox = params.sandbox;
|
|
204
235
|
this.targetDir = path.resolve(params.targetDir);
|
|
205
|
-
this.
|
|
236
|
+
this.folderTrust = params.folderTrust ?? false;
|
|
237
|
+
this.workspaceContext = new WorkspaceContext(this.targetDir, []);
|
|
238
|
+
this.pendingIncludeDirectories = params.includeDirectories ?? [];
|
|
206
239
|
this.debugMode = params.debugMode;
|
|
207
240
|
this.question = params.question;
|
|
208
|
-
this.fullContext = params.fullContext ?? false;
|
|
209
241
|
this.coreTools = params.coreTools;
|
|
210
242
|
this.allowedTools = params.allowedTools;
|
|
211
243
|
this.excludeTools = params.excludeTools;
|
|
@@ -213,8 +245,11 @@ export class Config {
|
|
|
213
245
|
this.toolCallCommand = params.toolCallCommand;
|
|
214
246
|
this.mcpServerCommand = params.mcpServerCommand;
|
|
215
247
|
this.mcpServers = params.mcpServers;
|
|
248
|
+
this.allowedMcpServers = params.allowedMcpServers ?? [];
|
|
249
|
+
this.blockedMcpServers = params.blockedMcpServers ?? [];
|
|
216
250
|
this.userMemory = params.userMemory ?? '';
|
|
217
251
|
this.geminiMdFileCount = params.geminiMdFileCount ?? 0;
|
|
252
|
+
this.geminiMdFilePaths = params.geminiMdFilePaths ?? [];
|
|
218
253
|
this.approvalMode = params.approvalMode ?? ApprovalMode.DEFAULT;
|
|
219
254
|
this.showMemoryUsage = params.showMemoryUsage ?? false;
|
|
220
255
|
this.accessibility = params.accessibility ?? {};
|
|
@@ -229,8 +264,10 @@ export class Config {
|
|
|
229
264
|
};
|
|
230
265
|
this.usageStatisticsEnabled = params.usageStatisticsEnabled ?? true;
|
|
231
266
|
this.fileFiltering = {
|
|
232
|
-
respectGitIgnore: params.fileFiltering?.respectGitIgnore ??
|
|
233
|
-
|
|
267
|
+
respectGitIgnore: params.fileFiltering?.respectGitIgnore ??
|
|
268
|
+
DEFAULT_FILE_FILTERING_OPTIONS.respectGitIgnore,
|
|
269
|
+
respectGeminiIgnore: params.fileFiltering?.respectGeminiIgnore ??
|
|
270
|
+
DEFAULT_FILE_FILTERING_OPTIONS.respectGeminiIgnore,
|
|
234
271
|
enableRecursiveFileSearch: params.fileFiltering?.enableRecursiveFileSearch ?? true,
|
|
235
272
|
disableFuzzySearch: params.fileFiltering?.disableFuzzySearch ?? false,
|
|
236
273
|
};
|
|
@@ -240,25 +277,30 @@ export class Config {
|
|
|
240
277
|
this.fileDiscoveryService = params.fileDiscoveryService ?? null;
|
|
241
278
|
this.bugCommand = params.bugCommand;
|
|
242
279
|
this.model = params.model;
|
|
243
|
-
this.
|
|
280
|
+
this.previewFeatures = params.previewFeatures ?? undefined;
|
|
244
281
|
this.maxSessionTurns = params.maxSessionTurns ?? -1;
|
|
245
282
|
this.experimentalZedIntegration =
|
|
246
283
|
params.experimentalZedIntegration ?? false;
|
|
284
|
+
this.listSessions = params.listSessions ?? false;
|
|
285
|
+
this.deleteSession = params.deleteSession;
|
|
247
286
|
this.listExtensions = params.listExtensions ?? false;
|
|
248
|
-
this.
|
|
249
|
-
|
|
287
|
+
this._extensionLoader =
|
|
288
|
+
params.extensionLoader ?? new SimpleExtensionLoader([]);
|
|
289
|
+
this._enabledExtensions = params.enabledExtensions ?? [];
|
|
250
290
|
this.noBrowser = params.noBrowser ?? false;
|
|
251
291
|
this.summarizeToolOutput = params.summarizeToolOutput;
|
|
252
|
-
this.folderTrustFeature = params.folderTrustFeature ?? false;
|
|
253
292
|
this.folderTrust = params.folderTrust ?? false;
|
|
254
293
|
this.ideMode = params.ideMode ?? false;
|
|
255
294
|
this.loadMemoryFromIncludeDirectories =
|
|
256
295
|
params.loadMemoryFromIncludeDirectories ?? false;
|
|
257
|
-
this.
|
|
296
|
+
this.importFormat = params.importFormat ?? 'tree';
|
|
297
|
+
this.discoveryMaxDirs = params.discoveryMaxDirs ?? 200;
|
|
298
|
+
this.compressionThreshold = params.compressionThreshold;
|
|
258
299
|
this.interactive = params.interactive ?? false;
|
|
300
|
+
this.ptyInfo = params.ptyInfo ?? 'child_process';
|
|
259
301
|
this.trustedFolder = params.trustedFolder;
|
|
260
302
|
this.useRipgrep = params.useRipgrep ?? true;
|
|
261
|
-
this.
|
|
303
|
+
this.enableInteractiveShell = params.enableInteractiveShell ?? false;
|
|
262
304
|
this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? true;
|
|
263
305
|
this.shellExecutionConfig = {
|
|
264
306
|
terminalWidth: params.shellExecutionConfig?.terminalWidth ?? 80,
|
|
@@ -273,31 +315,79 @@ export class Config {
|
|
|
273
315
|
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
|
274
316
|
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
|
275
317
|
this.useSmartEdit = params.useSmartEdit ?? true;
|
|
276
|
-
this.useWriteTodos = params.useWriteTodos ??
|
|
277
|
-
this.
|
|
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;
|
|
278
328
|
this.enableMessageBusIntegration =
|
|
279
|
-
params.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;
|
|
280
342
|
this.extensionManagement = params.extensionManagement ?? true;
|
|
343
|
+
this.enableExtensionReloading = params.enableExtensionReloading ?? false;
|
|
281
344
|
this.storage = new Storage(this.targetDir);
|
|
345
|
+
this.fakeResponses = params.fakeResponses;
|
|
346
|
+
this.recordResponses = params.recordResponses;
|
|
282
347
|
this.enablePromptCompletion = params.enablePromptCompletion ?? false;
|
|
283
348
|
this.fileExclusions = new FileExclusions(this);
|
|
284
349
|
this.eventEmitter = params.eventEmitter;
|
|
285
350
|
this.policyEngine = new PolicyEngine(params.policyEngineConfig);
|
|
286
|
-
this.messageBus = new MessageBus(this.policyEngine);
|
|
351
|
+
this.messageBus = new MessageBus(this.policyEngine, this.debugMode);
|
|
287
352
|
this.outputSettings = {
|
|
288
353
|
format: params.output?.format ?? OutputFormat.TEXT,
|
|
289
354
|
};
|
|
355
|
+
this.retryFetchErrors = params.retryFetchErrors ?? false;
|
|
356
|
+
this.disableYoloMode = params.disableYoloMode ?? false;
|
|
357
|
+
this.hooks = params.hooks;
|
|
358
|
+
this.experiments = params.experiments;
|
|
290
359
|
if (params.contextFileName) {
|
|
291
360
|
setGeminiMdFilename(params.contextFileName);
|
|
292
361
|
}
|
|
293
362
|
if (this.telemetrySettings.enabled) {
|
|
294
363
|
initializeTelemetry(this);
|
|
295
364
|
}
|
|
296
|
-
|
|
297
|
-
|
|
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
|
+
}
|
|
298
373
|
}
|
|
299
374
|
this.geminiClient = new GeminiClient(this);
|
|
300
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);
|
|
301
391
|
}
|
|
302
392
|
/**
|
|
303
393
|
* Must only be called once, throws if called again.
|
|
@@ -313,30 +403,64 @@ export class Config {
|
|
|
313
403
|
await this.getGitService();
|
|
314
404
|
}
|
|
315
405
|
this.promptRegistry = new PromptRegistry();
|
|
406
|
+
this.agentRegistry = new AgentRegistry(this);
|
|
407
|
+
await this.agentRegistry.initialize();
|
|
316
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
|
+
]);
|
|
317
414
|
await this.geminiClient.initialize();
|
|
318
415
|
}
|
|
319
416
|
getContentGenerator() {
|
|
320
417
|
return this.contentGenerator;
|
|
321
418
|
}
|
|
322
419
|
async refreshAuth(authMethod) {
|
|
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
|
+
}
|
|
426
|
+
}
|
|
323
427
|
// Vertex and Genai have incompatible encryption and sending history with
|
|
324
|
-
//
|
|
428
|
+
// thoughtSignature from Genai to Vertex will fail, we need to strip them
|
|
325
429
|
if (this.contentGeneratorConfig?.authType === AuthType.USE_GEMINI &&
|
|
326
|
-
authMethod
|
|
430
|
+
authMethod !== AuthType.USE_GEMINI) {
|
|
327
431
|
// Restore the conversation history to the new client
|
|
328
432
|
this.geminiClient.stripThoughtsFromHistory();
|
|
329
433
|
}
|
|
330
|
-
const newContentGeneratorConfig = createContentGeneratorConfig(this, authMethod);
|
|
434
|
+
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod);
|
|
331
435
|
this.contentGenerator = await createContentGenerator(newContentGeneratorConfig, this, this.getSessionId());
|
|
332
436
|
// Only assign to instance properties after successful initialization
|
|
333
437
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
334
438
|
// Initialize BaseLlmClient now that the ContentGenerator is available
|
|
335
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);
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
this.experiments = undefined;
|
|
460
|
+
this.experimentsPromise = undefined;
|
|
461
|
+
}
|
|
336
462
|
// Reset the session flag since we're explicitly changing auth and using default model
|
|
337
463
|
this.inFallbackMode = false;
|
|
338
|
-
// Logging the cli configuration here as the auth related configuration params would have been loaded by this point
|
|
339
|
-
logCliConfiguration(this, new StartSessionEvent(this, this.toolRegistry));
|
|
340
464
|
}
|
|
341
465
|
getUserTier() {
|
|
342
466
|
return this.contentGenerator?.userTier;
|
|
@@ -359,9 +483,18 @@ export class Config {
|
|
|
359
483
|
getSessionId() {
|
|
360
484
|
return this.sessionId;
|
|
361
485
|
}
|
|
486
|
+
setSessionId(sessionId) {
|
|
487
|
+
this.sessionId = sessionId;
|
|
488
|
+
}
|
|
362
489
|
shouldLoadMemoryFromIncludeDirectories() {
|
|
363
490
|
return this.loadMemoryFromIncludeDirectories;
|
|
364
491
|
}
|
|
492
|
+
getImportFormat() {
|
|
493
|
+
return this.importFormat;
|
|
494
|
+
}
|
|
495
|
+
getDiscoveryMaxDirs() {
|
|
496
|
+
return this.discoveryMaxDirs;
|
|
497
|
+
}
|
|
365
498
|
getContentGeneratorConfig() {
|
|
366
499
|
return this.contentGeneratorConfig;
|
|
367
500
|
}
|
|
@@ -369,11 +502,11 @@ export class Config {
|
|
|
369
502
|
return this.model;
|
|
370
503
|
}
|
|
371
504
|
setModel(newModel) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
505
|
+
if (this.model !== newModel || this.inFallbackMode) {
|
|
506
|
+
this.model = newModel;
|
|
507
|
+
coreEvents.emitModelChanged(newModel);
|
|
375
508
|
}
|
|
376
|
-
this.
|
|
509
|
+
this.setFallbackMode(false);
|
|
377
510
|
}
|
|
378
511
|
isInFallbackMode() {
|
|
379
512
|
return this.inFallbackMode;
|
|
@@ -384,6 +517,21 @@ export class Config {
|
|
|
384
517
|
setFallbackModelHandler(handler) {
|
|
385
518
|
this.fallbackModelHandler = handler;
|
|
386
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;
|
|
534
|
+
}
|
|
387
535
|
getMaxSessionTurns() {
|
|
388
536
|
return this.maxSessionTurns;
|
|
389
537
|
}
|
|
@@ -416,6 +564,9 @@ export class Config {
|
|
|
416
564
|
getWorkspaceContext() {
|
|
417
565
|
return this.workspaceContext;
|
|
418
566
|
}
|
|
567
|
+
getAgentRegistry() {
|
|
568
|
+
return this.agentRegistry;
|
|
569
|
+
}
|
|
419
570
|
getToolRegistry() {
|
|
420
571
|
return this.toolRegistry;
|
|
421
572
|
}
|
|
@@ -428,8 +579,11 @@ export class Config {
|
|
|
428
579
|
getQuestion() {
|
|
429
580
|
return this.question;
|
|
430
581
|
}
|
|
431
|
-
|
|
432
|
-
return this.
|
|
582
|
+
getPreviewFeatures() {
|
|
583
|
+
return this.previewFeatures;
|
|
584
|
+
}
|
|
585
|
+
setPreviewFeatures(previewFeatures) {
|
|
586
|
+
this.previewFeatures = previewFeatures;
|
|
433
587
|
}
|
|
434
588
|
getCoreTools() {
|
|
435
589
|
return this.coreTools;
|
|
@@ -437,8 +591,23 @@ export class Config {
|
|
|
437
591
|
getAllowedTools() {
|
|
438
592
|
return this.allowedTools;
|
|
439
593
|
}
|
|
594
|
+
/**
|
|
595
|
+
* All the excluded tools from static configuration, loaded extensions, or
|
|
596
|
+
* other sources.
|
|
597
|
+
*
|
|
598
|
+
* May change over time.
|
|
599
|
+
*/
|
|
440
600
|
getExcludeTools() {
|
|
441
|
-
|
|
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;
|
|
442
611
|
}
|
|
443
612
|
getToolDiscoveryCommand() {
|
|
444
613
|
return this.toolDiscoveryCommand;
|
|
@@ -449,9 +618,26 @@ export class Config {
|
|
|
449
618
|
getMcpServerCommand() {
|
|
450
619
|
return this.mcpServerCommand;
|
|
451
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* The user configured MCP servers (via gemini settings files).
|
|
623
|
+
*
|
|
624
|
+
* Does NOT include mcp servers configured by extensions.
|
|
625
|
+
*/
|
|
452
626
|
getMcpServers() {
|
|
453
627
|
return this.mcpServers;
|
|
454
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
|
+
}
|
|
455
641
|
getUserMemory() {
|
|
456
642
|
return this.userMemory;
|
|
457
643
|
}
|
|
@@ -464,6 +650,12 @@ export class Config {
|
|
|
464
650
|
setGeminiMdFileCount(count) {
|
|
465
651
|
this.geminiMdFileCount = count;
|
|
466
652
|
}
|
|
653
|
+
getGeminiMdFilePaths() {
|
|
654
|
+
return this.geminiMdFilePaths;
|
|
655
|
+
}
|
|
656
|
+
setGeminiMdFilePaths(paths) {
|
|
657
|
+
this.geminiMdFilePaths = paths;
|
|
658
|
+
}
|
|
467
659
|
getApprovalMode() {
|
|
468
660
|
return this.approvalMode;
|
|
469
661
|
}
|
|
@@ -473,6 +665,15 @@ export class Config {
|
|
|
473
665
|
}
|
|
474
666
|
this.approvalMode = mode;
|
|
475
667
|
}
|
|
668
|
+
isYoloModeDisabled() {
|
|
669
|
+
return this.disableYoloMode || !this.isTrustedFolder();
|
|
670
|
+
}
|
|
671
|
+
getPendingIncludeDirectories() {
|
|
672
|
+
return this.pendingIncludeDirectories;
|
|
673
|
+
}
|
|
674
|
+
clearPendingIncludeDirectories() {
|
|
675
|
+
this.pendingIncludeDirectories = [];
|
|
676
|
+
}
|
|
476
677
|
getShowMemoryUsage() {
|
|
477
678
|
return this.showMemoryUsage;
|
|
478
679
|
}
|
|
@@ -503,6 +704,16 @@ export class Config {
|
|
|
503
704
|
getGeminiClient() {
|
|
504
705
|
return this.geminiClient;
|
|
505
706
|
}
|
|
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
|
+
}
|
|
716
|
+
}
|
|
506
717
|
getModelRouterService() {
|
|
507
718
|
return this.modelRouterService;
|
|
508
719
|
}
|
|
@@ -559,23 +770,34 @@ export class Config {
|
|
|
559
770
|
getUsageStatisticsEnabled() {
|
|
560
771
|
return this.usageStatisticsEnabled;
|
|
561
772
|
}
|
|
562
|
-
getExtensionContextFilePaths() {
|
|
563
|
-
return this.extensionContextFilePaths;
|
|
564
|
-
}
|
|
565
773
|
getExperimentalZedIntegration() {
|
|
566
774
|
return this.experimentalZedIntegration;
|
|
567
775
|
}
|
|
568
776
|
getListExtensions() {
|
|
569
777
|
return this.listExtensions;
|
|
570
778
|
}
|
|
779
|
+
getListSessions() {
|
|
780
|
+
return this.listSessions;
|
|
781
|
+
}
|
|
782
|
+
getDeleteSession() {
|
|
783
|
+
return this.deleteSession;
|
|
784
|
+
}
|
|
571
785
|
getExtensionManagement() {
|
|
572
786
|
return this.extensionManagement;
|
|
573
787
|
}
|
|
574
788
|
getExtensions() {
|
|
575
|
-
return this.
|
|
789
|
+
return this._extensionLoader.getExtensions();
|
|
576
790
|
}
|
|
577
|
-
|
|
578
|
-
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;
|
|
579
801
|
}
|
|
580
802
|
getNoBrowser() {
|
|
581
803
|
return this.noBrowser;
|
|
@@ -589,16 +811,16 @@ export class Config {
|
|
|
589
811
|
getIdeMode() {
|
|
590
812
|
return this.ideMode;
|
|
591
813
|
}
|
|
592
|
-
getFolderTrustFeature() {
|
|
593
|
-
return this.folderTrustFeature;
|
|
594
|
-
}
|
|
595
814
|
/**
|
|
596
|
-
* Returns 'true' if the
|
|
597
|
-
* 'false' for untrusted.
|
|
815
|
+
* Returns 'true' if the folder trust feature is enabled.
|
|
598
816
|
*/
|
|
599
817
|
getFolderTrust() {
|
|
600
818
|
return this.folderTrust;
|
|
601
819
|
}
|
|
820
|
+
/**
|
|
821
|
+
* Returns 'true' if the workspace is considered "trusted".
|
|
822
|
+
* 'false' for untrusted.
|
|
823
|
+
*/
|
|
602
824
|
isTrustedFolder() {
|
|
603
825
|
// isWorkspaceTrusted in cli/src/config/trustedFolder.js returns undefined
|
|
604
826
|
// when the file based trust value is unavailable, since it is mainly used
|
|
@@ -631,8 +853,47 @@ export class Config {
|
|
|
631
853
|
setFileSystemService(fileSystemService) {
|
|
632
854
|
this.fileSystemService = fileSystemService;
|
|
633
855
|
}
|
|
634
|
-
|
|
635
|
-
|
|
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);
|
|
636
897
|
}
|
|
637
898
|
isInteractive() {
|
|
638
899
|
return this.interactive;
|
|
@@ -640,12 +901,21 @@ export class Config {
|
|
|
640
901
|
getUseRipgrep() {
|
|
641
902
|
return this.useRipgrep;
|
|
642
903
|
}
|
|
643
|
-
|
|
644
|
-
return this.
|
|
904
|
+
getEnableInteractiveShell() {
|
|
905
|
+
return this.enableInteractiveShell;
|
|
645
906
|
}
|
|
646
907
|
getSkipNextSpeakerCheck() {
|
|
647
908
|
return this.skipNextSpeakerCheck;
|
|
648
909
|
}
|
|
910
|
+
getContinueOnFailedApiCall() {
|
|
911
|
+
return this.continueOnFailedApiCall;
|
|
912
|
+
}
|
|
913
|
+
getRetryFetchErrors() {
|
|
914
|
+
return this.retryFetchErrors;
|
|
915
|
+
}
|
|
916
|
+
getEnableShellOutputEfficiency() {
|
|
917
|
+
return this.enableShellOutputEfficiency;
|
|
918
|
+
}
|
|
649
919
|
getShellExecutionConfig() {
|
|
650
920
|
return this.shellExecutionConfig;
|
|
651
921
|
}
|
|
@@ -708,15 +978,24 @@ export class Config {
|
|
|
708
978
|
getEnableMessageBusIntegration() {
|
|
709
979
|
return this.enableMessageBusIntegration;
|
|
710
980
|
}
|
|
981
|
+
getEnableHooks() {
|
|
982
|
+
return this.enableHooks;
|
|
983
|
+
}
|
|
984
|
+
getCodebaseInvestigatorSettings() {
|
|
985
|
+
return this.codebaseInvestigatorSettings;
|
|
986
|
+
}
|
|
711
987
|
async createToolRegistry() {
|
|
712
|
-
const registry = new ToolRegistry(this
|
|
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
|
+
}
|
|
713
993
|
// helper to create & register core tools that are enabled
|
|
714
994
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
715
995
|
const registerCoreTool = (ToolClass, ...args) => {
|
|
716
996
|
const className = ToolClass.name;
|
|
717
997
|
const toolName = ToolClass.Name || className;
|
|
718
998
|
const coreTools = this.getCoreTools();
|
|
719
|
-
const excludeTools = this.getExcludeTools() || [];
|
|
720
999
|
// On some platforms, the className can be minified to _ClassName.
|
|
721
1000
|
const normalizedClassName = className.replace(/^_+/, '');
|
|
722
1001
|
let isEnabled = true; // Enabled by default if coreTools is not set.
|
|
@@ -726,24 +1005,14 @@ export class Config {
|
|
|
726
1005
|
tool.startsWith(`${toolName}(`) ||
|
|
727
1006
|
tool.startsWith(`${normalizedClassName}(`));
|
|
728
1007
|
}
|
|
729
|
-
const isExcluded = excludeTools.some((tool) => tool === toolName || tool === normalizedClassName);
|
|
730
|
-
if (isExcluded) {
|
|
731
|
-
isEnabled = false;
|
|
732
|
-
}
|
|
733
1008
|
if (isEnabled) {
|
|
734
1009
|
// Pass message bus to tools when feature flag is enabled
|
|
735
1010
|
// This first implementation is only focused on the general case of
|
|
736
1011
|
// the tool registry.
|
|
737
1012
|
const messageBusEnabled = this.getEnableMessageBusIntegration();
|
|
738
|
-
if (this.debugMode && messageBusEnabled) {
|
|
739
|
-
console.log(`[DEBUG] enableMessageBusIntegration setting: ${messageBusEnabled}`);
|
|
740
|
-
}
|
|
741
1013
|
const toolArgs = messageBusEnabled
|
|
742
1014
|
? [...args, this.getMessageBus()]
|
|
743
1015
|
: args;
|
|
744
|
-
if (this.debugMode && messageBusEnabled) {
|
|
745
|
-
console.log(`[DEBUG] Registering ${className} with messageBus: ${messageBusEnabled ? 'YES' : 'NO'}`);
|
|
746
|
-
}
|
|
747
1016
|
registry.registerTool(new ToolClass(...toolArgs));
|
|
748
1017
|
}
|
|
749
1018
|
};
|
|
@@ -778,16 +1047,86 @@ export class Config {
|
|
|
778
1047
|
}
|
|
779
1048
|
registerCoreTool(WriteFileTool, this);
|
|
780
1049
|
registerCoreTool(WebFetchTool, this);
|
|
781
|
-
registerCoreTool(ReadManyFilesTool, this);
|
|
782
1050
|
registerCoreTool(ShellTool, this);
|
|
783
1051
|
registerCoreTool(MemoryTool);
|
|
784
1052
|
registerCoreTool(WebSearchTool, this);
|
|
785
1053
|
if (this.getUseWriteTodos()) {
|
|
786
1054
|
registerCoreTool(WriteTodosTool, this);
|
|
787
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
|
+
}
|
|
788
1070
|
await registry.discoverAllTools();
|
|
1071
|
+
registry.sortTools();
|
|
789
1072
|
return registry;
|
|
790
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
|
+
}
|
|
791
1130
|
}
|
|
792
1131
|
// Export model constants for use in CLI
|
|
793
1132
|
export { DEFAULT_GEMINI_FLASH_MODEL };
|