@google/gemini-cli 0.11.0-nightly.20251020.a96f0659 → 0.11.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.
Files changed (199) hide show
  1. package/dist/index.js +5 -5
  2. package/dist/index.js.map +1 -1
  3. package/dist/package.json +2 -2
  4. package/dist/src/commands/extensions/disable.js +8 -5
  5. package/dist/src/commands/extensions/disable.js.map +1 -1
  6. package/dist/src/commands/extensions/enable.js +8 -6
  7. package/dist/src/commands/extensions/enable.js.map +1 -1
  8. package/dist/src/commands/extensions/install.js +5 -4
  9. package/dist/src/commands/extensions/install.js.map +1 -1
  10. package/dist/src/commands/extensions/link.js +3 -2
  11. package/dist/src/commands/extensions/link.js.map +1 -1
  12. package/dist/src/commands/extensions/list.js +4 -3
  13. package/dist/src/commands/extensions/list.js.map +1 -1
  14. package/dist/src/commands/extensions/new.js +14 -20
  15. package/dist/src/commands/extensions/new.js.map +1 -1
  16. package/dist/src/commands/extensions/uninstall.js +3 -2
  17. package/dist/src/commands/extensions/uninstall.js.map +1 -1
  18. package/dist/src/commands/extensions/update.js +16 -16
  19. package/dist/src/commands/extensions/update.js.map +1 -1
  20. package/dist/src/commands/mcp/add.js +7 -4
  21. package/dist/src/commands/mcp/add.js.map +1 -1
  22. package/dist/src/commands/mcp/add.test.js +13 -3
  23. package/dist/src/commands/mcp/add.test.js.map +1 -1
  24. package/dist/src/commands/mcp/list.js +6 -6
  25. package/dist/src/commands/mcp/list.js.map +1 -1
  26. package/dist/src/commands/mcp/list.test.js +16 -15
  27. package/dist/src/commands/mcp/list.test.js.map +1 -1
  28. package/dist/src/commands/mcp/remove.js +3 -2
  29. package/dist/src/commands/mcp/remove.js.map +1 -1
  30. package/dist/src/config/config.d.ts +2 -3
  31. package/dist/src/config/config.integration.test.js +0 -30
  32. package/dist/src/config/config.integration.test.js.map +1 -1
  33. package/dist/src/config/config.js +21 -28
  34. package/dist/src/config/config.js.map +1 -1
  35. package/dist/src/config/config.test.js +120 -149
  36. package/dist/src/config/config.test.js.map +1 -1
  37. package/dist/src/config/extension.d.ts +4 -11
  38. package/dist/src/config/extension.js +66 -64
  39. package/dist/src/config/extension.js.map +1 -1
  40. package/dist/src/config/extension.test.js +49 -137
  41. package/dist/src/config/extension.test.js.map +1 -1
  42. package/dist/src/config/extensions/github.d.ts +3 -2
  43. package/dist/src/config/extensions/github.js +12 -9
  44. package/dist/src/config/extensions/github.js.map +1 -1
  45. package/dist/src/config/extensions/github.test.js +11 -5
  46. package/dist/src/config/extensions/github.test.js.map +1 -1
  47. package/dist/src/config/extensions/update.d.ts +5 -4
  48. package/dist/src/config/extensions/update.js +10 -6
  49. package/dist/src/config/extensions/update.js.map +1 -1
  50. package/dist/src/config/extensions/update.test.js +57 -57
  51. package/dist/src/config/extensions/update.test.js.map +1 -1
  52. package/dist/src/config/extensions/variableSchema.d.ts +2 -0
  53. package/dist/src/config/extensions/variableSchema.js.map +1 -1
  54. package/dist/src/config/policy.d.ts +3 -2
  55. package/dist/src/config/policy.js +20 -10
  56. package/dist/src/config/policy.js.map +1 -1
  57. package/dist/src/config/policy.test.js +58 -34
  58. package/dist/src/config/policy.test.js.map +1 -1
  59. package/dist/src/config/settings.js +5 -3
  60. package/dist/src/config/settings.js.map +1 -1
  61. package/dist/src/config/settings.test.js +9 -11
  62. package/dist/src/config/settings.test.js.map +1 -1
  63. package/dist/src/config/settingsSchema.d.ts +1 -1
  64. package/dist/src/config/settingsSchema.js +1 -1
  65. package/dist/src/config/settingsSchema.js.map +1 -1
  66. package/dist/src/gemini.js +19 -15
  67. package/dist/src/gemini.js.map +1 -1
  68. package/dist/src/gemini.test.js +8 -0
  69. package/dist/src/gemini.test.js.map +1 -1
  70. package/dist/src/generated/git-commit.d.ts +2 -2
  71. package/dist/src/generated/git-commit.js +2 -2
  72. package/dist/src/generated/git-commit.js.map +1 -1
  73. package/dist/src/nonInteractiveCli.js +2 -2
  74. package/dist/src/nonInteractiveCli.js.map +1 -1
  75. package/dist/src/nonInteractiveCli.test.js +28 -0
  76. package/dist/src/nonInteractiveCli.test.js.map +1 -1
  77. package/dist/src/nonInteractiveCliCommands.js +2 -2
  78. package/dist/src/nonInteractiveCliCommands.js.map +1 -1
  79. package/dist/src/services/CommandService.js +2 -1
  80. package/dist/src/services/CommandService.js.map +1 -1
  81. package/dist/src/services/prompt-processors/atFileProcessor.js +3 -2
  82. package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -1
  83. package/dist/src/ui/AppContainer.js +8 -6
  84. package/dist/src/ui/AppContainer.js.map +1 -1
  85. package/dist/src/ui/auth/AuthDialog.js +2 -2
  86. package/dist/src/ui/auth/AuthDialog.js.map +1 -1
  87. package/dist/src/ui/auth/useAuth.js +2 -2
  88. package/dist/src/ui/auth/useAuth.js.map +1 -1
  89. package/dist/src/ui/commands/copyCommand.js +2 -1
  90. package/dist/src/ui/commands/copyCommand.js.map +1 -1
  91. package/dist/src/ui/commands/directoryCommand.js +1 -1
  92. package/dist/src/ui/commands/directoryCommand.js.map +1 -1
  93. package/dist/src/ui/commands/directoryCommand.test.js +0 -1
  94. package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
  95. package/dist/src/ui/commands/extensionsCommand.test.js +3 -0
  96. package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
  97. package/dist/src/ui/commands/memoryCommand.js +1 -1
  98. package/dist/src/ui/commands/memoryCommand.js.map +1 -1
  99. package/dist/src/ui/commands/memoryCommand.test.js +1 -1
  100. package/dist/src/ui/commands/memoryCommand.test.js.map +1 -1
  101. package/dist/src/ui/commands/setupGithubCommand.js +4 -3
  102. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
  103. package/dist/src/ui/commands/types.d.ts +1 -0
  104. package/dist/src/ui/components/Composer.js +2 -2
  105. package/dist/src/ui/components/Composer.js.map +1 -1
  106. package/dist/src/ui/components/InputPrompt.test.js +39 -18
  107. package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
  108. package/dist/src/ui/components/SettingsDialog.js +3 -2
  109. package/dist/src/ui/components/SettingsDialog.js.map +1 -1
  110. package/dist/src/ui/components/SettingsDialog.test.js +1 -20
  111. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
  112. package/dist/src/ui/components/messages/Todo.js +24 -14
  113. package/dist/src/ui/components/messages/Todo.js.map +1 -1
  114. package/dist/src/ui/components/messages/Todo.test.js +50 -61
  115. package/dist/src/ui/components/messages/Todo.test.js.map +1 -1
  116. package/dist/src/ui/components/shared/BaseSelectionList.test.js +34 -25
  117. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
  118. package/dist/src/ui/components/shared/text-buffer.js +1 -1
  119. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  120. package/dist/src/ui/components/shared/text-buffer.test.js +24 -0
  121. package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
  122. package/dist/src/ui/components/views/ExtensionsList.js +3 -4
  123. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -1
  124. package/dist/src/ui/components/views/ExtensionsList.test.js +2 -9
  125. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
  126. package/dist/src/ui/components/views/McpStatus.js +2 -2
  127. package/dist/src/ui/components/views/McpStatus.js.map +1 -1
  128. package/dist/src/ui/hooks/atCommandProcessor.js +2 -2
  129. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  130. package/dist/src/ui/hooks/shellCommandProcessor.js +0 -1
  131. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
  132. package/dist/src/ui/hooks/slashCommandProcessor.js +2 -0
  133. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  134. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +2 -1
  135. package/dist/src/ui/hooks/useExtensionUpdates.js +5 -3
  136. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
  137. package/dist/src/ui/hooks/useExtensionUpdates.test.js +25 -13
  138. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -1
  139. package/dist/src/ui/hooks/useGeminiStream.js +30 -24
  140. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  141. package/dist/src/ui/hooks/useGeminiStream.test.js +38 -3
  142. package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
  143. package/dist/src/ui/hooks/useInputHistoryStore.js +2 -1
  144. package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -1
  145. package/dist/src/ui/hooks/useReactToolScheduler.js +2 -2
  146. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
  147. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +1 -1
  148. package/dist/src/ui/hooks/useShowMemoryCommand.js +4 -3
  149. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -1
  150. package/dist/src/ui/hooks/useSlashCompletion.js +2 -1
  151. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
  152. package/dist/src/ui/hooks/vim.js +2 -1
  153. package/dist/src/ui/hooks/vim.js.map +1 -1
  154. package/dist/src/ui/themes/color-utils.js +2 -1
  155. package/dist/src/ui/themes/color-utils.js.map +1 -1
  156. package/dist/src/ui/themes/theme-manager.js +8 -7
  157. package/dist/src/ui/themes/theme-manager.js.map +1 -1
  158. package/dist/src/ui/utils/commandUtils.js +2 -1
  159. package/dist/src/ui/utils/commandUtils.js.map +1 -1
  160. package/dist/src/ui/utils/computeStats.js +5 -2
  161. package/dist/src/ui/utils/computeStats.js.map +1 -1
  162. package/dist/src/ui/utils/computeStats.test.d.ts +6 -0
  163. package/dist/src/ui/utils/computeStats.test.js +262 -0
  164. package/dist/src/ui/utils/computeStats.test.js.map +1 -0
  165. package/dist/src/ui/utils/terminalSetup.js +3 -2
  166. package/dist/src/ui/utils/terminalSetup.js.map +1 -1
  167. package/dist/src/ui/utils/updateCheck.js +2 -1
  168. package/dist/src/ui/utils/updateCheck.js.map +1 -1
  169. package/dist/src/utils/cleanup.test.d.ts +6 -0
  170. package/dist/src/utils/cleanup.test.js +49 -0
  171. package/dist/src/utils/cleanup.test.js.map +1 -0
  172. package/dist/src/utils/gitUtils.js +3 -2
  173. package/dist/src/utils/gitUtils.js.map +1 -1
  174. package/dist/src/utils/handleAutoUpdate.test.d.ts +6 -0
  175. package/dist/src/utils/handleAutoUpdate.test.js +225 -0
  176. package/dist/src/utils/handleAutoUpdate.test.js.map +1 -0
  177. package/dist/src/utils/installationInfo.js +2 -2
  178. package/dist/src/utils/installationInfo.js.map +1 -1
  179. package/dist/src/utils/installationInfo.test.js +8 -4
  180. package/dist/src/utils/installationInfo.test.js.map +1 -1
  181. package/dist/src/utils/readStdin.js +2 -1
  182. package/dist/src/utils/readStdin.js.map +1 -1
  183. package/dist/src/utils/sandbox-macos-permissive-open.sb +3 -1
  184. package/dist/src/utils/sandbox.js +13 -13
  185. package/dist/src/utils/sandbox.js.map +1 -1
  186. package/dist/src/utils/sessionCleanup.js +4 -4
  187. package/dist/src/utils/sessionCleanup.js.map +1 -1
  188. package/dist/src/utils/startupWarnings.test.d.ts +6 -0
  189. package/dist/src/utils/startupWarnings.test.js +61 -0
  190. package/dist/src/utils/startupWarnings.test.js.map +1 -0
  191. package/dist/src/validateNonInterActiveAuth.js +2 -2
  192. package/dist/src/validateNonInterActiveAuth.js.map +1 -1
  193. package/dist/src/validateNonInterActiveAuth.test.js +1 -4
  194. package/dist/src/validateNonInterActiveAuth.test.js.map +1 -1
  195. package/dist/src/zed-integration/zedIntegration.js +6 -7
  196. package/dist/src/zed-integration/zedIntegration.js.map +1 -1
  197. package/dist/tsconfig.tsbuildinfo +1 -1
  198. package/package.json +3 -3
  199. package/dist/google-gemini-cli-0.11.0-nightly.20251015.203bad7c.tgz +0 -0
@@ -10,7 +10,6 @@ import { DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_MODEL_AUTO, OutputFormat, SHELL_TO
10
10
  import { loadCliConfig, parseArguments } from './config.js';
11
11
  import * as ServerConfig from '@google/gemini-cli-core';
12
12
  import { isWorkspaceTrusted } from './trustedFolders.js';
13
- import { ExtensionEnablementManager } from './extensions/extensionEnablement.js';
14
13
  vi.mock('./trustedFolders.js', () => ({
15
14
  isWorkspaceTrusted: vi
16
15
  .fn()
@@ -420,7 +419,7 @@ describe('loadCliConfig', () => {
420
419
  process.argv = ['node', 'script.js'];
421
420
  const argv = await parseArguments({});
422
421
  const settings = {};
423
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
422
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
424
423
  expect(config.getProxy()).toBeFalsy();
425
424
  });
426
425
  const proxy_url = 'http://localhost:7890';
@@ -460,7 +459,7 @@ describe('loadCliConfig', () => {
460
459
  process.argv = ['node', 'script.js'];
461
460
  const argv = await parseArguments({});
462
461
  const settings = {};
463
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
462
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
464
463
  expect(config.getProxy()).toBe(expected);
465
464
  });
466
465
  });
@@ -482,6 +481,7 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => {
482
481
  {
483
482
  path: '/path/to/ext1',
484
483
  name: 'ext1',
484
+ id: 'ext1-id',
485
485
  version: '1.0.0',
486
486
  contextFiles: ['/path/to/ext1/GEMINI.md'],
487
487
  isActive: true,
@@ -489,6 +489,7 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => {
489
489
  {
490
490
  path: '/path/to/ext2',
491
491
  name: 'ext2',
492
+ id: 'ext2-id',
492
493
  version: '1.0.0',
493
494
  contextFiles: [],
494
495
  isActive: true,
@@ -496,6 +497,7 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => {
496
497
  {
497
498
  path: '/path/to/ext3',
498
499
  name: 'ext3',
500
+ id: 'ext3-id',
499
501
  version: '1.0.0',
500
502
  contextFiles: [
501
503
  '/path/to/ext3/context1.md',
@@ -505,12 +507,8 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => {
505
507
  },
506
508
  ];
507
509
  const argv = await parseArguments({});
508
- await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'session-id', argv);
509
- expect(ServerConfig.loadServerHierarchicalMemory).toHaveBeenCalledWith(expect.any(String), [], false, expect.any(Object), [
510
- '/path/to/ext1/GEMINI.md',
511
- '/path/to/ext3/context1.md',
512
- '/path/to/ext3/context2.md',
513
- ], true, 'tree', {
510
+ await loadCliConfig(settings, extensions, 'session-id', argv);
511
+ expect(ServerConfig.loadServerHierarchicalMemory).toHaveBeenCalledWith(expect.any(String), [], false, expect.any(Object), extensions, true, 'tree', {
514
512
  respectGitIgnore: false,
515
513
  respectGeminiIgnore: true,
516
514
  }, undefined);
@@ -561,6 +559,7 @@ describe('mergeMcpServers', () => {
561
559
  {
562
560
  path: '/path/to/ext1',
563
561
  name: 'ext1',
562
+ id: 'ext1-id',
564
563
  version: '1.0.0',
565
564
  mcpServers: {
566
565
  'ext1-server': {
@@ -574,7 +573,7 @@ describe('mergeMcpServers', () => {
574
573
  const originalSettings = JSON.parse(JSON.stringify(settings));
575
574
  process.argv = ['node', 'script.js'];
576
575
  const argv = await parseArguments({});
577
- await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
576
+ await loadCliConfig(settings, extensions, 'test-session', argv);
578
577
  expect(settings).toEqual(originalSettings);
579
578
  });
580
579
  });
@@ -597,6 +596,7 @@ describe('mergeExcludeTools', () => {
597
596
  {
598
597
  path: '/path/to/ext1',
599
598
  name: 'ext1',
599
+ id: 'ext1-id',
600
600
  version: '1.0.0',
601
601
  excludeTools: ['tool3', 'tool4'],
602
602
  contextFiles: [],
@@ -605,6 +605,7 @@ describe('mergeExcludeTools', () => {
605
605
  {
606
606
  path: '/path/to/ext2',
607
607
  name: 'ext2',
608
+ id: 'ext2-id',
608
609
  version: '1.0.0',
609
610
  excludeTools: ['tool5'],
610
611
  contextFiles: [],
@@ -613,7 +614,7 @@ describe('mergeExcludeTools', () => {
613
614
  ];
614
615
  process.argv = ['node', 'script.js'];
615
616
  const argv = await parseArguments({});
616
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
617
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
617
618
  expect(config.getExcludeTools()).toEqual(expect.arrayContaining(['tool1', 'tool2', 'tool3', 'tool4', 'tool5']));
618
619
  expect(config.getExcludeTools()).toHaveLength(5);
619
620
  });
@@ -623,6 +624,7 @@ describe('mergeExcludeTools', () => {
623
624
  {
624
625
  path: '/path/to/ext1',
625
626
  name: 'ext1',
627
+ id: 'ext1-id',
626
628
  version: '1.0.0',
627
629
  excludeTools: ['tool2', 'tool3'],
628
630
  contextFiles: [],
@@ -631,7 +633,7 @@ describe('mergeExcludeTools', () => {
631
633
  ];
632
634
  process.argv = ['node', 'script.js'];
633
635
  const argv = await parseArguments({});
634
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
636
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
635
637
  expect(config.getExcludeTools()).toEqual(expect.arrayContaining(['tool1', 'tool2', 'tool3']));
636
638
  expect(config.getExcludeTools()).toHaveLength(3);
637
639
  });
@@ -641,6 +643,7 @@ describe('mergeExcludeTools', () => {
641
643
  {
642
644
  path: '/path/to/ext1',
643
645
  name: 'ext1',
646
+ id: 'ext1-id',
644
647
  version: '1.0.0',
645
648
  excludeTools: ['tool2', 'tool3'],
646
649
  contextFiles: [],
@@ -649,6 +652,7 @@ describe('mergeExcludeTools', () => {
649
652
  {
650
653
  path: '/path/to/ext2',
651
654
  name: 'ext2',
655
+ id: 'ext2-id',
652
656
  version: '1.0.0',
653
657
  excludeTools: ['tool3', 'tool4'],
654
658
  contextFiles: [],
@@ -657,7 +661,7 @@ describe('mergeExcludeTools', () => {
657
661
  ];
658
662
  process.argv = ['node', 'script.js'];
659
663
  const argv = await parseArguments({});
660
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
664
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
661
665
  expect(config.getExcludeTools()).toEqual(expect.arrayContaining(['tool1', 'tool2', 'tool3', 'tool4']));
662
666
  expect(config.getExcludeTools()).toHaveLength(4);
663
667
  });
@@ -667,7 +671,7 @@ describe('mergeExcludeTools', () => {
667
671
  const extensions = [];
668
672
  process.argv = ['node', 'script.js'];
669
673
  const argv = await parseArguments({});
670
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
674
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
671
675
  expect(config.getExcludeTools()).toEqual([]);
672
676
  });
673
677
  it('should return default excludes when no excludeTools are specified and it is not interactive', async () => {
@@ -676,7 +680,7 @@ describe('mergeExcludeTools', () => {
676
680
  const extensions = [];
677
681
  process.argv = ['node', 'script.js', '-p', 'test'];
678
682
  const argv = await parseArguments({});
679
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
683
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
680
684
  expect(config.getExcludeTools()).toEqual(defaultExcludes);
681
685
  });
682
686
  it('should handle settings with excludeTools but no extensions', async () => {
@@ -684,7 +688,7 @@ describe('mergeExcludeTools', () => {
684
688
  const argv = await parseArguments({});
685
689
  const settings = { tools: { exclude: ['tool1', 'tool2'] } };
686
690
  const extensions = [];
687
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
691
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
688
692
  expect(config.getExcludeTools()).toEqual(expect.arrayContaining(['tool1', 'tool2']));
689
693
  expect(config.getExcludeTools()).toHaveLength(2);
690
694
  });
@@ -694,6 +698,7 @@ describe('mergeExcludeTools', () => {
694
698
  {
695
699
  path: '/path/to/ext',
696
700
  name: 'ext1',
701
+ id: 'ext1-id',
697
702
  version: '1.0.0',
698
703
  excludeTools: ['tool1', 'tool2'],
699
704
  contextFiles: [],
@@ -702,7 +707,7 @@ describe('mergeExcludeTools', () => {
702
707
  ];
703
708
  process.argv = ['node', 'script.js'];
704
709
  const argv = await parseArguments({});
705
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
710
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
706
711
  expect(config.getExcludeTools()).toEqual(expect.arrayContaining(['tool1', 'tool2']));
707
712
  expect(config.getExcludeTools()).toHaveLength(2);
708
713
  });
@@ -712,6 +717,7 @@ describe('mergeExcludeTools', () => {
712
717
  {
713
718
  path: '/path/to/ext',
714
719
  name: 'ext1',
720
+ id: 'ext1-id',
715
721
  version: '1.0.0',
716
722
  excludeTools: ['tool2'],
717
723
  contextFiles: [],
@@ -721,7 +727,7 @@ describe('mergeExcludeTools', () => {
721
727
  const originalSettings = JSON.parse(JSON.stringify(settings));
722
728
  process.argv = ['node', 'script.js'];
723
729
  const argv = await parseArguments({});
724
- await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
730
+ await loadCliConfig(settings, extensions, 'test-session', argv);
725
731
  expect(settings).toEqual(originalSettings);
726
732
  });
727
733
  });
@@ -742,7 +748,7 @@ describe('Approval mode tool exclusion logic', () => {
742
748
  const argv = await parseArguments({});
743
749
  const settings = {};
744
750
  const extensions = [];
745
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
751
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
746
752
  const excludedTools = config.getExcludeTools();
747
753
  expect(excludedTools).toContain(SHELL_TOOL_NAME);
748
754
  expect(excludedTools).toContain(EDIT_TOOL_NAME);
@@ -760,7 +766,7 @@ describe('Approval mode tool exclusion logic', () => {
760
766
  const argv = await parseArguments({});
761
767
  const settings = {};
762
768
  const extensions = [];
763
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
769
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
764
770
  const excludedTools = config.getExcludeTools();
765
771
  expect(excludedTools).toContain(SHELL_TOOL_NAME);
766
772
  expect(excludedTools).toContain(EDIT_TOOL_NAME);
@@ -778,7 +784,7 @@ describe('Approval mode tool exclusion logic', () => {
778
784
  const argv = await parseArguments({});
779
785
  const settings = {};
780
786
  const extensions = [];
781
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
787
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
782
788
  const excludedTools = config.getExcludeTools();
783
789
  expect(excludedTools).toContain(SHELL_TOOL_NAME);
784
790
  expect(excludedTools).not.toContain(EDIT_TOOL_NAME);
@@ -796,7 +802,7 @@ describe('Approval mode tool exclusion logic', () => {
796
802
  const argv = await parseArguments({});
797
803
  const settings = {};
798
804
  const extensions = [];
799
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
805
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
800
806
  const excludedTools = config.getExcludeTools();
801
807
  expect(excludedTools).not.toContain(SHELL_TOOL_NAME);
802
808
  expect(excludedTools).not.toContain(EDIT_TOOL_NAME);
@@ -807,7 +813,7 @@ describe('Approval mode tool exclusion logic', () => {
807
813
  const argv = await parseArguments({});
808
814
  const settings = {};
809
815
  const extensions = [];
810
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
816
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
811
817
  const excludedTools = config.getExcludeTools();
812
818
  expect(excludedTools).not.toContain(SHELL_TOOL_NAME);
813
819
  expect(excludedTools).not.toContain(EDIT_TOOL_NAME);
@@ -827,7 +833,7 @@ describe('Approval mode tool exclusion logic', () => {
827
833
  const argv = await parseArguments({});
828
834
  const settings = {};
829
835
  const extensions = [];
830
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
836
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
831
837
  const excludedTools = config.getExcludeTools();
832
838
  expect(excludedTools).not.toContain(SHELL_TOOL_NAME);
833
839
  expect(excludedTools).not.toContain(EDIT_TOOL_NAME);
@@ -846,7 +852,7 @@ describe('Approval mode tool exclusion logic', () => {
846
852
  const argv = await parseArguments({});
847
853
  const settings = { tools: { exclude: ['custom_tool'] } };
848
854
  const extensions = [];
849
- const config = await loadCliConfig(settings, extensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
855
+ const config = await loadCliConfig(settings, extensions, 'test-session', argv);
850
856
  const excludedTools = config.getExcludeTools();
851
857
  expect(excludedTools).toContain('custom_tool'); // From settings
852
858
  expect(excludedTools).toContain(SHELL_TOOL_NAME); // From approval mode
@@ -863,7 +869,7 @@ describe('Approval mode tool exclusion logic', () => {
863
869
  };
864
870
  const settings = {};
865
871
  const extensions = [];
866
- await expect(loadCliConfig(settings, extensions, new ExtensionEnablementManager(invalidArgv.extensions), 'test-session', invalidArgv)).rejects.toThrow('Invalid approval mode: invalid_mode. Valid values are: yolo, auto_edit, default');
872
+ await expect(loadCliConfig(settings, extensions, 'test-session', invalidArgv)).rejects.toThrow('Invalid approval mode: invalid_mode. Valid values are: yolo, auto_edit, default');
867
873
  });
868
874
  });
869
875
  describe('loadCliConfig with allowed-mcp-server-names', () => {
@@ -888,7 +894,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
888
894
  it('should allow all MCP servers if the flag is not provided', async () => {
889
895
  process.argv = ['node', 'script.js'];
890
896
  const argv = await parseArguments({});
891
- const config = await loadCliConfig(baseSettings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
897
+ const config = await loadCliConfig(baseSettings, [], 'test-session', argv);
892
898
  expect(config.getMcpServers()).toEqual(baseSettings.mcpServers);
893
899
  });
894
900
  it('should allow only the specified MCP server', async () => {
@@ -899,7 +905,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
899
905
  'server1',
900
906
  ];
901
907
  const argv = await parseArguments({});
902
- const config = await loadCliConfig(baseSettings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
908
+ const config = await loadCliConfig(baseSettings, [], 'test-session', argv);
903
909
  expect(config.getMcpServers()).toEqual({
904
910
  server1: { url: 'http://localhost:8080' },
905
911
  });
@@ -914,7 +920,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
914
920
  'server3',
915
921
  ];
916
922
  const argv = await parseArguments({});
917
- const config = await loadCliConfig(baseSettings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
923
+ const config = await loadCliConfig(baseSettings, [], 'test-session', argv);
918
924
  expect(config.getMcpServers()).toEqual({
919
925
  server1: { url: 'http://localhost:8080' },
920
926
  server3: { url: 'http://localhost:8082' },
@@ -930,7 +936,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
930
936
  'server4',
931
937
  ];
932
938
  const argv = await parseArguments({});
933
- const config = await loadCliConfig(baseSettings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
939
+ const config = await loadCliConfig(baseSettings, [], 'test-session', argv);
934
940
  expect(config.getMcpServers()).toEqual({
935
941
  server1: { url: 'http://localhost:8080' },
936
942
  });
@@ -938,7 +944,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
938
944
  it('should allow no MCP servers if the flag is provided but empty', async () => {
939
945
  process.argv = ['node', 'script.js', '--allowed-mcp-server-names', ''];
940
946
  const argv = await parseArguments({});
941
- const config = await loadCliConfig(baseSettings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
947
+ const config = await loadCliConfig(baseSettings, [], 'test-session', argv);
942
948
  expect(config.getMcpServers()).toEqual({});
943
949
  });
944
950
  it('should read allowMCPServers from settings', async () => {
@@ -948,7 +954,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
948
954
  ...baseSettings,
949
955
  mcp: { allowed: ['server1', 'server2'] },
950
956
  };
951
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
957
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
952
958
  expect(config.getMcpServers()).toEqual({
953
959
  server1: { url: 'http://localhost:8080' },
954
960
  server2: { url: 'http://localhost:8081' },
@@ -961,7 +967,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
961
967
  ...baseSettings,
962
968
  mcp: { excluded: ['server1', 'server2'] },
963
969
  };
964
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
970
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
965
971
  expect(config.getMcpServers()).toEqual({
966
972
  server3: { url: 'http://localhost:8082' },
967
973
  });
@@ -976,7 +982,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
976
982
  allowed: ['server1', 'server2'],
977
983
  },
978
984
  };
979
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
985
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
980
986
  expect(config.getMcpServers()).toEqual({
981
987
  server2: { url: 'http://localhost:8081' },
982
988
  });
@@ -996,7 +1002,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
996
1002
  allowed: ['server2'],
997
1003
  },
998
1004
  };
999
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1005
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1000
1006
  expect(config.getMcpServers()).toEqual({
1001
1007
  server1: { url: 'http://localhost:8080' },
1002
1008
  });
@@ -1018,48 +1024,13 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
1018
1024
  excluded: ['server3'], // Should be ignored
1019
1025
  },
1020
1026
  };
1021
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1027
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1022
1028
  expect(config.getMcpServers()).toEqual({
1023
1029
  server2: { url: 'http://localhost:8081' },
1024
1030
  server3: { url: 'http://localhost:8082' },
1025
1031
  });
1026
1032
  });
1027
1033
  });
1028
- describe('loadCliConfig extensions', () => {
1029
- const mockExtensions = [
1030
- {
1031
- path: '/path/to/ext1',
1032
- name: 'ext1',
1033
- version: '1.0.0',
1034
- contextFiles: ['/path/to/ext1.md'],
1035
- isActive: true,
1036
- },
1037
- {
1038
- path: '/path/to/ext2',
1039
- name: 'ext2',
1040
- version: '1.0.0',
1041
- contextFiles: ['/path/to/ext2.md'],
1042
- isActive: true,
1043
- },
1044
- ];
1045
- it('should not filter extensions if --extensions flag is not used', async () => {
1046
- process.argv = ['node', 'script.js'];
1047
- const argv = await parseArguments({});
1048
- const settings = {};
1049
- const config = await loadCliConfig(settings, mockExtensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1050
- expect(config.getExtensionContextFilePaths()).toEqual([
1051
- '/path/to/ext1.md',
1052
- '/path/to/ext2.md',
1053
- ]);
1054
- });
1055
- it('should filter extensions if --extensions flag is used', async () => {
1056
- process.argv = ['node', 'script.js', '--extensions', 'ext1'];
1057
- const argv = await parseArguments({});
1058
- const settings = {};
1059
- const config = await loadCliConfig(settings, mockExtensions, new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1060
- expect(config.getExtensionContextFilePaths()).toEqual(['/path/to/ext1.md']);
1061
- });
1062
- });
1063
1034
  describe('loadCliConfig model selection', () => {
1064
1035
  it('selects a model from settings.json if provided', async () => {
1065
1036
  process.argv = ['node', 'script.js'];
@@ -1068,7 +1039,7 @@ describe('loadCliConfig model selection', () => {
1068
1039
  model: {
1069
1040
  name: 'gemini-9001-ultra',
1070
1041
  },
1071
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1042
+ }, [], 'test-session', argv);
1072
1043
  expect(config.getModel()).toBe('gemini-9001-ultra');
1073
1044
  });
1074
1045
  it('uses the default gemini model if nothing is set', async () => {
@@ -1076,25 +1047,25 @@ describe('loadCliConfig model selection', () => {
1076
1047
  const argv = await parseArguments({});
1077
1048
  const config = await loadCliConfig({
1078
1049
  // No model set.
1079
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1050
+ }, [], 'test-session', argv);
1080
1051
  expect(config.getModel()).toBe('auto');
1081
1052
  });
1082
- it('always prefers model from argvs', async () => {
1053
+ it('always prefers model from argv', async () => {
1083
1054
  process.argv = ['node', 'script.js', '--model', 'gemini-8675309-ultra'];
1084
1055
  const argv = await parseArguments({});
1085
1056
  const config = await loadCliConfig({
1086
1057
  model: {
1087
1058
  name: 'gemini-9001-ultra',
1088
1059
  },
1089
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1060
+ }, [], 'test-session', argv);
1090
1061
  expect(config.getModel()).toBe('gemini-8675309-ultra');
1091
1062
  });
1092
- it('selects the model from argvs if provided', async () => {
1063
+ it('selects the model from argv if provided', async () => {
1093
1064
  process.argv = ['node', 'script.js', '--model', 'gemini-8675309-ultra'];
1094
1065
  const argv = await parseArguments({});
1095
1066
  const config = await loadCliConfig({
1096
1067
  // No model provided via settings.
1097
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1068
+ }, [], 'test-session', argv);
1098
1069
  expect(config.getModel()).toBe('gemini-8675309-ultra');
1099
1070
  });
1100
1071
  });
@@ -1106,7 +1077,7 @@ describe('loadCliConfig model selection with model router', () => {
1106
1077
  experimental: {
1107
1078
  useModelRouter: true,
1108
1079
  },
1109
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1080
+ }, [], 'test-session', argv);
1110
1081
  expect(config.getModel()).toBe(DEFAULT_GEMINI_MODEL_AUTO);
1111
1082
  });
1112
1083
  it('should use default model when useModelRouter is false and no model is provided', async () => {
@@ -1116,7 +1087,7 @@ describe('loadCliConfig model selection with model router', () => {
1116
1087
  experimental: {
1117
1088
  useModelRouter: false,
1118
1089
  },
1119
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1090
+ }, [], 'test-session', argv);
1120
1091
  expect(config.getModel()).toBe(DEFAULT_GEMINI_MODEL);
1121
1092
  });
1122
1093
  it('should prioritize argv over useModelRouter', async () => {
@@ -1126,7 +1097,7 @@ describe('loadCliConfig model selection with model router', () => {
1126
1097
  experimental: {
1127
1098
  useModelRouter: true,
1128
1099
  },
1129
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1100
+ }, [], 'test-session', argv);
1130
1101
  expect(config.getModel()).toBe('gemini-from-argv');
1131
1102
  });
1132
1103
  it('should prioritize settings over useModelRouter', async () => {
@@ -1139,7 +1110,7 @@ describe('loadCliConfig model selection with model router', () => {
1139
1110
  model: {
1140
1111
  name: 'gemini-from-settings',
1141
1112
  },
1142
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1113
+ }, [], 'test-session', argv);
1143
1114
  expect(config.getModel()).toBe('gemini-from-settings');
1144
1115
  });
1145
1116
  it('should prioritize environment variable over useModelRouter', async () => {
@@ -1150,7 +1121,7 @@ describe('loadCliConfig model selection with model router', () => {
1150
1121
  experimental: {
1151
1122
  useModelRouter: true,
1152
1123
  },
1153
- }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1124
+ }, [], 'test-session', argv);
1154
1125
  expect(config.getModel()).toBe('gemini-from-env');
1155
1126
  });
1156
1127
  });
@@ -1176,7 +1147,7 @@ describe('loadCliConfig folderTrust', () => {
1176
1147
  },
1177
1148
  };
1178
1149
  const argv = await parseArguments({});
1179
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1150
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1180
1151
  expect(config.getFolderTrust()).toBe(false);
1181
1152
  });
1182
1153
  it('should be true when folderTrust is true', async () => {
@@ -1189,14 +1160,14 @@ describe('loadCliConfig folderTrust', () => {
1189
1160
  },
1190
1161
  },
1191
1162
  };
1192
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1163
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1193
1164
  expect(config.getFolderTrust()).toBe(true);
1194
1165
  });
1195
1166
  it('should be false by default', async () => {
1196
1167
  process.argv = ['node', 'script.js'];
1197
1168
  const argv = await parseArguments({});
1198
1169
  const settings = {};
1199
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1170
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1200
1171
  expect(config.getFolderTrust()).toBe(false);
1201
1172
  });
1202
1173
  });
@@ -1231,7 +1202,7 @@ describe('loadCliConfig with includeDirectories', () => {
1231
1202
  ],
1232
1203
  },
1233
1204
  };
1234
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1205
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1235
1206
  const expected = [
1236
1207
  mockCwd,
1237
1208
  path.resolve(path.sep, 'cli', 'path1'),
@@ -1266,7 +1237,7 @@ describe('loadCliConfig chatCompression', () => {
1266
1237
  },
1267
1238
  },
1268
1239
  };
1269
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1240
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1270
1241
  expect(config.getChatCompression()).toEqual({
1271
1242
  contextPercentageThreshold: 0.5,
1272
1243
  });
@@ -1275,7 +1246,7 @@ describe('loadCliConfig chatCompression', () => {
1275
1246
  process.argv = ['node', 'script.js'];
1276
1247
  const argv = await parseArguments({});
1277
1248
  const settings = {};
1278
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1249
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1279
1250
  expect(config.getChatCompression()).toBeUndefined();
1280
1251
  });
1281
1252
  });
@@ -1295,43 +1266,43 @@ describe('loadCliConfig useRipgrep', () => {
1295
1266
  process.argv = ['node', 'script.js'];
1296
1267
  const argv = await parseArguments({});
1297
1268
  const settings = {};
1298
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1269
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1299
1270
  expect(config.getUseRipgrep()).toBe(true);
1300
1271
  });
1301
1272
  it('should be false when useRipgrep is set to false in settings', async () => {
1302
1273
  process.argv = ['node', 'script.js'];
1303
1274
  const argv = await parseArguments({});
1304
1275
  const settings = { tools: { useRipgrep: false } };
1305
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1276
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1306
1277
  expect(config.getUseRipgrep()).toBe(false);
1307
1278
  });
1308
1279
  it('should be true when useRipgrep is explicitly set to true in settings', async () => {
1309
1280
  process.argv = ['node', 'script.js'];
1310
1281
  const argv = await parseArguments({});
1311
1282
  const settings = { tools: { useRipgrep: true } };
1312
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1283
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1313
1284
  expect(config.getUseRipgrep()).toBe(true);
1314
1285
  });
1315
1286
  describe('loadCliConfig useModelRouter', () => {
1316
- it('should be false by default when useModelRouter is not set in settings', async () => {
1287
+ it('should be true by default when useModelRouter is not set in settings', async () => {
1317
1288
  process.argv = ['node', 'script.js'];
1318
1289
  const argv = await parseArguments({});
1319
1290
  const settings = {};
1320
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1291
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1321
1292
  expect(config.getUseModelRouter()).toBe(true);
1322
1293
  });
1323
1294
  it('should be true when useModelRouter is set to true in settings', async () => {
1324
1295
  process.argv = ['node', 'script.js'];
1325
1296
  const argv = await parseArguments({});
1326
1297
  const settings = { experimental: { useModelRouter: true } };
1327
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1298
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1328
1299
  expect(config.getUseModelRouter()).toBe(true);
1329
1300
  });
1330
1301
  it('should be false when useModelRouter is explicitly set to false in settings', async () => {
1331
1302
  process.argv = ['node', 'script.js'];
1332
1303
  const argv = await parseArguments({});
1333
1304
  const settings = { experimental: { useModelRouter: false } };
1334
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1305
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1335
1306
  expect(config.getUseModelRouter()).toBe(false);
1336
1307
  });
1337
1308
  });
@@ -1354,7 +1325,7 @@ describe('screenReader configuration', () => {
1354
1325
  const settings = {
1355
1326
  ui: { accessibility: { screenReader: true } },
1356
1327
  };
1357
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1328
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1358
1329
  expect(config.getScreenReader()).toBe(true);
1359
1330
  });
1360
1331
  it('should use screenReader value from settings if CLI flag is not present (settings false)', async () => {
@@ -1363,7 +1334,7 @@ describe('screenReader configuration', () => {
1363
1334
  const settings = {
1364
1335
  ui: { accessibility: { screenReader: false } },
1365
1336
  };
1366
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1337
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1367
1338
  expect(config.getScreenReader()).toBe(false);
1368
1339
  });
1369
1340
  it('should prioritize --screen-reader CLI flag (true) over settings (false)', async () => {
@@ -1372,14 +1343,14 @@ describe('screenReader configuration', () => {
1372
1343
  const settings = {
1373
1344
  ui: { accessibility: { screenReader: false } },
1374
1345
  };
1375
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1346
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1376
1347
  expect(config.getScreenReader()).toBe(true);
1377
1348
  });
1378
1349
  it('should be false by default when no flag or setting is present', async () => {
1379
1350
  process.argv = ['node', 'script.js'];
1380
1351
  const argv = await parseArguments({});
1381
1352
  const settings = {};
1382
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1353
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1383
1354
  expect(config.getScreenReader()).toBe(false);
1384
1355
  });
1385
1356
  });
@@ -1406,7 +1377,7 @@ describe('loadCliConfig tool exclusions', () => {
1406
1377
  process.stdin.isTTY = true;
1407
1378
  process.argv = ['node', 'script.js'];
1408
1379
  const argv = await parseArguments({});
1409
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1380
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1410
1381
  expect(config.getExcludeTools()).not.toContain('run_shell_command');
1411
1382
  expect(config.getExcludeTools()).not.toContain('replace');
1412
1383
  expect(config.getExcludeTools()).not.toContain('write_file');
@@ -1415,7 +1386,7 @@ describe('loadCliConfig tool exclusions', () => {
1415
1386
  process.stdin.isTTY = true;
1416
1387
  process.argv = ['node', 'script.js', '--yolo'];
1417
1388
  const argv = await parseArguments({});
1418
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1389
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1419
1390
  expect(config.getExcludeTools()).not.toContain('run_shell_command');
1420
1391
  expect(config.getExcludeTools()).not.toContain('replace');
1421
1392
  expect(config.getExcludeTools()).not.toContain('write_file');
@@ -1424,7 +1395,7 @@ describe('loadCliConfig tool exclusions', () => {
1424
1395
  process.stdin.isTTY = false;
1425
1396
  process.argv = ['node', 'script.js', '-p', 'test'];
1426
1397
  const argv = await parseArguments({});
1427
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1398
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1428
1399
  expect(config.getExcludeTools()).toContain('run_shell_command');
1429
1400
  expect(config.getExcludeTools()).toContain('replace');
1430
1401
  expect(config.getExcludeTools()).toContain('write_file');
@@ -1433,7 +1404,7 @@ describe('loadCliConfig tool exclusions', () => {
1433
1404
  process.stdin.isTTY = false;
1434
1405
  process.argv = ['node', 'script.js', '-p', 'test', '--yolo'];
1435
1406
  const argv = await parseArguments({});
1436
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1407
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1437
1408
  expect(config.getExcludeTools()).not.toContain('run_shell_command');
1438
1409
  expect(config.getExcludeTools()).not.toContain('replace');
1439
1410
  expect(config.getExcludeTools()).not.toContain('write_file');
@@ -1449,7 +1420,7 @@ describe('loadCliConfig tool exclusions', () => {
1449
1420
  'ShellTool',
1450
1421
  ];
1451
1422
  const argv = await parseArguments({});
1452
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1423
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1453
1424
  expect(config.getExcludeTools()).not.toContain(SHELL_TOOL_NAME);
1454
1425
  });
1455
1426
  it('should not exclude shell tool in non-interactive mode when --allowed-tools="run_shell_command" is set', async () => {
@@ -1463,7 +1434,7 @@ describe('loadCliConfig tool exclusions', () => {
1463
1434
  'run_shell_command',
1464
1435
  ];
1465
1436
  const argv = await parseArguments({});
1466
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1437
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1467
1438
  expect(config.getExcludeTools()).not.toContain(SHELL_TOOL_NAME);
1468
1439
  });
1469
1440
  it('should not exclude shell tool in non-interactive mode when --allowed-tools="ShellTool(wc)" is set', async () => {
@@ -1477,7 +1448,7 @@ describe('loadCliConfig tool exclusions', () => {
1477
1448
  'ShellTool(wc)',
1478
1449
  ];
1479
1450
  const argv = await parseArguments({});
1480
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1451
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1481
1452
  expect(config.getExcludeTools()).not.toContain(SHELL_TOOL_NAME);
1482
1453
  });
1483
1454
  });
@@ -1500,35 +1471,35 @@ describe('loadCliConfig interactive', () => {
1500
1471
  process.stdin.isTTY = true;
1501
1472
  process.argv = ['node', 'script.js'];
1502
1473
  const argv = await parseArguments({});
1503
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1474
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1504
1475
  expect(config.isInteractive()).toBe(true);
1505
1476
  });
1506
1477
  it('should be interactive if prompt-interactive is set', async () => {
1507
1478
  process.stdin.isTTY = false;
1508
1479
  process.argv = ['node', 'script.js', '--prompt-interactive', 'test'];
1509
1480
  const argv = await parseArguments({});
1510
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1481
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1511
1482
  expect(config.isInteractive()).toBe(true);
1512
1483
  });
1513
1484
  it('should not be interactive if not isTTY and no prompt', async () => {
1514
1485
  process.stdin.isTTY = false;
1515
1486
  process.argv = ['node', 'script.js'];
1516
1487
  const argv = await parseArguments({});
1517
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1488
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1518
1489
  expect(config.isInteractive()).toBe(false);
1519
1490
  });
1520
1491
  it('should not be interactive if prompt is set', async () => {
1521
1492
  process.stdin.isTTY = true;
1522
1493
  process.argv = ['node', 'script.js', '--prompt', 'test'];
1523
1494
  const argv = await parseArguments({});
1524
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1495
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1525
1496
  expect(config.isInteractive()).toBe(false);
1526
1497
  });
1527
1498
  it('should not be interactive if positional prompt words are provided with other flags', async () => {
1528
1499
  process.stdin.isTTY = true;
1529
1500
  process.argv = ['node', 'script.js', '--model', 'gemini-1.5-pro', 'Hello'];
1530
1501
  const argv = await parseArguments({});
1531
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1502
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1532
1503
  expect(config.isInteractive()).toBe(false);
1533
1504
  });
1534
1505
  it('should not be interactive if positional prompt words are provided with multiple flags', async () => {
@@ -1542,7 +1513,7 @@ describe('loadCliConfig interactive', () => {
1542
1513
  'Hello world',
1543
1514
  ];
1544
1515
  const argv = await parseArguments({});
1545
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1516
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1546
1517
  expect(config.isInteractive()).toBe(false);
1547
1518
  // Verify the question is preserved for one-shot execution
1548
1519
  expect(argv.prompt).toBe('Hello world');
@@ -1552,7 +1523,7 @@ describe('loadCliConfig interactive', () => {
1552
1523
  process.stdin.isTTY = true;
1553
1524
  process.argv = ['node', 'script.js', '-e', 'none', 'hello'];
1554
1525
  const argv = await parseArguments({});
1555
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1526
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1556
1527
  expect(config.isInteractive()).toBe(false);
1557
1528
  expect(argv.query).toBe('hello');
1558
1529
  expect(argv.extensions).toEqual(['none']);
@@ -1561,7 +1532,7 @@ describe('loadCliConfig interactive', () => {
1561
1532
  process.stdin.isTTY = true;
1562
1533
  process.argv = ['node', 'script.js', 'hello world how are you'];
1563
1534
  const argv = await parseArguments({});
1564
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1535
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1565
1536
  expect(config.isInteractive()).toBe(false);
1566
1537
  expect(argv.query).toBe('hello world how are you');
1567
1538
  expect(argv.prompt).toBe('hello world how are you');
@@ -1581,7 +1552,7 @@ describe('loadCliConfig interactive', () => {
1581
1552
  'array',
1582
1553
  ];
1583
1554
  const argv = await parseArguments({});
1584
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1555
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1585
1556
  expect(config.isInteractive()).toBe(false);
1586
1557
  expect(argv.query).toBe('write a function to sort array');
1587
1558
  expect(argv.model).toBe('gemini-1.5-pro');
@@ -1590,7 +1561,7 @@ describe('loadCliConfig interactive', () => {
1590
1561
  process.stdin.isTTY = true;
1591
1562
  process.argv = ['node', 'script.js', ''];
1592
1563
  const argv = await parseArguments({});
1593
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1564
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1594
1565
  expect(config.isInteractive()).toBe(true);
1595
1566
  expect(argv.query).toBeUndefined();
1596
1567
  });
@@ -1608,7 +1579,7 @@ describe('loadCliConfig interactive', () => {
1608
1579
  'you',
1609
1580
  ];
1610
1581
  const argv = await parseArguments({});
1611
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1582
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1612
1583
  expect(config.isInteractive()).toBe(false);
1613
1584
  expect(argv.query).toBe('hello world how are you');
1614
1585
  expect(argv.extensions).toEqual(['none']);
@@ -1617,7 +1588,7 @@ describe('loadCliConfig interactive', () => {
1617
1588
  process.stdin.isTTY = true;
1618
1589
  process.argv = ['node', 'script.js', '--model', 'gemini-1.5-pro'];
1619
1590
  const argv = await parseArguments({});
1620
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1591
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1621
1592
  expect(config.isInteractive()).toBe(true);
1622
1593
  });
1623
1594
  });
@@ -1641,37 +1612,37 @@ describe('loadCliConfig approval mode', () => {
1641
1612
  it('should default to DEFAULT approval mode when no flags are set', async () => {
1642
1613
  process.argv = ['node', 'script.js'];
1643
1614
  const argv = await parseArguments({});
1644
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1615
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1645
1616
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.DEFAULT);
1646
1617
  });
1647
1618
  it('should set YOLO approval mode when --yolo flag is used', async () => {
1648
1619
  process.argv = ['node', 'script.js', '--yolo'];
1649
1620
  const argv = await parseArguments({});
1650
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1621
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1651
1622
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.YOLO);
1652
1623
  });
1653
1624
  it('should set YOLO approval mode when -y flag is used', async () => {
1654
1625
  process.argv = ['node', 'script.js', '-y'];
1655
1626
  const argv = await parseArguments({});
1656
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1627
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1657
1628
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.YOLO);
1658
1629
  });
1659
1630
  it('should set DEFAULT approval mode when --approval-mode=default', async () => {
1660
1631
  process.argv = ['node', 'script.js', '--approval-mode', 'default'];
1661
1632
  const argv = await parseArguments({});
1662
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1633
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1663
1634
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.DEFAULT);
1664
1635
  });
1665
1636
  it('should set AUTO_EDIT approval mode when --approval-mode=auto_edit', async () => {
1666
1637
  process.argv = ['node', 'script.js', '--approval-mode', 'auto_edit'];
1667
1638
  const argv = await parseArguments({});
1668
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1639
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1669
1640
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.AUTO_EDIT);
1670
1641
  });
1671
1642
  it('should set YOLO approval mode when --approval-mode=yolo', async () => {
1672
1643
  process.argv = ['node', 'script.js', '--approval-mode', 'yolo'];
1673
1644
  const argv = await parseArguments({});
1674
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1645
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1675
1646
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.YOLO);
1676
1647
  });
1677
1648
  it('should prioritize --approval-mode over --yolo when both would be valid (but validation prevents this)', async () => {
@@ -1681,13 +1652,13 @@ describe('loadCliConfig approval mode', () => {
1681
1652
  const argv = await parseArguments({});
1682
1653
  // Manually set yolo to true to simulate what would happen if validation didn't prevent it
1683
1654
  argv.yolo = true;
1684
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1655
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1685
1656
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.DEFAULT);
1686
1657
  });
1687
1658
  it('should fall back to --yolo behavior when --approval-mode is not set', async () => {
1688
1659
  process.argv = ['node', 'script.js', '--yolo'];
1689
1660
  const argv = await parseArguments({});
1690
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1661
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1691
1662
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.YOLO);
1692
1663
  });
1693
1664
  // --- Untrusted Folder Scenarios ---
@@ -1701,25 +1672,25 @@ describe('loadCliConfig approval mode', () => {
1701
1672
  it('should override --approval-mode=yolo to DEFAULT', async () => {
1702
1673
  process.argv = ['node', 'script.js', '--approval-mode', 'yolo'];
1703
1674
  const argv = await parseArguments({});
1704
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1675
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1705
1676
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.DEFAULT);
1706
1677
  });
1707
1678
  it('should override --approval-mode=auto_edit to DEFAULT', async () => {
1708
1679
  process.argv = ['node', 'script.js', '--approval-mode', 'auto_edit'];
1709
1680
  const argv = await parseArguments({});
1710
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1681
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1711
1682
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.DEFAULT);
1712
1683
  });
1713
1684
  it('should override --yolo flag to DEFAULT', async () => {
1714
1685
  process.argv = ['node', 'script.js', '--yolo'];
1715
1686
  const argv = await parseArguments({});
1716
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1687
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1717
1688
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.DEFAULT);
1718
1689
  });
1719
1690
  it('should remain DEFAULT when --approval-mode=default', async () => {
1720
1691
  process.argv = ['node', 'script.js', '--approval-mode', 'default'];
1721
1692
  const argv = await parseArguments({});
1722
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1693
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1723
1694
  expect(config.getApprovalMode()).toBe(ServerConfig.ApprovalMode.DEFAULT);
1724
1695
  });
1725
1696
  });
@@ -1786,7 +1757,7 @@ describe('loadCliConfig fileFiltering', () => {
1786
1757
  },
1787
1758
  };
1788
1759
  const argv = await parseArguments(settings);
1789
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1760
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1790
1761
  expect(getter(config)).toBe(value);
1791
1762
  });
1792
1763
  });
@@ -1794,25 +1765,25 @@ describe('Output format', () => {
1794
1765
  it('should default to TEXT', async () => {
1795
1766
  process.argv = ['node', 'script.js'];
1796
1767
  const argv = await parseArguments({});
1797
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1768
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1798
1769
  expect(config.getOutputFormat()).toBe(OutputFormat.TEXT);
1799
1770
  });
1800
1771
  it('should use the format from settings', async () => {
1801
1772
  process.argv = ['node', 'script.js'];
1802
1773
  const argv = await parseArguments({});
1803
- const config = await loadCliConfig({ output: { format: OutputFormat.JSON } }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1774
+ const config = await loadCliConfig({ output: { format: OutputFormat.JSON } }, [], 'test-session', argv);
1804
1775
  expect(config.getOutputFormat()).toBe(OutputFormat.JSON);
1805
1776
  });
1806
1777
  it('should prioritize the format from argv', async () => {
1807
1778
  process.argv = ['node', 'script.js', '--output-format', 'json'];
1808
1779
  const argv = await parseArguments({});
1809
- const config = await loadCliConfig({ output: { format: OutputFormat.JSON } }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1780
+ const config = await loadCliConfig({ output: { format: OutputFormat.JSON } }, [], 'test-session', argv);
1810
1781
  expect(config.getOutputFormat()).toBe(OutputFormat.JSON);
1811
1782
  });
1812
1783
  it('should accept stream-json as a valid output format', async () => {
1813
1784
  process.argv = ['node', 'script.js', '--output-format', 'stream-json'];
1814
1785
  const argv = await parseArguments({});
1815
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1786
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1816
1787
  expect(config.getOutputFormat()).toBe(OutputFormat.STREAM_JSON);
1817
1788
  });
1818
1789
  it('should error on invalid --output-format argument', async () => {
@@ -1883,7 +1854,7 @@ describe('Telemetry configuration via environment variables', () => {
1883
1854
  process.argv = ['node', 'script.js'];
1884
1855
  const argv = await parseArguments({});
1885
1856
  const settings = { telemetry: { enabled: false } };
1886
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1857
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1887
1858
  expect(config.getTelemetryEnabled()).toBe(true);
1888
1859
  });
1889
1860
  it('should prioritize GEMINI_TELEMETRY_TARGET over settings', async () => {
@@ -1893,7 +1864,7 @@ describe('Telemetry configuration via environment variables', () => {
1893
1864
  const settings = {
1894
1865
  telemetry: { target: ServerConfig.TelemetryTarget.LOCAL },
1895
1866
  };
1896
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1867
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1897
1868
  expect(config.getTelemetryTarget()).toBe('gcp');
1898
1869
  });
1899
1870
  it('should throw when GEMINI_TELEMETRY_TARGET is invalid', async () => {
@@ -1903,7 +1874,7 @@ describe('Telemetry configuration via environment variables', () => {
1903
1874
  const settings = {
1904
1875
  telemetry: { target: ServerConfig.TelemetryTarget.GCP },
1905
1876
  };
1906
- await expect(loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv)).rejects.toThrow(/Invalid telemetry configuration: .*Invalid telemetry target/i);
1877
+ await expect(loadCliConfig(settings, [], 'test-session', argv)).rejects.toThrow(/Invalid telemetry configuration: .*Invalid telemetry target/i);
1907
1878
  vi.unstubAllEnvs();
1908
1879
  });
1909
1880
  it('should prioritize GEMINI_TELEMETRY_OTLP_ENDPOINT over settings and default env var', async () => {
@@ -1914,7 +1885,7 @@ describe('Telemetry configuration via environment variables', () => {
1914
1885
  const settings = {
1915
1886
  telemetry: { otlpEndpoint: 'http://settings.com' },
1916
1887
  };
1917
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1888
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1918
1889
  expect(config.getTelemetryOtlpEndpoint()).toBe('http://gemini.env.com');
1919
1890
  });
1920
1891
  it('should prioritize GEMINI_TELEMETRY_OTLP_PROTOCOL over settings', async () => {
@@ -1922,7 +1893,7 @@ describe('Telemetry configuration via environment variables', () => {
1922
1893
  process.argv = ['node', 'script.js'];
1923
1894
  const argv = await parseArguments({});
1924
1895
  const settings = { telemetry: { otlpProtocol: 'grpc' } };
1925
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1896
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1926
1897
  expect(config.getTelemetryOtlpProtocol()).toBe('http');
1927
1898
  });
1928
1899
  it('should prioritize GEMINI_TELEMETRY_LOG_PROMPTS over settings', async () => {
@@ -1930,7 +1901,7 @@ describe('Telemetry configuration via environment variables', () => {
1930
1901
  process.argv = ['node', 'script.js'];
1931
1902
  const argv = await parseArguments({});
1932
1903
  const settings = { telemetry: { logPrompts: true } };
1933
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1904
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1934
1905
  expect(config.getTelemetryLogPromptsEnabled()).toBe(false);
1935
1906
  });
1936
1907
  it('should prioritize GEMINI_TELEMETRY_OUTFILE over settings', async () => {
@@ -1940,7 +1911,7 @@ describe('Telemetry configuration via environment variables', () => {
1940
1911
  const settings = {
1941
1912
  telemetry: { outfile: '/settings/telemetry.log' },
1942
1913
  };
1943
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1914
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1944
1915
  expect(config.getTelemetryOutfile()).toBe('/gemini/env/telemetry.log');
1945
1916
  });
1946
1917
  it('should prioritize GEMINI_TELEMETRY_USE_COLLECTOR over settings', async () => {
@@ -1948,7 +1919,7 @@ describe('Telemetry configuration via environment variables', () => {
1948
1919
  process.argv = ['node', 'script.js'];
1949
1920
  const argv = await parseArguments({});
1950
1921
  const settings = { telemetry: { useCollector: false } };
1951
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1922
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1952
1923
  expect(config.getTelemetryUseCollector()).toBe(true);
1953
1924
  });
1954
1925
  it('should use settings value when GEMINI_TELEMETRY_ENABLED is not set', async () => {
@@ -1956,7 +1927,7 @@ describe('Telemetry configuration via environment variables', () => {
1956
1927
  process.argv = ['node', 'script.js'];
1957
1928
  const argv = await parseArguments({});
1958
1929
  const settings = { telemetry: { enabled: true } };
1959
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1930
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1960
1931
  expect(config.getTelemetryEnabled()).toBe(true);
1961
1932
  });
1962
1933
  it('should use settings value when GEMINI_TELEMETRY_TARGET is not set', async () => {
@@ -1966,35 +1937,35 @@ describe('Telemetry configuration via environment variables', () => {
1966
1937
  const settings = {
1967
1938
  telemetry: { target: ServerConfig.TelemetryTarget.LOCAL },
1968
1939
  };
1969
- const config = await loadCliConfig(settings, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1940
+ const config = await loadCliConfig(settings, [], 'test-session', argv);
1970
1941
  expect(config.getTelemetryTarget()).toBe('local');
1971
1942
  });
1972
1943
  it("should treat GEMINI_TELEMETRY_ENABLED='1' as true", async () => {
1973
1944
  vi.stubEnv('GEMINI_TELEMETRY_ENABLED', '1');
1974
1945
  process.argv = ['node', 'script.js'];
1975
1946
  const argv = await parseArguments({});
1976
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1947
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1977
1948
  expect(config.getTelemetryEnabled()).toBe(true);
1978
1949
  });
1979
1950
  it("should treat GEMINI_TELEMETRY_ENABLED='0' as false", async () => {
1980
1951
  vi.stubEnv('GEMINI_TELEMETRY_ENABLED', '0');
1981
1952
  process.argv = ['node', 'script.js'];
1982
1953
  const argv = await parseArguments({});
1983
- const config = await loadCliConfig({ telemetry: { enabled: true } }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1954
+ const config = await loadCliConfig({ telemetry: { enabled: true } }, [], 'test-session', argv);
1984
1955
  expect(config.getTelemetryEnabled()).toBe(false);
1985
1956
  });
1986
1957
  it("should treat GEMINI_TELEMETRY_LOG_PROMPTS='1' as true", async () => {
1987
1958
  vi.stubEnv('GEMINI_TELEMETRY_LOG_PROMPTS', '1');
1988
1959
  process.argv = ['node', 'script.js'];
1989
1960
  const argv = await parseArguments({});
1990
- const config = await loadCliConfig({}, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1961
+ const config = await loadCliConfig({}, [], 'test-session', argv);
1991
1962
  expect(config.getTelemetryLogPromptsEnabled()).toBe(true);
1992
1963
  });
1993
1964
  it("should treat GEMINI_TELEMETRY_LOG_PROMPTS='false' as false", async () => {
1994
1965
  vi.stubEnv('GEMINI_TELEMETRY_LOG_PROMPTS', 'false');
1995
1966
  process.argv = ['node', 'script.js'];
1996
1967
  const argv = await parseArguments({});
1997
- const config = await loadCliConfig({ telemetry: { logPrompts: true } }, [], new ExtensionEnablementManager(argv.extensions), 'test-session', argv);
1968
+ const config = await loadCliConfig({ telemetry: { logPrompts: true } }, [], 'test-session', argv);
1998
1969
  expect(config.getTelemetryLogPromptsEnabled()).toBe(false);
1999
1970
  });
2000
1971
  });