@google/gemini-cli 0.42.0-preview.2 → 0.43.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{chunk-FIIOJPLW.js → chunk-43AGRA7S.js} +3 -3
- package/bundle/{chunk-M6ZQAQKH.js → chunk-46T44JOY.js} +1 -1
- package/bundle/{chunk-OFOKTVUH.js → chunk-4TLQKGTR.js} +1 -1
- package/bundle/{chunk-4NXNVHPO.js → chunk-6XOSIMPZ.js} +8 -9
- package/bundle/{chunk-AAU5XCLJ.js → chunk-HQXINMBL.js} +2 -2
- package/bundle/{chunk-QM234EIA.js → chunk-JENIU3E3.js} +1 -1
- package/bundle/{chunk-R7BHIYZD.js → chunk-LBQFRHYD.js} +1 -1
- package/bundle/{chunk-WLPWIJ3Y.js → chunk-LFGJVOVZ.js} +486 -381
- package/bundle/{chunk-DEKZKOVU.js → chunk-MRHFLHPJ.js} +2 -2
- package/bundle/{chunk-ODIOD5TJ.js → chunk-MXKXLNQD.js} +3 -3
- package/bundle/{chunk-ECNYAST2.js → chunk-N6QYTC2T.js} +5417 -5376
- package/bundle/{chunk-WOGMVEEF.js → chunk-NBRZ4A3S.js} +2170 -791
- package/bundle/{chunk-Q24MYLMP.js → chunk-P4UQCQUB.js} +3 -3
- package/bundle/{chunk-S3WIE72K.js → chunk-PGJUNQPO.js} +34 -16
- package/bundle/{chunk-THNM4JU6.js → chunk-PSWUV2OO.js} +3 -3
- package/bundle/{chunk-6QBZKEWW.js → chunk-PYLHDAUK.js} +3 -3
- package/bundle/{chunk-2KRAWFEQ.js → chunk-Q23X5R4A.js} +486 -381
- package/bundle/{chunk-SJ6AOVZF.js → chunk-QYUN3J2L.js} +533 -441
- package/bundle/{chunk-77HSANAH.js → chunk-SAISHGWW.js} +1907 -716
- package/bundle/{chunk-I6IY72IP.js → chunk-SYD5SJFT.js} +38 -23
- package/bundle/{chunk-JW36FWGZ.js → chunk-T3SUXLQQ.js} +2 -2
- package/bundle/{chunk-BLNG7CSO.js → chunk-UIG2IVPJ.js} +34 -16
- package/bundle/{chunk-JEW7ZIWE.js → chunk-UJ26GAE5.js} +5326 -5290
- package/bundle/{chunk-E54WEGH3.js → chunk-UNAVBUTP.js} +14729 -7452
- package/bundle/{chunk-LYMYMKWM.js → chunk-WQOLTO3C.js} +1 -1
- package/bundle/{chunk-WFKT4UTI.js → chunk-X26T73X6.js} +3 -3
- package/bundle/{cleanup-5FPOUEHR.js → cleanup-EIZJH2E3.js} +3 -3
- package/bundle/{cleanup-G7DNOS4V.js → cleanup-MI76P55B.js} +3 -3
- package/bundle/{cleanup-GZM5KIZA.js → cleanup-NZBQYB7U.js} +3 -3
- package/bundle/{core-IYSSLWMM.js → core-ERSGIOMQ.js} +30 -2
- package/bundle/{dist-D7FZVGG3.js → core-T2TBFAYG.js} +30 -2
- package/bundle/{devtoolsService-UADEEKOH.js → devtoolsService-7KZDSYEF.js} +3 -3
- package/bundle/{devtoolsService-3XOQOECV.js → devtoolsService-FYTOIC37.js} +3 -3
- package/bundle/{devtoolsService-7ZN7CSSO.js → devtoolsService-LV5NJ2BT.js} +4 -5
- package/bundle/{dist-GF2RNVWZ.js → dist-ETX67B7P.js} +30 -2
- package/bundle/docs/changelogs/index.md +14 -0
- package/bundle/docs/changelogs/latest.md +108 -166
- package/bundle/docs/changelogs/preview.md +227 -103
- package/bundle/docs/cli/auto-memory.md +60 -38
- package/bundle/docs/cli/settings.md +1 -1
- package/bundle/docs/cli/tutorials/memory-management.md +1 -1
- package/bundle/docs/extensions/releasing.md +58 -24
- package/bundle/docs/reference/configuration.md +14 -1
- package/bundle/docs/reference/keyboard-shortcuts.md +23 -0
- package/bundle/{gemini-IRKIMLB4.js → gemini-IVKBXHDT.js} +160 -60
- package/bundle/{gemini-MWN2MSYV.js → gemini-JKWQQTKP.js} +160 -60
- package/bundle/{gemini-IMX43TZ4.js → gemini-Z77GAAR6.js} +331 -245
- package/bundle/gemini.js +8 -8
- package/bundle/{interactiveCli-SAMKYHUU.js → interactiveCli-36WZS6KT.js} +1704 -1457
- package/bundle/{interactiveCli-752P4PTI.js → interactiveCli-BQ36B66Z.js} +1703 -1457
- package/bundle/{interactiveCli-VX6GBWOV.js → interactiveCli-SME5QTEN.js} +1967 -1739
- package/bundle/{liteRtServerManager-CDLVKT7N.js → liteRtServerManager-2QD4R3A3.js} +5 -5
- package/bundle/{liteRtServerManager-FPYU5KEK.js → liteRtServerManager-ISYDOBNC.js} +5 -5
- package/bundle/{liteRtServerManager-OWPZ35U6.js → liteRtServerManager-N6OMT6W5.js} +5 -5
- package/bundle/{memoryDiscovery-FB7MMKTA.js → memoryDiscovery-LLSKN6HL.js} +1 -1
- package/bundle/{memoryDiscovery-KSYZVCWF.js → memoryDiscovery-SJ7P6RCN.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-446FDCUW.js → oauth2-provider-DOSIH6VE.js} +2 -2
- package/bundle/{oauth2-provider-RQNNLGWV.js → oauth2-provider-TZF6EZRX.js} +2 -2
- package/bundle/{oauth2-provider-6W4IY3LC.js → oauth2-provider-VFOABWBW.js} +73 -39
- package/bundle/{start-6U3XBAVH.js → start-3GPIRK3E.js} +7 -7
- package/bundle/{start-KUNHDGRA.js → start-6NONW677.js} +7 -7
- package/bundle/{start-TTLMBKNX.js → start-M6MUPEJS.js} +7 -7
- package/package.json +1 -1
- package/bundle/chunk-76KOJPMV.js +0 -391
- package/bundle/chunk-LHVIO4J4.js +0 -81544
- package/bundle/chunk-OP6THN3K.js +0 -118
- package/bundle/chunk-RO2XVFEU.js +0 -512
- package/bundle/chunk-WRDVEMWE.js +0 -1571
- package/bundle/chunk-YDC4M26X.js +0 -156
- package/bundle/chunk-ZDP2ZWKG.js +0 -17230
- package/bundle/chunk-ZFOGBX2H.js +0 -356008
- package/bundle/cleanup-J6AUEKWI.js +0 -33
- package/bundle/devtoolsService-KTUMQHXG.js +0 -857
- package/bundle/dist-HBMVDPXB.js +0 -2096
- package/bundle/gemini-SYFUC6XO.js +0 -16256
- package/bundle/interactiveCli-37SKHAKX.js +0 -34505
- package/bundle/liteRtServerManager-OWTQEYE6.js +0 -66
- package/bundle/oauth2-provider-TITPL3DN.js +0 -237
- package/bundle/start-TZXEJLTH.js +0 -19
|
@@ -41,18 +41,18 @@ import {
|
|
|
41
41
|
updateAllUpdatableExtensions,
|
|
42
42
|
updateExtension,
|
|
43
43
|
validateAuthMethod
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-LFGJVOVZ.js";
|
|
45
45
|
import {
|
|
46
46
|
appEvents
|
|
47
47
|
} from "./chunk-5PS3AYFU.js";
|
|
48
48
|
import {
|
|
49
49
|
startCommand,
|
|
50
50
|
startServer
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-PSWUV2OO.js";
|
|
52
52
|
import {
|
|
53
53
|
exitCli,
|
|
54
54
|
require_source
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-JENIU3E3.js";
|
|
56
56
|
import {
|
|
57
57
|
DEFAULT_PORT,
|
|
58
58
|
GEMMA_MODEL_NAME,
|
|
@@ -86,11 +86,11 @@ import {
|
|
|
86
86
|
readServerProcessInfo,
|
|
87
87
|
resolveGemmaConfig,
|
|
88
88
|
saveModelChange
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-UIG2IVPJ.js";
|
|
90
90
|
import {
|
|
91
91
|
RELAUNCH_EXIT_CODE
|
|
92
|
-
} from "./chunk-
|
|
93
|
-
import "./chunk-
|
|
92
|
+
} from "./chunk-MXKXLNQD.js";
|
|
93
|
+
import "./chunk-WQOLTO3C.js";
|
|
94
94
|
import {
|
|
95
95
|
cleanupCheckpoints,
|
|
96
96
|
registerCleanup,
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
runExitCleanup,
|
|
100
100
|
runSyncCleanup,
|
|
101
101
|
setupSignalHandlers
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-HQXINMBL.js";
|
|
103
103
|
import {
|
|
104
104
|
AuthType,
|
|
105
105
|
ChatRecordingService,
|
|
@@ -176,6 +176,7 @@ import {
|
|
|
176
176
|
listInboxPatches,
|
|
177
177
|
listInboxSkills,
|
|
178
178
|
listMemoryFiles,
|
|
179
|
+
loadConversationRecord,
|
|
179
180
|
logToolCall,
|
|
180
181
|
logUserPrompt,
|
|
181
182
|
parseAndFormatApiError,
|
|
@@ -199,7 +200,7 @@ import {
|
|
|
199
200
|
updatePolicy,
|
|
200
201
|
writeToStderr,
|
|
201
202
|
writeToStdout
|
|
202
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-SAISHGWW.js";
|
|
203
204
|
import {
|
|
204
205
|
ASK_USER_TOOL_NAME,
|
|
205
206
|
ApprovalMode,
|
|
@@ -241,13 +242,14 @@ import {
|
|
|
241
242
|
getDisplayString,
|
|
242
243
|
getErrorMessage,
|
|
243
244
|
getErrorType,
|
|
245
|
+
getProjectHash,
|
|
244
246
|
homedir,
|
|
245
247
|
isFatalToolError,
|
|
246
248
|
isNodeError,
|
|
247
249
|
loadServerHierarchicalMemory,
|
|
248
250
|
resolveToRealPath,
|
|
249
251
|
setGeminiMdFilename
|
|
250
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-UJ26GAE5.js";
|
|
251
253
|
import "./chunk-664ZODQF.js";
|
|
252
254
|
import "./chunk-RJTRUG2J.js";
|
|
253
255
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -1532,11 +1534,11 @@ var parser = new YargsParser({
|
|
|
1532
1534
|
resolve: resolve2,
|
|
1533
1535
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
1534
1536
|
// we can exercise all the lines below:
|
|
1535
|
-
require: (
|
|
1537
|
+
require: (path16) => {
|
|
1536
1538
|
if (typeof __require !== "undefined") {
|
|
1537
|
-
return __require(
|
|
1538
|
-
} else if (
|
|
1539
|
-
return JSON.parse(readFileSync(
|
|
1539
|
+
return __require(path16);
|
|
1540
|
+
} else if (path16.match(/\.json$/)) {
|
|
1541
|
+
return JSON.parse(readFileSync(path16, "utf8"));
|
|
1540
1542
|
} else {
|
|
1541
1543
|
throw Error("only .json config files are supported in ESM");
|
|
1542
1544
|
}
|
|
@@ -5447,12 +5449,16 @@ async function getServerStatus(serverName, server, isTrusted, activeSettings) {
|
|
|
5447
5449
|
}
|
|
5448
5450
|
return MCPServerStatus.DISABLED;
|
|
5449
5451
|
}
|
|
5452
|
+
if (!isTrusted) {
|
|
5453
|
+
return MCPServerStatus.DISABLED;
|
|
5454
|
+
}
|
|
5450
5455
|
return testMCPConnection(serverName, server, isTrusted, activeSettings);
|
|
5451
5456
|
}
|
|
5452
5457
|
async function listMcpServers(loadedSettingsArg) {
|
|
5453
5458
|
const loadedSettings = loadedSettingsArg ?? loadSettings();
|
|
5454
5459
|
const activeSettings = loadedSettings.merged;
|
|
5455
|
-
const
|
|
5460
|
+
const allSettings = !loadedSettings.isTrusted ? loadedSettings.getMergedSettingsAsIfTrusted() : activeSettings;
|
|
5461
|
+
const { mcpServers, blockedServerNames } = await getMcpServersFromConfig(allSettings);
|
|
5456
5462
|
const serverNames = Object.keys(mcpServers);
|
|
5457
5463
|
if (blockedServerNames.length > 0) {
|
|
5458
5464
|
const message = getAdminBlockedMcpServersMessage(
|
|
@@ -5467,6 +5473,13 @@ async function listMcpServers(loadedSettingsArg) {
|
|
|
5467
5473
|
}
|
|
5468
5474
|
return;
|
|
5469
5475
|
}
|
|
5476
|
+
if (!loadedSettings.isTrusted) {
|
|
5477
|
+
debugLogger.log(
|
|
5478
|
+
import_chalk.default.yellow(
|
|
5479
|
+
"Warning: MCP servers are configured but disabled because this folder is untrusted.\nUser-level servers are also suppressed in untrusted folders to prevent accidental side-effects.\n"
|
|
5480
|
+
)
|
|
5481
|
+
);
|
|
5482
|
+
}
|
|
5470
5483
|
debugLogger.log("Configured MCP servers:\n");
|
|
5471
5484
|
for (const serverName of serverNames) {
|
|
5472
5485
|
const server = mcpServers[serverName];
|
|
@@ -6306,27 +6319,27 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
|
6306
6319
|
var __filename = fileURLToPath2(import.meta.url);
|
|
6307
6320
|
var __dirname2 = dirname3(__filename);
|
|
6308
6321
|
var EXAMPLES_PATH = join(__dirname2, "examples");
|
|
6309
|
-
async function pathExists(
|
|
6322
|
+
async function pathExists(path16) {
|
|
6310
6323
|
try {
|
|
6311
|
-
await access(
|
|
6324
|
+
await access(path16);
|
|
6312
6325
|
return true;
|
|
6313
6326
|
} catch {
|
|
6314
6327
|
return false;
|
|
6315
6328
|
}
|
|
6316
6329
|
}
|
|
6317
|
-
async function createDirectory(
|
|
6318
|
-
if (await pathExists(
|
|
6319
|
-
throw new Error(`Path already exists: ${
|
|
6330
|
+
async function createDirectory(path16) {
|
|
6331
|
+
if (await pathExists(path16)) {
|
|
6332
|
+
throw new Error(`Path already exists: ${path16}`);
|
|
6320
6333
|
}
|
|
6321
|
-
await mkdir(
|
|
6334
|
+
await mkdir(path16, { recursive: true });
|
|
6322
6335
|
}
|
|
6323
|
-
async function copyDirectory(template,
|
|
6324
|
-
await createDirectory(
|
|
6336
|
+
async function copyDirectory(template, path16) {
|
|
6337
|
+
await createDirectory(path16);
|
|
6325
6338
|
const examplePath = join(EXAMPLES_PATH, template);
|
|
6326
6339
|
const entries = await readdir(examplePath, { withFileTypes: true });
|
|
6327
6340
|
for (const entry of entries) {
|
|
6328
6341
|
const srcPath = join(examplePath, entry.name);
|
|
6329
|
-
const destPath = join(
|
|
6342
|
+
const destPath = join(path16, entry.name);
|
|
6330
6343
|
await cp(srcPath, destPath, { recursive: true });
|
|
6331
6344
|
}
|
|
6332
6345
|
}
|
|
@@ -6601,7 +6614,7 @@ async function handleEnable3(args) {
|
|
|
6601
6614
|
const result = enableSkill(settings, name);
|
|
6602
6615
|
const feedback = renderSkillActionFeedback(
|
|
6603
6616
|
result,
|
|
6604
|
-
(label,
|
|
6617
|
+
(label, path16) => `${import_chalk5.default.bold(label)} (${import_chalk5.default.dim(path16)})`
|
|
6605
6618
|
);
|
|
6606
6619
|
debugLogger.log(feedback);
|
|
6607
6620
|
}
|
|
@@ -6631,7 +6644,7 @@ async function handleDisable3(args) {
|
|
|
6631
6644
|
const result = disableSkill(settings, name, scope);
|
|
6632
6645
|
const feedback = renderSkillActionFeedback(
|
|
6633
6646
|
result,
|
|
6634
|
-
(label,
|
|
6647
|
+
(label, path16) => `${import_chalk6.default.bold(label)} (${import_chalk6.default.dim(path16)})`
|
|
6635
6648
|
);
|
|
6636
6649
|
debugLogger.log(feedback);
|
|
6637
6650
|
}
|
|
@@ -7826,7 +7839,7 @@ async function loadSandboxConfig(settings, argv) {
|
|
|
7826
7839
|
}
|
|
7827
7840
|
const command2 = getSandboxCommand(sandboxValue);
|
|
7828
7841
|
const packageJson = await getPackageJson(__dirname3);
|
|
7829
|
-
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.
|
|
7842
|
+
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.43.0-preview.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
|
|
7830
7843
|
const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
|
|
7831
7844
|
return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
|
|
7832
7845
|
}
|
|
@@ -7994,8 +8007,13 @@ async function parseArguments(settings) {
|
|
|
7994
8007
|
const queryArg2 = argv["query"];
|
|
7995
8008
|
const query = typeof queryArg2 === "string" || Array.isArray(queryArg2) ? queryArg2 : void 0;
|
|
7996
8009
|
const hasPositionalQuery = Array.isArray(query) ? query.length > 0 : !!query;
|
|
7997
|
-
|
|
7998
|
-
|
|
8010
|
+
const sessionFlags = [
|
|
8011
|
+
argv["resume"] !== void 0,
|
|
8012
|
+
argv["session-id"] !== void 0,
|
|
8013
|
+
argv["session-file"] !== void 0
|
|
8014
|
+
].filter(Boolean).length;
|
|
8015
|
+
if (sessionFlags > 1) {
|
|
8016
|
+
return "The flags --resume, --session-id, and --session-file are mutually exclusive. Please provide only one.";
|
|
7999
8017
|
}
|
|
8000
8018
|
if (argv["prompt"] && hasPositionalQuery) {
|
|
8001
8019
|
return "Cannot use both a positional prompt and the --prompt (-p) flag together";
|
|
@@ -8126,6 +8144,10 @@ async function parseArguments(settings) {
|
|
|
8126
8144
|
}
|
|
8127
8145
|
return trimmed;
|
|
8128
8146
|
}
|
|
8147
|
+
}).option("session-file", {
|
|
8148
|
+
type: "string",
|
|
8149
|
+
nargs: 1,
|
|
8150
|
+
description: "Load a session from a JSON file"
|
|
8129
8151
|
}).option("session-id", {
|
|
8130
8152
|
type: "string",
|
|
8131
8153
|
nargs: 1,
|
|
@@ -8610,7 +8632,11 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
8610
8632
|
shellBackgroundCompletionBehavior: settings.tools?.shell?.backgroundCompletionBehavior,
|
|
8611
8633
|
shellToolInactivityTimeout: settings.tools?.shell?.inactivityTimeout,
|
|
8612
8634
|
enableShellOutputEfficiency: settings.tools?.shell?.enableShellOutputEfficiency ?? true,
|
|
8613
|
-
|
|
8635
|
+
// In ACP mode, always skip the next-speaker check. This check triggers
|
|
8636
|
+
// recursive continuation turns inside GeminiClient.processTurn() that
|
|
8637
|
+
// conflict with ACP's explicit turn management via session/prompt,
|
|
8638
|
+
// causing infinite agent_thought_chunk loops.
|
|
8639
|
+
skipNextSpeakerCheck: isAcpMode || settings.model?.skipNextSpeakerCheck,
|
|
8614
8640
|
truncateToolOutputThreshold: settings.tools?.truncateToolOutputThreshold,
|
|
8615
8641
|
eventEmitter: coreEvents,
|
|
8616
8642
|
useWriteTodos: argv.useWriteTodos ?? settings.useWriteTodos,
|
|
@@ -8769,6 +8795,8 @@ import { createHash as createHash2 } from "node:crypto";
|
|
|
8769
8795
|
import v8 from "node:v8";
|
|
8770
8796
|
import os6 from "node:os";
|
|
8771
8797
|
import dns from "node:dns";
|
|
8798
|
+
import * as path15 from "node:path";
|
|
8799
|
+
import * as fsPromises from "node:fs/promises";
|
|
8772
8800
|
|
|
8773
8801
|
// packages/cli/src/utils/sandbox.ts
|
|
8774
8802
|
var import_shell_quote2 = __toESM(require_shell_quote(), 1);
|
|
@@ -9229,21 +9257,11 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
9229
9257
|
}
|
|
9230
9258
|
const imageName = parseImageName(image);
|
|
9231
9259
|
const isIntegrationTest = process.env["GEMINI_CLI_INTEGRATION_TEST"] === "true";
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
debugLogger.log(`ContainerName: ${containerName}`);
|
|
9238
|
-
} else {
|
|
9239
|
-
let index = 0;
|
|
9240
|
-
const containerNameCheck = (await execAsync(`${command2} ps -a --format "{{.Names}}"`)).stdout.trim();
|
|
9241
|
-
while (containerNameCheck.includes(`${imageName}-${index}`)) {
|
|
9242
|
-
index++;
|
|
9243
|
-
}
|
|
9244
|
-
containerName = `${imageName}-${index}`;
|
|
9245
|
-
debugLogger.log(`ContainerName (regular): ${containerName}`);
|
|
9246
|
-
}
|
|
9260
|
+
const containerNamePrefix = isIntegrationTest ? "gemini-cli-integration-test" : imageName;
|
|
9261
|
+
const containerName = `${containerNamePrefix}-${randomBytes(6).toString(
|
|
9262
|
+
"hex"
|
|
9263
|
+
)}`;
|
|
9264
|
+
debugLogger.log(`ContainerName: ${containerName}`);
|
|
9247
9265
|
args.push("--name", containerName, "--hostname", containerName);
|
|
9248
9266
|
if (process.env["GEMINI_CLI_TEST_VAR"]) {
|
|
9249
9267
|
args.push(
|
|
@@ -10229,7 +10247,7 @@ async function runNonInteractive({
|
|
|
10229
10247
|
}
|
|
10230
10248
|
});
|
|
10231
10249
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
10232
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
10250
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-FYTOIC37.js");
|
|
10233
10251
|
setupInitialActivityLogger(config);
|
|
10234
10252
|
}
|
|
10235
10253
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -10684,6 +10702,9 @@ async function runNonInteractive({
|
|
|
10684
10702
|
async function runNonInteractive2(params) {
|
|
10685
10703
|
const useAgentSession = params.config.getAgentSessionNoninteractiveEnabled();
|
|
10686
10704
|
if (useAgentSession) {
|
|
10705
|
+
debugLogger.debug(
|
|
10706
|
+
"[ADK] Running non-interactive mode with ADK agent session"
|
|
10707
|
+
);
|
|
10687
10708
|
return runNonInteractive(params);
|
|
10688
10709
|
}
|
|
10689
10710
|
const { config, settings, input, prompt_id, resumedSessionData } = params;
|
|
@@ -10697,7 +10718,7 @@ async function runNonInteractive2(params) {
|
|
|
10697
10718
|
}
|
|
10698
10719
|
});
|
|
10699
10720
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
10700
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
10721
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-FYTOIC37.js");
|
|
10701
10722
|
setupInitialActivityLogger(config);
|
|
10702
10723
|
}
|
|
10703
10724
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -10931,6 +10952,20 @@ async function runNonInteractive2(params) {
|
|
|
10931
10952
|
durationMs
|
|
10932
10953
|
)
|
|
10933
10954
|
});
|
|
10955
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
10956
|
+
const formatter = new JsonFormatter();
|
|
10957
|
+
const stats = uiTelemetryService.getMetrics();
|
|
10958
|
+
textOutput.write(
|
|
10959
|
+
formatter.format(
|
|
10960
|
+
config.getSessionId(),
|
|
10961
|
+
responseText,
|
|
10962
|
+
stats,
|
|
10963
|
+
void 0,
|
|
10964
|
+
[...warnings, stopMessage]
|
|
10965
|
+
)
|
|
10966
|
+
);
|
|
10967
|
+
} else {
|
|
10968
|
+
textOutput.ensureTrailingNewline();
|
|
10934
10969
|
}
|
|
10935
10970
|
return;
|
|
10936
10971
|
} else if (event.type === GeminiEventType.AgentExecutionBlocked) {
|
|
@@ -14193,12 +14228,6 @@ ${event.value.description}`;
|
|
|
14193
14228
|
const invocation = tool.build(args);
|
|
14194
14229
|
const displayTitle = typeof invocation.getDisplayTitle === "function" ? invocation.getDisplayTitle() : invocation.getDescription();
|
|
14195
14230
|
const explanation = typeof invocation.getExplanation === "function" ? invocation.getExplanation() : "";
|
|
14196
|
-
if (explanation) {
|
|
14197
|
-
await this.sendUpdate({
|
|
14198
|
-
sessionUpdate: "agent_thought_chunk",
|
|
14199
|
-
content: { type: "text", text: explanation }
|
|
14200
|
-
});
|
|
14201
|
-
}
|
|
14202
14231
|
const confirmationDetails = await invocation.shouldConfirmExecute(abortSignal);
|
|
14203
14232
|
if (confirmationDetails) {
|
|
14204
14233
|
const content2 = [];
|
|
@@ -14213,6 +14242,12 @@ ${event.value.description}`;
|
|
|
14213
14242
|
}
|
|
14214
14243
|
});
|
|
14215
14244
|
}
|
|
14245
|
+
if (content2.length === 0 && explanation) {
|
|
14246
|
+
content2.push({
|
|
14247
|
+
type: "content",
|
|
14248
|
+
content: { type: "text", text: explanation }
|
|
14249
|
+
});
|
|
14250
|
+
}
|
|
14216
14251
|
const params = {
|
|
14217
14252
|
sessionId: this.id,
|
|
14218
14253
|
options: toPermissionOptions(
|
|
@@ -14261,6 +14296,12 @@ ${event.value.description}`;
|
|
|
14261
14296
|
}
|
|
14262
14297
|
} else {
|
|
14263
14298
|
const content2 = [];
|
|
14299
|
+
if (explanation) {
|
|
14300
|
+
content2.push({
|
|
14301
|
+
type: "content",
|
|
14302
|
+
content: { type: "text", text: explanation }
|
|
14303
|
+
});
|
|
14304
|
+
}
|
|
14264
14305
|
await this.sendUpdate({
|
|
14265
14306
|
sessionUpdate: "tool_call",
|
|
14266
14307
|
toolCallId: callId,
|
|
@@ -15720,13 +15761,69 @@ ${reason.stack}` : ""}`;
|
|
|
15720
15761
|
}
|
|
15721
15762
|
});
|
|
15722
15763
|
}
|
|
15723
|
-
async function resolveSessionId(resumeArg, sessionIdArg) {
|
|
15724
|
-
if (!resumeArg && !sessionIdArg) {
|
|
15764
|
+
async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
|
|
15765
|
+
if (!resumeArg && !sessionIdArg && !sessionFileArg) {
|
|
15725
15766
|
return { sessionId: createSessionId() };
|
|
15726
15767
|
}
|
|
15727
15768
|
const storage = new Storage(process.cwd());
|
|
15728
15769
|
await storage.initialize();
|
|
15729
15770
|
const sessionSelector = new SessionSelector(storage);
|
|
15771
|
+
if (sessionFileArg) {
|
|
15772
|
+
try {
|
|
15773
|
+
const sessionData = await loadConversationRecord(sessionFileArg);
|
|
15774
|
+
if (!sessionData) {
|
|
15775
|
+
throw new Error(`File not found or invalid format: ${sessionFileArg}`);
|
|
15776
|
+
}
|
|
15777
|
+
const now = Date.now();
|
|
15778
|
+
const isoNow = new Date(now).toISOString();
|
|
15779
|
+
sessionData.messages = (sessionData.messages || []).filter(
|
|
15780
|
+
(m) => typeof m === "object" && m !== null && (m.type === "user" || m.type === "gemini") && m.content !== void 0
|
|
15781
|
+
);
|
|
15782
|
+
sessionData.messages.unshift({
|
|
15783
|
+
id: `import-${now}`,
|
|
15784
|
+
type: "info",
|
|
15785
|
+
content: `Imported session from ${sessionFileArg}`,
|
|
15786
|
+
timestamp: isoNow
|
|
15787
|
+
});
|
|
15788
|
+
const newSessionId = createSessionId();
|
|
15789
|
+
sessionData.sessionId = newSessionId;
|
|
15790
|
+
sessionData.projectHash = getProjectHash(storage.getProjectRoot());
|
|
15791
|
+
sessionData.startTime = isoNow;
|
|
15792
|
+
sessionData.lastUpdated = isoNow;
|
|
15793
|
+
const chatsDir = path15.join(storage.getProjectTempDir(), "chats");
|
|
15794
|
+
const newSessionPath = path15.join(
|
|
15795
|
+
chatsDir,
|
|
15796
|
+
`session-${now}-${newSessionId.slice(0, 8)}.jsonl`
|
|
15797
|
+
);
|
|
15798
|
+
const { messages: _messages, ...initialMetadata } = sessionData;
|
|
15799
|
+
const lines = [JSON.stringify(initialMetadata)];
|
|
15800
|
+
if (sessionData.messages) {
|
|
15801
|
+
for (const msg of sessionData.messages) {
|
|
15802
|
+
lines.push(JSON.stringify(msg));
|
|
15803
|
+
}
|
|
15804
|
+
}
|
|
15805
|
+
await fsPromises.mkdir(chatsDir, { recursive: true });
|
|
15806
|
+
await fsPromises.writeFile(
|
|
15807
|
+
newSessionPath,
|
|
15808
|
+
lines.join("\n") + "\n",
|
|
15809
|
+
"utf-8"
|
|
15810
|
+
);
|
|
15811
|
+
return {
|
|
15812
|
+
sessionId: newSessionId,
|
|
15813
|
+
resumedSessionData: {
|
|
15814
|
+
conversation: sessionData,
|
|
15815
|
+
filePath: newSessionPath
|
|
15816
|
+
}
|
|
15817
|
+
};
|
|
15818
|
+
} catch (error) {
|
|
15819
|
+
coreEvents.emitFeedback(
|
|
15820
|
+
"error",
|
|
15821
|
+
`Error importing session from file: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
15822
|
+
);
|
|
15823
|
+
await runExitCleanup();
|
|
15824
|
+
process.exit(ExitCodes.FATAL_INPUT_ERROR);
|
|
15825
|
+
}
|
|
15826
|
+
}
|
|
15730
15827
|
if (sessionIdArg) {
|
|
15731
15828
|
if (await sessionSelector.sessionExists(sessionIdArg)) {
|
|
15732
15829
|
coreEvents.emitFeedback(
|
|
@@ -15748,8 +15845,10 @@ async function resolveSessionId(resumeArg, sessionIdArg) {
|
|
|
15748
15845
|
};
|
|
15749
15846
|
} catch (error) {
|
|
15750
15847
|
if (error instanceof SessionError && error.code === "NO_SESSIONS_FOUND") {
|
|
15751
|
-
|
|
15752
|
-
|
|
15848
|
+
if (resumeArg === RESUME_LATEST) {
|
|
15849
|
+
coreEvents.emitFeedback("warning", error.message);
|
|
15850
|
+
return { sessionId: createSessionId() };
|
|
15851
|
+
}
|
|
15753
15852
|
}
|
|
15754
15853
|
coreEvents.emitFeedback(
|
|
15755
15854
|
"error",
|
|
@@ -15760,7 +15859,7 @@ async function resolveSessionId(resumeArg, sessionIdArg) {
|
|
|
15760
15859
|
}
|
|
15761
15860
|
}
|
|
15762
15861
|
async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
|
|
15763
|
-
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-
|
|
15862
|
+
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-36WZS6KT.js");
|
|
15764
15863
|
await doStartUI(
|
|
15765
15864
|
config,
|
|
15766
15865
|
settings,
|
|
@@ -15823,7 +15922,8 @@ async function main() {
|
|
|
15823
15922
|
const argv = await argvPromise;
|
|
15824
15923
|
const { sessionId, resumedSessionData } = await resolveSessionId(
|
|
15825
15924
|
argv.resume,
|
|
15826
|
-
argv.sessionId
|
|
15925
|
+
argv.sessionId,
|
|
15926
|
+
argv.sessionFile
|
|
15827
15927
|
);
|
|
15828
15928
|
if (argv.allowedTools && argv.allowedTools.length > 0 || settings.merged.tools?.allowed && settings.merged.tools.allowed.length > 0) {
|
|
15829
15929
|
coreEvents.emitFeedback(
|
|
@@ -15967,7 +16067,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
15967
16067
|
await config.storage.initialize();
|
|
15968
16068
|
adminControlsListner.setConfig(config);
|
|
15969
16069
|
if (config.isInteractive() && settings.merged.general.devtools) {
|
|
15970
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
16070
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-FYTOIC37.js");
|
|
15971
16071
|
setupInitialActivityLogger(config);
|
|
15972
16072
|
}
|
|
15973
16073
|
registerTelemetryConfig(config);
|
|
@@ -16026,7 +16126,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
16026
16126
|
const initAppHandle = startupProfiler.start("initialize_app");
|
|
16027
16127
|
const initializationResult = await initializeApp(config, settings);
|
|
16028
16128
|
initAppHandle?.end();
|
|
16029
|
-
import("./liteRtServerManager-
|
|
16129
|
+
import("./liteRtServerManager-N6OMT6W5.js").then(({ LiteRtServerManager }) => {
|
|
16030
16130
|
const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
|
|
16031
16131
|
if (!mergedGemma) return;
|
|
16032
16132
|
const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
|