@machina.ai/cell-cli-core 1.19.4-rc3 → 1.22.5-rc1
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/agents/delegate-to-agent-tool.d.ts +19 -0
- package/dist/src/agents/delegate-to-agent-tool.js +111 -0
- package/dist/src/agents/delegate-to-agent-tool.js.map +1 -0
- package/dist/src/agents/delegate-to-agent-tool.test.d.ts +6 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js +133 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js.map +1 -0
- package/dist/src/agents/executor.js +12 -17
- package/dist/src/agents/executor.js.map +1 -1
- package/dist/src/agents/executor.test.js +8 -9
- package/dist/src/agents/executor.test.js.map +1 -1
- package/dist/src/agents/registry.d.ts +15 -0
- package/dist/src/agents/registry.js +58 -2
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +61 -0
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/availability/errorClassification.d.ts +7 -0
- package/dist/src/availability/errorClassification.js +20 -0
- package/dist/src/availability/errorClassification.js.map +1 -0
- package/dist/src/availability/modelAvailabilityService.d.ts +2 -1
- package/dist/src/availability/modelAvailabilityService.js +5 -2
- package/dist/src/availability/modelAvailabilityService.js.map +1 -1
- package/dist/src/availability/modelAvailabilityService.test.js +3 -3
- package/dist/src/availability/modelAvailabilityService.test.js.map +1 -1
- package/dist/src/availability/modelPolicy.d.ts +8 -1
- package/dist/src/availability/policyCatalog.d.ts +4 -1
- package/dist/src/availability/policyCatalog.js +8 -9
- package/dist/src/availability/policyCatalog.js.map +1 -1
- package/dist/src/availability/policyCatalog.test.js +2 -2
- package/dist/src/availability/policyCatalog.test.js.map +1 -1
- package/dist/src/availability/policyHelpers.d.ts +51 -0
- package/dist/src/availability/policyHelpers.js +145 -0
- package/dist/src/availability/policyHelpers.js.map +1 -0
- package/dist/src/availability/policyHelpers.test.d.ts +6 -0
- package/dist/src/availability/policyHelpers.test.js +172 -0
- package/dist/src/availability/policyHelpers.test.js.map +1 -0
- package/dist/src/availability/testUtils.d.ts +10 -0
- package/dist/src/availability/testUtils.js +22 -0
- package/dist/src/availability/testUtils.js.map +1 -0
- package/dist/src/code_assist/experiments/client_metadata.js +3 -2
- package/dist/src/code_assist/experiments/client_metadata.js.map +1 -1
- package/dist/src/code_assist/experiments/client_metadata.test.js +7 -10
- package/dist/src/code_assist/experiments/client_metadata.test.js.map +1 -1
- package/dist/src/code_assist/experiments/experiments.js +2 -2
- package/dist/src/code_assist/experiments/experiments.js.map +1 -1
- package/dist/src/code_assist/oauth2.d.ts +2 -0
- package/dist/src/code_assist/oauth2.js +41 -15
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +114 -7
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.d.ts +2 -1
- package/dist/src/code_assist/server.js +7 -4
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +24 -0
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/types.d.ts +14 -0
- package/dist/src/commands/init.d.ts +7 -0
- package/dist/src/commands/init.js +53 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/init.test.d.ts +6 -0
- package/dist/src/commands/init.test.js +25 -0
- package/dist/src/commands/init.test.js.map +1 -0
- package/dist/src/commands/restore.d.ts +9 -0
- package/dist/src/commands/restore.js +46 -0
- package/dist/src/commands/restore.js.map +1 -0
- package/dist/src/commands/restore.test.d.ts +6 -0
- package/dist/src/commands/restore.test.js +137 -0
- package/dist/src/commands/restore.test.js.map +1 -0
- package/dist/src/commands/types.d.ts +41 -0
- package/dist/src/commands/types.js +7 -0
- package/dist/src/commands/types.js.map +1 -0
- package/dist/src/config/config.d.ts +43 -3
- package/dist/src/config/config.js +182 -29
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +217 -9
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/defaultModelConfigs.js +21 -0
- package/dist/src/config/defaultModelConfigs.js.map +1 -1
- package/dist/src/config/models.d.ts +33 -11
- package/dist/src/config/models.js +82 -24
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/models.test.js +70 -76
- package/dist/src/config/models.test.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.js +1 -0
- package/dist/src/confirmation-bus/message-bus.js.map +1 -1
- package/dist/src/confirmation-bus/types.d.ts +4 -0
- package/dist/src/core/AuthenticatedContentGenerator.js +4 -4
- package/dist/src/core/AuthenticatedContentGenerator.js.map +1 -1
- package/dist/src/core/baseLlmClient.d.ts +3 -1
- package/dist/src/core/baseLlmClient.js +40 -3
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +184 -7
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.js +52 -51
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +178 -6
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.js +5 -3
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +29 -22
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolHookTriggers.d.ts +55 -0
- package/dist/src/core/coreToolHookTriggers.js +244 -0
- package/dist/src/core/coreToolHookTriggers.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +1 -1
- package/dist/src/core/coreToolScheduler.js +87 -36
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +201 -38
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.js +144 -41
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +251 -192
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiChatHookTriggers.d.ts +64 -0
- package/dist/src/core/geminiChatHookTriggers.js +136 -0
- package/dist/src/core/geminiChatHookTriggers.js.map +1 -0
- package/dist/src/core/geminiChat_network_retry.test.d.ts +6 -0
- package/dist/src/core/geminiChat_network_retry.test.js +198 -0
- package/dist/src/core/geminiChat_network_retry.test.js.map +1 -0
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.js +9 -4
- package/dist/src/core/loggingContentGenerator.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +4 -5
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/prompts.js +50 -29
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +19 -8
- package/dist/src/core/prompts.test.js.map +1 -1
- package/dist/src/core/sessionHookTriggers.d.ts +28 -0
- package/dist/src/core/sessionHookTriggers.js +68 -0
- package/dist/src/core/sessionHookTriggers.js.map +1 -0
- package/dist/src/core/turn.d.ts +1 -0
- package/dist/src/core/turn.js +1 -1
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/fallback/handler.js +82 -69
- package/dist/src/fallback/handler.js.map +1 -1
- package/dist/src/fallback/handler.test.js +186 -170
- package/dist/src/fallback/handler.test.js.map +1 -1
- package/dist/src/fallback/types.d.ts +8 -0
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/hooks/hookEventHandler.js +70 -12
- package/dist/src/hooks/hookEventHandler.js.map +1 -1
- package/dist/src/hooks/hookEventHandler.test.js +8 -1
- package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
- package/dist/src/hooks/hookRegistry.d.ts +0 -7
- package/dist/src/hooks/hookRegistry.js +8 -21
- package/dist/src/hooks/hookRegistry.js.map +1 -1
- package/dist/src/hooks/hookRegistry.test.js +2 -7
- package/dist/src/hooks/hookRegistry.test.js.map +1 -1
- package/dist/src/hooks/hookRunner.js +19 -3
- package/dist/src/hooks/hookRunner.js.map +1 -1
- package/dist/src/hooks/hookRunner.test.js +2 -1
- package/dist/src/hooks/hookRunner.test.js.map +1 -1
- package/dist/src/hooks/hookSystem.d.ts +0 -8
- package/dist/src/hooks/hookSystem.js +0 -18
- package/dist/src/hooks/hookSystem.js.map +1 -1
- package/dist/src/hooks/hookSystem.test.js +124 -18
- package/dist/src/hooks/hookSystem.test.js.map +1 -1
- package/dist/src/hooks/index.d.ts +3 -1
- package/dist/src/hooks/index.js +3 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/types.d.ts +1 -2
- package/dist/src/hooks/types.js +0 -1
- package/dist/src/hooks/types.js.map +1 -1
- package/dist/src/ide/detect-ide.test.js +32 -1
- package/dist/src/ide/detect-ide.test.js.map +1 -1
- package/dist/src/ide/ide-client.js +5 -3
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-client.test.js +17 -0
- package/dist/src/ide/ide-client.test.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +1 -1
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +10 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/auth-provider.d.ts +16 -0
- package/dist/src/mcp/auth-provider.js +7 -0
- package/dist/src/mcp/auth-provider.js.map +1 -0
- package/dist/src/mcp/google-auth-provider.d.ts +10 -2
- package/dist/src/mcp/google-auth-provider.js +28 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.test.js +45 -0
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -1
- package/dist/src/mcp/mcpLauncher.js +6 -3
- package/dist/src/mcp/mcpLauncher.js.map +1 -1
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/sa-impersonation-provider.d.ts +2 -2
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -1
- package/dist/src/mcp/token-storage/hybrid-token-storage.js +1 -1
- package/dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -1
- package/dist/src/output/json-formatter.d.ts +2 -2
- package/dist/src/output/json-formatter.js +6 -3
- package/dist/src/output/json-formatter.js.map +1 -1
- package/dist/src/output/json-formatter.test.js +37 -9
- package/dist/src/output/json-formatter.test.js.map +1 -1
- package/dist/src/output/stream-json-formatter.js +6 -0
- package/dist/src/output/stream-json-formatter.js.map +1 -1
- package/dist/src/output/stream-json-formatter.test.js +98 -100
- package/dist/src/output/stream-json-formatter.test.js.map +1 -1
- package/dist/src/output/types.d.ts +3 -0
- package/dist/src/output/types.js.map +1 -1
- package/dist/src/policy/config.js +97 -11
- package/dist/src/policy/config.js.map +1 -1
- package/dist/src/policy/persistence.test.d.ts +6 -0
- package/dist/src/policy/persistence.test.js +154 -0
- package/dist/src/policy/persistence.test.js.map +1 -0
- package/dist/src/policy/policies/agent.toml +31 -0
- package/dist/src/policy/policies/read-only.toml +5 -0
- package/dist/src/policy/policy-engine.d.ts +10 -1
- package/dist/src/policy/policy-engine.js +79 -5
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/policy/policy-engine.test.js +26 -2
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- package/dist/src/policy/policy-updater.test.d.ts +6 -0
- package/dist/src/policy/policy-updater.test.js +116 -0
- package/dist/src/policy/policy-updater.test.js.map +1 -0
- package/dist/src/policy/shell-safety.test.d.ts +6 -0
- package/dist/src/policy/shell-safety.test.js +75 -0
- package/dist/src/policy/shell-safety.test.js.map +1 -0
- package/dist/src/policy/toml-loader.d.ts +11 -5
- package/dist/src/policy/toml-loader.js +38 -23
- package/dist/src/policy/toml-loader.js.map +1 -1
- package/dist/src/policy/toml-loader.test.js +28 -7
- package/dist/src/policy/toml-loader.test.js.map +1 -1
- package/dist/src/policy/types.d.ts +15 -0
- package/dist/src/resources/resource-registry.d.ts +30 -0
- package/dist/src/resources/resource-registry.js +57 -0
- package/dist/src/resources/resource-registry.js.map +1 -0
- package/dist/src/resources/resource-registry.test.d.ts +6 -0
- package/dist/src/resources/resource-registry.test.js +54 -0
- package/dist/src/resources/resource-registry.test.js.map +1 -0
- package/dist/src/routing/modelRouterService.js +0 -15
- package/dist/src/routing/modelRouterService.js.map +1 -1
- package/dist/src/routing/modelRouterService.test.js +0 -62
- package/dist/src/routing/modelRouterService.test.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.js +10 -21
- package/dist/src/routing/strategies/classifierStrategy.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js +2 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js +23 -12
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.test.js +69 -39
- package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/overrideStrategy.js +4 -3
- package/dist/src/routing/strategies/overrideStrategy.js.map +1 -1
- package/dist/src/safety/checker-runner.js +17 -6
- package/dist/src/safety/checker-runner.js.map +1 -1
- package/dist/src/services/chatCompressionService.js +17 -3
- package/dist/src/services/chatCompressionService.js.map +1 -1
- package/dist/src/services/chatCompressionService.test.js +9 -0
- package/dist/src/services/chatCompressionService.test.js.map +1 -1
- package/dist/src/services/chatRecordingService.d.ts +14 -0
- package/dist/src/services/chatRecordingService.js +37 -0
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/contextManager.d.ts +35 -0
- package/dist/src/services/contextManager.js +68 -0
- package/dist/src/services/contextManager.js.map +1 -0
- package/dist/src/services/contextManager.test.d.ts +6 -0
- package/dist/src/services/contextManager.test.js +105 -0
- package/dist/src/services/contextManager.test.js.map +1 -0
- package/dist/src/services/fileSystemService.d.ts +0 -9
- package/dist/src/services/fileSystemService.js +0 -11
- package/dist/src/services/fileSystemService.js.map +1 -1
- package/dist/src/services/gitService.js +5 -0
- package/dist/src/services/gitService.js.map +1 -1
- package/dist/src/services/gitService.test.js +28 -0
- package/dist/src/services/gitService.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.js +3 -3
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/modelConfig.golden.test.js +32 -0
- package/dist/src/services/modelConfig.golden.test.js.map +1 -1
- package/dist/src/services/modelConfigService.d.ts +3 -0
- package/dist/src/services/modelConfigService.js +3 -2
- package/dist/src/services/modelConfigService.js.map +1 -1
- package/dist/src/services/modelConfigService.test.js +110 -0
- package/dist/src/services/modelConfigService.test.js.map +1 -1
- package/dist/src/services/modelConfigServiceTestUtils.d.ts +10 -0
- package/dist/src/services/modelConfigServiceTestUtils.js +17 -0
- package/dist/src/services/modelConfigServiceTestUtils.js.map +1 -0
- package/dist/src/services/sessionSummaryService.d.ts +28 -0
- package/dist/src/services/sessionSummaryService.js +131 -0
- package/dist/src/services/sessionSummaryService.js.map +1 -0
- package/dist/src/services/sessionSummaryService.test.d.ts +6 -0
- package/dist/src/services/sessionSummaryService.test.js +785 -0
- package/dist/src/services/sessionSummaryService.test.js.map +1 -0
- package/dist/src/services/sessionSummaryUtils.d.ts +16 -0
- package/dist/src/services/sessionSummaryUtils.js +129 -0
- package/dist/src/services/sessionSummaryUtils.js.map +1 -0
- package/dist/src/services/sessionSummaryUtils.test.d.ts +6 -0
- package/dist/src/services/sessionSummaryUtils.test.js +137 -0
- package/dist/src/services/sessionSummaryUtils.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.js +56 -22
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +137 -5
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/services/test-data/resolved-aliases-retry.golden.json +238 -0
- package/dist/src/services/test-data/resolved-aliases.golden.json +16 -0
- package/dist/src/telemetry/activity-detector.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +28 -5
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +67 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +3 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/config.js +2 -0
- package/dist/src/telemetry/config.js.map +1 -1
- package/dist/src/telemetry/config.test.js +25 -0
- package/dist/src/telemetry/config.test.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.d.ts +4 -3
- package/dist/src/telemetry/gcp-exporters.js +8 -4
- package/dist/src/telemetry/gcp-exporters.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +2 -1
- package/dist/src/telemetry/index.js +2 -1
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +2 -1
- package/dist/src/telemetry/loggers.js +345 -338
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +195 -18
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/sdk.d.ts +9 -2
- package/dist/src/telemetry/sdk.js +143 -17
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/telemetry/sdk.test.js +130 -28
- package/dist/src/telemetry/sdk.test.js.map +1 -1
- package/dist/src/telemetry/startupProfiler.d.ts +51 -0
- package/dist/src/telemetry/startupProfiler.js +170 -0
- package/dist/src/telemetry/startupProfiler.js.map +1 -0
- package/dist/src/telemetry/startupProfiler.test.d.ts +6 -0
- package/dist/src/telemetry/startupProfiler.test.js +289 -0
- package/dist/src/telemetry/startupProfiler.test.js.map +1 -0
- package/dist/src/telemetry/telemetry.test.js +10 -3
- package/dist/src/telemetry/telemetry.test.js.map +1 -1
- package/dist/src/telemetry/trace.js +2 -2
- package/dist/src/telemetry/trace.js.map +1 -1
- package/dist/src/telemetry/types.d.ts +37 -10
- package/dist/src/telemetry/types.js +82 -17
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +1 -0
- package/dist/src/telemetry/uiTelemetry.js +2 -0
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +4 -0
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/mock-message-bus.js.map +1 -1
- package/dist/src/tools/confirmation-policy.test.d.ts +6 -0
- package/dist/src/tools/confirmation-policy.test.js +152 -0
- package/dist/src/tools/confirmation-policy.test.js.map +1 -0
- package/dist/src/tools/edit.js +5 -0
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.d.ts +3 -1
- package/dist/src/tools/mcp-client-manager.js +30 -4
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +38 -10
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +40 -3
- package/dist/src/tools/mcp-client.js +437 -174
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +695 -28
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/mcp-tool.js +13 -0
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/mcp-tool.test.js +25 -0
- package/dist/src/tools/mcp-tool.test.js.map +1 -1
- package/dist/src/tools/memoryTool.js +1 -0
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.test.js +22 -13
- package/dist/src/tools/modifiable-tool.test.js.map +1 -1
- package/dist/src/tools/read-file.js +1 -1
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.js +6 -4
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +1 -1
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +2 -1
- package/dist/src/tools/shell.js +58 -4
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +25 -5
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/smart-edit.js +6 -1
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/smart-edit.test.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +2 -0
- package/dist/src/tools/tool-names.js +2 -0
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tools.d.ts +19 -0
- package/dist/src/tools/tools.js +29 -8
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/web-fetch.js +18 -5
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +1 -0
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/write-file.js +5 -0
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.d.ts +8 -0
- package/dist/src/utils/bfsFileSearch.js +63 -23
- package/dist/src/utils/bfsFileSearch.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.test.js +65 -1
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -1
- package/dist/src/utils/checkpointUtils.d.ts +82 -0
- package/dist/src/utils/checkpointUtils.js +117 -0
- package/dist/src/utils/checkpointUtils.js.map +1 -0
- package/dist/src/utils/checkpointUtils.test.d.ts +6 -0
- package/dist/src/utils/checkpointUtils.test.js +229 -0
- package/dist/src/utils/checkpointUtils.test.js.map +1 -0
- package/dist/src/utils/debugLogger.d.ts +3 -0
- package/dist/src/utils/debugLogger.js +27 -0
- package/dist/src/utils/debugLogger.js.map +1 -1
- package/dist/src/utils/editCorrector.test.js +4 -0
- package/dist/src/utils/editCorrector.test.js.map +1 -1
- package/dist/src/utils/editor.d.ts +9 -1
- package/dist/src/utils/editor.js +23 -14
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/errors.d.ts +8 -0
- package/dist/src/utils/errors.js +39 -2
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +155 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/exitCodes.d.ts +12 -0
- package/dist/src/utils/exitCodes.js +13 -0
- package/dist/src/utils/exitCodes.js.map +1 -0
- package/dist/src/utils/extensionLoader.d.ts +2 -2
- package/dist/src/utils/extensionLoader.js +5 -6
- package/dist/src/utils/extensionLoader.js.map +1 -1
- package/dist/src/utils/extensionLoader.test.js +11 -0
- package/dist/src/utils/extensionLoader.test.js.map +1 -1
- package/dist/src/utils/fetch.d.ts +1 -1
- package/dist/src/utils/fetch.js +3 -3
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +15 -0
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/filesearch/crawlCache.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/flashFallback.test.js +1 -1
- package/dist/src/utils/flashFallback.test.js.map +1 -1
- package/dist/src/utils/googleErrors.js +31 -18
- package/dist/src/utils/googleErrors.js.map +1 -1
- package/dist/src/utils/googleErrors.test.js +10 -2
- package/dist/src/utils/googleErrors.test.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.d.ts +3 -3
- package/dist/src/utils/googleQuotaErrors.js +32 -6
- package/dist/src/utils/googleQuotaErrors.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.test.js +94 -2
- package/dist/src/utils/googleQuotaErrors.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +5 -0
- package/dist/src/utils/memoryDiscovery.js +7 -3
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +28 -0
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.test.js +4 -0
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
- package/dist/src/utils/pathCorrector.js +12 -2
- package/dist/src/utils/pathCorrector.js.map +1 -1
- package/dist/src/utils/pathCorrector.test.js +6 -2
- package/dist/src/utils/pathCorrector.test.js.map +1 -1
- package/dist/src/utils/retry.d.ts +11 -0
- package/dist/src/utils/retry.js +54 -13
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +170 -10
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/shell-permissions.d.ts +52 -0
- package/dist/src/utils/shell-permissions.js +188 -0
- package/dist/src/utils/shell-permissions.js.map +1 -0
- package/dist/src/utils/shell-permissions.test.d.ts +6 -0
- package/dist/src/utils/shell-permissions.test.js +347 -0
- package/dist/src/utils/shell-permissions.test.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +10 -47
- package/dist/src/utils/shell-utils.js +1 -182
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +1 -288
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/stdio.d.ts +2 -2
- package/dist/src/utils/stdio.js +2 -2
- package/dist/src/utils/stdio.js.map +1 -1
- package/dist/src/utils/stdio.test.js +5 -5
- package/dist/src/utils/stdio.test.js.map +1 -1
- package/dist/src/utils/terminalSerializer.test.js +17 -0
- package/dist/src/utils/terminalSerializer.test.js.map +1 -1
- package/dist/src/utils/tokenCalculation.d.ts +19 -0
- package/dist/src/utils/tokenCalculation.js +70 -0
- package/dist/src/utils/tokenCalculation.js.map +1 -0
- package/dist/src/utils/tokenCalculation.test.d.ts +6 -0
- package/dist/src/utils/tokenCalculation.test.js +78 -0
- package/dist/src/utils/tokenCalculation.test.js.map +1 -0
- package/dist/src/utils/tool-utils.js.map +1 -1
- package/dist/src/utils/version.d.ts +6 -0
- package/dist/src/utils/version.js +15 -0
- package/dist/src/utils/version.js.map +1 -0
- package/dist/src/utils/version.test.d.ts +6 -0
- package/dist/src/utils/version.test.js +39 -0
- package/dist/src/utils/version.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import { inspect } from 'node:util';
|
|
|
8
8
|
import process from 'node:process';
|
|
9
9
|
import { AuthType, createContentGenerator, createContentGeneratorConfig, } from '../core/contentGenerator.js';
|
|
10
10
|
import { PromptRegistry } from '../prompts/prompt-registry.js';
|
|
11
|
+
import { ResourceRegistry } from '../resources/resource-registry.js';
|
|
11
12
|
import { ToolRegistry } from '../tools/tool-registry.js';
|
|
12
13
|
import { LSTool } from '../tools/ls.js';
|
|
13
14
|
import { ReadFileTool } from '../tools/read-file.js';
|
|
@@ -28,17 +29,19 @@ import { GitService } from '../services/gitService.js';
|
|
|
28
29
|
import { initializeTelemetry, DEFAULT_TELEMETRY_TARGET, DEFAULT_OTLP_ENDPOINT, uiTelemetryService, } from '../telemetry/index.js';
|
|
29
30
|
import { coreEvents } from '../utils/events.js';
|
|
30
31
|
import { tokenLimit } from '../core/tokenLimits.js';
|
|
31
|
-
import { DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_FLASH_MODEL,
|
|
32
|
+
import { DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL_AUTO, DEFAULT_THINKING_MODE, isPreviewModel, PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_MODEL_AUTO, } from './models.js';
|
|
32
33
|
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
|
|
33
34
|
import { ideContextStore } from '../ide/ideContext.js';
|
|
34
35
|
import { WriteTodosTool } from '../tools/write-todos.js';
|
|
35
36
|
import { StandardFileSystemService } from '../services/fileSystemService.js';
|
|
36
37
|
import { logRipgrepFallback } from '../telemetry/loggers.js';
|
|
37
38
|
import { RipgrepFallbackEvent } from '../telemetry/types.js';
|
|
39
|
+
import { ModelAvailabilityService } from '../availability/modelAvailabilityService.js';
|
|
38
40
|
import { ModelRouterService } from '../routing/modelRouterService.js';
|
|
39
41
|
import { OutputFormat } from '../output/types.js';
|
|
40
42
|
import { ModelConfigService } from '../services/modelConfigService.js';
|
|
41
43
|
import { DEFAULT_MODEL_CONFIGS } from './defaultModelConfigs.js';
|
|
44
|
+
import { ContextManager } from '../services/contextManager.js';
|
|
42
45
|
import { WorkspaceContext } from '../utils/workspaceContext.js';
|
|
43
46
|
import { Storage } from './storage.js';
|
|
44
47
|
import { FileExclusions } from '../utils/ignorePatterns.js';
|
|
@@ -48,10 +51,12 @@ import { HookSystem } from '../hooks/index.js';
|
|
|
48
51
|
import { getCodeAssistServer } from '../code_assist/codeAssist.js';
|
|
49
52
|
import { AgentRegistry } from '../agents/registry.js';
|
|
50
53
|
import { setGlobalProxy } from '../utils/fetch.js';
|
|
51
|
-
import {
|
|
54
|
+
import { DelegateToAgentTool } from '../agents/delegate-to-agent-tool.js';
|
|
55
|
+
import { DELEGATE_TO_AGENT_TOOL_NAME } from '../tools/tool-names.js';
|
|
52
56
|
import { getExperiments } from '../code_assist/experiments/experiments.js';
|
|
53
57
|
import { ExperimentFlags } from '../code_assist/experiments/flagNames.js';
|
|
54
58
|
import { debugLogger } from '../utils/debugLogger.js';
|
|
59
|
+
import { startupProfiler } from '../telemetry/startupProfiler.js';
|
|
55
60
|
import { ApprovalMode } from '../policy/types.js';
|
|
56
61
|
export { ApprovalMode };
|
|
57
62
|
import { DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, } from './constants.js';
|
|
@@ -70,6 +75,7 @@ export class MCPServerConfig {
|
|
|
70
75
|
httpUrl;
|
|
71
76
|
headers;
|
|
72
77
|
tcp;
|
|
78
|
+
type;
|
|
73
79
|
timeout;
|
|
74
80
|
trust;
|
|
75
81
|
description;
|
|
@@ -89,6 +95,12 @@ export class MCPServerConfig {
|
|
|
89
95
|
httpUrl, headers,
|
|
90
96
|
// For websocket transport
|
|
91
97
|
tcp,
|
|
98
|
+
// Transport type (optional, for use with 'url' field)
|
|
99
|
+
// When set to 'http', uses StreamableHTTPClientTransport
|
|
100
|
+
// When set to 'sse', uses SSEClientTransport
|
|
101
|
+
// When omitted, auto-detects transport type
|
|
102
|
+
// Note: 'httpUrl' is deprecated in favor of 'url' + 'type'
|
|
103
|
+
type,
|
|
92
104
|
// Common
|
|
93
105
|
timeout, trust,
|
|
94
106
|
// Metadata
|
|
@@ -109,6 +121,7 @@ export class MCPServerConfig {
|
|
|
109
121
|
this.httpUrl = httpUrl;
|
|
110
122
|
this.headers = headers;
|
|
111
123
|
this.tcp = tcp;
|
|
124
|
+
this.type = type;
|
|
112
125
|
this.timeout = timeout;
|
|
113
126
|
this.trust = trust;
|
|
114
127
|
this.description = description;
|
|
@@ -133,6 +146,7 @@ export class Config {
|
|
|
133
146
|
allowedMcpServers;
|
|
134
147
|
blockedMcpServers;
|
|
135
148
|
promptRegistry;
|
|
149
|
+
resourceRegistry;
|
|
136
150
|
agentRegistry;
|
|
137
151
|
sessionId;
|
|
138
152
|
fileSystemService;
|
|
@@ -155,7 +169,6 @@ export class Config {
|
|
|
155
169
|
userMemory;
|
|
156
170
|
geminiMdFileCount;
|
|
157
171
|
geminiMdFilePaths;
|
|
158
|
-
approvalMode;
|
|
159
172
|
showMemoryUsage;
|
|
160
173
|
accessibility;
|
|
161
174
|
telemetrySettings;
|
|
@@ -163,6 +176,7 @@ export class Config {
|
|
|
163
176
|
geminiClient;
|
|
164
177
|
baseLlmClient;
|
|
165
178
|
modelRouterService;
|
|
179
|
+
modelAvailabilityService;
|
|
166
180
|
fileFiltering;
|
|
167
181
|
fileDiscoveryService = null;
|
|
168
182
|
gitService = undefined;
|
|
@@ -176,10 +190,12 @@ export class Config {
|
|
|
176
190
|
bugCommand;
|
|
177
191
|
model;
|
|
178
192
|
previewFeatures;
|
|
193
|
+
hasAccessToPreviewModel = false;
|
|
179
194
|
noBrowser;
|
|
180
195
|
folderTrust;
|
|
181
196
|
ideMode;
|
|
182
197
|
inFallbackMode = false;
|
|
198
|
+
_activeModel;
|
|
183
199
|
maxSessionTurns;
|
|
184
200
|
listSessions;
|
|
185
201
|
deleteSession;
|
|
@@ -221,18 +237,23 @@ export class Config {
|
|
|
221
237
|
continueOnFailedApiCall;
|
|
222
238
|
retryFetchErrors;
|
|
223
239
|
enableShellOutputEfficiency;
|
|
240
|
+
shellToolInactivityTimeout;
|
|
224
241
|
fakeResponses;
|
|
225
242
|
recordResponses;
|
|
226
243
|
disableYoloMode;
|
|
227
244
|
pendingIncludeDirectories;
|
|
228
245
|
enableHooks;
|
|
229
246
|
hooks;
|
|
247
|
+
disabledHooks;
|
|
230
248
|
experiments;
|
|
231
249
|
experimentsPromise;
|
|
232
250
|
hookSystem;
|
|
233
251
|
previewModelFallbackMode = false;
|
|
234
252
|
previewModelBypassMode = false;
|
|
235
253
|
enableModelAvailabilityService;
|
|
254
|
+
enableAgents;
|
|
255
|
+
experimentalJitContext;
|
|
256
|
+
contextManager;
|
|
236
257
|
constructor(params) {
|
|
237
258
|
this.sessionId = params.sessionId;
|
|
238
259
|
this.embeddingModel =
|
|
@@ -257,7 +278,6 @@ export class Config {
|
|
|
257
278
|
this.userMemory = params.userMemory ?? '';
|
|
258
279
|
this.geminiMdFileCount = params.geminiMdFileCount ?? 0;
|
|
259
280
|
this.geminiMdFilePaths = params.geminiMdFilePaths ?? [];
|
|
260
|
-
this.approvalMode = params.approvalMode ?? ApprovalMode.DEFAULT;
|
|
261
281
|
this.showMemoryUsage = params.showMemoryUsage ?? false;
|
|
262
282
|
this.accessibility = params.accessibility ?? {};
|
|
263
283
|
this.telemetrySettings = {
|
|
@@ -268,6 +288,7 @@ export class Config {
|
|
|
268
288
|
logPrompts: params.telemetry?.logPrompts ?? true,
|
|
269
289
|
outfile: params.telemetry?.outfile,
|
|
270
290
|
useCollector: params.telemetry?.useCollector,
|
|
291
|
+
useCliAuth: params.telemetry?.useCliAuth,
|
|
271
292
|
};
|
|
272
293
|
this.usageStatisticsEnabled = params.usageStatisticsEnabled ?? true;
|
|
273
294
|
this.fileFiltering = {
|
|
@@ -288,8 +309,11 @@ export class Config {
|
|
|
288
309
|
this.fileDiscoveryService = params.fileDiscoveryService ?? null;
|
|
289
310
|
this.bugCommand = params.bugCommand;
|
|
290
311
|
this.model = params.model;
|
|
291
|
-
this.
|
|
292
|
-
|
|
312
|
+
this._activeModel = params.model;
|
|
313
|
+
this.enableModelAvailabilityService = true;
|
|
314
|
+
this.enableAgents = params.enableAgents ?? false;
|
|
315
|
+
this.experimentalJitContext = params.experimentalJitContext ?? false;
|
|
316
|
+
this.modelAvailabilityService = new ModelAvailabilityService();
|
|
293
317
|
this.previewFeatures = params.previewFeatures ?? undefined;
|
|
294
318
|
this.maxSessionTurns = params.maxSessionTurns ?? -1;
|
|
295
319
|
this.experimentalZedIntegration =
|
|
@@ -328,8 +352,15 @@ export class Config {
|
|
|
328
352
|
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
|
329
353
|
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
|
330
354
|
this.useSmartEdit = params.useSmartEdit ?? true;
|
|
331
|
-
|
|
355
|
+
// // TODO(joshualitt): Re-evaluate the todo tool for 3 family.
|
|
356
|
+
this.useWriteTodos = isPreviewModel(this.model)
|
|
357
|
+
? false
|
|
358
|
+
: (params.useWriteTodos ?? true);
|
|
332
359
|
this.enableHooks = params.enableHooks ?? false;
|
|
360
|
+
this.disabledHooks =
|
|
361
|
+
(params.hooks && 'disabled' in params.hooks
|
|
362
|
+
? params.hooks.disabled
|
|
363
|
+
: undefined) ?? [];
|
|
333
364
|
// Enable MessageBus integration if:
|
|
334
365
|
// 1. Explicitly enabled via setting, OR
|
|
335
366
|
// 2. Hooks are enabled and hooks are configured
|
|
@@ -344,11 +375,13 @@ export class Config {
|
|
|
344
375
|
maxTimeMinutes: params.codebaseInvestigatorSettings?.maxTimeMinutes ?? 3,
|
|
345
376
|
thinkingBudget: params.codebaseInvestigatorSettings?.thinkingBudget ??
|
|
346
377
|
DEFAULT_THINKING_MODE,
|
|
347
|
-
model: params.codebaseInvestigatorSettings?.model
|
|
378
|
+
model: params.codebaseInvestigatorSettings?.model,
|
|
348
379
|
};
|
|
349
380
|
this.continueOnFailedApiCall = params.continueOnFailedApiCall ?? true;
|
|
350
381
|
this.enableShellOutputEfficiency =
|
|
351
382
|
params.enableShellOutputEfficiency ?? true;
|
|
383
|
+
this.shellToolInactivityTimeout =
|
|
384
|
+
(params.shellToolInactivityTimeout ?? 300) * 1000; // 5 minutes
|
|
352
385
|
this.extensionManagement = params.extensionManagement ?? true;
|
|
353
386
|
this.enableExtensionReloading = params.enableExtensionReloading ?? false;
|
|
354
387
|
this.storage = new Storage(this.targetDir);
|
|
@@ -357,7 +390,10 @@ export class Config {
|
|
|
357
390
|
this.enablePromptCompletion = params.enablePromptCompletion ?? false;
|
|
358
391
|
this.fileExclusions = new FileExclusions(this);
|
|
359
392
|
this.eventEmitter = params.eventEmitter;
|
|
360
|
-
this.policyEngine = new PolicyEngine(
|
|
393
|
+
this.policyEngine = new PolicyEngine({
|
|
394
|
+
...params.policyEngineConfig,
|
|
395
|
+
approvalMode: params.approvalMode ?? params.policyEngineConfig?.approvalMode,
|
|
396
|
+
});
|
|
361
397
|
this.messageBus = new MessageBus(this.policyEngine, this.debugMode);
|
|
362
398
|
this.outputSettings = {
|
|
363
399
|
format: params.output?.format ?? OutputFormat.TEXT,
|
|
@@ -370,6 +406,7 @@ export class Config {
|
|
|
370
406
|
setGeminiMdFilename(params.contextFileName);
|
|
371
407
|
}
|
|
372
408
|
if (this.telemetrySettings.enabled) {
|
|
409
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
373
410
|
initializeTelemetry(this);
|
|
374
411
|
}
|
|
375
412
|
const proxy = this.getProxy();
|
|
@@ -391,11 +428,19 @@ export class Config {
|
|
|
391
428
|
// TODO(12593): Fix the settings loading logic to properly merge defaults and
|
|
392
429
|
// remove this hack.
|
|
393
430
|
let modelConfigServiceConfig = params.modelConfigServiceConfig;
|
|
394
|
-
if (modelConfigServiceConfig
|
|
395
|
-
modelConfigServiceConfig
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
431
|
+
if (modelConfigServiceConfig) {
|
|
432
|
+
if (!modelConfigServiceConfig.aliases) {
|
|
433
|
+
modelConfigServiceConfig = {
|
|
434
|
+
...modelConfigServiceConfig,
|
|
435
|
+
aliases: DEFAULT_MODEL_CONFIGS.aliases,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
if (!modelConfigServiceConfig.overrides) {
|
|
439
|
+
modelConfigServiceConfig = {
|
|
440
|
+
...modelConfigServiceConfig,
|
|
441
|
+
overrides: DEFAULT_MODEL_CONFIGS.overrides,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
399
444
|
}
|
|
400
445
|
this.modelConfigService = new ModelConfigService(modelConfigServiceConfig ?? DEFAULT_MODEL_CONFIGS);
|
|
401
446
|
}
|
|
@@ -408,30 +453,40 @@ export class Config {
|
|
|
408
453
|
}
|
|
409
454
|
this.initialized = true;
|
|
410
455
|
// Initialize centralized FileDiscoveryService
|
|
456
|
+
const discoverToolsHandle = startupProfiler.start('discover_tools');
|
|
411
457
|
this.getFileService();
|
|
412
458
|
if (this.getCheckpointingEnabled()) {
|
|
413
459
|
await this.getGitService();
|
|
414
460
|
}
|
|
415
461
|
this.promptRegistry = new PromptRegistry();
|
|
462
|
+
this.resourceRegistry = new ResourceRegistry();
|
|
416
463
|
this.agentRegistry = new AgentRegistry(this);
|
|
417
464
|
await this.agentRegistry.initialize();
|
|
418
465
|
this.toolRegistry = await this.createToolRegistry();
|
|
466
|
+
discoverToolsHandle?.end();
|
|
419
467
|
this.mcpClientManager = new McpClientManager(this.toolRegistry, this, this.eventEmitter);
|
|
468
|
+
const initMcpHandle = startupProfiler.start('initialize_mcp_clients');
|
|
420
469
|
await Promise.all([
|
|
421
470
|
await this.mcpClientManager.startConfiguredMcpServers(),
|
|
422
471
|
await this.getExtensionLoader().start(this),
|
|
423
472
|
]);
|
|
473
|
+
initMcpHandle?.end();
|
|
424
474
|
// Initialize hook system if enabled
|
|
425
475
|
if (this.enableHooks) {
|
|
426
476
|
this.hookSystem = new HookSystem(this);
|
|
427
477
|
await this.hookSystem.initialize();
|
|
428
478
|
}
|
|
479
|
+
if (this.experimentalJitContext) {
|
|
480
|
+
this.contextManager = new ContextManager(this);
|
|
481
|
+
}
|
|
429
482
|
await this.geminiClient.initialize();
|
|
430
483
|
}
|
|
431
484
|
getContentGenerator() {
|
|
432
485
|
return this.contentGenerator;
|
|
433
486
|
}
|
|
434
487
|
async refreshAuth(authMethod, displayMessage) {
|
|
488
|
+
// Reset availability service when switching auth
|
|
489
|
+
this.modelAvailabilityService.reset();
|
|
435
490
|
// Vertex and Genai have incompatible encryption and sending history with
|
|
436
491
|
// thoughtSignature from Genai to Vertex will fail, we need to strip them
|
|
437
492
|
if (this.contentGeneratorConfig?.authType === AuthType.USE_GEMINI &&
|
|
@@ -439,6 +494,8 @@ export class Config {
|
|
|
439
494
|
// Restore the conversation history to the new client
|
|
440
495
|
this.geminiClient.stripThoughtsFromHistory();
|
|
441
496
|
}
|
|
497
|
+
// Reset availability status when switching auth (e.g. from limited key to OAuth)
|
|
498
|
+
this.modelAvailabilityService.reset();
|
|
442
499
|
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod, {
|
|
443
500
|
clientId: this.keycloakClientId,
|
|
444
501
|
deviceEndpoint: this.keycloakDeviceEndpoint,
|
|
@@ -449,14 +506,16 @@ export class Config {
|
|
|
449
506
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
450
507
|
// Initialize BaseLlmClient now that the ContentGenerator is available
|
|
451
508
|
this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);
|
|
452
|
-
const previewFeatures = this.getPreviewFeatures();
|
|
453
509
|
const codeAssistServer = getCodeAssistServer(this);
|
|
454
510
|
if (codeAssistServer) {
|
|
511
|
+
if (codeAssistServer.projectId) {
|
|
512
|
+
await this.refreshUserQuota();
|
|
513
|
+
}
|
|
455
514
|
this.experimentsPromise = getExperiments(codeAssistServer)
|
|
456
515
|
.then((experiments) => {
|
|
457
516
|
this.setExperiments(experiments);
|
|
458
517
|
// 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
|
|
459
|
-
if (
|
|
518
|
+
if (this.getPreviewFeatures() === undefined) {
|
|
460
519
|
const remotePreviewFeatures = experiments.flags[ExperimentFlags.ENABLE_PREVIEW]?.boolValue;
|
|
461
520
|
if (remotePreviewFeatures === true) {
|
|
462
521
|
this.setPreviewFeatures(remotePreviewFeatures);
|
|
@@ -471,8 +530,19 @@ export class Config {
|
|
|
471
530
|
this.experiments = undefined;
|
|
472
531
|
this.experimentsPromise = undefined;
|
|
473
532
|
}
|
|
533
|
+
const authType = this.contentGeneratorConfig.authType;
|
|
534
|
+
if (authType === AuthType.USE_GEMINI ||
|
|
535
|
+
authType === AuthType.USE_VERTEX_AI) {
|
|
536
|
+
this.setHasAccessToPreviewModel(true);
|
|
537
|
+
}
|
|
474
538
|
// Reset the session flag since we're explicitly changing auth and using default model
|
|
475
539
|
this.inFallbackMode = false;
|
|
540
|
+
// Update model if user no longer has access to the preview model
|
|
541
|
+
if (!this.getPreviewFeatures() &&
|
|
542
|
+
!this.hasAccessToPreviewModel &&
|
|
543
|
+
isPreviewModel(this.model)) {
|
|
544
|
+
this.setModel(DEFAULT_GEMINI_MODEL_AUTO);
|
|
545
|
+
}
|
|
476
546
|
}
|
|
477
547
|
async getExperimentsAsync() {
|
|
478
548
|
if (this.experiments) {
|
|
@@ -526,9 +596,23 @@ export class Config {
|
|
|
526
596
|
setModel(newModel) {
|
|
527
597
|
if (this.model !== newModel || this.inFallbackMode) {
|
|
528
598
|
this.model = newModel;
|
|
599
|
+
// When the user explicitly sets a model, that becomes the active model.
|
|
600
|
+
this._activeModel = newModel;
|
|
529
601
|
coreEvents.emitModelChanged(newModel);
|
|
530
602
|
}
|
|
531
603
|
this.setFallbackMode(false);
|
|
604
|
+
this.modelAvailabilityService.reset();
|
|
605
|
+
}
|
|
606
|
+
getActiveModel() {
|
|
607
|
+
return this._activeModel ?? this.model;
|
|
608
|
+
}
|
|
609
|
+
setActiveModel(model) {
|
|
610
|
+
if (this._activeModel !== model) {
|
|
611
|
+
this._activeModel = model;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
resetTurn() {
|
|
615
|
+
this.modelAvailabilityService.resetTurn();
|
|
532
616
|
}
|
|
533
617
|
isInFallbackMode() {
|
|
534
618
|
return this.inFallbackMode;
|
|
@@ -595,6 +679,9 @@ export class Config {
|
|
|
595
679
|
getPromptRegistry() {
|
|
596
680
|
return this.promptRegistry;
|
|
597
681
|
}
|
|
682
|
+
getResourceRegistry() {
|
|
683
|
+
return this.resourceRegistry;
|
|
684
|
+
}
|
|
598
685
|
getDebugMode() {
|
|
599
686
|
return this.debugMode;
|
|
600
687
|
}
|
|
@@ -605,7 +692,44 @@ export class Config {
|
|
|
605
692
|
return this.previewFeatures;
|
|
606
693
|
}
|
|
607
694
|
setPreviewFeatures(previewFeatures) {
|
|
695
|
+
// No change in state, no action needed
|
|
696
|
+
if (this.previewFeatures === previewFeatures) {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
608
699
|
this.previewFeatures = previewFeatures;
|
|
700
|
+
const currentModel = this.getModel();
|
|
701
|
+
// Case 1: Disabling preview features while on a preview model
|
|
702
|
+
if (!previewFeatures && isPreviewModel(currentModel)) {
|
|
703
|
+
this.setModel(DEFAULT_GEMINI_MODEL_AUTO);
|
|
704
|
+
}
|
|
705
|
+
// Case 2: Enabling preview features while on the default auto model
|
|
706
|
+
else if (previewFeatures && currentModel === DEFAULT_GEMINI_MODEL_AUTO) {
|
|
707
|
+
this.setModel(PREVIEW_GEMINI_MODEL_AUTO);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
getHasAccessToPreviewModel() {
|
|
711
|
+
return this.hasAccessToPreviewModel;
|
|
712
|
+
}
|
|
713
|
+
setHasAccessToPreviewModel(hasAccess) {
|
|
714
|
+
this.hasAccessToPreviewModel = hasAccess;
|
|
715
|
+
}
|
|
716
|
+
async refreshUserQuota() {
|
|
717
|
+
const codeAssistServer = getCodeAssistServer(this);
|
|
718
|
+
if (!codeAssistServer || !codeAssistServer.projectId) {
|
|
719
|
+
return undefined;
|
|
720
|
+
}
|
|
721
|
+
try {
|
|
722
|
+
const quota = await codeAssistServer.retrieveUserQuota({
|
|
723
|
+
project: codeAssistServer.projectId,
|
|
724
|
+
});
|
|
725
|
+
const hasAccess = quota.buckets?.some((b) => b.modelId === PREVIEW_GEMINI_MODEL) ?? false;
|
|
726
|
+
this.setHasAccessToPreviewModel(hasAccess);
|
|
727
|
+
return quota;
|
|
728
|
+
}
|
|
729
|
+
catch (e) {
|
|
730
|
+
debugLogger.debug('Failed to retrieve user quota', e);
|
|
731
|
+
return undefined;
|
|
732
|
+
}
|
|
609
733
|
}
|
|
610
734
|
getCoreTools() {
|
|
611
735
|
return this.coreTools;
|
|
@@ -666,6 +790,18 @@ export class Config {
|
|
|
666
790
|
setUserMemory(newUserMemory) {
|
|
667
791
|
this.userMemory = newUserMemory;
|
|
668
792
|
}
|
|
793
|
+
getGlobalMemory() {
|
|
794
|
+
return this.contextManager?.getGlobalMemory() ?? '';
|
|
795
|
+
}
|
|
796
|
+
getEnvironmentMemory() {
|
|
797
|
+
return this.contextManager?.getEnvironmentMemory() ?? '';
|
|
798
|
+
}
|
|
799
|
+
getContextManager() {
|
|
800
|
+
return this.contextManager;
|
|
801
|
+
}
|
|
802
|
+
isJitContextEnabled() {
|
|
803
|
+
return this.experimentalJitContext;
|
|
804
|
+
}
|
|
669
805
|
getGeminiMdFileCount() {
|
|
670
806
|
return this.geminiMdFileCount;
|
|
671
807
|
}
|
|
@@ -679,13 +815,13 @@ export class Config {
|
|
|
679
815
|
this.geminiMdFilePaths = paths;
|
|
680
816
|
}
|
|
681
817
|
getApprovalMode() {
|
|
682
|
-
return this.
|
|
818
|
+
return this.policyEngine.getApprovalMode();
|
|
683
819
|
}
|
|
684
820
|
setApprovalMode(mode) {
|
|
685
821
|
if (!this.isTrustedFolder() && mode !== ApprovalMode.DEFAULT) {
|
|
686
822
|
throw new Error('Cannot enable privileged approval modes in an untrusted folder.');
|
|
687
823
|
}
|
|
688
|
-
this.
|
|
824
|
+
this.policyEngine.setApprovalMode(mode);
|
|
689
825
|
}
|
|
690
826
|
isYoloModeDisabled() {
|
|
691
827
|
return this.disableYoloMode || !this.isTrustedFolder();
|
|
@@ -723,6 +859,9 @@ export class Config {
|
|
|
723
859
|
getTelemetryUseCollector() {
|
|
724
860
|
return this.telemetrySettings.useCollector ?? false;
|
|
725
861
|
}
|
|
862
|
+
getTelemetryUseCliAuth() {
|
|
863
|
+
return this.telemetrySettings.useCliAuth ?? false;
|
|
864
|
+
}
|
|
726
865
|
getGeminiClient() {
|
|
727
866
|
return this.geminiClient;
|
|
728
867
|
}
|
|
@@ -739,6 +878,9 @@ export class Config {
|
|
|
739
878
|
getModelRouterService() {
|
|
740
879
|
return this.modelRouterService;
|
|
741
880
|
}
|
|
881
|
+
getModelAvailabilityService() {
|
|
882
|
+
return this.modelAvailabilityService;
|
|
883
|
+
}
|
|
742
884
|
getEnableRecursiveFileSearch() {
|
|
743
885
|
return this.fileFiltering.enableRecursiveFileSearch;
|
|
744
886
|
}
|
|
@@ -836,6 +978,9 @@ export class Config {
|
|
|
836
978
|
isModelAvailabilityServiceEnabled() {
|
|
837
979
|
return this.enableModelAvailabilityService;
|
|
838
980
|
}
|
|
981
|
+
isAgentsEnabled() {
|
|
982
|
+
return this.enableAgents;
|
|
983
|
+
}
|
|
839
984
|
getNoBrowser() {
|
|
840
985
|
return this.noBrowser;
|
|
841
986
|
}
|
|
@@ -953,6 +1098,9 @@ export class Config {
|
|
|
953
1098
|
getEnableShellOutputEfficiency() {
|
|
954
1099
|
return this.enableShellOutputEfficiency;
|
|
955
1100
|
}
|
|
1101
|
+
getShellToolInactivityTimeout() {
|
|
1102
|
+
return this.shellToolInactivityTimeout;
|
|
1103
|
+
}
|
|
956
1104
|
getShellExecutionConfig() {
|
|
957
1105
|
return this.shellExecutionConfig;
|
|
958
1106
|
}
|
|
@@ -1088,17 +1236,16 @@ export class Config {
|
|
|
1088
1236
|
registerCoreTool(WriteTodosTool, this);
|
|
1089
1237
|
}
|
|
1090
1238
|
// Register Subagents as Tools
|
|
1091
|
-
if
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
}
|
|
1239
|
+
// Register DelegateToAgentTool if agents are enabled
|
|
1240
|
+
if (this.isAgentsEnabled() ||
|
|
1241
|
+
this.getCodebaseInvestigatorSettings().enabled) {
|
|
1242
|
+
// Check if the delegate tool itself is allowed (if allowedTools is set)
|
|
1243
|
+
const allowedTools = this.getAllowedTools();
|
|
1244
|
+
const isAllowed = !allowedTools || allowedTools.includes(DELEGATE_TO_AGENT_TOOL_NAME);
|
|
1245
|
+
if (isAllowed) {
|
|
1246
|
+
const messageBusEnabled = this.getEnableMessageBusIntegration();
|
|
1247
|
+
const delegateTool = new DelegateToAgentTool(this.agentRegistry, this, messageBusEnabled ? this.getMessageBus() : undefined);
|
|
1248
|
+
registry.registerTool(delegateTool);
|
|
1102
1249
|
}
|
|
1103
1250
|
}
|
|
1104
1251
|
await registry.discoverAllTools();
|
|
@@ -1117,6 +1264,12 @@ export class Config {
|
|
|
1117
1264
|
getHooks() {
|
|
1118
1265
|
return this.hooks;
|
|
1119
1266
|
}
|
|
1267
|
+
/**
|
|
1268
|
+
* Get disabled hooks list
|
|
1269
|
+
*/
|
|
1270
|
+
getDisabledHooks() {
|
|
1271
|
+
return this.disabledHooks;
|
|
1272
|
+
}
|
|
1120
1273
|
/**
|
|
1121
1274
|
* Get experiments configuration
|
|
1122
1275
|
*/
|