From ec0cb327b2a41afc248f916904aa9e18a4532614 Mon Sep 17 00:00:00 2001 From: Devnil434 Date: Thu, 26 Feb 2026 19:13:38 +0530 Subject: [PATCH 1/4] fix(policy): enforce ask_user as DENY in headless/non-interactive mode In non-interactive (headless) mode, policy rules with decision=ask_user should be treated as DENY since there is no user to ask. The getExcludedTools() method in PolicyEngine was computing which tools to hide from the LLM, but was not applying the nonInteractive mode conversion. This caused tools like run_shell_command to remain available even when a policy rule marked them as ask_user. Fix: apply applyNonInteractiveMode() when determining the effective policy decision in getExcludedTools(), so ask_user becomes DENY in headless mode. Also adds an integration test (policy_repro.test.ts) that verifies tools marked ask_user are blocked (not successfully executed) when the CLI runs headlessly with -p/--policy flags. Fixes #19773 --- integration-tests/policy_repro.responses | 2 + integration-tests/policy_repro.test.ts | 87 +++++++++++++++++++++++ packages/core/src/policy/policy-engine.ts | 4 +- 3 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 integration-tests/policy_repro.responses create mode 100644 integration-tests/policy_repro.test.ts diff --git a/integration-tests/policy_repro.responses b/integration-tests/policy_repro.responses new file mode 100644 index 00000000000..155d92eeacf --- /dev/null +++ b/integration-tests/policy_repro.responses @@ -0,0 +1,2 @@ +{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"run_shell_command","args":{"command":"echo policy-test-passed"}}}]},"finishReason":"STOP","index":0}]}]} +{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I was unable to run the command because it was blocked by policy."}]},"finishReason":"STOP","index":0}]}]} diff --git a/integration-tests/policy_repro.test.ts b/integration-tests/policy_repro.test.ts new file mode 100644 index 00000000000..26e5b0c4988 --- /dev/null +++ b/integration-tests/policy_repro.test.ts @@ -0,0 +1,87 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; +import { TestRig, printDebugInfo } from './test-helper.js'; +import * as path from 'node:path'; + +describe('Headless Policy Reproduction', () => { + let rig: TestRig; + + beforeEach(() => { + rig = new TestRig(); + vi.stubEnv('GEMINI_API_KEY', 'fake-key'); + }); + + afterEach(async () => { + await rig.cleanup(); + vi.unstubAllEnvs(); + }); + + it('should block tools that require ask_user confirmation in headless mode', async () => { + // 1. Setup the rig with fake responses + const responsesPath = path.resolve(__dirname, 'policy_repro.responses'); + await rig.setup( + 'should block tools that require ask_user confirmation in headless mode', + { + fakeResponsesPath: responsesPath, + settings: { + model: { + name: 'gemini-1.5-pro', + }, + }, + }, + ); + + // 2. Create a policy file with ask_user for run_shell_command. + // In headless/non-interactive mode, ask_user decisions must be converted to DENY, + // preventing the tool from executing. + const policyContent = ` +[[rule]] +toolName = "run_shell_command" +decision = "ask_user" +priority = 999 + `; + const policyPath = rig.createFile('ask-shell.toml', policyContent); + const prompt = 'Run "echo policy-test-passed" and show me the output'; + + const result = await rig.run({ + args: ['-p', prompt, '--policy', policyPath], + env: { + GEMINI_DEBUG: '1', + VERBOSE: 'true', + }, + }); + + // 3. Wait for any tool call attempt (the tool will be attempted but should fail with error). + // waitForToolCall returns true even for failed/errored calls. + await rig.waitForToolCall('run_shell_command'); + + // 4. Check the tool call was NOT successful. + const toolLogs = rig.readToolLogs(); + const shellCommandLog = toolLogs.find( + (log) => log.toolRequest.name === 'run_shell_command', + ); + + if (!shellCommandLog || shellCommandLog.toolRequest.success) { + console.log('CLI Result:', result); + printDebugInfo(rig, result, { + 'Tool log entry': shellCommandLog, + 'Policy path': policyPath, + 'Result contains blocked string': result.includes('policy-test-passed'), + }); + } + + // The tool call should have been attempted but blocked (not successful). + expect( + shellCommandLog?.toolRequest.success, + 'Expected run_shell_command to be BLOCKED by policy in headless mode (success should be false)', + ).toBe(false); + + // The actual command result should not appear in the output. + expect(result).not.toContain('policy-test-passed'); + }, 30000); +}); diff --git a/packages/core/src/policy/policy-engine.ts b/packages/core/src/policy/policy-engine.ts index 353cdae9c14..4a8049f2bbe 100644 --- a/packages/core/src/policy/policy-engine.ts +++ b/packages/core/src/policy/policy-engine.ts @@ -617,9 +617,9 @@ export class PolicyEngine { // Determine decision let decision: PolicyDecision; if (globalVerdict !== undefined) { - decision = globalVerdict; + decision = this.applyNonInteractiveMode(globalVerdict); } else { - decision = rule.decision; + decision = this.applyNonInteractiveMode(rule.decision); } if (decision === PolicyDecision.DENY) { From 40baf6f470132469b9691c25d3fb69c03655bf8a Mon Sep 17 00:00:00 2001 From: Devnil434 Date: Thu, 26 Feb 2026 22:24:42 +0530 Subject: [PATCH 2/4] fix(core): correct policy bypass vulnerability for global rules in headless mode --- debug_registration.txt | 366 +++ initialized.txt | 1 + integration-tests/policy_repro.test.ts | 61 + .../cli/src/config/settings-validation.d.ts | 32 + packages/cli/src/config/settings.d.ts | 193 ++ packages/cli/src/config/settingsSchema.d.ts | 2019 +++++++++++++++++ packages/cli/src/config/trustedFolders.d.ts | 75 + packages/cli/src/ui/constants.d.ts | 31 + packages/cli/src/ui/themes/color-utils.d.ts | 81 + packages/cli/src/ui/themes/default-light.d.ts | 7 + packages/cli/src/ui/themes/default.d.ts | 7 + .../cli/src/ui/themes/semantic-tokens.d.ts | 38 + packages/cli/src/ui/themes/theme.d.ts | 115 + packages/cli/src/ui/types.d.ts | 432 ++++ packages/cli/src/ui/utils/textUtils.d.ts | 67 + packages/cli/src/utils/commentJson.d.ts | 12 + packages/cli/src/utils/deepMerge.d.ts | 19 + packages/cli/src/utils/envVarResolver.d.ts | 45 + packages/cli/src/utils/sessionCleanup.d.ts | 54 + packages/cli/src/utils/sessionUtils.d.ts | 205 ++ packages/cli/tsc_output.txt | Bin 0 -> 2128 bytes packages/cli/tsc_output_utf8.txt | 9 + packages/core/src/policy/policy-engine.ts | 4 +- test_output.txt | 79 + 24 files changed, 3951 insertions(+), 1 deletion(-) create mode 100644 debug_registration.txt create mode 100644 initialized.txt create mode 100644 packages/cli/src/config/settings-validation.d.ts create mode 100644 packages/cli/src/config/settings.d.ts create mode 100644 packages/cli/src/config/settingsSchema.d.ts create mode 100644 packages/cli/src/config/trustedFolders.d.ts create mode 100644 packages/cli/src/ui/constants.d.ts create mode 100644 packages/cli/src/ui/themes/color-utils.d.ts create mode 100644 packages/cli/src/ui/themes/default-light.d.ts create mode 100644 packages/cli/src/ui/themes/default.d.ts create mode 100644 packages/cli/src/ui/themes/semantic-tokens.d.ts create mode 100644 packages/cli/src/ui/themes/theme.d.ts create mode 100644 packages/cli/src/ui/types.d.ts create mode 100644 packages/cli/src/ui/utils/textUtils.d.ts create mode 100644 packages/cli/src/utils/commentJson.d.ts create mode 100644 packages/cli/src/utils/deepMerge.d.ts create mode 100644 packages/cli/src/utils/envVarResolver.d.ts create mode 100644 packages/cli/src/utils/sessionCleanup.d.ts create mode 100644 packages/cli/src/utils/sessionUtils.d.ts create mode 100644 packages/cli/tsc_output.txt create mode 100644 packages/cli/tsc_output_utf8.txt create mode 100644 test_output.txt diff --git a/debug_registration.txt b/debug_registration.txt new file mode 100644 index 00000000000..a7c87b52a15 --- /dev/null +++ b/debug_registration.txt @@ -0,0 +1,366 @@ +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] Registering tool: list_directory +[DEBUG] Registering tool: read_file +[DEBUG] Registering tool: grep_search +[DEBUG] Registering tool: glob +[DEBUG] Registering tool: activate_skill +[DEBUG] Registering tool: replace +[DEBUG] Registering tool: write_file +[DEBUG] Registering tool: web_fetch +[DEBUG] Registering tool: run_shell_command +[DEBUG] Registering tool: save_memory +[DEBUG] Registering tool: google_web_search +[DEBUG] Registering tool: AskUserTool +[DEBUG] Registering tool: write_todos +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] Registering tool: list_directory +[DEBUG] Registering tool: read_file +[DEBUG] Registering tool: grep_search +[DEBUG] Registering tool: glob +[DEBUG] Registering tool: activate_skill +[DEBUG] Registering tool: replace +[DEBUG] Registering tool: write_file +[DEBUG] Registering tool: web_fetch +[DEBUG] Registering tool: run_shell_command +[DEBUG] Registering tool: save_memory +[DEBUG] Registering tool: google_web_search +[DEBUG] Registering tool: AskUserTool +[DEBUG] Registering tool: write_todos +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 +[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 + [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml + [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml + [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml + [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml + [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml + [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml + [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml + [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml + [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml + [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml +[DEBUG] Registering tool: list_directory +[DEBUG] Registering tool: read_file +[DEBUG] Registering tool: grep_search +[DEBUG] Registering tool: glob +[DEBUG] Registering tool: activate_skill +[DEBUG] Registering tool: replace +[DEBUG] Registering tool: write_file +[DEBUG] Registering tool: web_fetch +[DEBUG] Registering tool: run_shell_command +[DEBUG] Registering tool: save_memory +[DEBUG] Registering tool: google_web_search +[DEBUG] Registering tool: AskUserTool +[DEBUG] Registering tool: write_todos +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user +[DEBUG] getExcludeTools returning: run_shell_command, ask_user diff --git a/initialized.txt b/initialized.txt new file mode 100644 index 00000000000..d137faeaab2 --- /dev/null +++ b/initialized.txt @@ -0,0 +1 @@ +Config._initialize started diff --git a/integration-tests/policy_repro.test.ts b/integration-tests/policy_repro.test.ts index 26e5b0c4988..e91d780e693 100644 --- a/integration-tests/policy_repro.test.ts +++ b/integration-tests/policy_repro.test.ts @@ -84,4 +84,65 @@ priority = 999 // The actual command result should not appear in the output. expect(result).not.toContain('policy-test-passed'); }, 30000); + + it('should treat global ask_user decisions as DENY in headless mode', async () => { + // 1. Setup the rig with fake responses + const responsesPath = path.resolve(__dirname, 'policy_repro.responses'); + await rig.setup( + 'should treat global ask_user decisions as DENY in headless mode', + { + fakeResponsesPath: responsesPath, + settings: { + model: { + name: 'gemini-1.5-pro', + }, + }, + }, + ); + + // 2. Create a global policy file with ask_user. + // In headless/non-interactive mode, ask_user decisions must be converted to DENY. + const policyContent = ` +[[rule]] +decision = "ask_user" +priority = 999 + `; + const policyPath = rig.createFile('global-ask.toml', policyContent); + const prompt = 'Run "echo global-test-passed" and show me the output'; + + const result = await rig.run({ + args: ['-p', prompt, '--policy', policyPath], + env: { + GEMINI_DEBUG: '1', + VERBOSE: 'true', + }, + }); + + // 3. Wait for any tool call attempt. + await rig.waitForToolCall('run_shell_command'); + + // 4. Check the tool call was NOT successful. + const toolLogs = rig.readToolLogs(); + const shellCommandLog = toolLogs.find( + (log) => log.toolRequest.name === 'run_shell_command', + ); + + if (!shellCommandLog || shellCommandLog.toolRequest.success) { + console.log('CLI Result:', result); + printDebugInfo(rig, result, { + 'Tool log entry': shellCommandLog, + 'Policy path': policyPath, + 'Result contains blocked string': result.includes('global-test-passed'), + }); + } + + // The tool call should have been attempted but blocked (not successful). + expect( + shellCommandLog?.toolRequest.success, + 'Expected run_shell_command to be BLOCKED by global policy in headless mode (success should be false)', + ).toBe(false); + + // The actual command result should not appear in the output. + expect(result).not.toContain('global-test-passed'); + }, 30000); }); diff --git a/packages/cli/src/config/settings-validation.d.ts b/packages/cli/src/config/settings-validation.d.ts new file mode 100644 index 00000000000..b9503149559 --- /dev/null +++ b/packages/cli/src/config/settings-validation.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { z } from 'zod'; +export declare const settingsZodSchema: z.ZodObject< + Record, + z.UnknownKeysParam, + z.ZodTypeAny, + { + [x: string]: any; + }, + { + [x: string]: any; + } +>; +/** + * Validates settings data against the Zod schema + */ +export declare function validateSettings(data: unknown): { + success: boolean; + data?: unknown; + error?: z.ZodError; +}; +/** + * Format a Zod error into a helpful error message + */ +export declare function formatValidationError( + error: z.ZodError, + filePath: string, +): string; diff --git a/packages/cli/src/config/settings.d.ts b/packages/cli/src/config/settings.d.ts new file mode 100644 index 00000000000..196cc4deae3 --- /dev/null +++ b/packages/cli/src/config/settings.d.ts @@ -0,0 +1,193 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { type AdminControlsSettings } from '@google/gemini-cli-core'; +import { isWorkspaceTrusted } from './trustedFolders.js'; +import { + type Settings, + type MergedSettings, + type MemoryImportFormat, + type MergeStrategy, + type SettingsSchema, + type SettingDefinition, + getSettingsSchema, +} from './settingsSchema.js'; +export { + type Settings, + type MergedSettings, + type MemoryImportFormat, + type MergeStrategy, + type SettingsSchema, + type SettingDefinition, + getSettingsSchema, +}; +export declare function getMergeStrategyForPath( + path: string[], +): MergeStrategy | undefined; +export declare const USER_SETTINGS_PATH: string; +export declare const USER_SETTINGS_DIR: string; +export declare const DEFAULT_EXCLUDED_ENV_VARS: string[]; +/** + * Sanitizes an environment variable value to prevent shell injection. + * Restricts values to a safe character set: alphanumeric, -, _, ., / + */ +export declare function sanitizeEnvVar(value: string): string; +export declare function getSystemSettingsPath(): string; +export declare function getSystemDefaultsPath(): string; +export type { DnsResolutionOrder } from './settingsSchema.js'; +export declare enum SettingScope { + User = 'User', + Workspace = 'Workspace', + System = 'System', + SystemDefaults = 'SystemDefaults', + Session = 'Session', +} +/** + * A type representing the settings scopes that are supported for LoadedSettings. + */ +export type LoadableSettingScope = + | SettingScope.User + | SettingScope.Workspace + | SettingScope.System + | SettingScope.SystemDefaults; +/** + * A type guard function that checks if `scope` is a loadable settings scope, + * and allows promotion to the `LoadableSettingsScope` type based on the result. + */ +export declare function isLoadableSettingScope( + scope: SettingScope, +): scope is LoadableSettingScope; +export interface CheckpointingSettings { + enabled?: boolean; +} +export interface SummarizeToolOutputSettings { + tokenBudget?: number; +} +export type LoadingPhrasesMode = 'tips' | 'witty' | 'all' | 'off'; +export interface AccessibilitySettings { + /** @deprecated Use ui.loadingPhrases instead. */ + enableLoadingPhrases?: boolean; + screenReader?: boolean; +} +export interface SessionRetentionSettings { + /** Enable automatic session cleanup */ + enabled?: boolean; + /** Maximum age of sessions to keep (e.g., "30d", "7d", "24h", "1w") */ + maxAge?: string; + /** Alternative: Maximum number of sessions to keep (most recent) */ + maxCount?: number; + /** Minimum retention period (safety limit, defaults to "1d") */ + minRetention?: string; + /** INTERNAL: Whether the user has acknowledged the session retention warning */ + warningAcknowledged?: boolean; +} +export interface SettingsError { + message: string; + path: string; + severity: 'error' | 'warning'; +} +export interface SettingsFile { + settings: Settings; + originalSettings: Settings; + path: string; + rawJson?: string; + readOnly?: boolean; +} +export declare function getDefaultsFromSchema( + schema?: SettingsSchema, +): Settings; +export declare function mergeSettings( + system: Settings, + systemDefaults: Settings, + user: Settings, + workspace: Settings, + isTrusted: boolean, +): MergedSettings; +/** + * Creates a fully populated MergedSettings object for testing purposes. + * It merges the provided overrides with the default settings from the schema. + * + * @param overrides Partial settings to override the defaults. + * @returns A complete MergedSettings object. + */ +export declare function createTestMergedSettings( + overrides?: Partial, +): MergedSettings; +/** + * An immutable snapshot of settings state. + * Used with useSyncExternalStore for reactive updates. + */ +export interface LoadedSettingsSnapshot { + system: SettingsFile; + systemDefaults: SettingsFile; + user: SettingsFile; + workspace: SettingsFile; + isTrusted: boolean; + errors: SettingsError[]; + merged: MergedSettings; +} +export declare class LoadedSettings { + constructor( + system: SettingsFile, + systemDefaults: SettingsFile, + user: SettingsFile, + workspace: SettingsFile, + isTrusted: boolean, + errors?: SettingsError[], + ); + readonly system: SettingsFile; + readonly systemDefaults: SettingsFile; + readonly user: SettingsFile; + workspace: SettingsFile; + isTrusted: boolean; + readonly errors: SettingsError[]; + private _workspaceFile; + private _merged; + private _snapshot; + private _remoteAdminSettings; + get merged(): MergedSettings; + setTrusted(isTrusted: boolean): void; + private createEmptyWorkspace; + private computeMergedSettings; + private computeSnapshot; + subscribe(listener: () => void): () => void; + getSnapshot(): LoadedSettingsSnapshot; + forScope(scope: LoadableSettingScope): SettingsFile; + private isPersistable; + setValue(scope: LoadableSettingScope, key: string, value: unknown): void; + setRemoteAdminSettings(remoteSettings: AdminControlsSettings): void; +} +export declare function setUpCloudShellEnvironment( + envFilePath: string | null, + isTrusted: boolean, + isSandboxed: boolean, +): void; +export declare function loadEnvironment( + settings: Settings, + workspaceDir: string, + isWorkspaceTrustedFn?: typeof isWorkspaceTrusted, +): void; +/** + * Loads settings from user and workspace directories. + * Project settings override user settings. + */ +export declare function loadSettings(workspaceDir?: string): LoadedSettings; +/** + * Migrates deprecated settings to their new counterparts. + * + * TODO: After a couple of weeks (around early Feb 2026), we should start removing + * the deprecated settings from the settings files by default. + * + * @returns true if any changes were made and need to be saved. + */ +export declare function migrateDeprecatedSettings( + loadedSettings: LoadedSettings, + removeDeprecated?: boolean, +): boolean; +export declare function saveSettings(settingsFile: SettingsFile): void; +export declare function saveModelChange( + loadedSettings: LoadedSettings, + model: string, +): void; diff --git a/packages/cli/src/config/settingsSchema.d.ts b/packages/cli/src/config/settingsSchema.d.ts new file mode 100644 index 00000000000..b03e8c447b3 --- /dev/null +++ b/packages/cli/src/config/settingsSchema.d.ts @@ -0,0 +1,2019 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { + type MCPServerConfig, + type BugCommandSettings, + type TelemetrySettings, + type AuthType, + type AgentOverride, + type CustomTheme, +} from '@google/gemini-cli-core'; +import type { SessionRetentionSettings } from './settings.js'; +export type SettingsType = + | 'boolean' + | 'string' + | 'number' + | 'array' + | 'object' + | 'enum'; +export type SettingsValue = + | boolean + | string + | number + | string[] + | object + | undefined; +/** + * Setting datatypes that "toggle" through a fixed list of options + * (e.g. an enum or true/false) rather than allowing for free form input + * (like a number or string). + */ +export declare const TOGGLE_TYPES: ReadonlySet; +export interface SettingEnumOption { + value: string | number; + label: string; +} +export interface SettingCollectionDefinition { + type: SettingsType; + description?: string; + properties?: SettingsSchema; + /** Enum type options */ + options?: readonly SettingEnumOption[]; + /** + * Optional reference identifier for generators that emit a `$ref`. + * For example, a JSON schema generator can use this to point to a shared definition. + */ + ref?: string; + /** + * Optional merge strategy for dynamically added properties. + * Used when this collection definition is referenced via additionalProperties. + */ + mergeStrategy?: MergeStrategy; +} +export declare enum MergeStrategy { + REPLACE = 'replace', + CONCAT = 'concat', + UNION = 'union', + SHALLOW_MERGE = 'shallow_merge', +} +export interface SettingDefinition { + type: SettingsType; + label: string; + category: string; + requiresRestart: boolean; + default: SettingsValue; + description?: string; + parentKey?: string; + childKey?: string; + key?: string; + properties?: SettingsSchema; + showInDialog?: boolean; + ignoreInDocs?: boolean; + mergeStrategy?: MergeStrategy; + /** Enum type options */ + options?: readonly SettingEnumOption[]; + /** + * For collection types (e.g. arrays), describes the shape of each item. + */ + items?: SettingCollectionDefinition; + /** + * For map-like objects without explicit `properties`, describes the shape of the values. + */ + additionalProperties?: SettingCollectionDefinition; + /** + * Optional reference identifier for generators that emit a `$ref`. + */ + ref?: string; +} +export interface SettingsSchema { + [key: string]: SettingDefinition; +} +export type MemoryImportFormat = 'tree' | 'flat'; +export type DnsResolutionOrder = 'ipv4first' | 'verbatim'; +/** + * The canonical schema for all settings. + * The structure of this object defines the structure of the `Settings` type. + * `as const` is crucial for TypeScript to infer the most specific types possible. + */ +declare const SETTINGS_SCHEMA: { + readonly mcpServers: { + readonly type: 'object'; + readonly label: 'MCP Servers'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: Record; + readonly description: 'Configuration for MCP servers.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.SHALLOW_MERGE; + readonly additionalProperties: { + readonly type: 'object'; + readonly ref: 'MCPServerConfig'; + }; + }; + readonly policyPaths: { + readonly type: 'array'; + readonly label: 'Policy Paths'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: string[]; + readonly description: 'Additional policy files or directories to load.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + readonly general: { + readonly type: 'object'; + readonly label: 'General'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'General application settings.'; + readonly showInDialog: false; + readonly properties: { + readonly preferredEditor: { + readonly type: 'string'; + readonly label: 'Preferred Editor'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: string | undefined; + readonly description: 'The preferred editor to open files in.'; + readonly showInDialog: false; + }; + readonly vimMode: { + readonly type: 'boolean'; + readonly label: 'Vim Mode'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Enable Vim keybindings'; + readonly showInDialog: true; + }; + readonly defaultApprovalMode: { + readonly type: 'enum'; + readonly label: 'Default Approval Mode'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: 'default'; + readonly description: string; + readonly showInDialog: true; + readonly options: readonly [ + { + readonly value: 'default'; + readonly label: 'Default'; + }, + { + readonly value: 'auto_edit'; + readonly label: 'Auto Edit'; + }, + { + readonly value: 'plan'; + readonly label: 'Plan'; + }, + ]; + }; + readonly devtools: { + readonly type: 'boolean'; + readonly label: 'DevTools'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Enable DevTools inspector on launch.'; + readonly showInDialog: false; + }; + readonly enableAutoUpdate: { + readonly type: 'boolean'; + readonly label: 'Enable Auto Update'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Enable automatic updates.'; + readonly showInDialog: true; + }; + readonly enableAutoUpdateNotification: { + readonly type: 'boolean'; + readonly label: 'Enable Auto Update Notification'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Enable update notification prompts.'; + readonly showInDialog: false; + }; + readonly enableNotifications: { + readonly type: 'boolean'; + readonly label: 'Enable Notifications'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Enable run-event notifications for action-required prompts and session completion. Currently macOS only.'; + readonly showInDialog: true; + }; + readonly checkpointing: { + readonly type: 'object'; + readonly label: 'Checkpointing'; + readonly category: 'General'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Session checkpointing settings.'; + readonly showInDialog: false; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Enable Checkpointing'; + readonly category: 'General'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable session checkpointing for recovery'; + readonly showInDialog: false; + }; + }; + }; + readonly plan: { + readonly type: 'object'; + readonly label: 'Plan'; + readonly category: 'General'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Planning features configuration.'; + readonly showInDialog: false; + readonly properties: { + readonly directory: { + readonly type: 'string'; + readonly label: 'Plan Directory'; + readonly category: 'General'; + readonly requiresRestart: true; + readonly default: string | undefined; + readonly description: 'The directory where planning artifacts are stored. If not specified, defaults to the system temporary directory.'; + readonly showInDialog: true; + }; + }; + }; + readonly enablePromptCompletion: { + readonly type: 'boolean'; + readonly label: 'Enable Prompt Completion'; + readonly category: 'General'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable AI-powered prompt completion suggestions while typing.'; + readonly showInDialog: true; + }; + readonly retryFetchErrors: { + readonly type: 'boolean'; + readonly label: 'Retry Fetch Errors'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Retry on "exception TypeError: fetch failed sending request" errors.'; + readonly showInDialog: false; + }; + readonly debugKeystrokeLogging: { + readonly type: 'boolean'; + readonly label: 'Debug Keystroke Logging'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Enable debug logging of keystrokes to the console.'; + readonly showInDialog: true; + }; + readonly sessionRetention: { + readonly type: 'object'; + readonly label: 'Session Retention'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: SessionRetentionSettings | undefined; + readonly showInDialog: false; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Enable Session Cleanup'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Enable automatic session cleanup'; + readonly showInDialog: true; + }; + readonly maxAge: { + readonly type: 'string'; + readonly label: 'Keep chat history'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: string | undefined; + readonly description: 'Automatically delete chats older than this time period (e.g., "30d", "7d", "24h", "1w")'; + readonly showInDialog: true; + }; + readonly maxCount: { + readonly type: 'number'; + readonly label: 'Max Session Count'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: number | undefined; + readonly description: 'Alternative: Maximum number of sessions to keep (most recent)'; + readonly showInDialog: false; + }; + readonly minRetention: { + readonly type: 'string'; + readonly label: 'Min Retention Period'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: string; + readonly description: `Minimum retention period (safety limit, defaults to "${string}")`; + readonly showInDialog: false; + }; + readonly warningAcknowledged: { + readonly type: 'boolean'; + readonly label: 'Warning Acknowledged'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: false; + readonly showInDialog: false; + readonly description: 'INTERNAL: Whether the user has acknowledged the session retention warning'; + }; + }; + readonly description: 'Settings for automatic session cleanup.'; + }; + }; + }; + readonly output: { + readonly type: 'object'; + readonly label: 'Output'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings for the CLI output.'; + readonly showInDialog: false; + readonly properties: { + readonly format: { + readonly type: 'enum'; + readonly label: 'Output Format'; + readonly category: 'General'; + readonly requiresRestart: false; + readonly default: 'text'; + readonly description: 'The format of the CLI output. Can be `text` or `json`.'; + readonly showInDialog: true; + readonly options: readonly [ + { + readonly value: 'text'; + readonly label: 'Text'; + }, + { + readonly value: 'json'; + readonly label: 'JSON'; + }, + ]; + }; + }; + }; + readonly ui: { + readonly type: 'object'; + readonly label: 'UI'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'User interface settings.'; + readonly showInDialog: false; + readonly properties: { + readonly theme: { + readonly type: 'string'; + readonly label: 'Theme'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: string | undefined; + readonly description: 'The color theme for the UI. See the CLI themes guide for available options.'; + readonly showInDialog: false; + }; + readonly autoThemeSwitching: { + readonly type: 'boolean'; + readonly label: 'Auto Theme Switching'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Automatically switch between default light and dark themes based on terminal background color.'; + readonly showInDialog: true; + }; + readonly terminalBackgroundPollingInterval: { + readonly type: 'number'; + readonly label: 'Terminal Background Polling Interval'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: 60; + readonly description: 'Interval in seconds to poll the terminal background color.'; + readonly showInDialog: true; + }; + readonly customThemes: { + readonly type: 'object'; + readonly label: 'Custom Themes'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: Record; + readonly description: 'Custom theme definitions.'; + readonly showInDialog: false; + readonly additionalProperties: { + readonly type: 'object'; + readonly ref: 'CustomTheme'; + }; + }; + readonly hideWindowTitle: { + readonly type: 'boolean'; + readonly label: 'Hide Window Title'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Hide the window title bar'; + readonly showInDialog: true; + }; + readonly inlineThinkingMode: { + readonly type: 'enum'; + readonly label: 'Inline Thinking'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: 'off'; + readonly description: 'Display model thinking inline: off or full.'; + readonly showInDialog: true; + readonly options: readonly [ + { + readonly value: 'off'; + readonly label: 'Off'; + }, + { + readonly value: 'full'; + readonly label: 'Full'; + }, + ]; + }; + readonly showStatusInTitle: { + readonly type: 'boolean'; + readonly label: 'Show Thoughts in Title'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Show Gemini CLI model thoughts in the terminal window title during the working phase'; + readonly showInDialog: true; + }; + readonly dynamicWindowTitle: { + readonly type: 'boolean'; + readonly label: 'Dynamic Window Title'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Update the terminal window title with current status icons (Ready: ◇, Action Required: ✋, Working: ✦)'; + readonly showInDialog: true; + }; + readonly showHomeDirectoryWarning: { + readonly type: 'boolean'; + readonly label: 'Show Home Directory Warning'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Show a warning when running Gemini CLI in the home directory.'; + readonly showInDialog: true; + }; + readonly showCompatibilityWarnings: { + readonly type: 'boolean'; + readonly label: 'Show Compatibility Warnings'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Show warnings about terminal or OS compatibility issues.'; + readonly showInDialog: true; + }; + readonly hideTips: { + readonly type: 'boolean'; + readonly label: 'Hide Tips'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Hide helpful tips in the UI'; + readonly showInDialog: true; + }; + readonly showShortcutsHint: { + readonly type: 'boolean'; + readonly label: 'Show Shortcuts Hint'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Show the "? for shortcuts" hint above the input.'; + readonly showInDialog: true; + }; + readonly hideBanner: { + readonly type: 'boolean'; + readonly label: 'Hide Banner'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Hide the application banner'; + readonly showInDialog: true; + }; + readonly hideContextSummary: { + readonly type: 'boolean'; + readonly label: 'Hide Context Summary'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Hide the context summary (GEMINI.md, MCP servers) above the input.'; + readonly showInDialog: true; + }; + readonly footer: { + readonly type: 'object'; + readonly label: 'Footer'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings for the footer.'; + readonly showInDialog: false; + readonly properties: { + readonly hideCWD: { + readonly type: 'boolean'; + readonly label: 'Hide CWD'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Hide the current working directory path in the footer.'; + readonly showInDialog: true; + }; + readonly hideSandboxStatus: { + readonly type: 'boolean'; + readonly label: 'Hide Sandbox Status'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Hide the sandbox status indicator in the footer.'; + readonly showInDialog: true; + }; + readonly hideModelInfo: { + readonly type: 'boolean'; + readonly label: 'Hide Model Info'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Hide the model name and context usage in the footer.'; + readonly showInDialog: true; + }; + readonly hideContextPercentage: { + readonly type: 'boolean'; + readonly label: 'Hide Context Window Percentage'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Hides the context window remaining percentage.'; + readonly showInDialog: true; + }; + }; + }; + readonly hideFooter: { + readonly type: 'boolean'; + readonly label: 'Hide Footer'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Hide the footer from the UI'; + readonly showInDialog: true; + }; + readonly showMemoryUsage: { + readonly type: 'boolean'; + readonly label: 'Show Memory Usage'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Display memory usage information in the UI'; + readonly showInDialog: true; + }; + readonly showLineNumbers: { + readonly type: 'boolean'; + readonly label: 'Show Line Numbers'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Show line numbers in the chat.'; + readonly showInDialog: true; + }; + readonly showCitations: { + readonly type: 'boolean'; + readonly label: 'Show Citations'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Show citations for generated text in the chat.'; + readonly showInDialog: true; + }; + readonly showModelInfoInChat: { + readonly type: 'boolean'; + readonly label: 'Show Model Info In Chat'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Show the model name in the chat for each model turn.'; + readonly showInDialog: true; + }; + readonly showUserIdentity: { + readonly type: 'boolean'; + readonly label: 'Show User Identity'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: "Show the logged-in user's identity (e.g. email) in the UI."; + readonly showInDialog: true; + }; + readonly useAlternateBuffer: { + readonly type: 'boolean'; + readonly label: 'Use Alternate Screen Buffer'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Use an alternate screen buffer for the UI, preserving shell history.'; + readonly showInDialog: true; + }; + readonly useBackgroundColor: { + readonly type: 'boolean'; + readonly label: 'Use Background Color'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Whether to use background colors in the UI.'; + readonly showInDialog: true; + }; + readonly incrementalRendering: { + readonly type: 'boolean'; + readonly label: 'Incremental Rendering'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Enable incremental rendering for the UI. This option will reduce flickering but may cause rendering artifacts. Only supported when useAlternateBuffer is enabled.'; + readonly showInDialog: true; + }; + readonly showSpinner: { + readonly type: 'boolean'; + readonly label: 'Show Spinner'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Show the spinner during operations.'; + readonly showInDialog: true; + }; + readonly loadingPhrases: { + readonly type: 'enum'; + readonly label: 'Loading Phrases'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: 'tips'; + readonly description: 'What to show while the model is working: tips, witty comments, both, or nothing.'; + readonly showInDialog: true; + readonly options: readonly [ + { + readonly value: 'tips'; + readonly label: 'Tips'; + }, + { + readonly value: 'witty'; + readonly label: 'Witty'; + }, + { + readonly value: 'all'; + readonly label: 'All'; + }, + { + readonly value: 'off'; + readonly label: 'Off'; + }, + ]; + }; + readonly customWittyPhrases: { + readonly type: 'array'; + readonly label: 'Custom Witty Phrases'; + readonly category: 'UI'; + readonly requiresRestart: false; + readonly default: string[]; + readonly description: string; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + }; + readonly accessibility: { + readonly type: 'object'; + readonly label: 'Accessibility'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Accessibility settings.'; + readonly showInDialog: false; + readonly properties: { + readonly enableLoadingPhrases: { + readonly type: 'boolean'; + readonly label: 'Enable Loading Phrases'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: true; + readonly description: '@deprecated Use ui.loadingPhrases instead. Enable loading phrases during operations.'; + readonly showInDialog: false; + }; + readonly screenReader: { + readonly type: 'boolean'; + readonly label: 'Screen Reader Mode'; + readonly category: 'UI'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Render output in plain-text to be more screen reader accessible'; + readonly showInDialog: true; + }; + }; + }; + }; + }; + readonly ide: { + readonly type: 'object'; + readonly label: 'IDE'; + readonly category: 'IDE'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'IDE integration settings.'; + readonly showInDialog: false; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'IDE Mode'; + readonly category: 'IDE'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable IDE integration mode.'; + readonly showInDialog: true; + }; + readonly hasSeenNudge: { + readonly type: 'boolean'; + readonly label: 'Has Seen IDE Integration Nudge'; + readonly category: 'IDE'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Whether the user has seen the IDE integration nudge.'; + readonly showInDialog: false; + }; + }; + }; + readonly privacy: { + readonly type: 'object'; + readonly label: 'Privacy'; + readonly category: 'Privacy'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Privacy-related settings.'; + readonly showInDialog: false; + readonly properties: { + readonly usageStatisticsEnabled: { + readonly type: 'boolean'; + readonly label: 'Enable Usage Statistics'; + readonly category: 'Privacy'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Enable collection of usage statistics'; + readonly showInDialog: false; + }; + }; + }; + readonly telemetry: { + readonly type: 'object'; + readonly label: 'Telemetry'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: TelemetrySettings | undefined; + readonly description: 'Telemetry configuration.'; + readonly showInDialog: false; + readonly ref: 'TelemetrySettings'; + }; + readonly model: { + readonly type: 'object'; + readonly label: 'Model'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings related to the generative model.'; + readonly showInDialog: false; + readonly properties: { + readonly name: { + readonly type: 'string'; + readonly label: 'Model'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: string | undefined; + readonly description: 'The Gemini model to use for conversations.'; + readonly showInDialog: false; + }; + readonly maxSessionTurns: { + readonly type: 'number'; + readonly label: 'Max Session Turns'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: -1; + readonly description: 'Maximum number of user/model/tool turns to keep in a session. -1 means unlimited.'; + readonly showInDialog: true; + }; + readonly summarizeToolOutput: { + readonly type: 'object'; + readonly label: 'Summarize Tool Output'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: + | Record< + string, + { + tokenBudget?: number; + } + > + | undefined; + readonly description: string; + readonly showInDialog: false; + readonly additionalProperties: { + readonly type: 'object'; + readonly description: 'Per-tool summarization settings with an optional tokenBudget.'; + readonly ref: 'SummarizeToolOutputSettings'; + }; + }; + readonly compressionThreshold: { + readonly type: 'number'; + readonly label: 'Compression Threshold'; + readonly category: 'Model'; + readonly requiresRestart: true; + readonly default: number; + readonly description: 'The fraction of context usage at which to trigger context compression (e.g. 0.2, 0.3).'; + readonly showInDialog: true; + }; + readonly disableLoopDetection: { + readonly type: 'boolean'; + readonly label: 'Disable Loop Detection'; + readonly category: 'Model'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Disable automatic detection and prevention of infinite loops.'; + readonly showInDialog: true; + }; + readonly skipNextSpeakerCheck: { + readonly type: 'boolean'; + readonly label: 'Skip Next Speaker Check'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Skip the next speaker check.'; + readonly showInDialog: true; + }; + }; + }; + readonly modelConfigs: { + readonly type: 'object'; + readonly label: 'Model Configs'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: import('@google/gemini-cli-core/dist/src/services/modelConfigService.js').ModelConfigServiceConfig; + readonly description: 'Model configurations.'; + readonly showInDialog: false; + readonly properties: { + readonly aliases: { + readonly type: 'object'; + readonly label: 'Model Config Aliases'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: Record< + string, + import('@google/gemini-cli-core/dist/src/services/modelConfigService.js').ModelConfigAlias + >; + readonly description: 'Named presets for model configs. Can be used in place of a model name and can inherit from other aliases using an `extends` property.'; + readonly showInDialog: false; + }; + readonly customAliases: { + readonly type: 'object'; + readonly label: 'Custom Model Config Aliases'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Custom named presets for model configs. These are merged with (and override) the built-in aliases.'; + readonly showInDialog: false; + }; + readonly customOverrides: { + readonly type: 'array'; + readonly label: 'Custom Model Config Overrides'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Custom model config overrides. These are merged with (and added to) the built-in overrides.'; + readonly showInDialog: false; + }; + readonly overrides: { + readonly type: 'array'; + readonly label: 'Model Config Overrides'; + readonly category: 'Model'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Apply specific configuration overrides based on matches, with a primary key of model (or alias). The most specific match will be used.'; + readonly showInDialog: false; + }; + }; + }; + readonly agents: { + readonly type: 'object'; + readonly label: 'Agents'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Settings for subagents.'; + readonly showInDialog: false; + readonly properties: { + readonly overrides: { + readonly type: 'object'; + readonly label: 'Agent Overrides'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: Record; + readonly description: 'Override settings for specific agents, e.g. to disable the agent, set a custom model config, or run config.'; + readonly showInDialog: false; + readonly additionalProperties: { + readonly type: 'object'; + readonly ref: 'AgentOverride'; + }; + }; + }; + }; + readonly context: { + readonly type: 'object'; + readonly label: 'Context'; + readonly category: 'Context'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings for managing context provided to the model.'; + readonly showInDialog: false; + readonly properties: { + readonly fileName: { + readonly type: 'string'; + readonly label: 'Context File Name'; + readonly category: 'Context'; + readonly requiresRestart: false; + readonly default: string | string[] | undefined; + readonly ref: 'StringOrStringArray'; + readonly description: 'The name of the context file or files to load into memory. Accepts either a single string or an array of strings.'; + readonly showInDialog: false; + }; + readonly importFormat: { + readonly type: 'string'; + readonly label: 'Memory Import Format'; + readonly category: 'Context'; + readonly requiresRestart: false; + readonly default: MemoryImportFormat | undefined; + readonly description: 'The format to use when importing memory.'; + readonly showInDialog: false; + }; + readonly includeDirectoryTree: { + readonly type: 'boolean'; + readonly label: 'Include Directory Tree'; + readonly category: 'Context'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Whether to include the directory tree of the current working directory in the initial request to the model.'; + readonly showInDialog: false; + }; + readonly discoveryMaxDirs: { + readonly type: 'number'; + readonly label: 'Memory Discovery Max Dirs'; + readonly category: 'Context'; + readonly requiresRestart: false; + readonly default: 200; + readonly description: 'Maximum number of directories to search for memory.'; + readonly showInDialog: true; + }; + readonly includeDirectories: { + readonly type: 'array'; + readonly label: 'Include Directories'; + readonly category: 'Context'; + readonly requiresRestart: false; + readonly default: string[]; + readonly description: string; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly loadMemoryFromIncludeDirectories: { + readonly type: 'boolean'; + readonly label: 'Load Memory From Include Directories'; + readonly category: 'Context'; + readonly requiresRestart: false; + readonly default: false; + readonly description: string; + readonly showInDialog: true; + }; + readonly fileFiltering: { + readonly type: 'object'; + readonly label: 'File Filtering'; + readonly category: 'Context'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Settings for git-aware file filtering.'; + readonly showInDialog: false; + readonly properties: { + readonly respectGitIgnore: { + readonly type: 'boolean'; + readonly label: 'Respect .gitignore'; + readonly category: 'Context'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Respect .gitignore files when searching.'; + readonly showInDialog: true; + }; + readonly respectGeminiIgnore: { + readonly type: 'boolean'; + readonly label: 'Respect .geminiignore'; + readonly category: 'Context'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Respect .geminiignore files when searching.'; + readonly showInDialog: true; + }; + readonly enableRecursiveFileSearch: { + readonly type: 'boolean'; + readonly label: 'Enable Recursive File Search'; + readonly category: 'Context'; + readonly requiresRestart: true; + readonly default: true; + readonly description: string; + readonly showInDialog: true; + }; + readonly enableFuzzySearch: { + readonly type: 'boolean'; + readonly label: 'Enable Fuzzy Search'; + readonly category: 'Context'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Enable fuzzy search when searching for files.'; + readonly showInDialog: true; + }; + readonly customIgnoreFilePaths: { + readonly type: 'array'; + readonly label: 'Custom Ignore File Paths'; + readonly category: 'Context'; + readonly requiresRestart: true; + readonly default: string[]; + readonly description: 'Additional ignore file paths to respect. These files take precedence over .geminiignore and .gitignore. Files earlier in the array take precedence over files later in the array, e.g. the first file takes precedence over the second one.'; + readonly showInDialog: true; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + }; + }; + }; + }; + readonly tools: { + readonly type: 'object'; + readonly label: 'Tools'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Settings for built-in and custom tools.'; + readonly showInDialog: false; + readonly properties: { + readonly sandbox: { + readonly type: 'string'; + readonly label: 'Sandbox'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: boolean | string | undefined; + readonly ref: 'BooleanOrString'; + readonly description: string; + readonly showInDialog: false; + }; + readonly shell: { + readonly type: 'object'; + readonly label: 'Shell'; + readonly category: 'Tools'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings for shell execution.'; + readonly showInDialog: false; + readonly properties: { + readonly enableInteractiveShell: { + readonly type: 'boolean'; + readonly label: 'Enable Interactive Shell'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: true; + readonly description: string; + readonly showInDialog: true; + }; + readonly pager: { + readonly type: 'string'; + readonly label: 'Pager'; + readonly category: 'Tools'; + readonly requiresRestart: false; + readonly default: string | undefined; + readonly description: 'The pager command to use for shell output. Defaults to `cat`.'; + readonly showInDialog: false; + }; + readonly showColor: { + readonly type: 'boolean'; + readonly label: 'Show Color'; + readonly category: 'Tools'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Show color in shell output.'; + readonly showInDialog: true; + }; + readonly inactivityTimeout: { + readonly type: 'number'; + readonly label: 'Inactivity Timeout'; + readonly category: 'Tools'; + readonly requiresRestart: false; + readonly default: 300; + readonly description: 'The maximum time in seconds allowed without output from the shell command. Defaults to 5 minutes.'; + readonly showInDialog: false; + }; + readonly enableShellOutputEfficiency: { + readonly type: 'boolean'; + readonly label: 'Enable Shell Output Efficiency'; + readonly category: 'Tools'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Enable shell output efficiency optimizations for better performance.'; + readonly showInDialog: false; + }; + }; + }; + readonly core: { + readonly type: 'array'; + readonly label: 'Core Tools'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: string[] | undefined; + readonly description: string; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + }; + readonly allowed: { + readonly type: 'array'; + readonly label: 'Allowed Tools'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: string[] | undefined; + readonly description: string; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + }; + readonly exclude: { + readonly type: 'array'; + readonly label: 'Exclude Tools'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: string[] | undefined; + readonly description: 'Tool names to exclude from discovery.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + readonly discoveryCommand: { + readonly type: 'string'; + readonly label: 'Tool Discovery Command'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: string | undefined; + readonly description: 'Command to run for tool discovery.'; + readonly showInDialog: false; + }; + readonly callCommand: { + readonly type: 'string'; + readonly label: 'Tool Call Command'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: string | undefined; + readonly description: string; + readonly showInDialog: false; + }; + readonly useRipgrep: { + readonly type: 'boolean'; + readonly label: 'Use Ripgrep'; + readonly category: 'Tools'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance.'; + readonly showInDialog: true; + }; + readonly truncateToolOutputThreshold: { + readonly type: 'number'; + readonly label: 'Tool Output Truncation Threshold'; + readonly category: 'General'; + readonly requiresRestart: true; + readonly default: 40000; + readonly description: 'Maximum characters to show when truncating large tool outputs. Set to 0 or negative to disable truncation.'; + readonly showInDialog: true; + }; + readonly disableLLMCorrection: { + readonly type: 'boolean'; + readonly label: 'Disable LLM Correction'; + readonly category: 'Tools'; + readonly requiresRestart: true; + readonly default: true; + readonly description: string; + readonly showInDialog: true; + }; + }; + }; + readonly mcp: { + readonly type: 'object'; + readonly label: 'MCP'; + readonly category: 'MCP'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Settings for Model Context Protocol (MCP) servers.'; + readonly showInDialog: false; + readonly properties: { + readonly serverCommand: { + readonly type: 'string'; + readonly label: 'MCP Server Command'; + readonly category: 'MCP'; + readonly requiresRestart: true; + readonly default: string | undefined; + readonly description: 'Command to start an MCP server.'; + readonly showInDialog: false; + }; + readonly allowed: { + readonly type: 'array'; + readonly label: 'Allow MCP Servers'; + readonly category: 'MCP'; + readonly requiresRestart: true; + readonly default: string[] | undefined; + readonly description: 'A list of MCP servers to allow.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + }; + readonly excluded: { + readonly type: 'array'; + readonly label: 'Exclude MCP Servers'; + readonly category: 'MCP'; + readonly requiresRestart: true; + readonly default: string[] | undefined; + readonly description: 'A list of MCP servers to exclude.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + }; + }; + }; + readonly useWriteTodos: { + readonly type: 'boolean'; + readonly label: 'Use WriteTodos'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Enable the write_todos tool.'; + readonly showInDialog: false; + }; + readonly security: { + readonly type: 'object'; + readonly label: 'Security'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Security-related settings.'; + readonly showInDialog: false; + readonly properties: { + readonly disableYoloMode: { + readonly type: 'boolean'; + readonly label: 'Disable YOLO Mode'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Disable YOLO mode, even if enabled by a flag.'; + readonly showInDialog: true; + }; + readonly enablePermanentToolApproval: { + readonly type: 'boolean'; + readonly label: 'Allow Permanent Tool Approval'; + readonly category: 'Security'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Enable the "Allow for all future sessions" option in tool confirmation dialogs.'; + readonly showInDialog: true; + }; + readonly blockGitExtensions: { + readonly type: 'boolean'; + readonly label: 'Blocks extensions from Git'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Blocks installing and loading extensions from Git.'; + readonly showInDialog: true; + }; + readonly allowedExtensions: { + readonly type: 'array'; + readonly label: 'Extension Source Regex Allowlist'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: string[]; + readonly description: 'List of Regex patterns for allowed extensions. If nonempty, only extensions that match the patterns in this list are allowed. Overrides the blockGitExtensions setting.'; + readonly showInDialog: true; + readonly items: { + readonly type: 'string'; + }; + }; + readonly folderTrust: { + readonly type: 'object'; + readonly label: 'Folder Trust'; + readonly category: 'Security'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings for folder trust.'; + readonly showInDialog: false; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Folder Trust'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Setting to track whether Folder trust is enabled.'; + readonly showInDialog: true; + }; + }; + }; + readonly environmentVariableRedaction: { + readonly type: 'object'; + readonly label: 'Environment Variable Redaction'; + readonly category: 'Security'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings for environment variable redaction.'; + readonly showInDialog: false; + readonly properties: { + readonly allowed: { + readonly type: 'array'; + readonly label: 'Allowed Environment Variables'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: string[]; + readonly description: 'Environment variables to always allow (bypass redaction).'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + }; + readonly blocked: { + readonly type: 'array'; + readonly label: 'Blocked Environment Variables'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: string[]; + readonly description: 'Environment variables to always redact.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + }; + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Enable Environment Variable Redaction'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable redaction of environment variables that may contain secrets.'; + readonly showInDialog: true; + }; + }; + }; + readonly auth: { + readonly type: 'object'; + readonly label: 'Authentication'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Authentication settings.'; + readonly showInDialog: false; + readonly properties: { + readonly selectedType: { + readonly type: 'string'; + readonly label: 'Selected Auth Type'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: AuthType | undefined; + readonly description: 'The currently selected authentication type.'; + readonly showInDialog: false; + }; + readonly enforcedType: { + readonly type: 'string'; + readonly label: 'Enforced Auth Type'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: AuthType | undefined; + readonly description: 'The required auth type. If this does not match the selected auth type, the user will be prompted to re-authenticate.'; + readonly showInDialog: false; + }; + readonly useExternal: { + readonly type: 'boolean'; + readonly label: 'Use External Auth'; + readonly category: 'Security'; + readonly requiresRestart: true; + readonly default: boolean | undefined; + readonly description: 'Whether to use an external authentication flow.'; + readonly showInDialog: false; + }; + }; + }; + }; + }; + readonly advanced: { + readonly type: 'object'; + readonly label: 'Advanced'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Advanced settings for power users.'; + readonly showInDialog: false; + readonly properties: { + readonly autoConfigureMemory: { + readonly type: 'boolean'; + readonly label: 'Auto Configure Max Old Space Size'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Automatically configure Node.js memory limits'; + readonly showInDialog: true; + }; + readonly dnsResolutionOrder: { + readonly type: 'string'; + readonly label: 'DNS Resolution Order'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: DnsResolutionOrder | undefined; + readonly description: 'The DNS resolution order.'; + readonly showInDialog: false; + }; + readonly excludedEnvVars: { + readonly type: 'array'; + readonly label: 'Excluded Project Environment Variables'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: string[]; + readonly description: 'Environment variables to exclude from project context.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + readonly bugCommand: { + readonly type: 'object'; + readonly label: 'Bug Command'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: BugCommandSettings | undefined; + readonly description: 'Configuration for the bug report command.'; + readonly showInDialog: false; + readonly ref: 'BugCommandSettings'; + }; + }; + }; + readonly experimental: { + readonly type: 'object'; + readonly label: 'Experimental'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Setting to enable experimental features'; + readonly showInDialog: false; + readonly properties: { + readonly toolOutputMasking: { + readonly type: 'object'; + readonly label: 'Tool Output Masking'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly ignoreInDocs: false; + readonly default: {}; + readonly description: 'Advanced settings for tool output masking to manage context window efficiency.'; + readonly showInDialog: false; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Enable Tool Output Masking'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Enables tool output masking to save tokens.'; + readonly showInDialog: true; + }; + readonly toolProtectionThreshold: { + readonly type: 'number'; + readonly label: 'Tool Protection Threshold'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: 50000; + readonly description: 'Minimum number of tokens to protect from masking (most recent tool outputs).'; + readonly showInDialog: false; + }; + readonly minPrunableTokensThreshold: { + readonly type: 'number'; + readonly label: 'Min Prunable Tokens Threshold'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: 30000; + readonly description: 'Minimum prunable tokens required to trigger a masking pass.'; + readonly showInDialog: false; + }; + readonly protectLatestTurn: { + readonly type: 'boolean'; + readonly label: 'Protect Latest Turn'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Ensures the absolute latest turn is never masked, regardless of token count.'; + readonly showInDialog: false; + }; + }; + }; + readonly enableAgents: { + readonly type: 'boolean'; + readonly label: 'Enable Agents'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable local and remote subagents. Warning: Experimental feature, uses YOLO mode for subagents'; + readonly showInDialog: false; + }; + readonly extensionManagement: { + readonly type: 'boolean'; + readonly label: 'Extension Management'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Enable extension management features.'; + readonly showInDialog: false; + }; + readonly extensionConfig: { + readonly type: 'boolean'; + readonly label: 'Extension Configuration'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Enable requesting and fetching of extension settings.'; + readonly showInDialog: false; + }; + readonly extensionRegistry: { + readonly type: 'boolean'; + readonly label: 'Extension Registry Explore UI'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable extension registry explore UI.'; + readonly showInDialog: false; + }; + readonly extensionReloading: { + readonly type: 'boolean'; + readonly label: 'Extension Reloading'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enables extension loading/unloading within the CLI session.'; + readonly showInDialog: false; + }; + readonly jitContext: { + readonly type: 'boolean'; + readonly label: 'JIT Context Loading'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable Just-In-Time (JIT) context loading.'; + readonly showInDialog: false; + }; + readonly useOSC52Paste: { + readonly type: 'boolean'; + readonly label: 'Use OSC 52 Paste'; + readonly category: 'Experimental'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Use OSC 52 for pasting. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it).'; + readonly showInDialog: true; + }; + readonly useOSC52Copy: { + readonly type: 'boolean'; + readonly label: 'Use OSC 52 Copy'; + readonly category: 'Experimental'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Use OSC 52 for copying. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it).'; + readonly showInDialog: true; + }; + readonly plan: { + readonly type: 'boolean'; + readonly label: 'Plan'; + readonly category: 'Experimental'; + readonly requiresRestart: true; + readonly default: false; + readonly description: 'Enable planning features (Plan Mode and tools).'; + readonly showInDialog: true; + }; + readonly modelSteering: { + readonly type: 'boolean'; + readonly label: 'Model Steering'; + readonly category: 'Experimental'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'Enable model steering (user hints) to guide the model during tool execution.'; + readonly showInDialog: true; + }; + }; + }; + readonly extensions: { + readonly type: 'object'; + readonly label: 'Extensions'; + readonly category: 'Extensions'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Settings for extensions.'; + readonly showInDialog: false; + readonly properties: { + readonly disabled: { + readonly type: 'array'; + readonly label: 'Disabled Extensions'; + readonly category: 'Extensions'; + readonly requiresRestart: true; + readonly default: string[]; + readonly description: 'List of disabled extensions.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + readonly workspacesWithMigrationNudge: { + readonly type: 'array'; + readonly label: 'Workspaces with Migration Nudge'; + readonly category: 'Extensions'; + readonly requiresRestart: false; + readonly default: string[]; + readonly description: 'List of workspaces for which the migration nudge has been shown.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + }; + }; + readonly skills: { + readonly type: 'object'; + readonly label: 'Skills'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: {}; + readonly description: 'Settings for agent skills.'; + readonly showInDialog: false; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Enable Agent Skills'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Enable Agent Skills.'; + readonly showInDialog: true; + }; + readonly disabled: { + readonly type: 'array'; + readonly label: 'Disabled Skills'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: string[]; + readonly description: 'List of disabled skills.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + }; + }; + readonly hooksConfig: { + readonly type: 'object'; + readonly label: 'HooksConfig'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Hook configurations for intercepting and customizing agent behavior.'; + readonly showInDialog: false; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Enable Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: true; + readonly default: true; + readonly description: 'Canonical toggle for the hooks system. When disabled, no hooks will be executed.'; + readonly showInDialog: true; + }; + readonly disabled: { + readonly type: 'array'; + readonly label: 'Disabled Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: string[]; + readonly description: 'List of hook names (commands) that should be disabled. Hooks in this list will not execute even if configured.'; + readonly showInDialog: false; + readonly items: { + readonly type: 'string'; + readonly description: 'Hook command name'; + }; + readonly mergeStrategy: MergeStrategy.UNION; + }; + readonly notifications: { + readonly type: 'boolean'; + readonly label: 'Hook Notifications'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'Show visual indicators when hooks are executing.'; + readonly showInDialog: true; + }; + }; + }; + readonly hooks: { + readonly type: 'object'; + readonly label: 'Hook Events'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Event-specific hook configurations.'; + readonly showInDialog: false; + readonly properties: { + readonly BeforeTool: { + readonly type: 'array'; + readonly label: 'Before Tool Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute before tool execution. Can intercept, validate, or modify tool calls.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly AfterTool: { + readonly type: 'array'; + readonly label: 'After Tool Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute after tool execution. Can process results, log outputs, or trigger follow-up actions.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly BeforeAgent: { + readonly type: 'array'; + readonly label: 'Before Agent Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute before agent loop starts. Can set up context or initialize resources.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly AfterAgent: { + readonly type: 'array'; + readonly label: 'After Agent Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute after agent loop completes. Can perform cleanup or summarize results.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly Notification: { + readonly type: 'array'; + readonly label: 'Notification Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute on notification events (errors, warnings, info). Can log or alert on specific conditions.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly SessionStart: { + readonly type: 'array'; + readonly label: 'Session Start Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute when a session starts. Can initialize session-specific resources or state.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly SessionEnd: { + readonly type: 'array'; + readonly label: 'Session End Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute when a session ends. Can perform cleanup or persist session data.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly PreCompress: { + readonly type: 'array'; + readonly label: 'Pre-Compress Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute before chat history compression. Can back up or analyze conversation before compression.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly BeforeModel: { + readonly type: 'array'; + readonly label: 'Before Model Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute before LLM requests. Can modify prompts, inject context, or control model parameters.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly AfterModel: { + readonly type: 'array'; + readonly label: 'After Model Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute after LLM responses. Can process outputs, extract information, or log interactions.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + readonly BeforeToolSelection: { + readonly type: 'array'; + readonly label: 'Before Tool Selection Hooks'; + readonly category: 'Advanced'; + readonly requiresRestart: false; + readonly default: []; + readonly description: 'Hooks that execute before tool selection. Can filter or prioritize available tools dynamically.'; + readonly showInDialog: false; + readonly ref: 'HookDefinitionArray'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + }; + readonly additionalProperties: { + readonly type: 'array'; + readonly description: 'Custom hook event arrays that contain hook definitions for user-defined events'; + readonly mergeStrategy: MergeStrategy.CONCAT; + }; + }; + readonly admin: { + readonly type: 'object'; + readonly label: 'Admin'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Settings configured remotely by enterprise admins.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + readonly properties: { + readonly secureModeEnabled: { + readonly type: 'boolean'; + readonly label: 'Secure Mode Enabled'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: false; + readonly description: 'If true, disallows yolo mode from being used.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + }; + readonly extensions: { + readonly type: 'object'; + readonly label: 'Extensions Settings'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Extensions-specific admin settings.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Extensions Enabled'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'If false, disallows extensions from being installed or used.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + }; + }; + }; + readonly mcp: { + readonly type: 'object'; + readonly label: 'MCP Settings'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'MCP-specific admin settings.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'MCP Enabled'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'If false, disallows MCP servers from being used.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + }; + readonly config: { + readonly type: 'object'; + readonly label: 'MCP Config'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: Record; + readonly description: 'Admin-configured MCP servers.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + readonly additionalProperties: { + readonly type: 'object'; + readonly ref: 'MCPServerConfig'; + }; + }; + }; + }; + readonly skills: { + readonly type: 'object'; + readonly label: 'Skills Settings'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: {}; + readonly description: 'Agent Skills-specific admin settings.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + readonly properties: { + readonly enabled: { + readonly type: 'boolean'; + readonly label: 'Skills Enabled'; + readonly category: 'Admin'; + readonly requiresRestart: false; + readonly default: true; + readonly description: 'If false, disallows agent skills from being used.'; + readonly showInDialog: false; + readonly mergeStrategy: MergeStrategy.REPLACE; + }; + }; + }; + }; + }; +}; +export type SettingsSchemaType = typeof SETTINGS_SCHEMA; +export type SettingsJsonSchemaDefinition = Record; +export declare const SETTINGS_SCHEMA_DEFINITIONS: Record< + string, + SettingsJsonSchemaDefinition +>; +export declare function getSettingsSchema(): SettingsSchemaType; +type InferSettings = { + -readonly [K in keyof T]?: T[K] extends { + properties: SettingsSchema; + } + ? InferSettings + : T[K]['type'] extends 'enum' + ? T[K]['options'] extends readonly SettingEnumOption[] + ? T[K]['options'][number]['value'] + : T[K]['default'] + : T[K]['default'] extends boolean + ? boolean + : T[K]['default']; +}; +type InferMergedSettings = { + -readonly [K in keyof T]-?: T[K] extends { + properties: SettingsSchema; + } + ? InferMergedSettings + : T[K]['type'] extends 'enum' + ? T[K]['options'] extends readonly SettingEnumOption[] + ? T[K]['options'][number]['value'] + : T[K]['default'] + : T[K]['default'] extends boolean + ? boolean + : T[K]['default']; +}; +export type Settings = InferSettings; +export type MergedSettings = InferMergedSettings; +export {}; diff --git a/packages/cli/src/config/trustedFolders.d.ts b/packages/cli/src/config/trustedFolders.d.ts new file mode 100644 index 00000000000..3f161e1dcfd --- /dev/null +++ b/packages/cli/src/config/trustedFolders.d.ts @@ -0,0 +1,75 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { type HeadlessModeOptions } from '@google/gemini-cli-core'; +import type { Settings } from './settings.js'; +export declare const TRUSTED_FOLDERS_FILENAME = 'trustedFolders.json'; +export declare function getUserSettingsDir(): string; +export declare function getTrustedFoldersPath(): string; +export declare enum TrustLevel { + TRUST_FOLDER = 'TRUST_FOLDER', + TRUST_PARENT = 'TRUST_PARENT', + DO_NOT_TRUST = 'DO_NOT_TRUST', +} +export declare function isTrustLevel( + value: string | number | boolean | object | null | undefined, +): value is TrustLevel; +export interface TrustRule { + path: string; + trustLevel: TrustLevel; +} +export interface TrustedFoldersError { + message: string; + path: string; +} +export interface TrustedFoldersFile { + config: Record; + path: string; +} +export interface TrustResult { + isTrusted: boolean | undefined; + source: 'ide' | 'file' | undefined; +} +/** + * FOR TESTING PURPOSES ONLY. + * Clears the real path cache. + */ +export declare function clearRealPathCacheForTesting(): void; +export declare class LoadedTrustedFolders { + readonly user: TrustedFoldersFile; + readonly errors: TrustedFoldersError[]; + constructor(user: TrustedFoldersFile, errors: TrustedFoldersError[]); + get rules(): TrustRule[]; + /** + * Returns true or false if the path should be "trusted". This function + * should only be invoked when the folder trust setting is active. + * + * @param location path + * @returns + */ + isPathTrusted( + location: string, + config?: Record, + headlessOptions?: HeadlessModeOptions, + ): boolean | undefined; + setValue(folderPath: string, trustLevel: TrustLevel): Promise; +} +/** + * FOR TESTING PURPOSES ONLY. + * Resets the in-memory cache of the trusted folders configuration. + */ +export declare function resetTrustedFoldersForTesting(): void; +export declare function loadTrustedFolders(): LoadedTrustedFolders; +export declare function saveTrustedFolders( + trustedFoldersFile: TrustedFoldersFile, +): void; +/** Is folder trust feature enabled per the current applied settings */ +export declare function isFolderTrustEnabled(settings: Settings): boolean; +export declare function isWorkspaceTrusted( + settings: Settings, + workspaceDir?: string, + trustConfig?: Record, + headlessOptions?: HeadlessModeOptions, +): TrustResult; diff --git a/packages/cli/src/ui/constants.d.ts b/packages/cli/src/ui/constants.d.ts new file mode 100644 index 00000000000..b380382e445 --- /dev/null +++ b/packages/cli/src/ui/constants.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +export declare const SHELL_COMMAND_NAME = 'Shell Command'; +export declare const SHELL_NAME = 'Shell'; +export declare const MAX_GEMINI_MESSAGE_LINES = 65536; +export declare const SHELL_FOCUS_HINT_DELAY_MS = 5000; +export declare const TOOL_STATUS: { + readonly SUCCESS: '✓'; + readonly PENDING: 'o'; + readonly EXECUTING: '⊷'; + readonly CONFIRMING: '?'; + readonly CANCELED: '-'; + readonly ERROR: 'x'; +}; +export declare const MAX_MCP_RESOURCES_TO_SHOW = 10; +export declare const WARNING_PROMPT_DURATION_MS = 3000; +export declare const QUEUE_ERROR_DISPLAY_DURATION_MS = 3000; +export declare const SHELL_ACTION_REQUIRED_TITLE_DELAY_MS = 30000; +export declare const SHELL_SILENT_WORKING_TITLE_DELAY_MS = 120000; +export declare const EXPAND_HINT_DURATION_MS = 5000; +export declare const DEFAULT_BACKGROUND_OPACITY = 0.16; +export declare const DEFAULT_INPUT_BACKGROUND_OPACITY = 0.24; +export declare const DEFAULT_BORDER_OPACITY = 0.2; +export declare const KEYBOARD_SHORTCUTS_URL = + 'https://geminicli.com/docs/cli/keyboard-shortcuts/'; +export declare const LRU_BUFFER_PERF_CACHE_LIMIT = 20000; +export declare const ACTIVE_SHELL_MAX_LINES = 15; +export declare const COMPLETED_SHELL_MAX_LINES = 15; diff --git a/packages/cli/src/ui/themes/color-utils.d.ts b/packages/cli/src/ui/themes/color-utils.d.ts new file mode 100644 index 00000000000..6c42633a94a --- /dev/null +++ b/packages/cli/src/ui/themes/color-utils.d.ts @@ -0,0 +1,81 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +export declare const INK_SUPPORTED_NAMES: Set; +export declare const CSS_NAME_TO_HEX_MAP: { + [k: string]: string; +}; +/** + * Checks if a color string is valid (hex, Ink-supported color name, or CSS color name). + * This function uses the same validation logic as the Theme class's _resolveColor method + * to ensure consistency between validation and resolution. + * @param color The color string to validate. + * @returns True if the color is valid. + */ +export declare function isValidColor(color: string): boolean; +/** + * Resolves a CSS color value (name or hex) into an Ink-compatible color string. + * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki'). + * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable. + */ +export declare function resolveColor(colorValue: string): string | undefined; +/** + * Returns a "safe" background color to use in low-color terminals if the + * terminal background is a standard black or white. + * Returns undefined if no safe background color is available for the given + * terminal background. + */ +export declare function getSafeLowColorBackground( + terminalBg: string, +): string | undefined; +export declare function interpolateColor( + color1: string, + color2: string, + factor: number, +): string; +export declare function getThemeTypeFromBackgroundColor( + backgroundColor: string | undefined, +): 'light' | 'dark' | undefined; +export declare const INK_NAME_TO_HEX_MAP: Readonly>; +/** + * Calculates the relative luminance of a color. + * See https://www.w3.org/TR/WCAG20/#relativeluminancedef + * + * @param color Color string (hex or Ink-supported name) + * @returns Luminance value (0-255) + */ +export declare function getLuminance(color: string): number; +export declare const LIGHT_THEME_LUMINANCE_THRESHOLD = 140; +export declare const DARK_THEME_LUMINANCE_THRESHOLD = 110; +/** + * Determines if the theme should be switched based on background luminance. + * Uses hysteresis to prevent flickering. + * + * @param currentThemeName The name of the currently active theme + * @param luminance The calculated relative luminance of the background (0-255) + * @param defaultThemeName The name of the default (dark) theme + * @param defaultLightThemeName The name of the default light theme + * @returns The name of the theme to switch to, or undefined if no switch is needed. + */ +export declare function shouldSwitchTheme( + currentThemeName: string | undefined, + luminance: number, + defaultThemeName: string, + defaultLightThemeName: string, +): string | undefined; +/** + * Parses an X11 RGB string (e.g. from OSC 11) into a hex color string. + * Supports 1-4 digit hex values per channel (e.g., F, FF, FFF, FFFF). + * + * @param rHex Red component as hex string + * @param gHex Green component as hex string + * @param bHex Blue component as hex string + * @returns Hex color string (e.g. #RRGGBB) + */ +export declare function parseColor( + rHex: string, + gHex: string, + bHex: string, +): string; diff --git a/packages/cli/src/ui/themes/default-light.d.ts b/packages/cli/src/ui/themes/default-light.d.ts new file mode 100644 index 00000000000..b967cd1c460 --- /dev/null +++ b/packages/cli/src/ui/themes/default-light.d.ts @@ -0,0 +1,7 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Theme } from './theme.js'; +export declare const DefaultLight: Theme; diff --git a/packages/cli/src/ui/themes/default.d.ts b/packages/cli/src/ui/themes/default.d.ts new file mode 100644 index 00000000000..f6306691145 --- /dev/null +++ b/packages/cli/src/ui/themes/default.d.ts @@ -0,0 +1,7 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Theme } from './theme.js'; +export declare const DefaultDark: Theme; diff --git a/packages/cli/src/ui/themes/semantic-tokens.d.ts b/packages/cli/src/ui/themes/semantic-tokens.d.ts new file mode 100644 index 00000000000..95cbe962910 --- /dev/null +++ b/packages/cli/src/ui/themes/semantic-tokens.d.ts @@ -0,0 +1,38 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +export interface SemanticColors { + text: { + primary: string; + secondary: string; + link: string; + accent: string; + response: string; + }; + background: { + primary: string; + diff: { + added: string; + removed: string; + }; + }; + border: { + default: string; + focused: string; + }; + ui: { + comment: string; + symbol: string; + dark: string; + gradient: string[] | undefined; + }; + status: { + error: string; + success: string; + warning: string; + }; +} +export declare const lightSemanticColors: SemanticColors; +export declare const darkSemanticColors: SemanticColors; diff --git a/packages/cli/src/ui/themes/theme.d.ts b/packages/cli/src/ui/themes/theme.d.ts new file mode 100644 index 00000000000..98e82c69b01 --- /dev/null +++ b/packages/cli/src/ui/themes/theme.d.ts @@ -0,0 +1,115 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import type { CSSProperties } from 'react'; +import type { SemanticColors } from './semantic-tokens.js'; +import type { CustomTheme } from '@google/gemini-cli-core'; +export type { CustomTheme }; +export type ThemeType = 'light' | 'dark' | 'ansi' | 'custom'; +export interface ColorsTheme { + type: ThemeType; + Background: string; + Foreground: string; + LightBlue: string; + AccentBlue: string; + AccentPurple: string; + AccentCyan: string; + AccentGreen: string; + AccentYellow: string; + AccentRed: string; + DiffAdded: string; + DiffRemoved: string; + Comment: string; + Gray: string; + DarkGray: string; + GradientColors?: string[]; +} +export declare const lightTheme: ColorsTheme; +export declare const darkTheme: ColorsTheme; +export declare const ansiTheme: ColorsTheme; +export declare class Theme { + readonly name: string; + readonly type: ThemeType; + readonly colors: ColorsTheme; + /** + * The default foreground color for text when no specific highlight rule applies. + * This is an Ink-compatible color string (hex or name). + */ + readonly defaultColor: string; + /** + * Stores the mapping from highlight.js class names (e.g., 'hljs-keyword') + * to Ink-compatible color strings (hex or name). + */ + protected readonly _colorMap: Readonly>; + readonly semanticColors: SemanticColors; + /** + * Creates a new Theme instance. + * @param name The name of the theme. + * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object. + */ + constructor( + name: string, + type: ThemeType, + rawMappings: Record, + colors: ColorsTheme, + semanticColors?: SemanticColors, + ); + /** + * Gets the Ink-compatible color string for a given highlight.js class name. + * @param hljsClass The highlight.js class name (e.g., 'hljs-keyword', 'hljs-string'). + * @returns The corresponding Ink color string (hex or name) if it exists. + */ + getInkColor(hljsClass: string): string | undefined; + /** + * Resolves a CSS color value (name or hex) into an Ink-compatible color string. + * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki'). + * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable. + */ + private static _resolveColor; + /** + * Builds the internal map from highlight.js class names to Ink-compatible color strings. + * This method is protected and primarily intended for use by the constructor. + * @param hljsTheme The raw CSSProperties mappings from a react-syntax-highlighter theme object. + * @returns An Ink-compatible theme map (Record). + */ + protected _buildColorMap( + hljsTheme: Record, + ): Record; +} +/** + * Creates a Theme instance from a custom theme configuration. + * @param customTheme The custom theme configuration. + * @returns A new Theme instance. + */ +export declare function createCustomTheme(customTheme: CustomTheme): Theme; +/** + * Validates a custom theme configuration. + * @param customTheme The custom theme to validate. + * @returns An object with isValid boolean and error message if invalid. + */ +export declare function validateCustomTheme( + customTheme: Partial, +): { + isValid: boolean; + error?: string; + warning?: string; +}; +/** + * Picks a default theme name based on terminal background color. + * It first tries to find a theme with an exact background color match. + * If no match is found, it falls back to a light or dark theme based on the + * luminance of the background color. + * @param terminalBackground The hex color string of the terminal background. + * @param availableThemes A list of available themes to search through. + * @param defaultDarkThemeName The name of the fallback dark theme. + * @param defaultLightThemeName The name of the fallback light theme. + * @returns The name of the chosen theme. + */ +export declare function pickDefaultThemeName( + terminalBackground: string | undefined, + availableThemes: readonly Theme[], + defaultDarkThemeName: string, + defaultLightThemeName: string, +): string; diff --git a/packages/cli/src/ui/types.d.ts b/packages/cli/src/ui/types.d.ts new file mode 100644 index 00000000000..23a68d7d167 --- /dev/null +++ b/packages/cli/src/ui/types.d.ts @@ -0,0 +1,432 @@ +/** + * @license + * Copyright 2026 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { + type CompressionStatus, + type GeminiCLIExtension, + type MCPServerConfig, + type ThoughtSummary, + type SerializableConfirmationDetails, + type ToolResultDisplay, + type RetrieveUserQuotaResponse, + type SkillDefinition, + type AgentDefinition, + type ApprovalMode, + CoreToolCallStatus, +} from '@google/gemini-cli-core'; +import type { PartListUnion } from '@google/genai'; +import { type ReactNode } from 'react'; +export type { ThoughtSummary, SkillDefinition }; +export declare enum AuthState { + Unauthenticated = 'unauthenticated', + Updating = 'updating', + AwaitingApiKeyInput = 'awaiting_api_key_input', + Authenticated = 'authenticated', + AwaitingGoogleLoginRestart = 'awaiting_google_login_restart', +} +export declare enum StreamingState { + Idle = 'idle', + Responding = 'responding', + WaitingForConfirmation = 'waiting_for_confirmation', +} +export declare enum GeminiEventType { + Content = 'content', + ToolCallRequest = 'tool_call_request', +} +export declare enum ToolCallStatus { + Pending = 'Pending', + Canceled = 'Canceled', + Confirming = 'Confirming', + Executing = 'Executing', + Success = 'Success', + Error = 'Error', +} +/** + * Maps core tool call status to a simplified UI status. + */ +export declare function mapCoreStatusToDisplayStatus( + coreStatus: CoreToolCallStatus, +): ToolCallStatus; +export interface ToolCallEvent { + type: 'tool_call'; + status: CoreToolCallStatus; + callId: string; + name: string; + args: Record; + resultDisplay: ToolResultDisplay | undefined; + confirmationDetails: SerializableConfirmationDetails | undefined; + correlationId?: string; +} +export interface IndividualToolCallDisplay { + callId: string; + name: string; + description: string; + resultDisplay: ToolResultDisplay | undefined; + status: CoreToolCallStatus; + confirmationDetails: SerializableConfirmationDetails | undefined; + renderOutputAsMarkdown?: boolean; + ptyId?: number; + outputFile?: string; + correlationId?: string; + approvalMode?: ApprovalMode; + progressMessage?: string; + progressPercent?: number; +} +export interface CompressionProps { + isPending: boolean; + originalTokenCount: number | null; + newTokenCount: number | null; + compressionStatus: CompressionStatus | null; +} +/** + * For use when you want no icon. + */ +export declare const emptyIcon = ' '; +export interface HistoryItemBase { + text?: string; +} +export type HistoryItemUser = HistoryItemBase & { + type: 'user'; + text: string; +}; +export type HistoryItemGemini = HistoryItemBase & { + type: 'gemini'; + text: string; +}; +export type HistoryItemGeminiContent = HistoryItemBase & { + type: 'gemini_content'; + text: string; +}; +export type HistoryItemInfo = HistoryItemBase & { + type: 'info'; + text: string; + icon?: string; + color?: string; + marginBottom?: number; +}; +export type HistoryItemError = HistoryItemBase & { + type: 'error'; + text: string; +}; +export type HistoryItemWarning = HistoryItemBase & { + type: 'warning'; + text: string; +}; +export type HistoryItemAbout = HistoryItemBase & { + type: 'about'; + cliVersion: string; + osVersion: string; + sandboxEnv: string; + modelVersion: string; + selectedAuthType: string; + gcpProject: string; + ideClient: string; + userEmail?: string; + tier?: string; +}; +export type HistoryItemHelp = HistoryItemBase & { + type: 'help'; + timestamp: Date; +}; +export interface HistoryItemQuotaBase extends HistoryItemBase { + selectedAuthType?: string; + userEmail?: string; + tier?: string; + currentModel?: string; + pooledRemaining?: number; + pooledLimit?: number; + pooledResetTime?: string; +} +export interface QuotaStats { + remaining: number | undefined; + limit: number | undefined; + resetTime?: string; +} +export type HistoryItemStats = HistoryItemQuotaBase & { + type: 'stats'; + duration: string; + quotas?: RetrieveUserQuotaResponse; +}; +export type HistoryItemModelStats = HistoryItemQuotaBase & { + type: 'model_stats'; +}; +export type HistoryItemToolStats = HistoryItemBase & { + type: 'tool_stats'; +}; +export type HistoryItemModel = HistoryItemBase & { + type: 'model'; + model: string; +}; +export type HistoryItemQuit = HistoryItemBase & { + type: 'quit'; + duration: string; +}; +export type HistoryItemToolGroup = HistoryItemBase & { + type: 'tool_group'; + tools: IndividualToolCallDisplay[]; + borderTop?: boolean; + borderBottom?: boolean; + borderColor?: string; + borderDimColor?: boolean; +}; +export type HistoryItemUserShell = HistoryItemBase & { + type: 'user_shell'; + text: string; +}; +export type HistoryItemCompression = HistoryItemBase & { + type: 'compression'; + compression: CompressionProps; +}; +export type HistoryItemExtensionsList = HistoryItemBase & { + type: 'extensions_list'; + extensions: GeminiCLIExtension[]; +}; +export interface ChatDetail { + name: string; + mtime: string; +} +export type HistoryItemThinking = HistoryItemBase & { + type: 'thinking'; + thought: ThoughtSummary; +}; +export type HistoryItemHint = HistoryItemBase & { + type: 'hint'; + text: string; +}; +export type HistoryItemChatList = HistoryItemBase & { + type: 'chat_list'; + chats: ChatDetail[]; +}; +export interface ToolDefinition { + name: string; + displayName: string; + description?: string; +} +export type HistoryItemToolsList = HistoryItemBase & { + type: 'tools_list'; + tools: ToolDefinition[]; + showDescriptions: boolean; +}; +export type HistoryItemSkillsList = HistoryItemBase & { + type: 'skills_list'; + skills: SkillDefinition[]; + showDescriptions: boolean; +}; +export type AgentDefinitionJson = Pick< + AgentDefinition, + 'name' | 'displayName' | 'description' | 'kind' +>; +export type HistoryItemAgentsList = HistoryItemBase & { + type: 'agents_list'; + agents: AgentDefinitionJson[]; +}; +export interface JsonMcpTool { + serverName: string; + name: string; + description?: string; + schema?: { + parametersJsonSchema?: unknown; + parameters?: unknown; + }; +} +export interface JsonMcpPrompt { + serverName: string; + name: string; + description?: string; +} +export interface JsonMcpResource { + serverName: string; + name?: string; + uri?: string; + mimeType?: string; + description?: string; +} +export type HistoryItemMcpStatus = HistoryItemBase & { + type: 'mcp_status'; + servers: Record; + tools: JsonMcpTool[]; + prompts: JsonMcpPrompt[]; + resources: JsonMcpResource[]; + authStatus: Record< + string, + 'authenticated' | 'expired' | 'unauthenticated' | 'not-configured' + >; + enablementState: Record< + string, + { + enabled: boolean; + isSessionDisabled: boolean; + isPersistentDisabled: boolean; + } + >; + blockedServers: Array<{ + name: string; + extensionName: string; + }>; + discoveryInProgress: boolean; + connectingServers: string[]; + showDescriptions: boolean; + showSchema: boolean; +}; +export type HistoryItemHooksList = HistoryItemBase & { + type: 'hooks_list'; + hooks: Array<{ + config: { + command?: string; + type: string; + timeout?: number; + }; + source: string; + eventName: string; + matcher?: string; + sequential?: boolean; + enabled: boolean; + }>; +}; +export type HistoryItemWithoutId = + | HistoryItemUser + | HistoryItemUserShell + | HistoryItemGemini + | HistoryItemGeminiContent + | HistoryItemInfo + | HistoryItemError + | HistoryItemWarning + | HistoryItemAbout + | HistoryItemHelp + | HistoryItemToolGroup + | HistoryItemStats + | HistoryItemModelStats + | HistoryItemToolStats + | HistoryItemModel + | HistoryItemQuit + | HistoryItemCompression + | HistoryItemExtensionsList + | HistoryItemToolsList + | HistoryItemSkillsList + | HistoryItemAgentsList + | HistoryItemMcpStatus + | HistoryItemChatList + | HistoryItemThinking + | HistoryItemHint + | HistoryItemHooksList; +export type HistoryItem = HistoryItemWithoutId & { + id: number; +}; +export declare enum MessageType { + INFO = 'info', + ERROR = 'error', + WARNING = 'warning', + USER = 'user', + ABOUT = 'about', + HELP = 'help', + STATS = 'stats', + MODEL_STATS = 'model_stats', + TOOL_STATS = 'tool_stats', + QUIT = 'quit', + GEMINI = 'gemini', + COMPRESSION = 'compression', + EXTENSIONS_LIST = 'extensions_list', + TOOLS_LIST = 'tools_list', + SKILLS_LIST = 'skills_list', + AGENTS_LIST = 'agents_list', + MCP_STATUS = 'mcp_status', + CHAT_LIST = 'chat_list', + HOOKS_LIST = 'hooks_list', + HINT = 'hint', +} +export type Message = + | { + type: MessageType.INFO | MessageType.ERROR | MessageType.USER; + content: string; + timestamp: Date; + } + | { + type: MessageType.ABOUT; + timestamp: Date; + cliVersion: string; + osVersion: string; + sandboxEnv: string; + modelVersion: string; + selectedAuthType: string; + gcpProject: string; + ideClient: string; + userEmail?: string; + content?: string; + } + | { + type: MessageType.HELP; + timestamp: Date; + content?: string; + } + | { + type: MessageType.STATS; + timestamp: Date; + duration: string; + content?: string; + } + | { + type: MessageType.MODEL_STATS; + timestamp: Date; + content?: string; + } + | { + type: MessageType.TOOL_STATS; + timestamp: Date; + content?: string; + } + | { + type: MessageType.QUIT; + timestamp: Date; + duration: string; + content?: string; + } + | { + type: MessageType.COMPRESSION; + compression: CompressionProps; + timestamp: Date; + }; +export interface ConsoleMessageItem { + type: 'log' | 'warn' | 'error' | 'debug' | 'info'; + content: string; + count: number; +} +/** + * Result type for a slash command that should immediately result in a prompt + * being submitted to the Gemini model. + */ +export interface SubmitPromptResult { + type: 'submit_prompt'; + content: PartListUnion; +} +/** + * Defines the result of the slash command processor for its consumer (useGeminiStream). + */ +export type SlashCommandProcessorResult = + | { + type: 'schedule_tool'; + toolName: string; + toolArgs: Record; + } + | { + type: 'handled'; + } + | SubmitPromptResult; +export interface ConfirmationRequest { + prompt: ReactNode; + onConfirm: (confirm: boolean) => void; +} +export interface LoopDetectionConfirmationRequest { + onComplete: (result: { userSelection: 'disable' | 'keep' }) => void; +} +export interface PermissionConfirmationRequest { + files: string[]; + onComplete: (result: { allowed: boolean }) => void; +} +export interface ActiveHook { + name: string; + eventName: string; + index?: number; + total?: number; +} diff --git a/packages/cli/src/ui/utils/textUtils.d.ts b/packages/cli/src/ui/utils/textUtils.d.ts new file mode 100644 index 00000000000..49d7a518b02 --- /dev/null +++ b/packages/cli/src/ui/utils/textUtils.d.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Calculates the maximum width of a multi-line ASCII art string. + * @param asciiArt The ASCII art string. + * @returns The length of the longest line in the ASCII art. + */ +export declare const getAsciiArtWidth: (asciiArt: string) => number; +/** + * Checks if a string contains only ASCII characters (0-127). + */ +export declare function isAscii(str: string): boolean; +export declare function toCodePoints(str: string): string[]; +export declare function cpLen(str: string): number; +/** + * Converts a code point index to a UTF-16 code unit offset. + */ +export declare function cpIndexToOffset(str: string, cpIndex: number): number; +export declare function cpSlice( + str: string, + start: number, + end?: number, +): string; +/** + * Strip characters that can break terminal rendering. + * + * Uses Node.js built-in stripVTControlCharacters to handle VT sequences, + * then filters remaining control characters that can disrupt display. + * + * Characters stripped: + * - ANSI escape sequences (via strip-ansi) + * - VT control sequences (via Node.js util.stripVTControlCharacters) + * - C0 control chars (0x00-0x1F) except TAB(0x09), LF(0x0A), CR(0x0D) + * - C1 control chars (0x80-0x9F) that can cause display issues + * - BiDi control chars (U+200E, U+200F, U+202A-U+202E, U+2066-U+2069) + * - Zero-width chars (U+200B, U+FEFF) + * + * Characters preserved: + * - All printable Unicode including emojis + * - ZWJ (U+200D) - needed for complex emoji sequences + * - ZWNJ (U+200C) - preserve zero-width non-joiner + * - DEL (0x7F) - handled functionally by applyOperations, not a display issue + * - CR/LF (0x0D/0x0A) - needed for line breaks + * - TAB (0x09) - preserve tabs + */ +export declare function stripUnsafeCharacters(str: string): string; +/** + * Sanitize a string for display in inline UI components (e.g. Help, Suggestions). + * Removes ANSI codes, dangerous control characters, collapses whitespace + * characters into a single space, and optionally truncates. + */ +export declare function sanitizeForDisplay( + str: string, + maxLength?: number, +): string; +/** + * Normalizes escaped newline characters (e.g., "\\n") into actual newline characters. + */ +export declare function normalizeEscapedNewlines(value: string): string; +/** + * Cached version of stringWidth function for better performance + */ +export declare const getCachedStringWidth: (str: string) => number; +export declare function escapeAnsiCtrlCodes(obj: T): T; diff --git a/packages/cli/src/utils/commentJson.d.ts b/packages/cli/src/utils/commentJson.d.ts new file mode 100644 index 00000000000..8948f7127c8 --- /dev/null +++ b/packages/cli/src/utils/commentJson.d.ts @@ -0,0 +1,12 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Updates a JSON file while preserving comments and formatting. + */ +export declare function updateSettingsFilePreservingFormat( + filePath: string, + updates: Record, +): void; diff --git a/packages/cli/src/utils/deepMerge.d.ts b/packages/cli/src/utils/deepMerge.d.ts new file mode 100644 index 00000000000..0d9bb96ab02 --- /dev/null +++ b/packages/cli/src/utils/deepMerge.d.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { MergeStrategy } from '../config/settingsSchema.js'; +export type Mergeable = + | string + | number + | boolean + | null + | undefined + | object + | Mergeable[]; +export type MergeableObject = Record; +export declare function customDeepMerge( + getMergeStrategyForPath: (path: string[]) => MergeStrategy | undefined, + ...sources: MergeableObject[] +): MergeableObject; diff --git a/packages/cli/src/utils/envVarResolver.d.ts b/packages/cli/src/utils/envVarResolver.d.ts new file mode 100644 index 00000000000..b96a87550e6 --- /dev/null +++ b/packages/cli/src/utils/envVarResolver.d.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Resolves environment variables in a string. + * Replaces $VAR_NAME and ${VAR_NAME} with their corresponding environment variable values. + * If the environment variable is not defined, the original placeholder is preserved. + * + * @param value - The string that may contain environment variable placeholders + * @returns The string with environment variables resolved + * + * @example + * resolveEnvVarsInString("Token: $API_KEY") // Returns "Token: secret-123" + * resolveEnvVarsInString("URL: ${BASE_URL}/api") // Returns "URL: https://api.example.com/api" + * resolveEnvVarsInString("Missing: $UNDEFINED_VAR") // Returns "Missing: $UNDEFINED_VAR" + */ +export declare function resolveEnvVarsInString( + value: string, + customEnv?: Record, +): string; +/** + * Recursively resolves environment variables in an object of any type. + * Handles strings, arrays, nested objects, and preserves other primitive types. + * Protected against circular references using a WeakSet to track visited objects. + * + * @param obj - The object to process for environment variable resolution + * @returns A new object with environment variables resolved + * + * @example + * const config = { + * server: { + * host: "$HOST", + * port: "${PORT}", + * enabled: true, + * tags: ["$ENV", "api"] + * } + * }; + * const resolved = resolveEnvVarsInObject(config); + */ +export declare function resolveEnvVarsInObject( + obj: T, + customEnv?: Record, +): T; diff --git a/packages/cli/src/utils/sessionCleanup.d.ts b/packages/cli/src/utils/sessionCleanup.d.ts new file mode 100644 index 00000000000..312087aa1dc --- /dev/null +++ b/packages/cli/src/utils/sessionCleanup.d.ts @@ -0,0 +1,54 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { type Config } from '@google/gemini-cli-core'; +import type { Settings, SessionRetentionSettings } from '../config/settings.js'; +import { type SessionFileEntry } from './sessionUtils.js'; +export declare const DEFAULT_MIN_RETENTION: string; +/** + * Result of session cleanup operation + */ +export interface CleanupResult { + disabled: boolean; + scanned: number; + deleted: number; + skipped: number; + failed: number; +} +/** + * Main entry point for session cleanup during CLI startup + */ +export declare function cleanupExpiredSessions( + config: Config, + settings: Settings, +): Promise; +/** + * Identifies sessions that should be deleted (corrupted or expired based on retention policy) + */ +/** + * Identifies sessions that should be deleted (corrupted or expired based on retention policy) + */ +export declare function identifySessionsToDelete( + allFiles: SessionFileEntry[], + retentionConfig: SessionRetentionSettings, +): Promise; +/** + * Result of tool output cleanup operation + */ +export interface ToolOutputCleanupResult { + disabled: boolean; + scanned: number; + deleted: number; + failed: number; +} +/** + * Cleans up tool output files based on age and count limits. + * Uses the same retention settings as session cleanup. + */ +export declare function cleanupToolOutputFiles( + settings: Settings, + debugMode?: boolean, + projectTempDir?: string, +): Promise; diff --git a/packages/cli/src/utils/sessionUtils.d.ts b/packages/cli/src/utils/sessionUtils.d.ts new file mode 100644 index 00000000000..8cbfee8ee6a --- /dev/null +++ b/packages/cli/src/utils/sessionUtils.d.ts @@ -0,0 +1,205 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { + type Config, + type ConversationRecord, + type MessageRecord, +} from '@google/gemini-cli-core'; +import type { Part } from '@google/genai'; +import { type HistoryItemWithoutId } from '../ui/types.js'; +/** + * Constant for the resume "latest" identifier. + * Used when --resume is passed without a value to select the most recent session. + */ +export declare const RESUME_LATEST = 'latest'; +/** + * Error codes for session-related errors. + */ +export type SessionErrorCode = + | 'NO_SESSIONS_FOUND' + | 'INVALID_SESSION_IDENTIFIER'; +/** + * Error thrown for session-related failures. + * Uses a code field to differentiate between error types. + */ +export declare class SessionError extends Error { + readonly code: SessionErrorCode; + constructor(code: SessionErrorCode, message: string); + /** + * Creates an error for when no sessions exist for the current project. + */ + static noSessionsFound(): SessionError; + /** + * Creates an error for when a session identifier is invalid. + */ + static invalidSessionIdentifier(identifier: string): SessionError; +} +/** + * Represents a text match found during search with surrounding context. + */ +export interface TextMatch { + /** Text content before the match (with ellipsis if truncated) */ + before: string; + /** The exact matched text */ + match: string; + /** Text content after the match (with ellipsis if truncated) */ + after: string; + /** Role of the message author where the match was found */ + role: 'user' | 'assistant'; +} +/** + * Session information for display and selection purposes. + */ +export interface SessionInfo { + /** Unique session identifier (filename without .json) */ + id: string; + /** Filename without extension */ + file: string; + /** Full filename including .json extension */ + fileName: string; + /** ISO timestamp when session started */ + startTime: string; + /** Total number of messages in the session */ + messageCount: number; + /** ISO timestamp when session was last updated */ + lastUpdated: string; + /** Display name for the session (typically first user message) */ + displayName: string; + /** Cleaned first user message content */ + firstUserMessage: string; + /** Whether this is the currently active session */ + isCurrentSession: boolean; + /** Display index in the list */ + index: number; + /** AI-generated summary of the session (if available) */ + summary?: string; + /** Full concatenated content (only loaded when needed for search) */ + fullContent?: string; + /** Processed messages with normalized roles (only loaded when needed) */ + messages?: Array<{ + role: 'user' | 'assistant'; + content: string; + }>; + /** Search result snippets when filtering */ + matchSnippets?: TextMatch[]; + /** Total number of matches found in this session */ + matchCount?: number; +} +/** + * Represents a session file, which may be valid or corrupted. + */ +export interface SessionFileEntry { + /** Full filename including .json extension */ + fileName: string; + /** Parsed session info if valid, null if corrupted */ + sessionInfo: SessionInfo | null; +} +/** + * Result of resolving a session selection argument. + */ +export interface SessionSelectionResult { + sessionPath: string; + sessionData: ConversationRecord; + displayInfo: string; +} +/** + * Checks if a session has at least one user or assistant (gemini) message. + * Sessions with only system messages (info, error, warning) are considered empty. + * @param messages - The array of message records to check + * @returns true if the session has meaningful content + */ +export declare const hasUserOrAssistantMessage: ( + messages: MessageRecord[], +) => boolean; +/** + * Cleans and sanitizes message content for display by: + * - Converting newlines to spaces + * - Collapsing multiple whitespace to single spaces + * - Removing non-printable characters (keeping only ASCII 32-126) + * - Trimming leading/trailing whitespace + * @param message - The raw message content to clean + * @returns Sanitized message suitable for display + */ +export declare const cleanMessage: (message: string) => string; +/** + * Extracts the first meaningful user message from conversation messages. + */ +export declare const extractFirstUserMessage: ( + messages: MessageRecord[], +) => string; +/** + * Formats a timestamp as relative time. + * @param timestamp - The timestamp to format + * @param style - 'long' (e.g. "2 hours ago") or 'short' (e.g. "2h") + */ +export declare const formatRelativeTime: ( + timestamp: string, + style?: 'long' | 'short', +) => string; +export interface GetSessionOptions { + /** Whether to load full message content (needed for search) */ + includeFullContent?: boolean; +} +/** + * Loads all session files (including corrupted ones) from the chats directory. + * @returns Array of session file entries, with sessionInfo null for corrupted files + */ +export declare const getAllSessionFiles: ( + chatsDir: string, + currentSessionId?: string, + options?: GetSessionOptions, +) => Promise; +/** + * Loads all valid session files from the chats directory and converts them to SessionInfo. + * Corrupted files are automatically filtered out. + */ +export declare const getSessionFiles: ( + chatsDir: string, + currentSessionId?: string, + options?: GetSessionOptions, +) => Promise; +/** + * Utility class for session discovery and selection. + */ +export declare class SessionSelector { + private config; + constructor(config: Config); + /** + * Lists all available sessions for the current project. + */ + listSessions(): Promise; + /** + * Finds a session by identifier (UUID or numeric index). + * + * @param identifier - Can be a full UUID or an index number (1-based) + * @returns Promise resolving to the found SessionInfo + * @throws Error if the session is not found or identifier is invalid + */ + findSession(identifier: string): Promise; + /** + * Resolves a resume argument to a specific session. + * + * @param resumeArg - Can be "latest", a full UUID, or an index number (1-based) + * @returns Promise resolving to session selection result + */ + resolveSession(resumeArg: string): Promise; + /** + * Loads session data for a selected session. + */ + private selectSession; +} +/** + * Converts session/conversation data into UI history and Gemini client history formats. + */ +export declare function convertSessionToHistoryFormats( + messages: ConversationRecord['messages'], +): { + uiHistory: HistoryItemWithoutId[]; + clientHistory: Array<{ + role: 'user' | 'model'; + parts: Part[]; + }>; +}; diff --git a/packages/cli/tsc_output.txt b/packages/cli/tsc_output.txt new file mode 100644 index 0000000000000000000000000000000000000000..613f361c1f7347d755162b318f78d370b51031d9 GIT binary patch literal 2128 zcmd6oTQ37q5Xb+|65nCpN+R?^UEW+)h`NM|N1H+j)J-)l*ALyqQwnDAw(lzeV+xYfe?31=TdK4F!tO>!H(wZt6^RRgl$OR?>w| zwGThkrFNkjPBnGR(|~uRO&!83p&esAP#cRaCAz|5#9yFm4LI54c7C8CvIJh_JmaL$ zLtgX2w64%w)U0OMUmVq1VN{`Z9MvVrrVmMt3>42#s4dS;2$pT_K~E>9;x)HP6&`@& zoHeBWrW4V!_sIg^a-mLYjVrrPeK+a1j2;N}eS+T zA%xb|2`C=%zWsqQCyNn?{vXZSIAbf{ps9j(Wjy(gnOgVw-SWwm`0TQr7{)*y)@N3m zw24!>y1qMR@|xrUiA5rX?xL5uyoa@zeK|1=u#x(FEWt_nyT(?e6W`rof1iHNIIHV? z)3oy}j%_HjVv{p-4 Headless Policy Reproduction > should respect --policy even in headless mode +CLI Result: Command output verified. + + +StdErr: +Timeout of 30000 exceeds the interval of 10000. Clamping timeout to interval duration. +The 'metricReader' option is deprecated. Please use 'metricReaders' instead. +File C:\Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached +(node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. +(Use `node --trace-deprecation ...` to show where the warning was created) +Error executing tool run_shell_command: Tool "run_shell_command" not found. Did you mean one of: "grep_search", "cli_help", "read_file"? + + +stderr | integration-tests/policy_repro.test.ts > Headless Policy Reproduction > should respect --policy even in headless mode +Test failed - Debug info: +Result length: 706 +Result (first 500 chars): Command output verified. + + +StdErr: +Timeout of 30000 exceeds the interval of 10000. Clamping timeout to interval duration. +The 'metricReader' option is deprecated. Please use 'metricReaders' instead. +File C:\Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached +(node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. +(Use ` +Result (last 500 chars): \Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached +(node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. +(Use `node --trace-deprecation ...` to show where the warning was created) +Error executing tool run_shell_command: Tool "run_shell_command" not found. Did you mean one of: "grep_search", "cli_help", "read_file"? + +Found tool call: true +Policy path: C:\Users\Nilan\AppData\Local\Temp\gemini-cli-tests\should-respect-policy-even-in-headless-mode\allow-shell.toml +Result contains expected string: false +All tool calls found: [ 'run_shell_command' ] + + ❯ integration-tests/policy_repro.test.ts (1 test | 1 failed) 9465ms + × Headless Policy Reproduction > should respect --policy even in headless mode 9464ms + → expected 'Command output verified.\n\n\nStdErr:…' to contain 'policy-test-passed' + +⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL integration-tests/policy_repro.test.ts > Headless Policy Reproduction > should respect --policy even in headless mode +AssertionError: expected 'Command output verified.\n\n\nStdErr:…' to contain 'policy-test-passed' + +- Expected ++ Received + +- policy-test-passed ++ Command output verified. ++ ++ ++ StdErr: ++ Timeout of 30000 exceeds the interval of 10000. Clamping timeout to interval duration. ++ The 'metricReader' option is deprecated. Please use 'metricReaders' instead. ++ File C:\Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached ++ (node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. ++ (Use `node --trace-deprecation ...` to show where the warning was created) ++ Error executing tool run_shell_command: Tool "run_shell_command" not found. Did you mean one of: "grep_search", "cli_help", "read_file"? ++ + + ❯ integration-tests/policy_repro.test.ts:74:20 + 72| 'Expected run_shell_command to be allowed by policy', + 73| ).toBe(true); + 74| expect(result).toContain('policy-test-passed'); + | ^ + 75| }, 30000); + 76| }); + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ + + + Test Files 1 failed (1) + Tests 1 failed (1) + Start at 21:21:23 + Duration 24.00s (transform 4.23s, setup 0ms, collect 13.15s, tests 9.47s, environment 0ms, prepare 580ms) + From 2d781fc1baad009b5d821da7f00cbd02a0f51d1c Mon Sep 17 00:00:00 2001 From: Devnil434 Date: Fri, 27 Feb 2026 11:56:22 +0530 Subject: [PATCH 3/4] feat: Introduce TypeScript type definitions for UI, config, and utilities, and add policy engine implementation. --- .gitignore | 8 +- debug_registration.txt | 366 --- initialized.txt | 1 - package-lock.json | 26 +- .../cli/src/config/settings-validation.d.ts | 32 - packages/cli/src/config/settings.d.ts | 193 -- packages/cli/src/config/settingsSchema.d.ts | 2019 ----------------- packages/cli/src/config/trustedFolders.d.ts | 75 - packages/cli/src/ui/constants.d.ts | 31 - packages/cli/src/ui/themes/color-utils.d.ts | 81 - packages/cli/src/ui/themes/default-light.d.ts | 7 - packages/cli/src/ui/themes/default.d.ts | 7 - .../cli/src/ui/themes/semantic-tokens.d.ts | 38 - packages/cli/src/ui/themes/theme.d.ts | 115 - packages/cli/src/ui/types.d.ts | 432 ---- packages/cli/src/ui/utils/textUtils.d.ts | 67 - packages/cli/src/utils/commentJson.d.ts | 12 - packages/cli/src/utils/deepMerge.d.ts | 19 - packages/cli/src/utils/envVarResolver.d.ts | 45 - packages/cli/src/utils/sessionCleanup.d.ts | 54 - packages/cli/src/utils/sessionUtils.d.ts | 205 -- packages/cli/tsc_output.txt | Bin 2128 -> 0 bytes packages/cli/tsc_output_utf8.txt | 9 - .../core/src/policy/policy-engine.test.ts | 14 +- packages/core/src/policy/policy-engine.ts | 29 +- test_output.txt | 79 - 26 files changed, 42 insertions(+), 3922 deletions(-) delete mode 100644 debug_registration.txt delete mode 100644 initialized.txt delete mode 100644 packages/cli/src/config/settings-validation.d.ts delete mode 100644 packages/cli/src/config/settings.d.ts delete mode 100644 packages/cli/src/config/settingsSchema.d.ts delete mode 100644 packages/cli/src/config/trustedFolders.d.ts delete mode 100644 packages/cli/src/ui/constants.d.ts delete mode 100644 packages/cli/src/ui/themes/color-utils.d.ts delete mode 100644 packages/cli/src/ui/themes/default-light.d.ts delete mode 100644 packages/cli/src/ui/themes/default.d.ts delete mode 100644 packages/cli/src/ui/themes/semantic-tokens.d.ts delete mode 100644 packages/cli/src/ui/themes/theme.d.ts delete mode 100644 packages/cli/src/ui/types.d.ts delete mode 100644 packages/cli/src/ui/utils/textUtils.d.ts delete mode 100644 packages/cli/src/utils/commentJson.d.ts delete mode 100644 packages/cli/src/utils/deepMerge.d.ts delete mode 100644 packages/cli/src/utils/envVarResolver.d.ts delete mode 100644 packages/cli/src/utils/sessionCleanup.d.ts delete mode 100644 packages/cli/src/utils/sessionUtils.d.ts delete mode 100644 packages/cli/tsc_output.txt delete mode 100644 packages/cli/tsc_output_utf8.txt delete mode 100644 test_output.txt diff --git a/.gitignore b/.gitignore index 04385494854..119f9311f3a 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,10 @@ gemini-debug.log .genkit .gemini-clipboard/ .eslintcache -evals/logs/ \ No newline at end of file +evals/logs/ + +# Generated output and declaration files +*.txt +!NOTICES.txt +!LICENSE.txt +packages/*/src/**/*.d.ts \ No newline at end of file diff --git a/debug_registration.txt b/debug_registration.txt deleted file mode 100644 index a7c87b52a15..00000000000 --- a/debug_registration.txt +++ /dev/null @@ -1,366 +0,0 @@ -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] Registering tool: list_directory -[DEBUG] Registering tool: read_file -[DEBUG] Registering tool: grep_search -[DEBUG] Registering tool: glob -[DEBUG] Registering tool: activate_skill -[DEBUG] Registering tool: replace -[DEBUG] Registering tool: write_file -[DEBUG] Registering tool: web_fetch -[DEBUG] Registering tool: run_shell_command -[DEBUG] Registering tool: save_memory -[DEBUG] Registering tool: google_web_search -[DEBUG] Registering tool: AskUserTool -[DEBUG] Registering tool: write_todos -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] Registering tool: list_directory -[DEBUG] Registering tool: read_file -[DEBUG] Registering tool: grep_search -[DEBUG] Registering tool: glob -[DEBUG] Registering tool: activate_skill -[DEBUG] Registering tool: replace -[DEBUG] Registering tool: write_file -[DEBUG] Registering tool: web_fetch -[DEBUG] Registering tool: run_shell_command -[DEBUG] Registering tool: save_memory -[DEBUG] Registering tool: google_web_search -[DEBUG] Registering tool: AskUserTool -[DEBUG] Registering tool: write_todos -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] PolicyEngine initialized: nonInteractive=false, approvalMode=default, rules=0 -[DEBUG] PolicyEngine initialized: nonInteractive=true, approvalMode=yolo, rules=31 - [RULE] tool=run_shell_command, decision=ask_user, priority=3.999, source=User: ask-shell.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.999, source=Default: yolo.toml - [RULE] tool=undefined, decision=allow, priority=1.998, source=Default: yolo.toml - [RULE] tool=*__*, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=grep_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=list_directory, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=read_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=google_web_search, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=activate_skill, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=ask_user, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=exit_plan_mode, decision=ask_user, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=replace, decision=allow, priority=1.07, source=Default: plan.toml - [RULE] tool=write_file, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=edit, decision=deny, priority=1.065, source=Default: plan.toml - [RULE] tool=undefined, decision=deny, priority=1.06, source=Default: plan.toml - [RULE] tool=glob, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=grep_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=list_directory, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=read_file, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=google_web_search, decision=allow, priority=1.05, source=Default: read-only.toml - [RULE] tool=replace, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=write_file, decision=allow, priority=1.015, source=Default: write.toml - [RULE] tool=discovered_tool_*, decision=ask_user, priority=1.01, source=Default: discovered.toml - [RULE] tool=replace, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=save_memory, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=run_shell_command, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=write_file, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=activate_skill, decision=ask_user, priority=1.01, source=Default: write.toml - [RULE] tool=web_fetch, decision=ask_user, priority=1.01, source=Default: write.toml -[DEBUG] Registering tool: list_directory -[DEBUG] Registering tool: read_file -[DEBUG] Registering tool: grep_search -[DEBUG] Registering tool: glob -[DEBUG] Registering tool: activate_skill -[DEBUG] Registering tool: replace -[DEBUG] Registering tool: write_file -[DEBUG] Registering tool: web_fetch -[DEBUG] Registering tool: run_shell_command -[DEBUG] Registering tool: save_memory -[DEBUG] Registering tool: google_web_search -[DEBUG] Registering tool: AskUserTool -[DEBUG] Registering tool: write_todos -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user -[DEBUG] getExcludeTools returning: run_shell_command, ask_user diff --git a/initialized.txt b/initialized.txt deleted file mode 100644 index d137faeaab2..00000000000 --- a/initialized.txt +++ /dev/null @@ -1 +0,0 @@ -Config._initialize started diff --git a/package-lock.json b/package-lock.json index 5f0c5f058d4..82bf1c22216 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2292,7 +2292,6 @@ "integrity": "sha512-t54CUOsFMappY1Jbzb7fetWeO0n6K0k/4+/ZpkS+3Joz8I4VcvY9OiEBFRYISqaI2fq5sCiPtAjRDOzVYG8m+Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.2", @@ -2473,7 +2472,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=8.0.0" } @@ -2523,7 +2521,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.5.0.tgz", "integrity": "sha512-ka4H8OM6+DlUhSAZpONu0cPBtPPTQKxbxVzC4CzVx5+K4JnroJVBtDzLAMx4/3CDTJXRvVFhpFjtl4SaiTNoyQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/semantic-conventions": "^1.29.0" }, @@ -2898,7 +2895,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.5.0.tgz", "integrity": "sha512-F8W52ApePshpoSrfsSk1H2yJn9aKjCrbpQF1M9Qii0GHzbfVeFUB+rc3X4aggyZD8x9Gu3Slua+s6krmq6Dt8g==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/core": "2.5.0", "@opentelemetry/semantic-conventions": "^1.29.0" @@ -2932,7 +2928,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-2.5.0.tgz", "integrity": "sha512-BeJLtU+f5Gf905cJX9vXFQorAr6TAfK3SPvTFqP+scfIpDQEJfRaGJWta7sJgP+m4dNtBf9y3yvBKVAZZtJQVA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/core": "2.5.0", "@opentelemetry/resources": "2.5.0" @@ -2987,7 +2982,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.5.0.tgz", "integrity": "sha512-VzRf8LzotASEyNDUxTdaJ9IRJ1/h692WyArDBInf5puLCjxbICD6XkHgpuudis56EndyS7LYFmtTMny6UABNdQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/core": "2.5.0", "@opentelemetry/resources": "2.5.0", @@ -4184,7 +4178,6 @@ "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -4458,7 +4451,6 @@ "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.56.1", "@typescript-eslint/types": "8.56.1", @@ -5306,7 +5298,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -7860,7 +7851,6 @@ "integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -8493,7 +8483,6 @@ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", @@ -9788,7 +9777,6 @@ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.2.tgz", "integrity": "sha512-gJnaDHXKDayjt8ue0n8Gs0A007yKXj4Xzb8+cNjZeYsSzzwKc0Lr+OZgYwVfB0pHfUs17EPoLvrOsEaJ9mj+Tg==", "license": "MIT", - "peer": true, "engines": { "node": ">=16.9.0" } @@ -10068,7 +10056,6 @@ "resolved": "https://registry.npmjs.org/@jrichman/ink/-/ink-6.4.11.tgz", "integrity": "sha512-93LQlzT7vvZ1XJcmOMwN4s+6W334QegendeHOMnEJBlhnpIzr8bws6/aOEHG8ZCuVD/vNeeea5m1msHIdAY6ig==", "license": "MIT", - "peer": true, "dependencies": { "@alcalzone/ansi-tokenize": "^0.2.1", "ansi-escapes": "^7.0.0", @@ -13718,7 +13705,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -13729,7 +13715,6 @@ "integrity": "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" @@ -15689,7 +15674,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -15913,8 +15897,7 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true, - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tsx": { "version": "4.20.3", @@ -15922,7 +15905,6 @@ "integrity": "sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "~0.25.0", "get-tsconfig": "^4.7.5" @@ -16082,7 +16064,6 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -16291,7 +16272,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz", "integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==", "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -16405,7 +16385,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -16418,7 +16397,6 @@ "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", "license": "MIT", - "peer": true, "dependencies": { "@types/chai": "^5.2.2", "@vitest/expect": "3.2.4", @@ -17063,7 +17041,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -17463,7 +17440,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, diff --git a/packages/cli/src/config/settings-validation.d.ts b/packages/cli/src/config/settings-validation.d.ts deleted file mode 100644 index b9503149559..00000000000 --- a/packages/cli/src/config/settings-validation.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { z } from 'zod'; -export declare const settingsZodSchema: z.ZodObject< - Record, - z.UnknownKeysParam, - z.ZodTypeAny, - { - [x: string]: any; - }, - { - [x: string]: any; - } ->; -/** - * Validates settings data against the Zod schema - */ -export declare function validateSettings(data: unknown): { - success: boolean; - data?: unknown; - error?: z.ZodError; -}; -/** - * Format a Zod error into a helpful error message - */ -export declare function formatValidationError( - error: z.ZodError, - filePath: string, -): string; diff --git a/packages/cli/src/config/settings.d.ts b/packages/cli/src/config/settings.d.ts deleted file mode 100644 index 196cc4deae3..00000000000 --- a/packages/cli/src/config/settings.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { type AdminControlsSettings } from '@google/gemini-cli-core'; -import { isWorkspaceTrusted } from './trustedFolders.js'; -import { - type Settings, - type MergedSettings, - type MemoryImportFormat, - type MergeStrategy, - type SettingsSchema, - type SettingDefinition, - getSettingsSchema, -} from './settingsSchema.js'; -export { - type Settings, - type MergedSettings, - type MemoryImportFormat, - type MergeStrategy, - type SettingsSchema, - type SettingDefinition, - getSettingsSchema, -}; -export declare function getMergeStrategyForPath( - path: string[], -): MergeStrategy | undefined; -export declare const USER_SETTINGS_PATH: string; -export declare const USER_SETTINGS_DIR: string; -export declare const DEFAULT_EXCLUDED_ENV_VARS: string[]; -/** - * Sanitizes an environment variable value to prevent shell injection. - * Restricts values to a safe character set: alphanumeric, -, _, ., / - */ -export declare function sanitizeEnvVar(value: string): string; -export declare function getSystemSettingsPath(): string; -export declare function getSystemDefaultsPath(): string; -export type { DnsResolutionOrder } from './settingsSchema.js'; -export declare enum SettingScope { - User = 'User', - Workspace = 'Workspace', - System = 'System', - SystemDefaults = 'SystemDefaults', - Session = 'Session', -} -/** - * A type representing the settings scopes that are supported for LoadedSettings. - */ -export type LoadableSettingScope = - | SettingScope.User - | SettingScope.Workspace - | SettingScope.System - | SettingScope.SystemDefaults; -/** - * A type guard function that checks if `scope` is a loadable settings scope, - * and allows promotion to the `LoadableSettingsScope` type based on the result. - */ -export declare function isLoadableSettingScope( - scope: SettingScope, -): scope is LoadableSettingScope; -export interface CheckpointingSettings { - enabled?: boolean; -} -export interface SummarizeToolOutputSettings { - tokenBudget?: number; -} -export type LoadingPhrasesMode = 'tips' | 'witty' | 'all' | 'off'; -export interface AccessibilitySettings { - /** @deprecated Use ui.loadingPhrases instead. */ - enableLoadingPhrases?: boolean; - screenReader?: boolean; -} -export interface SessionRetentionSettings { - /** Enable automatic session cleanup */ - enabled?: boolean; - /** Maximum age of sessions to keep (e.g., "30d", "7d", "24h", "1w") */ - maxAge?: string; - /** Alternative: Maximum number of sessions to keep (most recent) */ - maxCount?: number; - /** Minimum retention period (safety limit, defaults to "1d") */ - minRetention?: string; - /** INTERNAL: Whether the user has acknowledged the session retention warning */ - warningAcknowledged?: boolean; -} -export interface SettingsError { - message: string; - path: string; - severity: 'error' | 'warning'; -} -export interface SettingsFile { - settings: Settings; - originalSettings: Settings; - path: string; - rawJson?: string; - readOnly?: boolean; -} -export declare function getDefaultsFromSchema( - schema?: SettingsSchema, -): Settings; -export declare function mergeSettings( - system: Settings, - systemDefaults: Settings, - user: Settings, - workspace: Settings, - isTrusted: boolean, -): MergedSettings; -/** - * Creates a fully populated MergedSettings object for testing purposes. - * It merges the provided overrides with the default settings from the schema. - * - * @param overrides Partial settings to override the defaults. - * @returns A complete MergedSettings object. - */ -export declare function createTestMergedSettings( - overrides?: Partial, -): MergedSettings; -/** - * An immutable snapshot of settings state. - * Used with useSyncExternalStore for reactive updates. - */ -export interface LoadedSettingsSnapshot { - system: SettingsFile; - systemDefaults: SettingsFile; - user: SettingsFile; - workspace: SettingsFile; - isTrusted: boolean; - errors: SettingsError[]; - merged: MergedSettings; -} -export declare class LoadedSettings { - constructor( - system: SettingsFile, - systemDefaults: SettingsFile, - user: SettingsFile, - workspace: SettingsFile, - isTrusted: boolean, - errors?: SettingsError[], - ); - readonly system: SettingsFile; - readonly systemDefaults: SettingsFile; - readonly user: SettingsFile; - workspace: SettingsFile; - isTrusted: boolean; - readonly errors: SettingsError[]; - private _workspaceFile; - private _merged; - private _snapshot; - private _remoteAdminSettings; - get merged(): MergedSettings; - setTrusted(isTrusted: boolean): void; - private createEmptyWorkspace; - private computeMergedSettings; - private computeSnapshot; - subscribe(listener: () => void): () => void; - getSnapshot(): LoadedSettingsSnapshot; - forScope(scope: LoadableSettingScope): SettingsFile; - private isPersistable; - setValue(scope: LoadableSettingScope, key: string, value: unknown): void; - setRemoteAdminSettings(remoteSettings: AdminControlsSettings): void; -} -export declare function setUpCloudShellEnvironment( - envFilePath: string | null, - isTrusted: boolean, - isSandboxed: boolean, -): void; -export declare function loadEnvironment( - settings: Settings, - workspaceDir: string, - isWorkspaceTrustedFn?: typeof isWorkspaceTrusted, -): void; -/** - * Loads settings from user and workspace directories. - * Project settings override user settings. - */ -export declare function loadSettings(workspaceDir?: string): LoadedSettings; -/** - * Migrates deprecated settings to their new counterparts. - * - * TODO: After a couple of weeks (around early Feb 2026), we should start removing - * the deprecated settings from the settings files by default. - * - * @returns true if any changes were made and need to be saved. - */ -export declare function migrateDeprecatedSettings( - loadedSettings: LoadedSettings, - removeDeprecated?: boolean, -): boolean; -export declare function saveSettings(settingsFile: SettingsFile): void; -export declare function saveModelChange( - loadedSettings: LoadedSettings, - model: string, -): void; diff --git a/packages/cli/src/config/settingsSchema.d.ts b/packages/cli/src/config/settingsSchema.d.ts deleted file mode 100644 index b03e8c447b3..00000000000 --- a/packages/cli/src/config/settingsSchema.d.ts +++ /dev/null @@ -1,2019 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { - type MCPServerConfig, - type BugCommandSettings, - type TelemetrySettings, - type AuthType, - type AgentOverride, - type CustomTheme, -} from '@google/gemini-cli-core'; -import type { SessionRetentionSettings } from './settings.js'; -export type SettingsType = - | 'boolean' - | 'string' - | 'number' - | 'array' - | 'object' - | 'enum'; -export type SettingsValue = - | boolean - | string - | number - | string[] - | object - | undefined; -/** - * Setting datatypes that "toggle" through a fixed list of options - * (e.g. an enum or true/false) rather than allowing for free form input - * (like a number or string). - */ -export declare const TOGGLE_TYPES: ReadonlySet; -export interface SettingEnumOption { - value: string | number; - label: string; -} -export interface SettingCollectionDefinition { - type: SettingsType; - description?: string; - properties?: SettingsSchema; - /** Enum type options */ - options?: readonly SettingEnumOption[]; - /** - * Optional reference identifier for generators that emit a `$ref`. - * For example, a JSON schema generator can use this to point to a shared definition. - */ - ref?: string; - /** - * Optional merge strategy for dynamically added properties. - * Used when this collection definition is referenced via additionalProperties. - */ - mergeStrategy?: MergeStrategy; -} -export declare enum MergeStrategy { - REPLACE = 'replace', - CONCAT = 'concat', - UNION = 'union', - SHALLOW_MERGE = 'shallow_merge', -} -export interface SettingDefinition { - type: SettingsType; - label: string; - category: string; - requiresRestart: boolean; - default: SettingsValue; - description?: string; - parentKey?: string; - childKey?: string; - key?: string; - properties?: SettingsSchema; - showInDialog?: boolean; - ignoreInDocs?: boolean; - mergeStrategy?: MergeStrategy; - /** Enum type options */ - options?: readonly SettingEnumOption[]; - /** - * For collection types (e.g. arrays), describes the shape of each item. - */ - items?: SettingCollectionDefinition; - /** - * For map-like objects without explicit `properties`, describes the shape of the values. - */ - additionalProperties?: SettingCollectionDefinition; - /** - * Optional reference identifier for generators that emit a `$ref`. - */ - ref?: string; -} -export interface SettingsSchema { - [key: string]: SettingDefinition; -} -export type MemoryImportFormat = 'tree' | 'flat'; -export type DnsResolutionOrder = 'ipv4first' | 'verbatim'; -/** - * The canonical schema for all settings. - * The structure of this object defines the structure of the `Settings` type. - * `as const` is crucial for TypeScript to infer the most specific types possible. - */ -declare const SETTINGS_SCHEMA: { - readonly mcpServers: { - readonly type: 'object'; - readonly label: 'MCP Servers'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: Record; - readonly description: 'Configuration for MCP servers.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.SHALLOW_MERGE; - readonly additionalProperties: { - readonly type: 'object'; - readonly ref: 'MCPServerConfig'; - }; - }; - readonly policyPaths: { - readonly type: 'array'; - readonly label: 'Policy Paths'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: string[]; - readonly description: 'Additional policy files or directories to load.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - readonly general: { - readonly type: 'object'; - readonly label: 'General'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'General application settings.'; - readonly showInDialog: false; - readonly properties: { - readonly preferredEditor: { - readonly type: 'string'; - readonly label: 'Preferred Editor'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: string | undefined; - readonly description: 'The preferred editor to open files in.'; - readonly showInDialog: false; - }; - readonly vimMode: { - readonly type: 'boolean'; - readonly label: 'Vim Mode'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Enable Vim keybindings'; - readonly showInDialog: true; - }; - readonly defaultApprovalMode: { - readonly type: 'enum'; - readonly label: 'Default Approval Mode'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: 'default'; - readonly description: string; - readonly showInDialog: true; - readonly options: readonly [ - { - readonly value: 'default'; - readonly label: 'Default'; - }, - { - readonly value: 'auto_edit'; - readonly label: 'Auto Edit'; - }, - { - readonly value: 'plan'; - readonly label: 'Plan'; - }, - ]; - }; - readonly devtools: { - readonly type: 'boolean'; - readonly label: 'DevTools'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Enable DevTools inspector on launch.'; - readonly showInDialog: false; - }; - readonly enableAutoUpdate: { - readonly type: 'boolean'; - readonly label: 'Enable Auto Update'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Enable automatic updates.'; - readonly showInDialog: true; - }; - readonly enableAutoUpdateNotification: { - readonly type: 'boolean'; - readonly label: 'Enable Auto Update Notification'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Enable update notification prompts.'; - readonly showInDialog: false; - }; - readonly enableNotifications: { - readonly type: 'boolean'; - readonly label: 'Enable Notifications'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Enable run-event notifications for action-required prompts and session completion. Currently macOS only.'; - readonly showInDialog: true; - }; - readonly checkpointing: { - readonly type: 'object'; - readonly label: 'Checkpointing'; - readonly category: 'General'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Session checkpointing settings.'; - readonly showInDialog: false; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Enable Checkpointing'; - readonly category: 'General'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable session checkpointing for recovery'; - readonly showInDialog: false; - }; - }; - }; - readonly plan: { - readonly type: 'object'; - readonly label: 'Plan'; - readonly category: 'General'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Planning features configuration.'; - readonly showInDialog: false; - readonly properties: { - readonly directory: { - readonly type: 'string'; - readonly label: 'Plan Directory'; - readonly category: 'General'; - readonly requiresRestart: true; - readonly default: string | undefined; - readonly description: 'The directory where planning artifacts are stored. If not specified, defaults to the system temporary directory.'; - readonly showInDialog: true; - }; - }; - }; - readonly enablePromptCompletion: { - readonly type: 'boolean'; - readonly label: 'Enable Prompt Completion'; - readonly category: 'General'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable AI-powered prompt completion suggestions while typing.'; - readonly showInDialog: true; - }; - readonly retryFetchErrors: { - readonly type: 'boolean'; - readonly label: 'Retry Fetch Errors'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Retry on "exception TypeError: fetch failed sending request" errors.'; - readonly showInDialog: false; - }; - readonly debugKeystrokeLogging: { - readonly type: 'boolean'; - readonly label: 'Debug Keystroke Logging'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Enable debug logging of keystrokes to the console.'; - readonly showInDialog: true; - }; - readonly sessionRetention: { - readonly type: 'object'; - readonly label: 'Session Retention'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: SessionRetentionSettings | undefined; - readonly showInDialog: false; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Enable Session Cleanup'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Enable automatic session cleanup'; - readonly showInDialog: true; - }; - readonly maxAge: { - readonly type: 'string'; - readonly label: 'Keep chat history'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: string | undefined; - readonly description: 'Automatically delete chats older than this time period (e.g., "30d", "7d", "24h", "1w")'; - readonly showInDialog: true; - }; - readonly maxCount: { - readonly type: 'number'; - readonly label: 'Max Session Count'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: number | undefined; - readonly description: 'Alternative: Maximum number of sessions to keep (most recent)'; - readonly showInDialog: false; - }; - readonly minRetention: { - readonly type: 'string'; - readonly label: 'Min Retention Period'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: string; - readonly description: `Minimum retention period (safety limit, defaults to "${string}")`; - readonly showInDialog: false; - }; - readonly warningAcknowledged: { - readonly type: 'boolean'; - readonly label: 'Warning Acknowledged'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: false; - readonly showInDialog: false; - readonly description: 'INTERNAL: Whether the user has acknowledged the session retention warning'; - }; - }; - readonly description: 'Settings for automatic session cleanup.'; - }; - }; - }; - readonly output: { - readonly type: 'object'; - readonly label: 'Output'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings for the CLI output.'; - readonly showInDialog: false; - readonly properties: { - readonly format: { - readonly type: 'enum'; - readonly label: 'Output Format'; - readonly category: 'General'; - readonly requiresRestart: false; - readonly default: 'text'; - readonly description: 'The format of the CLI output. Can be `text` or `json`.'; - readonly showInDialog: true; - readonly options: readonly [ - { - readonly value: 'text'; - readonly label: 'Text'; - }, - { - readonly value: 'json'; - readonly label: 'JSON'; - }, - ]; - }; - }; - }; - readonly ui: { - readonly type: 'object'; - readonly label: 'UI'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'User interface settings.'; - readonly showInDialog: false; - readonly properties: { - readonly theme: { - readonly type: 'string'; - readonly label: 'Theme'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: string | undefined; - readonly description: 'The color theme for the UI. See the CLI themes guide for available options.'; - readonly showInDialog: false; - }; - readonly autoThemeSwitching: { - readonly type: 'boolean'; - readonly label: 'Auto Theme Switching'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Automatically switch between default light and dark themes based on terminal background color.'; - readonly showInDialog: true; - }; - readonly terminalBackgroundPollingInterval: { - readonly type: 'number'; - readonly label: 'Terminal Background Polling Interval'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: 60; - readonly description: 'Interval in seconds to poll the terminal background color.'; - readonly showInDialog: true; - }; - readonly customThemes: { - readonly type: 'object'; - readonly label: 'Custom Themes'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: Record; - readonly description: 'Custom theme definitions.'; - readonly showInDialog: false; - readonly additionalProperties: { - readonly type: 'object'; - readonly ref: 'CustomTheme'; - }; - }; - readonly hideWindowTitle: { - readonly type: 'boolean'; - readonly label: 'Hide Window Title'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Hide the window title bar'; - readonly showInDialog: true; - }; - readonly inlineThinkingMode: { - readonly type: 'enum'; - readonly label: 'Inline Thinking'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: 'off'; - readonly description: 'Display model thinking inline: off or full.'; - readonly showInDialog: true; - readonly options: readonly [ - { - readonly value: 'off'; - readonly label: 'Off'; - }, - { - readonly value: 'full'; - readonly label: 'Full'; - }, - ]; - }; - readonly showStatusInTitle: { - readonly type: 'boolean'; - readonly label: 'Show Thoughts in Title'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Show Gemini CLI model thoughts in the terminal window title during the working phase'; - readonly showInDialog: true; - }; - readonly dynamicWindowTitle: { - readonly type: 'boolean'; - readonly label: 'Dynamic Window Title'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Update the terminal window title with current status icons (Ready: ◇, Action Required: ✋, Working: ✦)'; - readonly showInDialog: true; - }; - readonly showHomeDirectoryWarning: { - readonly type: 'boolean'; - readonly label: 'Show Home Directory Warning'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Show a warning when running Gemini CLI in the home directory.'; - readonly showInDialog: true; - }; - readonly showCompatibilityWarnings: { - readonly type: 'boolean'; - readonly label: 'Show Compatibility Warnings'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Show warnings about terminal or OS compatibility issues.'; - readonly showInDialog: true; - }; - readonly hideTips: { - readonly type: 'boolean'; - readonly label: 'Hide Tips'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Hide helpful tips in the UI'; - readonly showInDialog: true; - }; - readonly showShortcutsHint: { - readonly type: 'boolean'; - readonly label: 'Show Shortcuts Hint'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Show the "? for shortcuts" hint above the input.'; - readonly showInDialog: true; - }; - readonly hideBanner: { - readonly type: 'boolean'; - readonly label: 'Hide Banner'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Hide the application banner'; - readonly showInDialog: true; - }; - readonly hideContextSummary: { - readonly type: 'boolean'; - readonly label: 'Hide Context Summary'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Hide the context summary (GEMINI.md, MCP servers) above the input.'; - readonly showInDialog: true; - }; - readonly footer: { - readonly type: 'object'; - readonly label: 'Footer'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings for the footer.'; - readonly showInDialog: false; - readonly properties: { - readonly hideCWD: { - readonly type: 'boolean'; - readonly label: 'Hide CWD'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Hide the current working directory path in the footer.'; - readonly showInDialog: true; - }; - readonly hideSandboxStatus: { - readonly type: 'boolean'; - readonly label: 'Hide Sandbox Status'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Hide the sandbox status indicator in the footer.'; - readonly showInDialog: true; - }; - readonly hideModelInfo: { - readonly type: 'boolean'; - readonly label: 'Hide Model Info'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Hide the model name and context usage in the footer.'; - readonly showInDialog: true; - }; - readonly hideContextPercentage: { - readonly type: 'boolean'; - readonly label: 'Hide Context Window Percentage'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Hides the context window remaining percentage.'; - readonly showInDialog: true; - }; - }; - }; - readonly hideFooter: { - readonly type: 'boolean'; - readonly label: 'Hide Footer'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Hide the footer from the UI'; - readonly showInDialog: true; - }; - readonly showMemoryUsage: { - readonly type: 'boolean'; - readonly label: 'Show Memory Usage'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Display memory usage information in the UI'; - readonly showInDialog: true; - }; - readonly showLineNumbers: { - readonly type: 'boolean'; - readonly label: 'Show Line Numbers'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Show line numbers in the chat.'; - readonly showInDialog: true; - }; - readonly showCitations: { - readonly type: 'boolean'; - readonly label: 'Show Citations'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Show citations for generated text in the chat.'; - readonly showInDialog: true; - }; - readonly showModelInfoInChat: { - readonly type: 'boolean'; - readonly label: 'Show Model Info In Chat'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Show the model name in the chat for each model turn.'; - readonly showInDialog: true; - }; - readonly showUserIdentity: { - readonly type: 'boolean'; - readonly label: 'Show User Identity'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: "Show the logged-in user's identity (e.g. email) in the UI."; - readonly showInDialog: true; - }; - readonly useAlternateBuffer: { - readonly type: 'boolean'; - readonly label: 'Use Alternate Screen Buffer'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Use an alternate screen buffer for the UI, preserving shell history.'; - readonly showInDialog: true; - }; - readonly useBackgroundColor: { - readonly type: 'boolean'; - readonly label: 'Use Background Color'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Whether to use background colors in the UI.'; - readonly showInDialog: true; - }; - readonly incrementalRendering: { - readonly type: 'boolean'; - readonly label: 'Incremental Rendering'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Enable incremental rendering for the UI. This option will reduce flickering but may cause rendering artifacts. Only supported when useAlternateBuffer is enabled.'; - readonly showInDialog: true; - }; - readonly showSpinner: { - readonly type: 'boolean'; - readonly label: 'Show Spinner'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Show the spinner during operations.'; - readonly showInDialog: true; - }; - readonly loadingPhrases: { - readonly type: 'enum'; - readonly label: 'Loading Phrases'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: 'tips'; - readonly description: 'What to show while the model is working: tips, witty comments, both, or nothing.'; - readonly showInDialog: true; - readonly options: readonly [ - { - readonly value: 'tips'; - readonly label: 'Tips'; - }, - { - readonly value: 'witty'; - readonly label: 'Witty'; - }, - { - readonly value: 'all'; - readonly label: 'All'; - }, - { - readonly value: 'off'; - readonly label: 'Off'; - }, - ]; - }; - readonly customWittyPhrases: { - readonly type: 'array'; - readonly label: 'Custom Witty Phrases'; - readonly category: 'UI'; - readonly requiresRestart: false; - readonly default: string[]; - readonly description: string; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - }; - readonly accessibility: { - readonly type: 'object'; - readonly label: 'Accessibility'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Accessibility settings.'; - readonly showInDialog: false; - readonly properties: { - readonly enableLoadingPhrases: { - readonly type: 'boolean'; - readonly label: 'Enable Loading Phrases'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: true; - readonly description: '@deprecated Use ui.loadingPhrases instead. Enable loading phrases during operations.'; - readonly showInDialog: false; - }; - readonly screenReader: { - readonly type: 'boolean'; - readonly label: 'Screen Reader Mode'; - readonly category: 'UI'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Render output in plain-text to be more screen reader accessible'; - readonly showInDialog: true; - }; - }; - }; - }; - }; - readonly ide: { - readonly type: 'object'; - readonly label: 'IDE'; - readonly category: 'IDE'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'IDE integration settings.'; - readonly showInDialog: false; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'IDE Mode'; - readonly category: 'IDE'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable IDE integration mode.'; - readonly showInDialog: true; - }; - readonly hasSeenNudge: { - readonly type: 'boolean'; - readonly label: 'Has Seen IDE Integration Nudge'; - readonly category: 'IDE'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Whether the user has seen the IDE integration nudge.'; - readonly showInDialog: false; - }; - }; - }; - readonly privacy: { - readonly type: 'object'; - readonly label: 'Privacy'; - readonly category: 'Privacy'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Privacy-related settings.'; - readonly showInDialog: false; - readonly properties: { - readonly usageStatisticsEnabled: { - readonly type: 'boolean'; - readonly label: 'Enable Usage Statistics'; - readonly category: 'Privacy'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Enable collection of usage statistics'; - readonly showInDialog: false; - }; - }; - }; - readonly telemetry: { - readonly type: 'object'; - readonly label: 'Telemetry'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: TelemetrySettings | undefined; - readonly description: 'Telemetry configuration.'; - readonly showInDialog: false; - readonly ref: 'TelemetrySettings'; - }; - readonly model: { - readonly type: 'object'; - readonly label: 'Model'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings related to the generative model.'; - readonly showInDialog: false; - readonly properties: { - readonly name: { - readonly type: 'string'; - readonly label: 'Model'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: string | undefined; - readonly description: 'The Gemini model to use for conversations.'; - readonly showInDialog: false; - }; - readonly maxSessionTurns: { - readonly type: 'number'; - readonly label: 'Max Session Turns'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: -1; - readonly description: 'Maximum number of user/model/tool turns to keep in a session. -1 means unlimited.'; - readonly showInDialog: true; - }; - readonly summarizeToolOutput: { - readonly type: 'object'; - readonly label: 'Summarize Tool Output'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: - | Record< - string, - { - tokenBudget?: number; - } - > - | undefined; - readonly description: string; - readonly showInDialog: false; - readonly additionalProperties: { - readonly type: 'object'; - readonly description: 'Per-tool summarization settings with an optional tokenBudget.'; - readonly ref: 'SummarizeToolOutputSettings'; - }; - }; - readonly compressionThreshold: { - readonly type: 'number'; - readonly label: 'Compression Threshold'; - readonly category: 'Model'; - readonly requiresRestart: true; - readonly default: number; - readonly description: 'The fraction of context usage at which to trigger context compression (e.g. 0.2, 0.3).'; - readonly showInDialog: true; - }; - readonly disableLoopDetection: { - readonly type: 'boolean'; - readonly label: 'Disable Loop Detection'; - readonly category: 'Model'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Disable automatic detection and prevention of infinite loops.'; - readonly showInDialog: true; - }; - readonly skipNextSpeakerCheck: { - readonly type: 'boolean'; - readonly label: 'Skip Next Speaker Check'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Skip the next speaker check.'; - readonly showInDialog: true; - }; - }; - }; - readonly modelConfigs: { - readonly type: 'object'; - readonly label: 'Model Configs'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: import('@google/gemini-cli-core/dist/src/services/modelConfigService.js').ModelConfigServiceConfig; - readonly description: 'Model configurations.'; - readonly showInDialog: false; - readonly properties: { - readonly aliases: { - readonly type: 'object'; - readonly label: 'Model Config Aliases'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: Record< - string, - import('@google/gemini-cli-core/dist/src/services/modelConfigService.js').ModelConfigAlias - >; - readonly description: 'Named presets for model configs. Can be used in place of a model name and can inherit from other aliases using an `extends` property.'; - readonly showInDialog: false; - }; - readonly customAliases: { - readonly type: 'object'; - readonly label: 'Custom Model Config Aliases'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Custom named presets for model configs. These are merged with (and override) the built-in aliases.'; - readonly showInDialog: false; - }; - readonly customOverrides: { - readonly type: 'array'; - readonly label: 'Custom Model Config Overrides'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Custom model config overrides. These are merged with (and added to) the built-in overrides.'; - readonly showInDialog: false; - }; - readonly overrides: { - readonly type: 'array'; - readonly label: 'Model Config Overrides'; - readonly category: 'Model'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Apply specific configuration overrides based on matches, with a primary key of model (or alias). The most specific match will be used.'; - readonly showInDialog: false; - }; - }; - }; - readonly agents: { - readonly type: 'object'; - readonly label: 'Agents'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Settings for subagents.'; - readonly showInDialog: false; - readonly properties: { - readonly overrides: { - readonly type: 'object'; - readonly label: 'Agent Overrides'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: Record; - readonly description: 'Override settings for specific agents, e.g. to disable the agent, set a custom model config, or run config.'; - readonly showInDialog: false; - readonly additionalProperties: { - readonly type: 'object'; - readonly ref: 'AgentOverride'; - }; - }; - }; - }; - readonly context: { - readonly type: 'object'; - readonly label: 'Context'; - readonly category: 'Context'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings for managing context provided to the model.'; - readonly showInDialog: false; - readonly properties: { - readonly fileName: { - readonly type: 'string'; - readonly label: 'Context File Name'; - readonly category: 'Context'; - readonly requiresRestart: false; - readonly default: string | string[] | undefined; - readonly ref: 'StringOrStringArray'; - readonly description: 'The name of the context file or files to load into memory. Accepts either a single string or an array of strings.'; - readonly showInDialog: false; - }; - readonly importFormat: { - readonly type: 'string'; - readonly label: 'Memory Import Format'; - readonly category: 'Context'; - readonly requiresRestart: false; - readonly default: MemoryImportFormat | undefined; - readonly description: 'The format to use when importing memory.'; - readonly showInDialog: false; - }; - readonly includeDirectoryTree: { - readonly type: 'boolean'; - readonly label: 'Include Directory Tree'; - readonly category: 'Context'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Whether to include the directory tree of the current working directory in the initial request to the model.'; - readonly showInDialog: false; - }; - readonly discoveryMaxDirs: { - readonly type: 'number'; - readonly label: 'Memory Discovery Max Dirs'; - readonly category: 'Context'; - readonly requiresRestart: false; - readonly default: 200; - readonly description: 'Maximum number of directories to search for memory.'; - readonly showInDialog: true; - }; - readonly includeDirectories: { - readonly type: 'array'; - readonly label: 'Include Directories'; - readonly category: 'Context'; - readonly requiresRestart: false; - readonly default: string[]; - readonly description: string; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly loadMemoryFromIncludeDirectories: { - readonly type: 'boolean'; - readonly label: 'Load Memory From Include Directories'; - readonly category: 'Context'; - readonly requiresRestart: false; - readonly default: false; - readonly description: string; - readonly showInDialog: true; - }; - readonly fileFiltering: { - readonly type: 'object'; - readonly label: 'File Filtering'; - readonly category: 'Context'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Settings for git-aware file filtering.'; - readonly showInDialog: false; - readonly properties: { - readonly respectGitIgnore: { - readonly type: 'boolean'; - readonly label: 'Respect .gitignore'; - readonly category: 'Context'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Respect .gitignore files when searching.'; - readonly showInDialog: true; - }; - readonly respectGeminiIgnore: { - readonly type: 'boolean'; - readonly label: 'Respect .geminiignore'; - readonly category: 'Context'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Respect .geminiignore files when searching.'; - readonly showInDialog: true; - }; - readonly enableRecursiveFileSearch: { - readonly type: 'boolean'; - readonly label: 'Enable Recursive File Search'; - readonly category: 'Context'; - readonly requiresRestart: true; - readonly default: true; - readonly description: string; - readonly showInDialog: true; - }; - readonly enableFuzzySearch: { - readonly type: 'boolean'; - readonly label: 'Enable Fuzzy Search'; - readonly category: 'Context'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Enable fuzzy search when searching for files.'; - readonly showInDialog: true; - }; - readonly customIgnoreFilePaths: { - readonly type: 'array'; - readonly label: 'Custom Ignore File Paths'; - readonly category: 'Context'; - readonly requiresRestart: true; - readonly default: string[]; - readonly description: 'Additional ignore file paths to respect. These files take precedence over .geminiignore and .gitignore. Files earlier in the array take precedence over files later in the array, e.g. the first file takes precedence over the second one.'; - readonly showInDialog: true; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - }; - }; - }; - }; - readonly tools: { - readonly type: 'object'; - readonly label: 'Tools'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Settings for built-in and custom tools.'; - readonly showInDialog: false; - readonly properties: { - readonly sandbox: { - readonly type: 'string'; - readonly label: 'Sandbox'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: boolean | string | undefined; - readonly ref: 'BooleanOrString'; - readonly description: string; - readonly showInDialog: false; - }; - readonly shell: { - readonly type: 'object'; - readonly label: 'Shell'; - readonly category: 'Tools'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings for shell execution.'; - readonly showInDialog: false; - readonly properties: { - readonly enableInteractiveShell: { - readonly type: 'boolean'; - readonly label: 'Enable Interactive Shell'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: true; - readonly description: string; - readonly showInDialog: true; - }; - readonly pager: { - readonly type: 'string'; - readonly label: 'Pager'; - readonly category: 'Tools'; - readonly requiresRestart: false; - readonly default: string | undefined; - readonly description: 'The pager command to use for shell output. Defaults to `cat`.'; - readonly showInDialog: false; - }; - readonly showColor: { - readonly type: 'boolean'; - readonly label: 'Show Color'; - readonly category: 'Tools'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Show color in shell output.'; - readonly showInDialog: true; - }; - readonly inactivityTimeout: { - readonly type: 'number'; - readonly label: 'Inactivity Timeout'; - readonly category: 'Tools'; - readonly requiresRestart: false; - readonly default: 300; - readonly description: 'The maximum time in seconds allowed without output from the shell command. Defaults to 5 minutes.'; - readonly showInDialog: false; - }; - readonly enableShellOutputEfficiency: { - readonly type: 'boolean'; - readonly label: 'Enable Shell Output Efficiency'; - readonly category: 'Tools'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Enable shell output efficiency optimizations for better performance.'; - readonly showInDialog: false; - }; - }; - }; - readonly core: { - readonly type: 'array'; - readonly label: 'Core Tools'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: string[] | undefined; - readonly description: string; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - }; - readonly allowed: { - readonly type: 'array'; - readonly label: 'Allowed Tools'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: string[] | undefined; - readonly description: string; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - }; - readonly exclude: { - readonly type: 'array'; - readonly label: 'Exclude Tools'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: string[] | undefined; - readonly description: 'Tool names to exclude from discovery.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - readonly discoveryCommand: { - readonly type: 'string'; - readonly label: 'Tool Discovery Command'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: string | undefined; - readonly description: 'Command to run for tool discovery.'; - readonly showInDialog: false; - }; - readonly callCommand: { - readonly type: 'string'; - readonly label: 'Tool Call Command'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: string | undefined; - readonly description: string; - readonly showInDialog: false; - }; - readonly useRipgrep: { - readonly type: 'boolean'; - readonly label: 'Use Ripgrep'; - readonly category: 'Tools'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance.'; - readonly showInDialog: true; - }; - readonly truncateToolOutputThreshold: { - readonly type: 'number'; - readonly label: 'Tool Output Truncation Threshold'; - readonly category: 'General'; - readonly requiresRestart: true; - readonly default: 40000; - readonly description: 'Maximum characters to show when truncating large tool outputs. Set to 0 or negative to disable truncation.'; - readonly showInDialog: true; - }; - readonly disableLLMCorrection: { - readonly type: 'boolean'; - readonly label: 'Disable LLM Correction'; - readonly category: 'Tools'; - readonly requiresRestart: true; - readonly default: true; - readonly description: string; - readonly showInDialog: true; - }; - }; - }; - readonly mcp: { - readonly type: 'object'; - readonly label: 'MCP'; - readonly category: 'MCP'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Settings for Model Context Protocol (MCP) servers.'; - readonly showInDialog: false; - readonly properties: { - readonly serverCommand: { - readonly type: 'string'; - readonly label: 'MCP Server Command'; - readonly category: 'MCP'; - readonly requiresRestart: true; - readonly default: string | undefined; - readonly description: 'Command to start an MCP server.'; - readonly showInDialog: false; - }; - readonly allowed: { - readonly type: 'array'; - readonly label: 'Allow MCP Servers'; - readonly category: 'MCP'; - readonly requiresRestart: true; - readonly default: string[] | undefined; - readonly description: 'A list of MCP servers to allow.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - }; - readonly excluded: { - readonly type: 'array'; - readonly label: 'Exclude MCP Servers'; - readonly category: 'MCP'; - readonly requiresRestart: true; - readonly default: string[] | undefined; - readonly description: 'A list of MCP servers to exclude.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - }; - }; - }; - readonly useWriteTodos: { - readonly type: 'boolean'; - readonly label: 'Use WriteTodos'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Enable the write_todos tool.'; - readonly showInDialog: false; - }; - readonly security: { - readonly type: 'object'; - readonly label: 'Security'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Security-related settings.'; - readonly showInDialog: false; - readonly properties: { - readonly disableYoloMode: { - readonly type: 'boolean'; - readonly label: 'Disable YOLO Mode'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Disable YOLO mode, even if enabled by a flag.'; - readonly showInDialog: true; - }; - readonly enablePermanentToolApproval: { - readonly type: 'boolean'; - readonly label: 'Allow Permanent Tool Approval'; - readonly category: 'Security'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Enable the "Allow for all future sessions" option in tool confirmation dialogs.'; - readonly showInDialog: true; - }; - readonly blockGitExtensions: { - readonly type: 'boolean'; - readonly label: 'Blocks extensions from Git'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Blocks installing and loading extensions from Git.'; - readonly showInDialog: true; - }; - readonly allowedExtensions: { - readonly type: 'array'; - readonly label: 'Extension Source Regex Allowlist'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: string[]; - readonly description: 'List of Regex patterns for allowed extensions. If nonempty, only extensions that match the patterns in this list are allowed. Overrides the blockGitExtensions setting.'; - readonly showInDialog: true; - readonly items: { - readonly type: 'string'; - }; - }; - readonly folderTrust: { - readonly type: 'object'; - readonly label: 'Folder Trust'; - readonly category: 'Security'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings for folder trust.'; - readonly showInDialog: false; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Folder Trust'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Setting to track whether Folder trust is enabled.'; - readonly showInDialog: true; - }; - }; - }; - readonly environmentVariableRedaction: { - readonly type: 'object'; - readonly label: 'Environment Variable Redaction'; - readonly category: 'Security'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings for environment variable redaction.'; - readonly showInDialog: false; - readonly properties: { - readonly allowed: { - readonly type: 'array'; - readonly label: 'Allowed Environment Variables'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: string[]; - readonly description: 'Environment variables to always allow (bypass redaction).'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - }; - readonly blocked: { - readonly type: 'array'; - readonly label: 'Blocked Environment Variables'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: string[]; - readonly description: 'Environment variables to always redact.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - }; - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Enable Environment Variable Redaction'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable redaction of environment variables that may contain secrets.'; - readonly showInDialog: true; - }; - }; - }; - readonly auth: { - readonly type: 'object'; - readonly label: 'Authentication'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Authentication settings.'; - readonly showInDialog: false; - readonly properties: { - readonly selectedType: { - readonly type: 'string'; - readonly label: 'Selected Auth Type'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: AuthType | undefined; - readonly description: 'The currently selected authentication type.'; - readonly showInDialog: false; - }; - readonly enforcedType: { - readonly type: 'string'; - readonly label: 'Enforced Auth Type'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: AuthType | undefined; - readonly description: 'The required auth type. If this does not match the selected auth type, the user will be prompted to re-authenticate.'; - readonly showInDialog: false; - }; - readonly useExternal: { - readonly type: 'boolean'; - readonly label: 'Use External Auth'; - readonly category: 'Security'; - readonly requiresRestart: true; - readonly default: boolean | undefined; - readonly description: 'Whether to use an external authentication flow.'; - readonly showInDialog: false; - }; - }; - }; - }; - }; - readonly advanced: { - readonly type: 'object'; - readonly label: 'Advanced'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Advanced settings for power users.'; - readonly showInDialog: false; - readonly properties: { - readonly autoConfigureMemory: { - readonly type: 'boolean'; - readonly label: 'Auto Configure Max Old Space Size'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Automatically configure Node.js memory limits'; - readonly showInDialog: true; - }; - readonly dnsResolutionOrder: { - readonly type: 'string'; - readonly label: 'DNS Resolution Order'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: DnsResolutionOrder | undefined; - readonly description: 'The DNS resolution order.'; - readonly showInDialog: false; - }; - readonly excludedEnvVars: { - readonly type: 'array'; - readonly label: 'Excluded Project Environment Variables'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: string[]; - readonly description: 'Environment variables to exclude from project context.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - readonly bugCommand: { - readonly type: 'object'; - readonly label: 'Bug Command'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: BugCommandSettings | undefined; - readonly description: 'Configuration for the bug report command.'; - readonly showInDialog: false; - readonly ref: 'BugCommandSettings'; - }; - }; - }; - readonly experimental: { - readonly type: 'object'; - readonly label: 'Experimental'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Setting to enable experimental features'; - readonly showInDialog: false; - readonly properties: { - readonly toolOutputMasking: { - readonly type: 'object'; - readonly label: 'Tool Output Masking'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly ignoreInDocs: false; - readonly default: {}; - readonly description: 'Advanced settings for tool output masking to manage context window efficiency.'; - readonly showInDialog: false; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Enable Tool Output Masking'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Enables tool output masking to save tokens.'; - readonly showInDialog: true; - }; - readonly toolProtectionThreshold: { - readonly type: 'number'; - readonly label: 'Tool Protection Threshold'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: 50000; - readonly description: 'Minimum number of tokens to protect from masking (most recent tool outputs).'; - readonly showInDialog: false; - }; - readonly minPrunableTokensThreshold: { - readonly type: 'number'; - readonly label: 'Min Prunable Tokens Threshold'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: 30000; - readonly description: 'Minimum prunable tokens required to trigger a masking pass.'; - readonly showInDialog: false; - }; - readonly protectLatestTurn: { - readonly type: 'boolean'; - readonly label: 'Protect Latest Turn'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Ensures the absolute latest turn is never masked, regardless of token count.'; - readonly showInDialog: false; - }; - }; - }; - readonly enableAgents: { - readonly type: 'boolean'; - readonly label: 'Enable Agents'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable local and remote subagents. Warning: Experimental feature, uses YOLO mode for subagents'; - readonly showInDialog: false; - }; - readonly extensionManagement: { - readonly type: 'boolean'; - readonly label: 'Extension Management'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Enable extension management features.'; - readonly showInDialog: false; - }; - readonly extensionConfig: { - readonly type: 'boolean'; - readonly label: 'Extension Configuration'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Enable requesting and fetching of extension settings.'; - readonly showInDialog: false; - }; - readonly extensionRegistry: { - readonly type: 'boolean'; - readonly label: 'Extension Registry Explore UI'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable extension registry explore UI.'; - readonly showInDialog: false; - }; - readonly extensionReloading: { - readonly type: 'boolean'; - readonly label: 'Extension Reloading'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enables extension loading/unloading within the CLI session.'; - readonly showInDialog: false; - }; - readonly jitContext: { - readonly type: 'boolean'; - readonly label: 'JIT Context Loading'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable Just-In-Time (JIT) context loading.'; - readonly showInDialog: false; - }; - readonly useOSC52Paste: { - readonly type: 'boolean'; - readonly label: 'Use OSC 52 Paste'; - readonly category: 'Experimental'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Use OSC 52 for pasting. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it).'; - readonly showInDialog: true; - }; - readonly useOSC52Copy: { - readonly type: 'boolean'; - readonly label: 'Use OSC 52 Copy'; - readonly category: 'Experimental'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Use OSC 52 for copying. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it).'; - readonly showInDialog: true; - }; - readonly plan: { - readonly type: 'boolean'; - readonly label: 'Plan'; - readonly category: 'Experimental'; - readonly requiresRestart: true; - readonly default: false; - readonly description: 'Enable planning features (Plan Mode and tools).'; - readonly showInDialog: true; - }; - readonly modelSteering: { - readonly type: 'boolean'; - readonly label: 'Model Steering'; - readonly category: 'Experimental'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'Enable model steering (user hints) to guide the model during tool execution.'; - readonly showInDialog: true; - }; - }; - }; - readonly extensions: { - readonly type: 'object'; - readonly label: 'Extensions'; - readonly category: 'Extensions'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Settings for extensions.'; - readonly showInDialog: false; - readonly properties: { - readonly disabled: { - readonly type: 'array'; - readonly label: 'Disabled Extensions'; - readonly category: 'Extensions'; - readonly requiresRestart: true; - readonly default: string[]; - readonly description: 'List of disabled extensions.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - readonly workspacesWithMigrationNudge: { - readonly type: 'array'; - readonly label: 'Workspaces with Migration Nudge'; - readonly category: 'Extensions'; - readonly requiresRestart: false; - readonly default: string[]; - readonly description: 'List of workspaces for which the migration nudge has been shown.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - }; - }; - readonly skills: { - readonly type: 'object'; - readonly label: 'Skills'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: {}; - readonly description: 'Settings for agent skills.'; - readonly showInDialog: false; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Enable Agent Skills'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Enable Agent Skills.'; - readonly showInDialog: true; - }; - readonly disabled: { - readonly type: 'array'; - readonly label: 'Disabled Skills'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: string[]; - readonly description: 'List of disabled skills.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - }; - }; - readonly hooksConfig: { - readonly type: 'object'; - readonly label: 'HooksConfig'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Hook configurations for intercepting and customizing agent behavior.'; - readonly showInDialog: false; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Enable Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: true; - readonly default: true; - readonly description: 'Canonical toggle for the hooks system. When disabled, no hooks will be executed.'; - readonly showInDialog: true; - }; - readonly disabled: { - readonly type: 'array'; - readonly label: 'Disabled Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: string[]; - readonly description: 'List of hook names (commands) that should be disabled. Hooks in this list will not execute even if configured.'; - readonly showInDialog: false; - readonly items: { - readonly type: 'string'; - readonly description: 'Hook command name'; - }; - readonly mergeStrategy: MergeStrategy.UNION; - }; - readonly notifications: { - readonly type: 'boolean'; - readonly label: 'Hook Notifications'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'Show visual indicators when hooks are executing.'; - readonly showInDialog: true; - }; - }; - }; - readonly hooks: { - readonly type: 'object'; - readonly label: 'Hook Events'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Event-specific hook configurations.'; - readonly showInDialog: false; - readonly properties: { - readonly BeforeTool: { - readonly type: 'array'; - readonly label: 'Before Tool Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute before tool execution. Can intercept, validate, or modify tool calls.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly AfterTool: { - readonly type: 'array'; - readonly label: 'After Tool Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute after tool execution. Can process results, log outputs, or trigger follow-up actions.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly BeforeAgent: { - readonly type: 'array'; - readonly label: 'Before Agent Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute before agent loop starts. Can set up context or initialize resources.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly AfterAgent: { - readonly type: 'array'; - readonly label: 'After Agent Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute after agent loop completes. Can perform cleanup or summarize results.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly Notification: { - readonly type: 'array'; - readonly label: 'Notification Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute on notification events (errors, warnings, info). Can log or alert on specific conditions.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly SessionStart: { - readonly type: 'array'; - readonly label: 'Session Start Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute when a session starts. Can initialize session-specific resources or state.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly SessionEnd: { - readonly type: 'array'; - readonly label: 'Session End Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute when a session ends. Can perform cleanup or persist session data.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly PreCompress: { - readonly type: 'array'; - readonly label: 'Pre-Compress Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute before chat history compression. Can back up or analyze conversation before compression.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly BeforeModel: { - readonly type: 'array'; - readonly label: 'Before Model Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute before LLM requests. Can modify prompts, inject context, or control model parameters.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly AfterModel: { - readonly type: 'array'; - readonly label: 'After Model Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute after LLM responses. Can process outputs, extract information, or log interactions.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - readonly BeforeToolSelection: { - readonly type: 'array'; - readonly label: 'Before Tool Selection Hooks'; - readonly category: 'Advanced'; - readonly requiresRestart: false; - readonly default: []; - readonly description: 'Hooks that execute before tool selection. Can filter or prioritize available tools dynamically.'; - readonly showInDialog: false; - readonly ref: 'HookDefinitionArray'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - }; - readonly additionalProperties: { - readonly type: 'array'; - readonly description: 'Custom hook event arrays that contain hook definitions for user-defined events'; - readonly mergeStrategy: MergeStrategy.CONCAT; - }; - }; - readonly admin: { - readonly type: 'object'; - readonly label: 'Admin'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Settings configured remotely by enterprise admins.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - readonly properties: { - readonly secureModeEnabled: { - readonly type: 'boolean'; - readonly label: 'Secure Mode Enabled'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: false; - readonly description: 'If true, disallows yolo mode from being used.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - }; - readonly extensions: { - readonly type: 'object'; - readonly label: 'Extensions Settings'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Extensions-specific admin settings.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Extensions Enabled'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'If false, disallows extensions from being installed or used.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - }; - }; - }; - readonly mcp: { - readonly type: 'object'; - readonly label: 'MCP Settings'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'MCP-specific admin settings.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'MCP Enabled'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'If false, disallows MCP servers from being used.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - }; - readonly config: { - readonly type: 'object'; - readonly label: 'MCP Config'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: Record; - readonly description: 'Admin-configured MCP servers.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - readonly additionalProperties: { - readonly type: 'object'; - readonly ref: 'MCPServerConfig'; - }; - }; - }; - }; - readonly skills: { - readonly type: 'object'; - readonly label: 'Skills Settings'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: {}; - readonly description: 'Agent Skills-specific admin settings.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - readonly properties: { - readonly enabled: { - readonly type: 'boolean'; - readonly label: 'Skills Enabled'; - readonly category: 'Admin'; - readonly requiresRestart: false; - readonly default: true; - readonly description: 'If false, disallows agent skills from being used.'; - readonly showInDialog: false; - readonly mergeStrategy: MergeStrategy.REPLACE; - }; - }; - }; - }; - }; -}; -export type SettingsSchemaType = typeof SETTINGS_SCHEMA; -export type SettingsJsonSchemaDefinition = Record; -export declare const SETTINGS_SCHEMA_DEFINITIONS: Record< - string, - SettingsJsonSchemaDefinition ->; -export declare function getSettingsSchema(): SettingsSchemaType; -type InferSettings = { - -readonly [K in keyof T]?: T[K] extends { - properties: SettingsSchema; - } - ? InferSettings - : T[K]['type'] extends 'enum' - ? T[K]['options'] extends readonly SettingEnumOption[] - ? T[K]['options'][number]['value'] - : T[K]['default'] - : T[K]['default'] extends boolean - ? boolean - : T[K]['default']; -}; -type InferMergedSettings = { - -readonly [K in keyof T]-?: T[K] extends { - properties: SettingsSchema; - } - ? InferMergedSettings - : T[K]['type'] extends 'enum' - ? T[K]['options'] extends readonly SettingEnumOption[] - ? T[K]['options'][number]['value'] - : T[K]['default'] - : T[K]['default'] extends boolean - ? boolean - : T[K]['default']; -}; -export type Settings = InferSettings; -export type MergedSettings = InferMergedSettings; -export {}; diff --git a/packages/cli/src/config/trustedFolders.d.ts b/packages/cli/src/config/trustedFolders.d.ts deleted file mode 100644 index 3f161e1dcfd..00000000000 --- a/packages/cli/src/config/trustedFolders.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { type HeadlessModeOptions } from '@google/gemini-cli-core'; -import type { Settings } from './settings.js'; -export declare const TRUSTED_FOLDERS_FILENAME = 'trustedFolders.json'; -export declare function getUserSettingsDir(): string; -export declare function getTrustedFoldersPath(): string; -export declare enum TrustLevel { - TRUST_FOLDER = 'TRUST_FOLDER', - TRUST_PARENT = 'TRUST_PARENT', - DO_NOT_TRUST = 'DO_NOT_TRUST', -} -export declare function isTrustLevel( - value: string | number | boolean | object | null | undefined, -): value is TrustLevel; -export interface TrustRule { - path: string; - trustLevel: TrustLevel; -} -export interface TrustedFoldersError { - message: string; - path: string; -} -export interface TrustedFoldersFile { - config: Record; - path: string; -} -export interface TrustResult { - isTrusted: boolean | undefined; - source: 'ide' | 'file' | undefined; -} -/** - * FOR TESTING PURPOSES ONLY. - * Clears the real path cache. - */ -export declare function clearRealPathCacheForTesting(): void; -export declare class LoadedTrustedFolders { - readonly user: TrustedFoldersFile; - readonly errors: TrustedFoldersError[]; - constructor(user: TrustedFoldersFile, errors: TrustedFoldersError[]); - get rules(): TrustRule[]; - /** - * Returns true or false if the path should be "trusted". This function - * should only be invoked when the folder trust setting is active. - * - * @param location path - * @returns - */ - isPathTrusted( - location: string, - config?: Record, - headlessOptions?: HeadlessModeOptions, - ): boolean | undefined; - setValue(folderPath: string, trustLevel: TrustLevel): Promise; -} -/** - * FOR TESTING PURPOSES ONLY. - * Resets the in-memory cache of the trusted folders configuration. - */ -export declare function resetTrustedFoldersForTesting(): void; -export declare function loadTrustedFolders(): LoadedTrustedFolders; -export declare function saveTrustedFolders( - trustedFoldersFile: TrustedFoldersFile, -): void; -/** Is folder trust feature enabled per the current applied settings */ -export declare function isFolderTrustEnabled(settings: Settings): boolean; -export declare function isWorkspaceTrusted( - settings: Settings, - workspaceDir?: string, - trustConfig?: Record, - headlessOptions?: HeadlessModeOptions, -): TrustResult; diff --git a/packages/cli/src/ui/constants.d.ts b/packages/cli/src/ui/constants.d.ts deleted file mode 100644 index b380382e445..00000000000 --- a/packages/cli/src/ui/constants.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export declare const SHELL_COMMAND_NAME = 'Shell Command'; -export declare const SHELL_NAME = 'Shell'; -export declare const MAX_GEMINI_MESSAGE_LINES = 65536; -export declare const SHELL_FOCUS_HINT_DELAY_MS = 5000; -export declare const TOOL_STATUS: { - readonly SUCCESS: '✓'; - readonly PENDING: 'o'; - readonly EXECUTING: '⊷'; - readonly CONFIRMING: '?'; - readonly CANCELED: '-'; - readonly ERROR: 'x'; -}; -export declare const MAX_MCP_RESOURCES_TO_SHOW = 10; -export declare const WARNING_PROMPT_DURATION_MS = 3000; -export declare const QUEUE_ERROR_DISPLAY_DURATION_MS = 3000; -export declare const SHELL_ACTION_REQUIRED_TITLE_DELAY_MS = 30000; -export declare const SHELL_SILENT_WORKING_TITLE_DELAY_MS = 120000; -export declare const EXPAND_HINT_DURATION_MS = 5000; -export declare const DEFAULT_BACKGROUND_OPACITY = 0.16; -export declare const DEFAULT_INPUT_BACKGROUND_OPACITY = 0.24; -export declare const DEFAULT_BORDER_OPACITY = 0.2; -export declare const KEYBOARD_SHORTCUTS_URL = - 'https://geminicli.com/docs/cli/keyboard-shortcuts/'; -export declare const LRU_BUFFER_PERF_CACHE_LIMIT = 20000; -export declare const ACTIVE_SHELL_MAX_LINES = 15; -export declare const COMPLETED_SHELL_MAX_LINES = 15; diff --git a/packages/cli/src/ui/themes/color-utils.d.ts b/packages/cli/src/ui/themes/color-utils.d.ts deleted file mode 100644 index 6c42633a94a..00000000000 --- a/packages/cli/src/ui/themes/color-utils.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export declare const INK_SUPPORTED_NAMES: Set; -export declare const CSS_NAME_TO_HEX_MAP: { - [k: string]: string; -}; -/** - * Checks if a color string is valid (hex, Ink-supported color name, or CSS color name). - * This function uses the same validation logic as the Theme class's _resolveColor method - * to ensure consistency between validation and resolution. - * @param color The color string to validate. - * @returns True if the color is valid. - */ -export declare function isValidColor(color: string): boolean; -/** - * Resolves a CSS color value (name or hex) into an Ink-compatible color string. - * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki'). - * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable. - */ -export declare function resolveColor(colorValue: string): string | undefined; -/** - * Returns a "safe" background color to use in low-color terminals if the - * terminal background is a standard black or white. - * Returns undefined if no safe background color is available for the given - * terminal background. - */ -export declare function getSafeLowColorBackground( - terminalBg: string, -): string | undefined; -export declare function interpolateColor( - color1: string, - color2: string, - factor: number, -): string; -export declare function getThemeTypeFromBackgroundColor( - backgroundColor: string | undefined, -): 'light' | 'dark' | undefined; -export declare const INK_NAME_TO_HEX_MAP: Readonly>; -/** - * Calculates the relative luminance of a color. - * See https://www.w3.org/TR/WCAG20/#relativeluminancedef - * - * @param color Color string (hex or Ink-supported name) - * @returns Luminance value (0-255) - */ -export declare function getLuminance(color: string): number; -export declare const LIGHT_THEME_LUMINANCE_THRESHOLD = 140; -export declare const DARK_THEME_LUMINANCE_THRESHOLD = 110; -/** - * Determines if the theme should be switched based on background luminance. - * Uses hysteresis to prevent flickering. - * - * @param currentThemeName The name of the currently active theme - * @param luminance The calculated relative luminance of the background (0-255) - * @param defaultThemeName The name of the default (dark) theme - * @param defaultLightThemeName The name of the default light theme - * @returns The name of the theme to switch to, or undefined if no switch is needed. - */ -export declare function shouldSwitchTheme( - currentThemeName: string | undefined, - luminance: number, - defaultThemeName: string, - defaultLightThemeName: string, -): string | undefined; -/** - * Parses an X11 RGB string (e.g. from OSC 11) into a hex color string. - * Supports 1-4 digit hex values per channel (e.g., F, FF, FFF, FFFF). - * - * @param rHex Red component as hex string - * @param gHex Green component as hex string - * @param bHex Blue component as hex string - * @returns Hex color string (e.g. #RRGGBB) - */ -export declare function parseColor( - rHex: string, - gHex: string, - bHex: string, -): string; diff --git a/packages/cli/src/ui/themes/default-light.d.ts b/packages/cli/src/ui/themes/default-light.d.ts deleted file mode 100644 index b967cd1c460..00000000000 --- a/packages/cli/src/ui/themes/default-light.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { Theme } from './theme.js'; -export declare const DefaultLight: Theme; diff --git a/packages/cli/src/ui/themes/default.d.ts b/packages/cli/src/ui/themes/default.d.ts deleted file mode 100644 index f6306691145..00000000000 --- a/packages/cli/src/ui/themes/default.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { Theme } from './theme.js'; -export declare const DefaultDark: Theme; diff --git a/packages/cli/src/ui/themes/semantic-tokens.d.ts b/packages/cli/src/ui/themes/semantic-tokens.d.ts deleted file mode 100644 index 95cbe962910..00000000000 --- a/packages/cli/src/ui/themes/semantic-tokens.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export interface SemanticColors { - text: { - primary: string; - secondary: string; - link: string; - accent: string; - response: string; - }; - background: { - primary: string; - diff: { - added: string; - removed: string; - }; - }; - border: { - default: string; - focused: string; - }; - ui: { - comment: string; - symbol: string; - dark: string; - gradient: string[] | undefined; - }; - status: { - error: string; - success: string; - warning: string; - }; -} -export declare const lightSemanticColors: SemanticColors; -export declare const darkSemanticColors: SemanticColors; diff --git a/packages/cli/src/ui/themes/theme.d.ts b/packages/cli/src/ui/themes/theme.d.ts deleted file mode 100644 index 98e82c69b01..00000000000 --- a/packages/cli/src/ui/themes/theme.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import type { CSSProperties } from 'react'; -import type { SemanticColors } from './semantic-tokens.js'; -import type { CustomTheme } from '@google/gemini-cli-core'; -export type { CustomTheme }; -export type ThemeType = 'light' | 'dark' | 'ansi' | 'custom'; -export interface ColorsTheme { - type: ThemeType; - Background: string; - Foreground: string; - LightBlue: string; - AccentBlue: string; - AccentPurple: string; - AccentCyan: string; - AccentGreen: string; - AccentYellow: string; - AccentRed: string; - DiffAdded: string; - DiffRemoved: string; - Comment: string; - Gray: string; - DarkGray: string; - GradientColors?: string[]; -} -export declare const lightTheme: ColorsTheme; -export declare const darkTheme: ColorsTheme; -export declare const ansiTheme: ColorsTheme; -export declare class Theme { - readonly name: string; - readonly type: ThemeType; - readonly colors: ColorsTheme; - /** - * The default foreground color for text when no specific highlight rule applies. - * This is an Ink-compatible color string (hex or name). - */ - readonly defaultColor: string; - /** - * Stores the mapping from highlight.js class names (e.g., 'hljs-keyword') - * to Ink-compatible color strings (hex or name). - */ - protected readonly _colorMap: Readonly>; - readonly semanticColors: SemanticColors; - /** - * Creates a new Theme instance. - * @param name The name of the theme. - * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object. - */ - constructor( - name: string, - type: ThemeType, - rawMappings: Record, - colors: ColorsTheme, - semanticColors?: SemanticColors, - ); - /** - * Gets the Ink-compatible color string for a given highlight.js class name. - * @param hljsClass The highlight.js class name (e.g., 'hljs-keyword', 'hljs-string'). - * @returns The corresponding Ink color string (hex or name) if it exists. - */ - getInkColor(hljsClass: string): string | undefined; - /** - * Resolves a CSS color value (name or hex) into an Ink-compatible color string. - * @param colorValue The raw color string (e.g., 'blue', '#ff0000', 'darkkhaki'). - * @returns An Ink-compatible color string (hex or name), or undefined if not resolvable. - */ - private static _resolveColor; - /** - * Builds the internal map from highlight.js class names to Ink-compatible color strings. - * This method is protected and primarily intended for use by the constructor. - * @param hljsTheme The raw CSSProperties mappings from a react-syntax-highlighter theme object. - * @returns An Ink-compatible theme map (Record). - */ - protected _buildColorMap( - hljsTheme: Record, - ): Record; -} -/** - * Creates a Theme instance from a custom theme configuration. - * @param customTheme The custom theme configuration. - * @returns A new Theme instance. - */ -export declare function createCustomTheme(customTheme: CustomTheme): Theme; -/** - * Validates a custom theme configuration. - * @param customTheme The custom theme to validate. - * @returns An object with isValid boolean and error message if invalid. - */ -export declare function validateCustomTheme( - customTheme: Partial, -): { - isValid: boolean; - error?: string; - warning?: string; -}; -/** - * Picks a default theme name based on terminal background color. - * It first tries to find a theme with an exact background color match. - * If no match is found, it falls back to a light or dark theme based on the - * luminance of the background color. - * @param terminalBackground The hex color string of the terminal background. - * @param availableThemes A list of available themes to search through. - * @param defaultDarkThemeName The name of the fallback dark theme. - * @param defaultLightThemeName The name of the fallback light theme. - * @returns The name of the chosen theme. - */ -export declare function pickDefaultThemeName( - terminalBackground: string | undefined, - availableThemes: readonly Theme[], - defaultDarkThemeName: string, - defaultLightThemeName: string, -): string; diff --git a/packages/cli/src/ui/types.d.ts b/packages/cli/src/ui/types.d.ts deleted file mode 100644 index 23a68d7d167..00000000000 --- a/packages/cli/src/ui/types.d.ts +++ /dev/null @@ -1,432 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { - type CompressionStatus, - type GeminiCLIExtension, - type MCPServerConfig, - type ThoughtSummary, - type SerializableConfirmationDetails, - type ToolResultDisplay, - type RetrieveUserQuotaResponse, - type SkillDefinition, - type AgentDefinition, - type ApprovalMode, - CoreToolCallStatus, -} from '@google/gemini-cli-core'; -import type { PartListUnion } from '@google/genai'; -import { type ReactNode } from 'react'; -export type { ThoughtSummary, SkillDefinition }; -export declare enum AuthState { - Unauthenticated = 'unauthenticated', - Updating = 'updating', - AwaitingApiKeyInput = 'awaiting_api_key_input', - Authenticated = 'authenticated', - AwaitingGoogleLoginRestart = 'awaiting_google_login_restart', -} -export declare enum StreamingState { - Idle = 'idle', - Responding = 'responding', - WaitingForConfirmation = 'waiting_for_confirmation', -} -export declare enum GeminiEventType { - Content = 'content', - ToolCallRequest = 'tool_call_request', -} -export declare enum ToolCallStatus { - Pending = 'Pending', - Canceled = 'Canceled', - Confirming = 'Confirming', - Executing = 'Executing', - Success = 'Success', - Error = 'Error', -} -/** - * Maps core tool call status to a simplified UI status. - */ -export declare function mapCoreStatusToDisplayStatus( - coreStatus: CoreToolCallStatus, -): ToolCallStatus; -export interface ToolCallEvent { - type: 'tool_call'; - status: CoreToolCallStatus; - callId: string; - name: string; - args: Record; - resultDisplay: ToolResultDisplay | undefined; - confirmationDetails: SerializableConfirmationDetails | undefined; - correlationId?: string; -} -export interface IndividualToolCallDisplay { - callId: string; - name: string; - description: string; - resultDisplay: ToolResultDisplay | undefined; - status: CoreToolCallStatus; - confirmationDetails: SerializableConfirmationDetails | undefined; - renderOutputAsMarkdown?: boolean; - ptyId?: number; - outputFile?: string; - correlationId?: string; - approvalMode?: ApprovalMode; - progressMessage?: string; - progressPercent?: number; -} -export interface CompressionProps { - isPending: boolean; - originalTokenCount: number | null; - newTokenCount: number | null; - compressionStatus: CompressionStatus | null; -} -/** - * For use when you want no icon. - */ -export declare const emptyIcon = ' '; -export interface HistoryItemBase { - text?: string; -} -export type HistoryItemUser = HistoryItemBase & { - type: 'user'; - text: string; -}; -export type HistoryItemGemini = HistoryItemBase & { - type: 'gemini'; - text: string; -}; -export type HistoryItemGeminiContent = HistoryItemBase & { - type: 'gemini_content'; - text: string; -}; -export type HistoryItemInfo = HistoryItemBase & { - type: 'info'; - text: string; - icon?: string; - color?: string; - marginBottom?: number; -}; -export type HistoryItemError = HistoryItemBase & { - type: 'error'; - text: string; -}; -export type HistoryItemWarning = HistoryItemBase & { - type: 'warning'; - text: string; -}; -export type HistoryItemAbout = HistoryItemBase & { - type: 'about'; - cliVersion: string; - osVersion: string; - sandboxEnv: string; - modelVersion: string; - selectedAuthType: string; - gcpProject: string; - ideClient: string; - userEmail?: string; - tier?: string; -}; -export type HistoryItemHelp = HistoryItemBase & { - type: 'help'; - timestamp: Date; -}; -export interface HistoryItemQuotaBase extends HistoryItemBase { - selectedAuthType?: string; - userEmail?: string; - tier?: string; - currentModel?: string; - pooledRemaining?: number; - pooledLimit?: number; - pooledResetTime?: string; -} -export interface QuotaStats { - remaining: number | undefined; - limit: number | undefined; - resetTime?: string; -} -export type HistoryItemStats = HistoryItemQuotaBase & { - type: 'stats'; - duration: string; - quotas?: RetrieveUserQuotaResponse; -}; -export type HistoryItemModelStats = HistoryItemQuotaBase & { - type: 'model_stats'; -}; -export type HistoryItemToolStats = HistoryItemBase & { - type: 'tool_stats'; -}; -export type HistoryItemModel = HistoryItemBase & { - type: 'model'; - model: string; -}; -export type HistoryItemQuit = HistoryItemBase & { - type: 'quit'; - duration: string; -}; -export type HistoryItemToolGroup = HistoryItemBase & { - type: 'tool_group'; - tools: IndividualToolCallDisplay[]; - borderTop?: boolean; - borderBottom?: boolean; - borderColor?: string; - borderDimColor?: boolean; -}; -export type HistoryItemUserShell = HistoryItemBase & { - type: 'user_shell'; - text: string; -}; -export type HistoryItemCompression = HistoryItemBase & { - type: 'compression'; - compression: CompressionProps; -}; -export type HistoryItemExtensionsList = HistoryItemBase & { - type: 'extensions_list'; - extensions: GeminiCLIExtension[]; -}; -export interface ChatDetail { - name: string; - mtime: string; -} -export type HistoryItemThinking = HistoryItemBase & { - type: 'thinking'; - thought: ThoughtSummary; -}; -export type HistoryItemHint = HistoryItemBase & { - type: 'hint'; - text: string; -}; -export type HistoryItemChatList = HistoryItemBase & { - type: 'chat_list'; - chats: ChatDetail[]; -}; -export interface ToolDefinition { - name: string; - displayName: string; - description?: string; -} -export type HistoryItemToolsList = HistoryItemBase & { - type: 'tools_list'; - tools: ToolDefinition[]; - showDescriptions: boolean; -}; -export type HistoryItemSkillsList = HistoryItemBase & { - type: 'skills_list'; - skills: SkillDefinition[]; - showDescriptions: boolean; -}; -export type AgentDefinitionJson = Pick< - AgentDefinition, - 'name' | 'displayName' | 'description' | 'kind' ->; -export type HistoryItemAgentsList = HistoryItemBase & { - type: 'agents_list'; - agents: AgentDefinitionJson[]; -}; -export interface JsonMcpTool { - serverName: string; - name: string; - description?: string; - schema?: { - parametersJsonSchema?: unknown; - parameters?: unknown; - }; -} -export interface JsonMcpPrompt { - serverName: string; - name: string; - description?: string; -} -export interface JsonMcpResource { - serverName: string; - name?: string; - uri?: string; - mimeType?: string; - description?: string; -} -export type HistoryItemMcpStatus = HistoryItemBase & { - type: 'mcp_status'; - servers: Record; - tools: JsonMcpTool[]; - prompts: JsonMcpPrompt[]; - resources: JsonMcpResource[]; - authStatus: Record< - string, - 'authenticated' | 'expired' | 'unauthenticated' | 'not-configured' - >; - enablementState: Record< - string, - { - enabled: boolean; - isSessionDisabled: boolean; - isPersistentDisabled: boolean; - } - >; - blockedServers: Array<{ - name: string; - extensionName: string; - }>; - discoveryInProgress: boolean; - connectingServers: string[]; - showDescriptions: boolean; - showSchema: boolean; -}; -export type HistoryItemHooksList = HistoryItemBase & { - type: 'hooks_list'; - hooks: Array<{ - config: { - command?: string; - type: string; - timeout?: number; - }; - source: string; - eventName: string; - matcher?: string; - sequential?: boolean; - enabled: boolean; - }>; -}; -export type HistoryItemWithoutId = - | HistoryItemUser - | HistoryItemUserShell - | HistoryItemGemini - | HistoryItemGeminiContent - | HistoryItemInfo - | HistoryItemError - | HistoryItemWarning - | HistoryItemAbout - | HistoryItemHelp - | HistoryItemToolGroup - | HistoryItemStats - | HistoryItemModelStats - | HistoryItemToolStats - | HistoryItemModel - | HistoryItemQuit - | HistoryItemCompression - | HistoryItemExtensionsList - | HistoryItemToolsList - | HistoryItemSkillsList - | HistoryItemAgentsList - | HistoryItemMcpStatus - | HistoryItemChatList - | HistoryItemThinking - | HistoryItemHint - | HistoryItemHooksList; -export type HistoryItem = HistoryItemWithoutId & { - id: number; -}; -export declare enum MessageType { - INFO = 'info', - ERROR = 'error', - WARNING = 'warning', - USER = 'user', - ABOUT = 'about', - HELP = 'help', - STATS = 'stats', - MODEL_STATS = 'model_stats', - TOOL_STATS = 'tool_stats', - QUIT = 'quit', - GEMINI = 'gemini', - COMPRESSION = 'compression', - EXTENSIONS_LIST = 'extensions_list', - TOOLS_LIST = 'tools_list', - SKILLS_LIST = 'skills_list', - AGENTS_LIST = 'agents_list', - MCP_STATUS = 'mcp_status', - CHAT_LIST = 'chat_list', - HOOKS_LIST = 'hooks_list', - HINT = 'hint', -} -export type Message = - | { - type: MessageType.INFO | MessageType.ERROR | MessageType.USER; - content: string; - timestamp: Date; - } - | { - type: MessageType.ABOUT; - timestamp: Date; - cliVersion: string; - osVersion: string; - sandboxEnv: string; - modelVersion: string; - selectedAuthType: string; - gcpProject: string; - ideClient: string; - userEmail?: string; - content?: string; - } - | { - type: MessageType.HELP; - timestamp: Date; - content?: string; - } - | { - type: MessageType.STATS; - timestamp: Date; - duration: string; - content?: string; - } - | { - type: MessageType.MODEL_STATS; - timestamp: Date; - content?: string; - } - | { - type: MessageType.TOOL_STATS; - timestamp: Date; - content?: string; - } - | { - type: MessageType.QUIT; - timestamp: Date; - duration: string; - content?: string; - } - | { - type: MessageType.COMPRESSION; - compression: CompressionProps; - timestamp: Date; - }; -export interface ConsoleMessageItem { - type: 'log' | 'warn' | 'error' | 'debug' | 'info'; - content: string; - count: number; -} -/** - * Result type for a slash command that should immediately result in a prompt - * being submitted to the Gemini model. - */ -export interface SubmitPromptResult { - type: 'submit_prompt'; - content: PartListUnion; -} -/** - * Defines the result of the slash command processor for its consumer (useGeminiStream). - */ -export type SlashCommandProcessorResult = - | { - type: 'schedule_tool'; - toolName: string; - toolArgs: Record; - } - | { - type: 'handled'; - } - | SubmitPromptResult; -export interface ConfirmationRequest { - prompt: ReactNode; - onConfirm: (confirm: boolean) => void; -} -export interface LoopDetectionConfirmationRequest { - onComplete: (result: { userSelection: 'disable' | 'keep' }) => void; -} -export interface PermissionConfirmationRequest { - files: string[]; - onComplete: (result: { allowed: boolean }) => void; -} -export interface ActiveHook { - name: string; - eventName: string; - index?: number; - total?: number; -} diff --git a/packages/cli/src/ui/utils/textUtils.d.ts b/packages/cli/src/ui/utils/textUtils.d.ts deleted file mode 100644 index 49d7a518b02..00000000000 --- a/packages/cli/src/ui/utils/textUtils.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * Calculates the maximum width of a multi-line ASCII art string. - * @param asciiArt The ASCII art string. - * @returns The length of the longest line in the ASCII art. - */ -export declare const getAsciiArtWidth: (asciiArt: string) => number; -/** - * Checks if a string contains only ASCII characters (0-127). - */ -export declare function isAscii(str: string): boolean; -export declare function toCodePoints(str: string): string[]; -export declare function cpLen(str: string): number; -/** - * Converts a code point index to a UTF-16 code unit offset. - */ -export declare function cpIndexToOffset(str: string, cpIndex: number): number; -export declare function cpSlice( - str: string, - start: number, - end?: number, -): string; -/** - * Strip characters that can break terminal rendering. - * - * Uses Node.js built-in stripVTControlCharacters to handle VT sequences, - * then filters remaining control characters that can disrupt display. - * - * Characters stripped: - * - ANSI escape sequences (via strip-ansi) - * - VT control sequences (via Node.js util.stripVTControlCharacters) - * - C0 control chars (0x00-0x1F) except TAB(0x09), LF(0x0A), CR(0x0D) - * - C1 control chars (0x80-0x9F) that can cause display issues - * - BiDi control chars (U+200E, U+200F, U+202A-U+202E, U+2066-U+2069) - * - Zero-width chars (U+200B, U+FEFF) - * - * Characters preserved: - * - All printable Unicode including emojis - * - ZWJ (U+200D) - needed for complex emoji sequences - * - ZWNJ (U+200C) - preserve zero-width non-joiner - * - DEL (0x7F) - handled functionally by applyOperations, not a display issue - * - CR/LF (0x0D/0x0A) - needed for line breaks - * - TAB (0x09) - preserve tabs - */ -export declare function stripUnsafeCharacters(str: string): string; -/** - * Sanitize a string for display in inline UI components (e.g. Help, Suggestions). - * Removes ANSI codes, dangerous control characters, collapses whitespace - * characters into a single space, and optionally truncates. - */ -export declare function sanitizeForDisplay( - str: string, - maxLength?: number, -): string; -/** - * Normalizes escaped newline characters (e.g., "\\n") into actual newline characters. - */ -export declare function normalizeEscapedNewlines(value: string): string; -/** - * Cached version of stringWidth function for better performance - */ -export declare const getCachedStringWidth: (str: string) => number; -export declare function escapeAnsiCtrlCodes(obj: T): T; diff --git a/packages/cli/src/utils/commentJson.d.ts b/packages/cli/src/utils/commentJson.d.ts deleted file mode 100644 index 8948f7127c8..00000000000 --- a/packages/cli/src/utils/commentJson.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * Updates a JSON file while preserving comments and formatting. - */ -export declare function updateSettingsFilePreservingFormat( - filePath: string, - updates: Record, -): void; diff --git a/packages/cli/src/utils/deepMerge.d.ts b/packages/cli/src/utils/deepMerge.d.ts deleted file mode 100644 index 0d9bb96ab02..00000000000 --- a/packages/cli/src/utils/deepMerge.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MergeStrategy } from '../config/settingsSchema.js'; -export type Mergeable = - | string - | number - | boolean - | null - | undefined - | object - | Mergeable[]; -export type MergeableObject = Record; -export declare function customDeepMerge( - getMergeStrategyForPath: (path: string[]) => MergeStrategy | undefined, - ...sources: MergeableObject[] -): MergeableObject; diff --git a/packages/cli/src/utils/envVarResolver.d.ts b/packages/cli/src/utils/envVarResolver.d.ts deleted file mode 100644 index b96a87550e6..00000000000 --- a/packages/cli/src/utils/envVarResolver.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * Resolves environment variables in a string. - * Replaces $VAR_NAME and ${VAR_NAME} with their corresponding environment variable values. - * If the environment variable is not defined, the original placeholder is preserved. - * - * @param value - The string that may contain environment variable placeholders - * @returns The string with environment variables resolved - * - * @example - * resolveEnvVarsInString("Token: $API_KEY") // Returns "Token: secret-123" - * resolveEnvVarsInString("URL: ${BASE_URL}/api") // Returns "URL: https://api.example.com/api" - * resolveEnvVarsInString("Missing: $UNDEFINED_VAR") // Returns "Missing: $UNDEFINED_VAR" - */ -export declare function resolveEnvVarsInString( - value: string, - customEnv?: Record, -): string; -/** - * Recursively resolves environment variables in an object of any type. - * Handles strings, arrays, nested objects, and preserves other primitive types. - * Protected against circular references using a WeakSet to track visited objects. - * - * @param obj - The object to process for environment variable resolution - * @returns A new object with environment variables resolved - * - * @example - * const config = { - * server: { - * host: "$HOST", - * port: "${PORT}", - * enabled: true, - * tags: ["$ENV", "api"] - * } - * }; - * const resolved = resolveEnvVarsInObject(config); - */ -export declare function resolveEnvVarsInObject( - obj: T, - customEnv?: Record, -): T; diff --git a/packages/cli/src/utils/sessionCleanup.d.ts b/packages/cli/src/utils/sessionCleanup.d.ts deleted file mode 100644 index 312087aa1dc..00000000000 --- a/packages/cli/src/utils/sessionCleanup.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { type Config } from '@google/gemini-cli-core'; -import type { Settings, SessionRetentionSettings } from '../config/settings.js'; -import { type SessionFileEntry } from './sessionUtils.js'; -export declare const DEFAULT_MIN_RETENTION: string; -/** - * Result of session cleanup operation - */ -export interface CleanupResult { - disabled: boolean; - scanned: number; - deleted: number; - skipped: number; - failed: number; -} -/** - * Main entry point for session cleanup during CLI startup - */ -export declare function cleanupExpiredSessions( - config: Config, - settings: Settings, -): Promise; -/** - * Identifies sessions that should be deleted (corrupted or expired based on retention policy) - */ -/** - * Identifies sessions that should be deleted (corrupted or expired based on retention policy) - */ -export declare function identifySessionsToDelete( - allFiles: SessionFileEntry[], - retentionConfig: SessionRetentionSettings, -): Promise; -/** - * Result of tool output cleanup operation - */ -export interface ToolOutputCleanupResult { - disabled: boolean; - scanned: number; - deleted: number; - failed: number; -} -/** - * Cleans up tool output files based on age and count limits. - * Uses the same retention settings as session cleanup. - */ -export declare function cleanupToolOutputFiles( - settings: Settings, - debugMode?: boolean, - projectTempDir?: string, -): Promise; diff --git a/packages/cli/src/utils/sessionUtils.d.ts b/packages/cli/src/utils/sessionUtils.d.ts deleted file mode 100644 index 8cbfee8ee6a..00000000000 --- a/packages/cli/src/utils/sessionUtils.d.ts +++ /dev/null @@ -1,205 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { - type Config, - type ConversationRecord, - type MessageRecord, -} from '@google/gemini-cli-core'; -import type { Part } from '@google/genai'; -import { type HistoryItemWithoutId } from '../ui/types.js'; -/** - * Constant for the resume "latest" identifier. - * Used when --resume is passed without a value to select the most recent session. - */ -export declare const RESUME_LATEST = 'latest'; -/** - * Error codes for session-related errors. - */ -export type SessionErrorCode = - | 'NO_SESSIONS_FOUND' - | 'INVALID_SESSION_IDENTIFIER'; -/** - * Error thrown for session-related failures. - * Uses a code field to differentiate between error types. - */ -export declare class SessionError extends Error { - readonly code: SessionErrorCode; - constructor(code: SessionErrorCode, message: string); - /** - * Creates an error for when no sessions exist for the current project. - */ - static noSessionsFound(): SessionError; - /** - * Creates an error for when a session identifier is invalid. - */ - static invalidSessionIdentifier(identifier: string): SessionError; -} -/** - * Represents a text match found during search with surrounding context. - */ -export interface TextMatch { - /** Text content before the match (with ellipsis if truncated) */ - before: string; - /** The exact matched text */ - match: string; - /** Text content after the match (with ellipsis if truncated) */ - after: string; - /** Role of the message author where the match was found */ - role: 'user' | 'assistant'; -} -/** - * Session information for display and selection purposes. - */ -export interface SessionInfo { - /** Unique session identifier (filename without .json) */ - id: string; - /** Filename without extension */ - file: string; - /** Full filename including .json extension */ - fileName: string; - /** ISO timestamp when session started */ - startTime: string; - /** Total number of messages in the session */ - messageCount: number; - /** ISO timestamp when session was last updated */ - lastUpdated: string; - /** Display name for the session (typically first user message) */ - displayName: string; - /** Cleaned first user message content */ - firstUserMessage: string; - /** Whether this is the currently active session */ - isCurrentSession: boolean; - /** Display index in the list */ - index: number; - /** AI-generated summary of the session (if available) */ - summary?: string; - /** Full concatenated content (only loaded when needed for search) */ - fullContent?: string; - /** Processed messages with normalized roles (only loaded when needed) */ - messages?: Array<{ - role: 'user' | 'assistant'; - content: string; - }>; - /** Search result snippets when filtering */ - matchSnippets?: TextMatch[]; - /** Total number of matches found in this session */ - matchCount?: number; -} -/** - * Represents a session file, which may be valid or corrupted. - */ -export interface SessionFileEntry { - /** Full filename including .json extension */ - fileName: string; - /** Parsed session info if valid, null if corrupted */ - sessionInfo: SessionInfo | null; -} -/** - * Result of resolving a session selection argument. - */ -export interface SessionSelectionResult { - sessionPath: string; - sessionData: ConversationRecord; - displayInfo: string; -} -/** - * Checks if a session has at least one user or assistant (gemini) message. - * Sessions with only system messages (info, error, warning) are considered empty. - * @param messages - The array of message records to check - * @returns true if the session has meaningful content - */ -export declare const hasUserOrAssistantMessage: ( - messages: MessageRecord[], -) => boolean; -/** - * Cleans and sanitizes message content for display by: - * - Converting newlines to spaces - * - Collapsing multiple whitespace to single spaces - * - Removing non-printable characters (keeping only ASCII 32-126) - * - Trimming leading/trailing whitespace - * @param message - The raw message content to clean - * @returns Sanitized message suitable for display - */ -export declare const cleanMessage: (message: string) => string; -/** - * Extracts the first meaningful user message from conversation messages. - */ -export declare const extractFirstUserMessage: ( - messages: MessageRecord[], -) => string; -/** - * Formats a timestamp as relative time. - * @param timestamp - The timestamp to format - * @param style - 'long' (e.g. "2 hours ago") or 'short' (e.g. "2h") - */ -export declare const formatRelativeTime: ( - timestamp: string, - style?: 'long' | 'short', -) => string; -export interface GetSessionOptions { - /** Whether to load full message content (needed for search) */ - includeFullContent?: boolean; -} -/** - * Loads all session files (including corrupted ones) from the chats directory. - * @returns Array of session file entries, with sessionInfo null for corrupted files - */ -export declare const getAllSessionFiles: ( - chatsDir: string, - currentSessionId?: string, - options?: GetSessionOptions, -) => Promise; -/** - * Loads all valid session files from the chats directory and converts them to SessionInfo. - * Corrupted files are automatically filtered out. - */ -export declare const getSessionFiles: ( - chatsDir: string, - currentSessionId?: string, - options?: GetSessionOptions, -) => Promise; -/** - * Utility class for session discovery and selection. - */ -export declare class SessionSelector { - private config; - constructor(config: Config); - /** - * Lists all available sessions for the current project. - */ - listSessions(): Promise; - /** - * Finds a session by identifier (UUID or numeric index). - * - * @param identifier - Can be a full UUID or an index number (1-based) - * @returns Promise resolving to the found SessionInfo - * @throws Error if the session is not found or identifier is invalid - */ - findSession(identifier: string): Promise; - /** - * Resolves a resume argument to a specific session. - * - * @param resumeArg - Can be "latest", a full UUID, or an index number (1-based) - * @returns Promise resolving to session selection result - */ - resolveSession(resumeArg: string): Promise; - /** - * Loads session data for a selected session. - */ - private selectSession; -} -/** - * Converts session/conversation data into UI history and Gemini client history formats. - */ -export declare function convertSessionToHistoryFormats( - messages: ConversationRecord['messages'], -): { - uiHistory: HistoryItemWithoutId[]; - clientHistory: Array<{ - role: 'user' | 'model'; - parts: Part[]; - }>; -}; diff --git a/packages/cli/tsc_output.txt b/packages/cli/tsc_output.txt deleted file mode 100644 index 613f361c1f7347d755162b318f78d370b51031d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2128 zcmd6oTQ37q5Xb+|65nCpN+R?^UEW+)h`NM|N1H+j)J-)l*ALyqQwnDAw(lzeV+xYfe?31=TdK4F!tO>!H(wZt6^RRgl$OR?>w| zwGThkrFNkjPBnGR(|~uRO&!83p&esAP#cRaCAz|5#9yFm4LI54c7C8CvIJh_JmaL$ zLtgX2w64%w)U0OMUmVq1VN{`Z9MvVrrVmMt3>42#s4dS;2$pT_K~E>9;x)HP6&`@& zoHeBWrW4V!_sIg^a-mLYjVrrPeK+a1j2;N}eS+T zA%xb|2`C=%zWsqQCyNn?{vXZSIAbf{ps9j(Wjy(gnOgVw-SWwm`0TQr7{)*y)@N3m zw24!>y1qMR@|xrUiA5rX?xL5uyoa@zeK|1=u#x(FEWt_nyT(?e6W`rof1iHNIIHV? z)3oy}j%_HjVv{p-4 { expected: [], }, { - name: 'should NOT include ASK_USER tools even in non-interactive mode', + name: 'should include ASK_USER tools in non-interactive mode', rules: [ { toolName: 'tool1', @@ -2198,6 +2198,18 @@ describe('PolicyEngine', () => { }, ], nonInteractive: true, + expected: ['tool1'], + }, + { + name: 'should NOT exclude ASK_USER tools in interactive mode', + rules: [ + { + toolName: 'tool1', + decision: PolicyDecision.ASK_USER, + modes: [ApprovalMode.DEFAULT], + }, + ], + nonInteractive: false, expected: [], }, { diff --git a/packages/core/src/policy/policy-engine.ts b/packages/core/src/policy/policy-engine.ts index c06bdc198db..90cf9cb36d0 100644 --- a/packages/core/src/policy/policy-engine.ts +++ b/packages/core/src/policy/policy-engine.ts @@ -641,9 +641,24 @@ export class PolicyEngine { const processedTools = new Set(); let globalVerdict: PolicyDecision | undefined; + const normalizeDecision = ( + decision: PolicyDecision, + isHeadless: boolean, + ): PolicyDecision => { + if (isHeadless && decision === PolicyDecision.ASK_USER) { + return PolicyDecision.DENY; + } + return decision; + }; + for (const rule of this.rules) { + const normalizedDecision = normalizeDecision( + rule.decision, + this.nonInteractive, + ); + if (rule.argsPattern) { - if (rule.toolName && rule.decision !== PolicyDecision.DENY) { + if (rule.toolName && normalizedDecision !== PolicyDecision.DENY) { processedTools.add(rule.toolName); } continue; @@ -702,7 +717,7 @@ export class PolicyEngine { if (globalVerdict !== undefined) { decision = globalVerdict; } else { - decision = rule.decision; + decision = normalizedDecision; } if (decision === PolicyDecision.DENY) { excludedTools.add(toolName); @@ -715,10 +730,8 @@ export class PolicyEngine { // Handle Global Rules if (!rule.toolName) { if (globalVerdict === undefined) { - globalVerdict = rule.decision; - const effectiveGlobalVerdict = - this.applyNonInteractiveMode(globalVerdict); - if (effectiveGlobalVerdict !== PolicyDecision.DENY) { + globalVerdict = normalizedDecision; + if (globalVerdict !== PolicyDecision.DENY) { // Global ALLOW/ASK found. // Since rules are sorted by priority, this overrides any lower-priority rules. // We can stop processing because nothing else will be excluded. @@ -761,9 +774,9 @@ export class PolicyEngine { // Determine decision let decision: PolicyDecision; if (globalVerdict !== undefined) { - decision = this.applyNonInteractiveMode(globalVerdict); + decision = globalVerdict; } else { - decision = this.applyNonInteractiveMode(rule.decision); + decision = normalizedDecision; } if (decision === PolicyDecision.DENY) { diff --git a/test_output.txt b/test_output.txt deleted file mode 100644 index cb48f16b007..00000000000 --- a/test_output.txt +++ /dev/null @@ -1,79 +0,0 @@ - - RUN v3.2.4 E:/gemini-cli - -stdout | integration-tests/policy_repro.test.ts > Headless Policy Reproduction > should respect --policy even in headless mode -CLI Result: Command output verified. - - -StdErr: -Timeout of 30000 exceeds the interval of 10000. Clamping timeout to interval duration. -The 'metricReader' option is deprecated. Please use 'metricReaders' instead. -File C:\Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached -(node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. -(Use `node --trace-deprecation ...` to show where the warning was created) -Error executing tool run_shell_command: Tool "run_shell_command" not found. Did you mean one of: "grep_search", "cli_help", "read_file"? - - -stderr | integration-tests/policy_repro.test.ts > Headless Policy Reproduction > should respect --policy even in headless mode -Test failed - Debug info: -Result length: 706 -Result (first 500 chars): Command output verified. - - -StdErr: -Timeout of 30000 exceeds the interval of 10000. Clamping timeout to interval duration. -The 'metricReader' option is deprecated. Please use 'metricReaders' instead. -File C:\Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached -(node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. -(Use ` -Result (last 500 chars): \Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached -(node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. -(Use `node --trace-deprecation ...` to show where the warning was created) -Error executing tool run_shell_command: Tool "run_shell_command" not found. Did you mean one of: "grep_search", "cli_help", "read_file"? - -Found tool call: true -Policy path: C:\Users\Nilan\AppData\Local\Temp\gemini-cli-tests\should-respect-policy-even-in-headless-mode\allow-shell.toml -Result contains expected string: false -All tool calls found: [ 'run_shell_command' ] - - ❯ integration-tests/policy_repro.test.ts (1 test | 1 failed) 9465ms - × Headless Policy Reproduction > should respect --policy even in headless mode 9464ms - → expected 'Command output verified.\n\n\nStdErr:…' to contain 'policy-test-passed' - -⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL integration-tests/policy_repro.test.ts > Headless Policy Reproduction > should respect --policy even in headless mode -AssertionError: expected 'Command output verified.\n\n\nStdErr:…' to contain 'policy-test-passed' - -- Expected -+ Received - -- policy-test-passed -+ Command output verified. -+ -+ -+ StdErr: -+ Timeout of 30000 exceeds the interval of 10000. Clamping timeout to interval duration. -+ The 'metricReader' option is deprecated. Please use 'metricReaders' instead. -+ File C:\Users\Nilan\.cache/vscode-ripgrep/ripgrep-v13.0.0-10-x86_64-pc-windows-msvc.zip has been cached -+ (node:18380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. -+ (Use `node --trace-deprecation ...` to show where the warning was created) -+ Error executing tool run_shell_command: Tool "run_shell_command" not found. Did you mean one of: "grep_search", "cli_help", "read_file"? -+ - - ❯ integration-tests/policy_repro.test.ts:74:20 - 72| 'Expected run_shell_command to be allowed by policy', - 73| ).toBe(true); - 74| expect(result).toContain('policy-test-passed'); - | ^ - 75| }, 30000); - 76| }); - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ - - - Test Files 1 failed (1) - Tests 1 failed (1) - Start at 21:21:23 - Duration 24.00s (transform 4.23s, setup 0ms, collect 13.15s, tests 9.47s, environment 0ms, prepare 580ms) - From 1402d5cc940554a8202e7e9d01ebc6d5e51f7210 Mon Sep 17 00:00:00 2001 From: Devnil434 Date: Fri, 27 Feb 2026 20:09:59 +0530 Subject: [PATCH 4/4] test: Add integration tests to verify `ask_user` policy decisions are denied in headless mode. --- integration-tests/policy_repro.test.ts | 4 +- package-lock.json | 327 +++++++++++++++---------- 2 files changed, 193 insertions(+), 138 deletions(-) diff --git a/integration-tests/policy_repro.test.ts b/integration-tests/policy_repro.test.ts index e91d780e693..581ee1e49eb 100644 --- a/integration-tests/policy_repro.test.ts +++ b/integration-tests/policy_repro.test.ts @@ -83,7 +83,7 @@ priority = 999 // The actual command result should not appear in the output. expect(result).not.toContain('policy-test-passed'); - }, 30000); + }, 15000); it('should treat global ask_user decisions as DENY in headless mode', async () => { // 1. Setup the rig with fake responses @@ -144,5 +144,5 @@ priority = 999 // The actual command result should not appear in the output. expect(result).not.toContain('global-test-passed'); - }, 30000); + }, 15000); }); diff --git a/package-lock.json b/package-lock.json index 82bf1c22216..33016dffc7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1079,9 +1079,9 @@ } }, "node_modules/@eslint/config-array/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -1181,9 +1181,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -3130,9 +3130,9 @@ "license": "BSD-3-Clause" }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.2.tgz", - "integrity": "sha512-yDPzwsgiFO26RJA4nZo8I+xqzh7sJTZIWQOxn+/XOdPE31lAvLIYCKqjV+lNH/vxE2L2iH3plKxDCRK6i+CwhA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz", + "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==", "cpu": [ "arm" ], @@ -3143,9 +3143,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.2.tgz", - "integrity": "sha512-k8FontTxIE7b0/OGKeSN5B6j25EuppBcWM33Z19JoVT7UTXFSo3D9CdU39wGTeb29NO3XxpMNauh09B+Ibw+9g==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz", + "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==", "cpu": [ "arm64" ], @@ -3156,9 +3156,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.2.tgz", - "integrity": "sha512-A6s4gJpomNBtJ2yioj8bflM2oogDwzUiMl2yNJ2v9E7++sHrSrsQ29fOfn5DM/iCzpWcebNYEdXpaK4tr2RhfQ==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz", + "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==", "cpu": [ "arm64" ], @@ -3169,9 +3169,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.2.tgz", - "integrity": "sha512-e6XqVmXlHrBlG56obu9gDRPW3O3hLxpwHpLsBJvuI8qqnsrtSZ9ERoWUXtPOkY8c78WghyPHZdmPhHLWNdAGEw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz", + "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==", "cpu": [ "x64" ], @@ -3182,9 +3182,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.2.tgz", - "integrity": "sha512-v0E9lJW8VsrwPux5Qe5CwmH/CF/2mQs6xU1MF3nmUxmZUCHazCjLgYvToOk+YuuUqLQBio1qkkREhxhc656ViA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz", + "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==", "cpu": [ "arm64" ], @@ -3195,9 +3195,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.2.tgz", - "integrity": "sha512-ClAmAPx3ZCHtp6ysl4XEhWU69GUB1D+s7G9YjHGhIGCSrsg00nEGRRZHmINYxkdoJehde8VIsDC5t9C0gb6yqA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz", + "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==", "cpu": [ "x64" ], @@ -3208,9 +3208,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.2.tgz", - "integrity": "sha512-EPlb95nUsz6Dd9Qy13fI5kUPXNSljaG9FiJ4YUGU1O/Q77i5DYFW5KR8g1OzTcdZUqQQ1KdDqsTohdFVwCwjqg==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz", + "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==", "cpu": [ "arm" ], @@ -3221,9 +3221,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.2.tgz", - "integrity": "sha512-BOmnVW+khAUX+YZvNfa0tGTEMVVEerOxN0pDk2E6N6DsEIa2Ctj48FOMfNDdrwinocKaC7YXUZ1pHlKpnkja/Q==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz", + "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==", "cpu": [ "arm" ], @@ -3234,9 +3234,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.2.tgz", - "integrity": "sha512-Xt2byDZ+6OVNuREgBXr4+CZDJtrVso5woFtpKdGPhpTPHcNG7D8YXeQzpNbFRxzTVqJf7kvPMCub/pcGUWgBjA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz", + "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==", "cpu": [ "arm64" ], @@ -3247,9 +3247,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.2.tgz", - "integrity": "sha512-+LdZSldy/I9N8+klim/Y1HsKbJ3BbInHav5qE9Iy77dtHC/pibw1SR/fXlWyAk0ThnpRKoODwnAuSjqxFRDHUQ==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz", + "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==", "cpu": [ "arm64" ], @@ -3260,9 +3260,22 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.2.tgz", - "integrity": "sha512-8ms8sjmyc1jWJS6WdNSA23rEfdjWB30LH8Wqj0Cqvv7qSHnvw6kgMMXRdop6hkmGPlyYBdRPkjJnj3KCUHV/uQ==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz", + "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz", + "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==", "cpu": [ "loong64" ], @@ -3273,9 +3286,22 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.2.tgz", - "integrity": "sha512-3HRQLUQbpBDMmzoxPJYd3W6vrVHOo2cVW8RUo87Xz0JPJcBLBr5kZ1pGcQAhdZgX9VV7NbGNipah1omKKe23/g==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz", + "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz", + "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==", "cpu": [ "ppc64" ], @@ -3286,9 +3312,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.2.tgz", - "integrity": "sha512-fMjKi+ojnmIvhk34gZP94vjogXNNUKMEYs+EDaB/5TG/wUkoeua7p7VCHnE6T2Tx+iaghAqQX8teQzcvrYpaQA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz", + "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==", "cpu": [ "riscv64" ], @@ -3299,9 +3325,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.2.tgz", - "integrity": "sha512-XuGFGU+VwUUV5kLvoAdi0Wz5Xbh2SrjIxCtZj6Wq8MDp4bflb/+ThZsVxokM7n0pcbkEr2h5/pzqzDYI7cCgLQ==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz", + "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==", "cpu": [ "riscv64" ], @@ -3312,9 +3338,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.2.tgz", - "integrity": "sha512-w6yjZF0P+NGzWR3AXWX9zc0DNEGdtvykB03uhonSHMRa+oWA6novflo2WaJr6JZakG2ucsyb+rvhrKac6NIy+w==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz", + "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==", "cpu": [ "s390x" ], @@ -3325,9 +3351,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.2.tgz", - "integrity": "sha512-yo8d6tdfdeBArzC7T/PnHd7OypfI9cbuZzPnzLJIyKYFhAQ8SvlkKtKBMbXDxe1h03Rcr7u++nFS7tqXz87Gtw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz", + "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==", "cpu": [ "x64" ], @@ -3338,9 +3364,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.2.tgz", - "integrity": "sha512-ah59c1YkCxKExPP8O9PwOvs+XRLKwh/mV+3YdKqQ5AMQ0r4M4ZDuOrpWkUaqO7fzAHdINzV9tEVu8vNw48z0lA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz", + "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==", "cpu": [ "x64" ], @@ -3350,10 +3376,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz", + "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.2.tgz", - "integrity": "sha512-4VEd19Wmhr+Zy7hbUsFZ6YXEiP48hE//KPLCSVNY5RMGX2/7HZ+QkN55a3atM1C/BZCGIgqN+xrVgtdak2S9+A==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz", + "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==", "cpu": [ "arm64" ], @@ -3364,9 +3403,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.2.tgz", - "integrity": "sha512-IlbHFYc/pQCgew/d5fslcy1KEaYVCJ44G8pajugd8VoOEI8ODhtb/j8XMhLpwHCMB3yk2J07ctup10gpw2nyMA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz", + "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==", "cpu": [ "arm64" ], @@ -3377,9 +3416,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.2.tgz", - "integrity": "sha512-lNlPEGgdUfSzdCWU176ku/dQRnA7W+Gp8d+cWv73jYrb8uT7HTVVxq62DUYxjbaByuf1Yk0RIIAbDzp+CnOTFg==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz", + "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==", "cpu": [ "ia32" ], @@ -3390,9 +3429,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.2.tgz", - "integrity": "sha512-S6YojNVrHybQis2lYov1sd+uj7K0Q05NxHcGktuMMdIQ2VixGwAfbJ23NnlvvVV1bdpR2m5MsNBViHJKcA4ADw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz", + "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==", "cpu": [ "x64" ], @@ -3403,9 +3442,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.2.tgz", - "integrity": "sha512-k+/Rkcyx//P6fetPoLMb8pBeqJBNGx81uuf7iljX9++yNBVRDQgD04L+SVXmXmh5ZP4/WOp4mWF0kmi06PW2tA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz", + "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==", "cpu": [ "x64" ], @@ -3851,9 +3890,9 @@ } }, "node_modules/@ts-morph/common/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -4618,9 +4657,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -5113,9 +5152,9 @@ } }, "node_modules/@vscode/vsce/node_modules/glob/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -7142,9 +7181,9 @@ } }, "node_modules/depcheck/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -8052,9 +8091,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -8147,9 +8186,9 @@ } }, "node_modules/eslint-plugin-react/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -8250,9 +8289,9 @@ } }, "node_modules/eslint/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -8669,10 +8708,22 @@ ], "license": "BSD-3-Clause" }, + "node_modules/fast-xml-builder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.0.0.tgz", + "integrity": "sha512-fpZuDogrAgnyt9oDDz+5DBz0zgPdPZz6D4IR7iESxRXElrlGTRkHJ9eEt+SACRJwT0FNFrt71DFQIUFBJfX/uQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, "node_modules/fast-xml-parser": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.7.tgz", - "integrity": "sha512-JzVLro9NQv92pOM/jTCR6mHlJh2FGwtomH8ZQjhFj/R29P2Fnj38OgPJVtcvYw6SuKClhgYuwUZf5b3rd8u2mA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.4.1.tgz", + "integrity": "sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==", "funding": [ { "type": "github", @@ -8681,6 +8732,7 @@ ], "license": "MIT", "dependencies": { + "fast-xml-builder": "^1.0.0", "strnum": "^2.1.2" }, "bin": { @@ -9313,9 +9365,9 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "license": "BlueOak-1.0.0", "dependencies": { "brace-expansion": "^5.0.2" @@ -11912,9 +11964,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.3.tgz", - "integrity": "sha512-M2GCs7Vk83NxkUyQV1bkABc4yxgz9kILhHImZiBPAZ9ybuvCb0/H7lEl5XvIg3g+9d4eNotkZA5IWwYl0tibaA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -12094,9 +12146,9 @@ } }, "node_modules/multimatch/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -12461,9 +12513,9 @@ "license": "ISC" }, "node_modules/npm-run-all/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -14160,9 +14212,9 @@ } }, "node_modules/rollup": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.53.2.tgz", - "integrity": "sha512-MHngMYwGJVi6Fmnk6ISmnk7JAHRNF0UkuucA0CUW3N3a4KnONPEZz+vUanQP/ZC/iY1Qkf3bwPWzyY84wEks1g==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz", + "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==", "license": "MIT", "dependencies": { "@types/estree": "1.0.8" @@ -14175,28 +14227,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.53.2", - "@rollup/rollup-android-arm64": "4.53.2", - "@rollup/rollup-darwin-arm64": "4.53.2", - "@rollup/rollup-darwin-x64": "4.53.2", - "@rollup/rollup-freebsd-arm64": "4.53.2", - "@rollup/rollup-freebsd-x64": "4.53.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.53.2", - "@rollup/rollup-linux-arm-musleabihf": "4.53.2", - "@rollup/rollup-linux-arm64-gnu": "4.53.2", - "@rollup/rollup-linux-arm64-musl": "4.53.2", - "@rollup/rollup-linux-loong64-gnu": "4.53.2", - "@rollup/rollup-linux-ppc64-gnu": "4.53.2", - "@rollup/rollup-linux-riscv64-gnu": "4.53.2", - "@rollup/rollup-linux-riscv64-musl": "4.53.2", - "@rollup/rollup-linux-s390x-gnu": "4.53.2", - "@rollup/rollup-linux-x64-gnu": "4.53.2", - "@rollup/rollup-linux-x64-musl": "4.53.2", - "@rollup/rollup-openharmony-arm64": "4.53.2", - "@rollup/rollup-win32-arm64-msvc": "4.53.2", - "@rollup/rollup-win32-ia32-msvc": "4.53.2", - "@rollup/rollup-win32-x64-gnu": "4.53.2", - "@rollup/rollup-win32-x64-msvc": "4.53.2", + "@rollup/rollup-android-arm-eabi": "4.59.0", + "@rollup/rollup-android-arm64": "4.59.0", + "@rollup/rollup-darwin-arm64": "4.59.0", + "@rollup/rollup-darwin-x64": "4.59.0", + "@rollup/rollup-freebsd-arm64": "4.59.0", + "@rollup/rollup-freebsd-x64": "4.59.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", + "@rollup/rollup-linux-arm-musleabihf": "4.59.0", + "@rollup/rollup-linux-arm64-gnu": "4.59.0", + "@rollup/rollup-linux-arm64-musl": "4.59.0", + "@rollup/rollup-linux-loong64-gnu": "4.59.0", + "@rollup/rollup-linux-loong64-musl": "4.59.0", + "@rollup/rollup-linux-ppc64-gnu": "4.59.0", + "@rollup/rollup-linux-ppc64-musl": "4.59.0", + "@rollup/rollup-linux-riscv64-gnu": "4.59.0", + "@rollup/rollup-linux-riscv64-musl": "4.59.0", + "@rollup/rollup-linux-s390x-gnu": "4.59.0", + "@rollup/rollup-linux-x64-gnu": "4.59.0", + "@rollup/rollup-linux-x64-musl": "4.59.0", + "@rollup/rollup-openbsd-x64": "4.59.0", + "@rollup/rollup-openharmony-arm64": "4.59.0", + "@rollup/rollup-win32-arm64-msvc": "4.59.0", + "@rollup/rollup-win32-ia32-msvc": "4.59.0", + "@rollup/rollup-win32-x64-gnu": "4.59.0", + "@rollup/rollup-win32-x64-msvc": "4.59.0", "fsevents": "~2.3.2" } }, @@ -15557,9 +15612,9 @@ } }, "node_modules/test-exclude/node_modules/minimatch": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", - "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": {