@google/gemini-cli-core 0.61.0-nightly.20260914.g9c1b0a610 → 0.61.0-preview.0

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.
@@ -568,7 +568,11 @@ export interface ConfigParameters {
568
568
  logRagSnippets?: boolean;
569
569
  }
570
570
  export declare class Config implements McpContext, AgentLoopContext {
571
- private _toolRegistry;
571
+ readonly config: Config;
572
+ promptId: string;
573
+ toolRegistry: ToolRegistry;
574
+ promptRegistry: PromptRegistry;
575
+ resourceRegistry: ResourceRegistry;
572
576
  private mcpClientManager?;
573
577
  private readonly a2aClientManager?;
574
578
  private allowedMcpServers;
@@ -576,8 +580,6 @@ export declare class Config implements McpContext, AgentLoopContext {
576
580
  private allowedEnvironmentVariables;
577
581
  private blockedEnvironmentVariables;
578
582
  private readonly enableEnvironmentVariableRedaction;
579
- private _promptRegistry;
580
- private _resourceRegistry;
581
583
  private agentRegistry;
582
584
  private readonly acknowledgedAgentsService;
583
585
  private skillManager;
@@ -621,8 +623,8 @@ export declare class Config implements McpContext, AgentLoopContext {
621
623
  private readonly accessibility;
622
624
  private readonly telemetrySettings;
623
625
  private readonly usageStatisticsEnabled;
624
- private _geminiClient;
625
- private _sandboxManager;
626
+ geminiClient: GeminiClient;
627
+ sandboxManager: SandboxManager;
626
628
  private readonly _sandboxPolicyManager;
627
629
  private baseLlmClient;
628
630
  private localLiteRtLmClient?;
@@ -694,7 +696,7 @@ export declare class Config implements McpContext, AgentLoopContext {
694
696
  private readonly eventEmitter?;
695
697
  private readonly useWriteTodos;
696
698
  private readonly workspacePoliciesDir;
697
- private readonly _messageBus;
699
+ readonly messageBus: MessageBus;
698
700
  private readonly policyEngine;
699
701
  private policyUpdateConfirmationRequest;
700
702
  private readonly outputSettings;
@@ -753,7 +755,6 @@ export declare class Config implements McpContext, AgentLoopContext {
753
755
  readonly injectionService: InjectionService;
754
756
  private approvedPlanPath;
755
757
  constructor(params: ConfigParameters);
756
- get config(): Config;
757
758
  isInitialized(): boolean;
758
759
  /**
759
760
  * Dedups initialization requests using a shared promise that is only resolved
@@ -772,36 +773,26 @@ export declare class Config implements McpContext, AgentLoopContext {
772
773
  */
773
774
  getBaseLlmClient(): BaseLlmClient;
774
775
  getLocalLiteRtLmClient(): LocalLiteRtLmClient;
775
- get promptId(): string;
776
- /**
777
- * @deprecated Do not access directly on Config.
778
- * Use the injected AgentLoopContext instead.
779
- */
780
- get toolRegistry(): ToolRegistry;
781
- /**
782
- * @deprecated Do not access directly on Config.
783
- * Use the injected AgentLoopContext instead.
784
- */
785
- get promptRegistry(): PromptRegistry;
786
- /**
787
- * @deprecated Do not access directly on Config.
788
- * Use the injected AgentLoopContext instead.
789
- */
790
- get resourceRegistry(): ResourceRegistry;
791
- /**
792
- * @deprecated Do not access directly on Config.
793
- * Use the injected AgentLoopContext instead.
794
- */
795
- get messageBus(): MessageBus;
796
- /**
797
- * @deprecated Do not access directly on Config.
798
- * Use the injected AgentLoopContext instead.
799
- */
800
- get geminiClient(): GeminiClient;
776
+ /** @internal Backing field alias for backwards-compatibility */
777
+ get _toolRegistry(): ToolRegistry;
778
+ set _toolRegistry(value: ToolRegistry);
779
+ /** @internal Backing field alias for backwards-compatibility */
780
+ get _promptRegistry(): PromptRegistry;
781
+ set _promptRegistry(registry: PromptRegistry);
782
+ /** @internal Backing field alias for backwards-compatibility */
783
+ get _resourceRegistry(): ResourceRegistry;
784
+ set _resourceRegistry(registry: ResourceRegistry);
785
+ /** @internal Backing field alias for backwards-compatibility */
786
+ get _messageBus(): MessageBus;
787
+ /** @internal Backing field alias for backwards-compatibility */
788
+ get _geminiClient(): GeminiClient;
789
+ set _geminiClient(client: GeminiClient);
801
790
  private getSandboxForbiddenPaths;
802
791
  private refreshSandboxManager;
803
792
  get sandboxPolicyManager(): SandboxPolicyManager;
804
- get sandboxManager(): SandboxManager;
793
+ /** @internal Backing field alias for backwards-compatibility */
794
+ get _sandboxManager(): SandboxManager;
795
+ set _sandboxManager(manager: SandboxManager);
805
796
  getSessionId(): string;
806
797
  getWorktreeSettings(): WorktreeSettings | undefined;
807
798
  getClientName(): string | undefined;
@@ -203,7 +203,11 @@ export const ConfigSchema = z.object({
203
203
  .optional(),
204
204
  });
205
205
  export class Config {
206
- _toolRegistry;
206
+ config = this;
207
+ promptId;
208
+ toolRegistry;
209
+ promptRegistry;
210
+ resourceRegistry;
207
211
  mcpClientManager;
208
212
  a2aClientManager;
209
213
  allowedMcpServers;
@@ -211,8 +215,6 @@ export class Config {
211
215
  allowedEnvironmentVariables;
212
216
  blockedEnvironmentVariables;
213
217
  enableEnvironmentVariableRedaction;
214
- _promptRegistry;
215
- _resourceRegistry;
216
218
  agentRegistry;
217
219
  acknowledgedAgentsService;
218
220
  skillManager;
@@ -256,8 +258,8 @@ export class Config {
256
258
  accessibility;
257
259
  telemetrySettings;
258
260
  usageStatisticsEnabled;
259
- _geminiClient;
260
- _sandboxManager;
261
+ geminiClient;
262
+ sandboxManager;
261
263
  _sandboxPolicyManager;
262
264
  baseLlmClient;
263
265
  localLiteRtLmClient;
@@ -340,7 +342,7 @@ export class Config {
340
342
  eventEmitter;
341
343
  useWriteTodos;
342
344
  workspacePoliciesDir;
343
- _messageBus;
345
+ messageBus;
344
346
  policyEngine;
345
347
  policyUpdateConfirmationRequest;
346
348
  outputSettings;
@@ -400,6 +402,7 @@ export class Config {
400
402
  approvedPlanPath;
401
403
  constructor(params) {
402
404
  this._sessionId = params.sessionId;
405
+ this.promptId = params.sessionId;
403
406
  this.clientName = params.clientName;
404
407
  this._clientVersion = params.clientVersion ?? 'unknown';
405
408
  this.approvedPlanPath = undefined;
@@ -435,7 +438,7 @@ export class Config {
435
438
  const initialApprovalMode = params.approvalMode ??
436
439
  params.policyEngineConfig?.approvalMode ??
437
440
  'default';
438
- this._sandboxManager = createSandboxManager(this.sandbox, {
441
+ this.sandboxManager = createSandboxManager(this.sandbox, {
439
442
  workspace: this.targetDir,
440
443
  forbiddenPaths: this.getSandboxForbiddenPaths.bind(this),
441
444
  includeDirectories: [
@@ -444,9 +447,9 @@ export class Config {
444
447
  ],
445
448
  policyManager: this._sandboxPolicyManager,
446
449
  }, initialApprovalMode);
447
- if (!(this._sandboxManager instanceof NoopSandboxManager) &&
450
+ if (!(this.sandboxManager instanceof NoopSandboxManager) &&
448
451
  this.sandbox?.enabled) {
449
- this.fileSystemService = new SandboxedFileSystemService(this._sandboxManager, params.targetDir);
452
+ this.fileSystemService = new SandboxedFileSystemService(this.sandboxManager, params.targetDir);
450
453
  }
451
454
  else {
452
455
  this.fileSystemService = new StandardFileSystemService();
@@ -650,7 +653,7 @@ export class Config {
650
653
  showColor: params.shellExecutionConfig?.showColor ?? false,
651
654
  pager: params.shellExecutionConfig?.pager ?? 'cat',
652
655
  sanitizationConfig: this.sanitizationConfig,
653
- sandboxManager: this._sandboxManager,
656
+ sandboxManager: this.sandboxManager,
654
657
  sandboxConfig: this.sandbox,
655
658
  backgroundCompletionBehavior: this.shellBackgroundCompletionBehavior,
656
659
  };
@@ -700,7 +703,7 @@ export class Config {
700
703
  ...params.policyEngineConfig,
701
704
  approvalMode: engineApprovalMode,
702
705
  disableAlwaysAllow: this.disableAlwaysAllow,
703
- sandboxManager: this._sandboxManager,
706
+ sandboxManager: this.sandboxManager,
704
707
  isTrustedFolder: () => this.isTrustedFolder(),
705
708
  }, checkerRunner);
706
709
  // Register Conseca if enabled
@@ -708,7 +711,7 @@ export class Config {
708
711
  debugLogger.log('[SAFETY] Registering Conseca Safety Checker');
709
712
  ConsecaSafetyChecker.getInstance().setContext(this);
710
713
  }
711
- this._messageBus = new MessageBus(this.policyEngine, this.debugMode);
714
+ this.messageBus = new MessageBus(this.policyEngine, this.debugMode);
712
715
  this.acknowledgedAgentsService = new AcknowledgedAgentsService();
713
716
  this.skillManager = new SkillManager();
714
717
  this.outputSettings = {
@@ -763,13 +766,10 @@ export class Config {
763
766
  coreEvents.emitFeedback('error', 'Invalid proxy configuration detected. Check debug drawer for more details (F12)', error);
764
767
  }
765
768
  }
766
- this._geminiClient = new GeminiClient(this);
769
+ this.geminiClient = new GeminiClient(this);
767
770
  this.a2aClientManager = new A2AClientManager(this);
768
771
  this.modelRouterService = new ModelRouterService(this);
769
772
  }
770
- get config() {
771
- return this;
772
- }
773
773
  isInitialized() {
774
774
  return this.initialized;
775
775
  }
@@ -823,16 +823,16 @@ export class Config {
823
823
  if (this.getCheckpointingEnabled()) {
824
824
  await this.getGitService();
825
825
  }
826
- this._promptRegistry = new PromptRegistry();
827
- this._resourceRegistry = new ResourceRegistry();
826
+ this.promptRegistry = new PromptRegistry();
827
+ this.resourceRegistry = new ResourceRegistry();
828
828
  this.agentRegistry = new AgentRegistry(this);
829
829
  await this.agentRegistry.initialize();
830
830
  coreEvents.on(CoreEvent.AgentsRefreshed, this.onAgentsRefreshed);
831
- this._toolRegistry = await this.createToolRegistry();
831
+ this.toolRegistry = await this.createToolRegistry();
832
832
  discoverToolsHandle?.end();
833
833
  this.mcpClientManager = new McpClientManager(this.clientVersion, this, this.eventEmitter);
834
834
  this.mcpClientManager.setMainRegistries({
835
- toolRegistry: this._toolRegistry,
835
+ toolRegistry: this.toolRegistry,
836
836
  promptRegistry: this.promptRegistry,
837
837
  resourceRegistry: this.resourceRegistry,
838
838
  });
@@ -870,7 +870,7 @@ export class Config {
870
870
  }
871
871
  this.memoryContextManager = new MemoryContextManager(this);
872
872
  await this.memoryContextManager.refresh();
873
- await this._geminiClient.initialize();
873
+ await this.geminiClient.initialize();
874
874
  this.initialized = true;
875
875
  }
876
876
  getContentGenerator() {
@@ -886,7 +886,7 @@ export class Config {
886
886
  if (this.contentGeneratorConfig?.authType === AuthType.USE_GEMINI &&
887
887
  authMethod !== AuthType.USE_GEMINI) {
888
888
  // Restore the conversation history to the new client
889
- this._geminiClient.stripThoughtsFromHistory();
889
+ this.geminiClient.stripThoughtsFromHistory();
890
890
  }
891
891
  // Reset availability status when switching auth (e.g. from limited key to OAuth)
892
892
  this.modelAvailabilityService.reset();
@@ -991,43 +991,37 @@ export class Config {
991
991
  }
992
992
  return this.localLiteRtLmClient;
993
993
  }
994
- get promptId() {
995
- return this._sessionId;
994
+ /** @internal Backing field alias for backwards-compatibility */
995
+ get _toolRegistry() {
996
+ return this.toolRegistry;
996
997
  }
997
- /**
998
- * @deprecated Do not access directly on Config.
999
- * Use the injected AgentLoopContext instead.
1000
- */
1001
- get toolRegistry() {
1002
- return this._toolRegistry;
998
+ set _toolRegistry(value) {
999
+ this.toolRegistry = value;
1003
1000
  }
1004
- /**
1005
- * @deprecated Do not access directly on Config.
1006
- * Use the injected AgentLoopContext instead.
1007
- */
1008
- get promptRegistry() {
1009
- return this._promptRegistry;
1001
+ /** @internal Backing field alias for backwards-compatibility */
1002
+ get _promptRegistry() {
1003
+ return this.promptRegistry;
1010
1004
  }
1011
- /**
1012
- * @deprecated Do not access directly on Config.
1013
- * Use the injected AgentLoopContext instead.
1014
- */
1015
- get resourceRegistry() {
1016
- return this._resourceRegistry;
1005
+ set _promptRegistry(registry) {
1006
+ this.promptRegistry = registry;
1017
1007
  }
1018
- /**
1019
- * @deprecated Do not access directly on Config.
1020
- * Use the injected AgentLoopContext instead.
1021
- */
1022
- get messageBus() {
1023
- return this._messageBus;
1008
+ /** @internal Backing field alias for backwards-compatibility */
1009
+ get _resourceRegistry() {
1010
+ return this.resourceRegistry;
1024
1011
  }
1025
- /**
1026
- * @deprecated Do not access directly on Config.
1027
- * Use the injected AgentLoopContext instead.
1028
- */
1029
- get geminiClient() {
1030
- return this._geminiClient;
1012
+ set _resourceRegistry(registry) {
1013
+ this.resourceRegistry = registry;
1014
+ }
1015
+ /** @internal Backing field alias for backwards-compatibility */
1016
+ get _messageBus() {
1017
+ return this.messageBus;
1018
+ }
1019
+ /** @internal Backing field alias for backwards-compatibility */
1020
+ get _geminiClient() {
1021
+ return this.geminiClient;
1022
+ }
1023
+ set _geminiClient(client) {
1024
+ this.geminiClient = client;
1031
1025
  }
1032
1026
  async getSandboxForbiddenPaths() {
1033
1027
  if (this._sandboxForbiddenPaths) {
@@ -1040,7 +1034,7 @@ export class Config {
1040
1034
  return this._sandboxForbiddenPaths;
1041
1035
  }
1042
1036
  refreshSandboxManager() {
1043
- this._sandboxManager = createSandboxManager(this.sandbox, {
1037
+ this.sandboxManager = createSandboxManager(this.sandbox, {
1044
1038
  workspace: this.targetDir,
1045
1039
  forbiddenPaths: this.getSandboxForbiddenPaths.bind(this),
1046
1040
  includeDirectories: [
@@ -1049,13 +1043,17 @@ export class Config {
1049
1043
  ],
1050
1044
  policyManager: this._sandboxPolicyManager,
1051
1045
  }, this.getApprovalMode());
1052
- this.shellExecutionConfig.sandboxManager = this._sandboxManager;
1046
+ this.shellExecutionConfig.sandboxManager = this.sandboxManager;
1053
1047
  }
1054
1048
  get sandboxPolicyManager() {
1055
1049
  return this._sandboxPolicyManager;
1056
1050
  }
1057
- get sandboxManager() {
1058
- return this._sandboxManager;
1051
+ /** @internal Backing field alias for backwards-compatibility */
1052
+ get _sandboxManager() {
1053
+ return this.sandboxManager;
1054
+ }
1055
+ set _sandboxManager(manager) {
1056
+ this.sandboxManager = manager;
1059
1057
  }
1060
1058
  getSessionId() {
1061
1059
  return this.promptId;
@@ -1071,6 +1069,7 @@ export class Config {
1071
1069
  ? this.storage.getPlansDir()
1072
1070
  : undefined;
1073
1071
  this._sessionId = sessionId;
1072
+ this.promptId = sessionId;
1074
1073
  this.storage.setSessionId(sessionId);
1075
1074
  this.trackerService = undefined;
1076
1075
  this.fallbackOverrides.clear();
@@ -1097,6 +1096,7 @@ export class Config {
1097
1096
  }
1098
1097
  rotateSessionId(sessionId) {
1099
1098
  this._sessionId = sessionId;
1099
+ this.promptId = sessionId;
1100
1100
  }
1101
1101
  resetNewSessionState(sessionId) {
1102
1102
  this.setSessionId(sessionId);
@@ -1393,13 +1393,13 @@ export class Config {
1393
1393
  return this.toolRegistry;
1394
1394
  }
1395
1395
  getPromptRegistry() {
1396
- return this._promptRegistry;
1396
+ return this.promptRegistry;
1397
1397
  }
1398
1398
  getSkillManager() {
1399
1399
  return this.skillManager;
1400
1400
  }
1401
1401
  getResourceRegistry() {
1402
- return this._resourceRegistry;
1402
+ return this.resourceRegistry;
1403
1403
  }
1404
1404
  getDebugMode() {
1405
1405
  return this.debugMode;
@@ -1617,9 +1617,9 @@ export class Config {
1617
1617
  */
1618
1618
  async refreshMcpContext() {
1619
1619
  await this.memoryContextManager?.refresh();
1620
- if (this._geminiClient?.isInitialized()) {
1621
- await this._geminiClient.setTools();
1622
- this._geminiClient.updateSystemInstruction();
1620
+ if (this.geminiClient?.isInitialized()) {
1621
+ await this.geminiClient.setTools();
1622
+ this.geminiClient.updateSystemInstruction();
1623
1623
  }
1624
1624
  }
1625
1625
  setUserMemory(newUserMemory) {
@@ -1808,9 +1808,9 @@ export class Config {
1808
1808
  const isPlanModeTransition = currentMode === ApprovalMode.PLAN || mode === ApprovalMode.PLAN;
1809
1809
  const isYoloModeTransition = currentMode === ApprovalMode.YOLO || mode === ApprovalMode.YOLO;
1810
1810
  if (isPlanModeTransition || isYoloModeTransition) {
1811
- if (this._geminiClient?.isInitialized()) {
1812
- this._geminiClient.clearCurrentSequenceModel();
1813
- this._geminiClient.setTools().catch((err) => {
1811
+ if (this.geminiClient?.isInitialized()) {
1812
+ this.geminiClient.clearCurrentSequenceModel();
1813
+ this.geminiClient.setTools().catch((err) => {
1814
1814
  debugLogger.error('Failed to update tools', err);
1815
1815
  });
1816
1816
  }
@@ -2838,7 +2838,7 @@ export class Config {
2838
2838
  this.logCurrentModeDuration(this.getApprovalMode());
2839
2839
  coreEvents.off(CoreEvent.AgentsRefreshed, this.onAgentsRefreshed);
2840
2840
  this.agentRegistry?.dispose();
2841
- this._geminiClient?.dispose();
2841
+ this.geminiClient?.dispose();
2842
2842
  if (this.mcpClientManager) {
2843
2843
  await this.mcpClientManager.stop();
2844
2844
  }