@google/gemini-cli 0.62.0-preview.0 → 0.63.0-nightly.20260926.g2fe7c2d3f
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-VNI6B2SC.js → chunk-2AXHER6I.js} +1 -1
- package/bundle/{chunk-7P7I4GYC.js → chunk-2HPN5QAH.js} +1 -1
- package/bundle/{chunk-67JFSAOI.js → chunk-4PBNRKYJ.js} +8 -5
- package/bundle/{chunk-UDX2JG4X.js → chunk-4SQTLFVK.js} +45 -11
- package/bundle/chunk-5OA4MZUE.js +17368 -0
- package/bundle/{chunk-ZOLMIYBF.js → chunk-A6CY66PY.js} +109 -62
- package/bundle/{chunk-IP26BEPK.js → chunk-BMW3TCBN.js} +1 -1
- package/bundle/{chunk-X3MDVQ2M.js → chunk-C2KZGMGL.js} +1 -1
- package/bundle/{chunk-DSHGGNYE.js → chunk-DQIFLHPX.js} +3 -3
- package/bundle/{chunk-QE6MNPCN.js → chunk-EATZTV2L.js} +45 -11
- package/bundle/{chunk-UCTTKDYX.js → chunk-EYGY6SJV.js} +1 -1
- package/bundle/{chunk-ZNLZV6KB.js → chunk-GCXBFYJK.js} +1 -1
- package/bundle/{chunk-4B6A2PDH.js → chunk-JBO7A25S.js} +9 -8
- package/bundle/{chunk-FX7H3YXM.js → chunk-JRB2XGR5.js} +1 -1
- package/bundle/{chunk-2MIF7TLR.js → chunk-KRI5JA76.js} +680 -165
- package/bundle/{chunk-RQBLUWGO.js → chunk-PAIQESPE.js} +3 -3
- package/bundle/{chunk-IZ7EEAUQ.js → chunk-QO5HKIZU.js} +2 -2
- package/bundle/{chunk-HCJU65X4.js → chunk-QX7M3XMQ.js} +3 -3
- package/bundle/{chunk-7LRWECUM.js → chunk-R2KYUMIM.js} +612 -158
- package/bundle/{chunk-KYWRBXUN.js → chunk-RCREII42.js} +2 -2
- package/bundle/{chunk-4SYYS7FT.js → chunk-RFR5KZGU.js} +1 -1
- package/bundle/chunk-SCOXV26L.js +118 -0
- package/bundle/{chunk-UVWRONOW.js → chunk-SJFSOFYJ.js} +2 -2
- package/bundle/chunk-SZK5XAFL.js +398 -0
- package/bundle/chunk-T7LJ6AR4.js +512 -0
- package/bundle/{chunk-YHJCOL52.js → chunk-TXWIPUPY.js} +8372 -14832
- package/bundle/chunk-UFNI7OME.js +400484 -0
- package/bundle/chunk-UGKG4OIB.js +102951 -0
- package/bundle/chunk-VAGYZO4R.js +1571 -0
- package/bundle/{chunk-LXVOSY26.js → chunk-VNGBTT2C.js} +1 -1
- package/bundle/{chunk-ZXPUBJYD.js → chunk-ZAM747AR.js} +1 -1
- package/bundle/chunk-ZV5QN465.js +154 -0
- package/bundle/{cleanup-FHA2KSXH.js → cleanup-33SXPBZY.js} +2 -2
- package/bundle/{cleanup-HY2KJG6D.js → cleanup-6IDD7Q3X.js} +2 -2
- package/bundle/{cleanup-UNKT2DM4.js → cleanup-7UL3PRLF.js} +2 -2
- package/bundle/cleanup-ZMIILI4I.js +32 -0
- package/bundle/{core-FGYHAZ6H.js → core-IIFMZU4H.js} +11 -1
- package/bundle/{devtoolsService-WDMSDVS7.js → devtoolsService-3DTEOSCQ.js} +2 -2
- package/bundle/{devtoolsService-2RNXWTDT.js → devtoolsService-AK7UU2FI.js} +2 -2
- package/bundle/{devtoolsService-FYN3P465.js → devtoolsService-BHWAPOMO.js} +4 -3
- package/bundle/devtoolsService-REQSIEPU.js +4359 -0
- package/bundle/{dist-42YIZWSU.js → dist-4S434TWJ.js} +11 -1
- package/bundle/{core-CYZFUAYU.js → dist-6CWFFN6Z.js} +11 -1
- package/bundle/dist-I74UZ4GA.js +2248 -0
- package/bundle/docs/changelogs/index.md +16 -0
- package/bundle/docs/changelogs/latest.md +34 -55
- package/bundle/docs/changelogs/preview.md +65 -29
- package/bundle/{gemini-H6C5T6NZ.js → gemini-3326ZSFC.js} +21 -21
- package/bundle/{gemini-5VI65FOO.js → gemini-I47O5YI2.js} +221 -205
- package/bundle/{gemini-DRDYGTKK.js → gemini-PGIEQLQD.js} +21 -21
- package/bundle/gemini-YJG7YFT4.js +17863 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-TLTKI2C4.js → interactiveCli-A6SNZNGC.js} +31 -14
- package/bundle/{interactiveCli-SOVSAZ32.js → interactiveCli-JF6LE6RN.js} +334 -298
- package/bundle/{interactiveCli-KSL5ASTL.js → interactiveCli-JLFFVRVY.js} +31 -14
- package/bundle/interactiveCli-MHB4B6S7.js +34907 -0
- package/bundle/{liteRtServerManager-KO56TKLF.js → liteRtServerManager-4LVWWKUV.js} +4 -4
- package/bundle/{liteRtServerManager-T2GG72NW.js → liteRtServerManager-5LUGQWRF.js} +4 -4
- package/bundle/{liteRtServerManager-2CCV35OQ.js → liteRtServerManager-DVDNFJNH.js} +4 -4
- package/bundle/liteRtServerManager-FWIPKCGI.js +65 -0
- package/bundle/{oauth2-provider-TBQ7JUDB.js → oauth2-provider-IBKEWCFT.js} +1 -1
- package/bundle/{oauth2-provider-UY26FDAA.js → oauth2-provider-KPLVYPVA.js} +1 -1
- package/bundle/{oauth2-provider-BSRUMVCL.js → oauth2-provider-MTCBHRXI.js} +38 -72
- package/bundle/oauth2-provider-TDMWN5ME.js +235 -0
- package/bundle/{start-NGSQCGCK.js → start-2A3VVOAH.js} +6 -6
- package/bundle/{start-RUS2QGZK.js → start-665BHOTS.js} +6 -6
- package/bundle/{start-GCXJMSER.js → start-6PINHVUA.js} +6 -6
- package/bundle/start-DXGEU2SK.js +18 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
startCommand,
|
|
4
4
|
startServer
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QX7M3XMQ.js";
|
|
6
6
|
import {
|
|
7
7
|
BuiltinCommandLoader,
|
|
8
8
|
CommandService,
|
|
@@ -46,11 +46,11 @@ import {
|
|
|
46
46
|
updateExtension,
|
|
47
47
|
validateAuthMethod,
|
|
48
48
|
validateContextFilePath
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-4SQTLFVK.js";
|
|
50
50
|
import {
|
|
51
51
|
exitCli,
|
|
52
52
|
require_source
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-C2KZGMGL.js";
|
|
54
54
|
import {
|
|
55
55
|
appEvents
|
|
56
56
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -88,11 +88,11 @@ import {
|
|
|
88
88
|
resolveGemmaConfig,
|
|
89
89
|
saveModelChange,
|
|
90
90
|
stripAnsi
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-4PBNRKYJ.js";
|
|
92
92
|
import {
|
|
93
93
|
RELAUNCH_EXIT_CODE
|
|
94
|
-
} from "./chunk-
|
|
95
|
-
import "./chunk-
|
|
94
|
+
} from "./chunk-SZK5XAFL.js";
|
|
95
|
+
import "./chunk-EYGY6SJV.js";
|
|
96
96
|
import {
|
|
97
97
|
cleanupCheckpoints,
|
|
98
98
|
registerCleanup,
|
|
@@ -101,12 +101,15 @@ import {
|
|
|
101
101
|
runExitCleanup,
|
|
102
102
|
runSyncCleanup,
|
|
103
103
|
setupSignalHandlers
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-2AXHER6I.js";
|
|
105
105
|
import {
|
|
106
106
|
ASK_USER_TOOL_NAME,
|
|
107
|
+
ApprovalMode,
|
|
107
108
|
AuthType,
|
|
108
109
|
Client,
|
|
109
110
|
Config,
|
|
111
|
+
CoreEvent,
|
|
112
|
+
CoreToolCallStatus,
|
|
110
113
|
DEFAULT_CONTEXT_FILENAME,
|
|
111
114
|
DEFAULT_FILE_FILTERING_OPTIONS,
|
|
112
115
|
DEFAULT_GEMINI_EMBEDDING_MODEL,
|
|
@@ -128,19 +131,27 @@ import {
|
|
|
128
131
|
FolderTrustDiscoveryService,
|
|
129
132
|
GEMINI_DIR,
|
|
130
133
|
GEMINI_MODEL_ALIAS_AUTO,
|
|
134
|
+
GeminiEventType,
|
|
131
135
|
IdeClient,
|
|
136
|
+
IntegrityStatus,
|
|
132
137
|
InvalidStreamError,
|
|
133
138
|
JsonFormatter,
|
|
139
|
+
JsonStreamEventType,
|
|
140
|
+
Kind,
|
|
134
141
|
LegacyAgentSession,
|
|
135
142
|
Logger,
|
|
136
143
|
MAX_TOKENS_EXCEEDED_SUGGESTION,
|
|
137
144
|
MCPServerConfig,
|
|
145
|
+
MCPServerStatus,
|
|
146
|
+
MessageBusType,
|
|
138
147
|
OTHER_BLOCKED_MESSAGE,
|
|
148
|
+
OutputFormat,
|
|
139
149
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
140
150
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
141
151
|
PREVIEW_GEMINI_FLASH_LITE_MODEL,
|
|
142
152
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
143
153
|
PREVIEW_GEMINI_MODEL,
|
|
154
|
+
PolicyDecision,
|
|
144
155
|
PolicyIntegrityManager,
|
|
145
156
|
RECITATION_BLOCKED_MESSAGE,
|
|
146
157
|
REFERENCE_CONTENT_START,
|
|
@@ -148,6 +159,8 @@ import {
|
|
|
148
159
|
ReadManyFilesTool,
|
|
149
160
|
SAFETY_BLOCKED_MESSAGE,
|
|
150
161
|
Scheduler,
|
|
162
|
+
SessionEndReason,
|
|
163
|
+
SessionStartSource,
|
|
151
164
|
ShellExecutionService,
|
|
152
165
|
SimpleExtensionLoader,
|
|
153
166
|
Storage,
|
|
@@ -156,10 +169,13 @@ import {
|
|
|
156
169
|
TRUE_EMPTY_RESPONSE_MESSAGE,
|
|
157
170
|
ToolCallEvent,
|
|
158
171
|
ToolConfirmationOutcome,
|
|
172
|
+
ToolErrorType,
|
|
173
|
+
TrustLevel,
|
|
159
174
|
UserAccountManager,
|
|
160
175
|
UserPromptEvent,
|
|
161
176
|
ValidationCancelledError,
|
|
162
177
|
ValidationRequiredError,
|
|
178
|
+
WarningPriority,
|
|
163
179
|
applyAdminAllowlist,
|
|
164
180
|
applyRequiredServers,
|
|
165
181
|
clearCachedCredentialFile,
|
|
@@ -239,7 +255,7 @@ import {
|
|
|
239
255
|
updatePolicy,
|
|
240
256
|
writeToStderr,
|
|
241
257
|
writeToStdout
|
|
242
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-TXWIPUPY.js";
|
|
243
259
|
import "./chunk-664ZODQF.js";
|
|
244
260
|
import "./chunk-IUUIT4SU.js";
|
|
245
261
|
import "./chunk-L6PII3GR.js";
|
|
@@ -5369,7 +5385,7 @@ var MCP_LIST_DEFAULT_TIMEOUT_MSEC = 5e3;
|
|
|
5369
5385
|
async function testMCPConnection(serverName, config, isTrusted, activeSettings) {
|
|
5370
5386
|
const isStdio = !!config.command;
|
|
5371
5387
|
if (isStdio && !isTrusted) {
|
|
5372
|
-
return
|
|
5388
|
+
return MCPServerStatus.DISCONNECTED;
|
|
5373
5389
|
}
|
|
5374
5390
|
const client = new Client({
|
|
5375
5391
|
name: "mcp-test-client",
|
|
@@ -5405,7 +5421,7 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
|
|
|
5405
5421
|
transport = await createTransport(serverName, config, false, mcpContext);
|
|
5406
5422
|
} catch {
|
|
5407
5423
|
await client.close();
|
|
5408
|
-
return
|
|
5424
|
+
return MCPServerStatus.DISCONNECTED;
|
|
5409
5425
|
}
|
|
5410
5426
|
try {
|
|
5411
5427
|
const timeout = config.timeout ?? MCP_LIST_DEFAULT_TIMEOUT_MSEC;
|
|
@@ -5419,10 +5435,10 @@ async function testMCPConnection(serverName, config, isTrusted, activeSettings)
|
|
|
5419
5435
|
);
|
|
5420
5436
|
}
|
|
5421
5437
|
await client.close();
|
|
5422
|
-
return
|
|
5438
|
+
return MCPServerStatus.CONNECTED;
|
|
5423
5439
|
} catch {
|
|
5424
5440
|
await transport.close();
|
|
5425
|
-
return
|
|
5441
|
+
return MCPServerStatus.DISCONNECTED;
|
|
5426
5442
|
}
|
|
5427
5443
|
}
|
|
5428
5444
|
async function getServerStatus(serverName, server, isTrusted, activeSettings, consolidatedExcluded, consolidatedAllowed) {
|
|
@@ -5435,12 +5451,12 @@ async function getServerStatus(serverName, server, isTrusted, activeSettings, co
|
|
|
5435
5451
|
});
|
|
5436
5452
|
if (!loadResult.allowed) {
|
|
5437
5453
|
if (loadResult.blockType === "admin" || loadResult.blockType === "allowlist" || loadResult.blockType === "excludelist") {
|
|
5438
|
-
return
|
|
5454
|
+
return MCPServerStatus.BLOCKED;
|
|
5439
5455
|
}
|
|
5440
|
-
return
|
|
5456
|
+
return MCPServerStatus.DISABLED;
|
|
5441
5457
|
}
|
|
5442
5458
|
if (!isTrusted) {
|
|
5443
|
-
return
|
|
5459
|
+
return MCPServerStatus.DISABLED;
|
|
5444
5460
|
}
|
|
5445
5461
|
return testMCPConnection(serverName, server, isTrusted, activeSettings);
|
|
5446
5462
|
}
|
|
@@ -5486,23 +5502,23 @@ async function listMcpServers(loadedSettingsArg) {
|
|
|
5486
5502
|
let statusIndicator = "";
|
|
5487
5503
|
let statusText = "";
|
|
5488
5504
|
switch (status) {
|
|
5489
|
-
case
|
|
5505
|
+
case MCPServerStatus.CONNECTED:
|
|
5490
5506
|
statusIndicator = import_chalk.default.green("\u2713");
|
|
5491
5507
|
statusText = "Connected";
|
|
5492
5508
|
break;
|
|
5493
|
-
case
|
|
5509
|
+
case MCPServerStatus.CONNECTING:
|
|
5494
5510
|
statusIndicator = import_chalk.default.yellow("\u2026");
|
|
5495
5511
|
statusText = "Connecting";
|
|
5496
5512
|
break;
|
|
5497
|
-
case
|
|
5513
|
+
case MCPServerStatus.BLOCKED:
|
|
5498
5514
|
statusIndicator = import_chalk.default.red("\u26D4");
|
|
5499
5515
|
statusText = "Blocked";
|
|
5500
5516
|
break;
|
|
5501
|
-
case
|
|
5517
|
+
case MCPServerStatus.DISABLED:
|
|
5502
5518
|
statusIndicator = import_chalk.default.gray("\u25CB");
|
|
5503
5519
|
statusText = "Disabled";
|
|
5504
5520
|
break;
|
|
5505
|
-
case
|
|
5521
|
+
case MCPServerStatus.DISCONNECTED:
|
|
5506
5522
|
default:
|
|
5507
5523
|
statusIndicator = import_chalk.default.red("\u2717");
|
|
5508
5524
|
statusText = "Disconnected";
|
|
@@ -5788,7 +5804,7 @@ async function handleInstall(args) {
|
|
|
5788
5804
|
);
|
|
5789
5805
|
if (confirmed) {
|
|
5790
5806
|
const trustedFolders = loadTrustedFolders();
|
|
5791
|
-
await trustedFolders.setValue(realPath,
|
|
5807
|
+
await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
|
|
5792
5808
|
} else {
|
|
5793
5809
|
throw new Error(
|
|
5794
5810
|
`Installation aborted: Folder "${absolutePath}" is not trusted.`
|
|
@@ -7839,7 +7855,7 @@ async function loadSandboxConfig(settings, argv) {
|
|
|
7839
7855
|
}
|
|
7840
7856
|
const command2 = getSandboxCommand(sandboxValue);
|
|
7841
7857
|
const packageJson = await getPackageJson(__dirname3);
|
|
7842
|
-
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.
|
|
7858
|
+
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.63.0-nightly.20260923.gf50ba8608" ?? customImage ?? packageJson?.config?.sandboxImageUri;
|
|
7843
7859
|
const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
|
|
7844
7860
|
return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
|
|
7845
7861
|
}
|
|
@@ -7898,9 +7914,9 @@ async function resolveWorkspacePolicyState(options) {
|
|
|
7898
7914
|
cwd,
|
|
7899
7915
|
potentialWorkspacePoliciesDir
|
|
7900
7916
|
);
|
|
7901
|
-
if (integrityResult.status ===
|
|
7917
|
+
if (integrityResult.status === IntegrityStatus.MATCH) {
|
|
7902
7918
|
workspacePoliciesDir = potentialWorkspacePoliciesDir;
|
|
7903
|
-
} else if (integrityResult.status ===
|
|
7919
|
+
} else if (integrityResult.status === IntegrityStatus.NEW && integrityResult.fileCount === 0) {
|
|
7904
7920
|
workspacePoliciesDir = void 0;
|
|
7905
7921
|
} else if (interactive && !autoAcceptWorkspacePolicies) {
|
|
7906
7922
|
policyUpdateConfirmationRequest = {
|
|
@@ -8328,23 +8344,23 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
8328
8344
|
if (rawApprovalMode) {
|
|
8329
8345
|
switch (rawApprovalMode) {
|
|
8330
8346
|
case "yolo":
|
|
8331
|
-
approvalMode =
|
|
8347
|
+
approvalMode = ApprovalMode.YOLO;
|
|
8332
8348
|
break;
|
|
8333
8349
|
case "auto_edit":
|
|
8334
|
-
approvalMode =
|
|
8350
|
+
approvalMode = ApprovalMode.AUTO_EDIT;
|
|
8335
8351
|
break;
|
|
8336
8352
|
case "plan":
|
|
8337
8353
|
if (!(settings.general?.plan?.enabled ?? true)) {
|
|
8338
8354
|
debugLogger.warn(
|
|
8339
8355
|
'Approval mode "plan" is disabled in your settings. Falling back to "default".'
|
|
8340
8356
|
);
|
|
8341
|
-
approvalMode =
|
|
8357
|
+
approvalMode = ApprovalMode.DEFAULT;
|
|
8342
8358
|
} else {
|
|
8343
|
-
approvalMode =
|
|
8359
|
+
approvalMode = ApprovalMode.PLAN;
|
|
8344
8360
|
}
|
|
8345
8361
|
break;
|
|
8346
8362
|
case "default":
|
|
8347
|
-
approvalMode =
|
|
8363
|
+
approvalMode = ApprovalMode.DEFAULT;
|
|
8348
8364
|
break;
|
|
8349
8365
|
default:
|
|
8350
8366
|
throw new Error(
|
|
@@ -8352,10 +8368,10 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
8352
8368
|
);
|
|
8353
8369
|
}
|
|
8354
8370
|
} else {
|
|
8355
|
-
approvalMode =
|
|
8371
|
+
approvalMode = ApprovalMode.DEFAULT;
|
|
8356
8372
|
}
|
|
8357
8373
|
if (settings.security?.disableYoloMode || settings.admin?.secureModeEnabled) {
|
|
8358
|
-
if (approvalMode ===
|
|
8374
|
+
if (approvalMode === ApprovalMode.YOLO) {
|
|
8359
8375
|
if (settings.admin?.secureModeEnabled) {
|
|
8360
8376
|
debugLogger.error(
|
|
8361
8377
|
'YOLO mode is disabled by "secureModeEnabled" setting.'
|
|
@@ -8373,16 +8389,16 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
8373
8389
|
)
|
|
8374
8390
|
);
|
|
8375
8391
|
}
|
|
8376
|
-
} else if (approvalMode ===
|
|
8392
|
+
} else if (approvalMode === ApprovalMode.YOLO) {
|
|
8377
8393
|
debugLogger.warn(
|
|
8378
8394
|
"YOLO mode is enabled. All tool calls will be automatically approved."
|
|
8379
8395
|
);
|
|
8380
8396
|
}
|
|
8381
|
-
if (!trustedFolder && approvalMode !==
|
|
8397
|
+
if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT) {
|
|
8382
8398
|
debugLogger.warn(
|
|
8383
8399
|
`Approval mode overridden to "default" because the current folder is not trusted.`
|
|
8384
8400
|
);
|
|
8385
|
-
approvalMode =
|
|
8401
|
+
approvalMode = ApprovalMode.DEFAULT;
|
|
8386
8402
|
}
|
|
8387
8403
|
let telemetrySettings;
|
|
8388
8404
|
try {
|
|
@@ -11083,7 +11099,7 @@ import path10 from "node:path";
|
|
|
11083
11099
|
import process4 from "node:process";
|
|
11084
11100
|
var homeDirectoryCheck = {
|
|
11085
11101
|
id: "home-directory",
|
|
11086
|
-
priority:
|
|
11102
|
+
priority: WarningPriority.Low,
|
|
11087
11103
|
check: async (workspaceRoot, settings) => {
|
|
11088
11104
|
if (settings.ui?.showHomeDirectoryWarning === false) {
|
|
11089
11105
|
return null;
|
|
@@ -11107,7 +11123,7 @@ var homeDirectoryCheck = {
|
|
|
11107
11123
|
};
|
|
11108
11124
|
var rootDirectoryCheck = {
|
|
11109
11125
|
id: "root-directory",
|
|
11110
|
-
priority:
|
|
11126
|
+
priority: WarningPriority.High,
|
|
11111
11127
|
check: async (workspaceRoot, _settings) => {
|
|
11112
11128
|
try {
|
|
11113
11129
|
const workspaceRealPath = await fs9.realpath(workspaceRoot);
|
|
@@ -11123,7 +11139,7 @@ var rootDirectoryCheck = {
|
|
|
11123
11139
|
};
|
|
11124
11140
|
var folderTrustCheck = {
|
|
11125
11141
|
id: "folder-trust",
|
|
11126
|
-
priority:
|
|
11142
|
+
priority: WarningPriority.High,
|
|
11127
11143
|
check: async (workspaceRoot, settings) => {
|
|
11128
11144
|
if (!isFolderTrustEnabled(settings)) {
|
|
11129
11145
|
return null;
|
|
@@ -11313,12 +11329,12 @@ function handleError(error, config, customErrorCode) {
|
|
|
11313
11329
|
error,
|
|
11314
11330
|
config.getContentGeneratorConfig()?.authType
|
|
11315
11331
|
);
|
|
11316
|
-
if (config.getOutputFormat() ===
|
|
11332
|
+
if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
|
|
11317
11333
|
const streamFormatter = new StreamJsonFormatter();
|
|
11318
11334
|
const errorCode = customErrorCode ?? extractErrorCode(error);
|
|
11319
11335
|
const metrics = uiTelemetryService.getMetrics();
|
|
11320
11336
|
streamFormatter.emitEvent({
|
|
11321
|
-
type:
|
|
11337
|
+
type: JsonStreamEventType.RESULT,
|
|
11322
11338
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11323
11339
|
status: "error",
|
|
11324
11340
|
error: {
|
|
@@ -11329,7 +11345,7 @@ function handleError(error, config, customErrorCode) {
|
|
|
11329
11345
|
});
|
|
11330
11346
|
runSyncCleanup();
|
|
11331
11347
|
process.exit(getNumericExitCode(errorCode));
|
|
11332
|
-
} else if (config.getOutputFormat() ===
|
|
11348
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
11333
11349
|
const formatter = new JsonFormatter();
|
|
11334
11350
|
const errorCode = customErrorCode ?? extractErrorCode(error);
|
|
11335
11351
|
const formattedError = formatter.formatError(
|
|
@@ -11349,11 +11365,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
|
|
|
11349
11365
|
const isFatal = isFatalToolError(errorType);
|
|
11350
11366
|
if (isFatal) {
|
|
11351
11367
|
const toolExecutionError = new FatalToolExecutionError(errorMessage);
|
|
11352
|
-
if (config.getOutputFormat() ===
|
|
11368
|
+
if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
|
|
11353
11369
|
const streamFormatter = new StreamJsonFormatter();
|
|
11354
11370
|
const metrics = uiTelemetryService.getMetrics();
|
|
11355
11371
|
streamFormatter.emitEvent({
|
|
11356
|
-
type:
|
|
11372
|
+
type: JsonStreamEventType.RESULT,
|
|
11357
11373
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11358
11374
|
status: "error",
|
|
11359
11375
|
error: {
|
|
@@ -11362,7 +11378,7 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
|
|
|
11362
11378
|
},
|
|
11363
11379
|
stats: streamFormatter.convertToStreamStats(metrics, 0)
|
|
11364
11380
|
});
|
|
11365
|
-
} else if (config.getOutputFormat() ===
|
|
11381
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
11366
11382
|
const formatter = new JsonFormatter();
|
|
11367
11383
|
const formattedError = formatter.formatError(
|
|
11368
11384
|
toolExecutionError,
|
|
@@ -11380,11 +11396,11 @@ function handleToolError(toolName, toolError, config, errorType, resultDisplay)
|
|
|
11380
11396
|
}
|
|
11381
11397
|
function handleCancellationError(config) {
|
|
11382
11398
|
const cancellationError = new FatalCancellationError("Operation cancelled.");
|
|
11383
|
-
if (config.getOutputFormat() ===
|
|
11399
|
+
if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
|
|
11384
11400
|
const streamFormatter = new StreamJsonFormatter();
|
|
11385
11401
|
const metrics = uiTelemetryService.getMetrics();
|
|
11386
11402
|
streamFormatter.emitEvent({
|
|
11387
|
-
type:
|
|
11403
|
+
type: JsonStreamEventType.RESULT,
|
|
11388
11404
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11389
11405
|
status: "error",
|
|
11390
11406
|
error: {
|
|
@@ -11395,7 +11411,7 @@ function handleCancellationError(config) {
|
|
|
11395
11411
|
});
|
|
11396
11412
|
runSyncCleanup();
|
|
11397
11413
|
process.exit(cancellationError.exitCode);
|
|
11398
|
-
} else if (config.getOutputFormat() ===
|
|
11414
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
11399
11415
|
const formatter = new JsonFormatter();
|
|
11400
11416
|
const formattedError = formatter.formatError(
|
|
11401
11417
|
cancellationError,
|
|
@@ -11415,11 +11431,11 @@ function handleMaxTurnsExceededError(config) {
|
|
|
11415
11431
|
const maxTurnsError = new FatalTurnLimitedError(
|
|
11416
11432
|
"Reached max session turns for this session. Increase the number of turns by specifying maxSessionTurns in settings.json."
|
|
11417
11433
|
);
|
|
11418
|
-
if (config.getOutputFormat() ===
|
|
11434
|
+
if (config.getOutputFormat() === OutputFormat.STREAM_JSON) {
|
|
11419
11435
|
const streamFormatter = new StreamJsonFormatter();
|
|
11420
11436
|
const metrics = uiTelemetryService.getMetrics();
|
|
11421
11437
|
streamFormatter.emitEvent({
|
|
11422
|
-
type:
|
|
11438
|
+
type: JsonStreamEventType.RESULT,
|
|
11423
11439
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11424
11440
|
status: "error",
|
|
11425
11441
|
error: {
|
|
@@ -11430,7 +11446,7 @@ function handleMaxTurnsExceededError(config) {
|
|
|
11430
11446
|
});
|
|
11431
11447
|
runSyncCleanup();
|
|
11432
11448
|
process.exit(maxTurnsError.exitCode);
|
|
11433
|
-
} else if (config.getOutputFormat() ===
|
|
11449
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
11434
11450
|
const formatter = new JsonFormatter();
|
|
11435
11451
|
const formattedError = formatter.formatError(
|
|
11436
11452
|
maxTurnsError,
|
|
@@ -11510,7 +11526,7 @@ async function runNonInteractive({
|
|
|
11510
11526
|
}
|
|
11511
11527
|
});
|
|
11512
11528
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
11513
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
11529
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-REQSIEPU.js");
|
|
11514
11530
|
setupInitialActivityLogger(config);
|
|
11515
11531
|
}
|
|
11516
11532
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -11526,7 +11542,7 @@ async function runNonInteractive({
|
|
|
11526
11542
|
}
|
|
11527
11543
|
};
|
|
11528
11544
|
const startTime = Date.now();
|
|
11529
|
-
const streamFormatter = config.getOutputFormat() ===
|
|
11545
|
+
const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
|
|
11530
11546
|
const abortController = new AbortController();
|
|
11531
11547
|
let isAborting = false;
|
|
11532
11548
|
let cancelMessageTimer = null;
|
|
@@ -11579,13 +11595,13 @@ async function runNonInteractive({
|
|
|
11579
11595
|
};
|
|
11580
11596
|
try {
|
|
11581
11597
|
consolePatcher.patch();
|
|
11582
|
-
if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() ===
|
|
11598
|
+
if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
|
|
11583
11599
|
process.stderr.write(
|
|
11584
11600
|
"[WARNING] --raw-output is enabled. Model output is not sanitized and may contain harmful ANSI sequences (e.g. for phishing or command injection). Use --accept-raw-output-risk to suppress this warning.\n"
|
|
11585
11601
|
);
|
|
11586
11602
|
}
|
|
11587
11603
|
setupStdinCancellation();
|
|
11588
|
-
coreEvents.on(
|
|
11604
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
11589
11605
|
coreEvents.drainBacklogs();
|
|
11590
11606
|
process.stdout.on("error", (err) => {
|
|
11591
11607
|
if (err.code === "EPIPE") {
|
|
@@ -11611,7 +11627,7 @@ async function runNonInteractive({
|
|
|
11611
11627
|
}
|
|
11612
11628
|
if (streamFormatter) {
|
|
11613
11629
|
streamFormatter.emitEvent({
|
|
11614
|
-
type:
|
|
11630
|
+
type: JsonStreamEventType.INIT,
|
|
11615
11631
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11616
11632
|
session_id: config.getSessionId(),
|
|
11617
11633
|
model: config.getModel()
|
|
@@ -11649,7 +11665,7 @@ async function runNonInteractive({
|
|
|
11649
11665
|
}
|
|
11650
11666
|
if (streamFormatter) {
|
|
11651
11667
|
streamFormatter.emitEvent({
|
|
11652
|
-
type:
|
|
11668
|
+
type: JsonStreamEventType.MESSAGE,
|
|
11653
11669
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11654
11670
|
role: "user",
|
|
11655
11671
|
content: input
|
|
@@ -11688,12 +11704,12 @@ async function runNonInteractive({
|
|
|
11688
11704
|
const metrics = uiTelemetryService.getMetrics();
|
|
11689
11705
|
const durationMs = Date.now() - startTime;
|
|
11690
11706
|
streamFormatter.emitEvent({
|
|
11691
|
-
type:
|
|
11707
|
+
type: JsonStreamEventType.RESULT,
|
|
11692
11708
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11693
11709
|
status: errorPayload ? "error" : "success",
|
|
11694
11710
|
stats: streamFormatter.convertToStreamStats(metrics, durationMs)
|
|
11695
11711
|
});
|
|
11696
|
-
} else if (config.getOutputFormat() ===
|
|
11712
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
11697
11713
|
const formatter = new JsonFormatter();
|
|
11698
11714
|
const stats = uiTelemetryService.getMetrics();
|
|
11699
11715
|
textOutput.write(
|
|
@@ -11786,13 +11802,13 @@ async function runNonInteractive({
|
|
|
11786
11802
|
const output = isRaw ? part.text : stripAnsi(part.text);
|
|
11787
11803
|
if (streamFormatter) {
|
|
11788
11804
|
streamFormatter.emitEvent({
|
|
11789
|
-
type:
|
|
11805
|
+
type: JsonStreamEventType.MESSAGE,
|
|
11790
11806
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11791
11807
|
role: "assistant",
|
|
11792
11808
|
content: output,
|
|
11793
11809
|
delta: true
|
|
11794
11810
|
});
|
|
11795
|
-
} else if (config.getOutputFormat() ===
|
|
11811
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
11796
11812
|
responseText += output;
|
|
11797
11813
|
} else {
|
|
11798
11814
|
if (part.text) {
|
|
@@ -11805,13 +11821,13 @@ async function runNonInteractive({
|
|
|
11805
11821
|
break;
|
|
11806
11822
|
}
|
|
11807
11823
|
case "tool_request": {
|
|
11808
|
-
if (config.getOutputFormat() ===
|
|
11824
|
+
if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
11809
11825
|
preToolResponseText = responseText || preToolResponseText;
|
|
11810
11826
|
responseText = "";
|
|
11811
11827
|
}
|
|
11812
11828
|
if (streamFormatter) {
|
|
11813
11829
|
streamFormatter.emitEvent({
|
|
11814
|
-
type:
|
|
11830
|
+
type: JsonStreamEventType.TOOL_USE,
|
|
11815
11831
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11816
11832
|
tool_name: event.name,
|
|
11817
11833
|
tool_id: event.requestId,
|
|
@@ -11827,7 +11843,7 @@ async function runNonInteractive({
|
|
|
11827
11843
|
const displayText = displayContentToString(display);
|
|
11828
11844
|
const errorMsg = getTextContent(event.content) ?? "Tool error";
|
|
11829
11845
|
streamFormatter.emitEvent({
|
|
11830
|
-
type:
|
|
11846
|
+
type: JsonStreamEventType.TOOL_RESULT,
|
|
11831
11847
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11832
11848
|
tool_id: event.requestId,
|
|
11833
11849
|
status: event.isError ? "error" : "success",
|
|
@@ -11842,17 +11858,17 @@ async function runNonInteractive({
|
|
|
11842
11858
|
const display = event.display?.result;
|
|
11843
11859
|
const displayText = displayContentToString(display);
|
|
11844
11860
|
const errorMsg = getTextContent(event.content) ?? "Tool error";
|
|
11845
|
-
if (event.data?.["errorType"] ===
|
|
11846
|
-
if (config.getOutputFormat() ===
|
|
11861
|
+
if (event.data?.["errorType"] === ToolErrorType.STOP_EXECUTION) {
|
|
11862
|
+
if (config.getOutputFormat() === OutputFormat.JSON && !responseText && preToolResponseText) {
|
|
11847
11863
|
responseText = preToolResponseText;
|
|
11848
11864
|
}
|
|
11849
11865
|
const stopMessage = `Agent execution stopped: ${errorMsg}`;
|
|
11850
|
-
if (config.getOutputFormat() ===
|
|
11866
|
+
if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
11851
11867
|
process.stderr.write(`${stopMessage}
|
|
11852
11868
|
`);
|
|
11853
11869
|
}
|
|
11854
11870
|
}
|
|
11855
|
-
if (event.data?.["errorType"] ===
|
|
11871
|
+
if (event.data?.["errorType"] === ToolErrorType.NO_SPACE_LEFT) {
|
|
11856
11872
|
throw new FatalToolExecutionError(
|
|
11857
11873
|
"Error executing tool " + event.name + ": " + (displayText || errorMsg)
|
|
11858
11874
|
);
|
|
@@ -11887,12 +11903,12 @@ async function runNonInteractive({
|
|
|
11887
11903
|
}
|
|
11888
11904
|
if (streamFormatter) {
|
|
11889
11905
|
streamFormatter.emitEvent({
|
|
11890
|
-
type:
|
|
11906
|
+
type: JsonStreamEventType.ERROR,
|
|
11891
11907
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11892
11908
|
severity: "error",
|
|
11893
11909
|
message: errorMessage
|
|
11894
11910
|
});
|
|
11895
|
-
} else if (config.getOutputFormat() ===
|
|
11911
|
+
} else if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
11896
11912
|
process.stderr.write(`[ERROR] ${errorMessage}
|
|
11897
11913
|
`);
|
|
11898
11914
|
}
|
|
@@ -11913,12 +11929,12 @@ async function runNonInteractive({
|
|
|
11913
11929
|
const errorCode = event._meta?.["code"];
|
|
11914
11930
|
if (errorCode === "AGENT_EXECUTION_BLOCKED") {
|
|
11915
11931
|
const blockMessage = `Agent execution blocked: ${event.message.trim()}`;
|
|
11916
|
-
if (config.getOutputFormat() ===
|
|
11932
|
+
if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
11917
11933
|
process.stderr.write(`[WARNING] ${blockMessage}
|
|
11918
11934
|
`);
|
|
11919
11935
|
} else if (streamFormatter) {
|
|
11920
11936
|
streamFormatter.emitEvent({
|
|
11921
|
-
type:
|
|
11937
|
+
type: JsonStreamEventType.ERROR,
|
|
11922
11938
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11923
11939
|
severity: "warning",
|
|
11924
11940
|
message: stripAnsi(blockMessage)
|
|
@@ -11928,13 +11944,13 @@ async function runNonInteractive({
|
|
|
11928
11944
|
break;
|
|
11929
11945
|
}
|
|
11930
11946
|
const severity = event.status === "RESOURCE_EXHAUSTED" ? "error" : "warning";
|
|
11931
|
-
if (config.getOutputFormat() ===
|
|
11947
|
+
if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
11932
11948
|
process.stderr.write(`[WARNING] ${event.message}
|
|
11933
11949
|
`);
|
|
11934
11950
|
}
|
|
11935
11951
|
if (streamFormatter) {
|
|
11936
11952
|
streamFormatter.emitEvent({
|
|
11937
|
-
type:
|
|
11953
|
+
type: JsonStreamEventType.ERROR,
|
|
11938
11954
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11939
11955
|
severity,
|
|
11940
11956
|
message: stripAnsi(event.message)
|
|
@@ -11954,7 +11970,7 @@ async function runNonInteractive({
|
|
|
11954
11970
|
);
|
|
11955
11971
|
} else if (streamFormatter) {
|
|
11956
11972
|
streamFormatter.emitEvent({
|
|
11957
|
-
type:
|
|
11973
|
+
type: JsonStreamEventType.ERROR,
|
|
11958
11974
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11959
11975
|
severity: "error",
|
|
11960
11976
|
message: "Maximum session turns exceeded"
|
|
@@ -11962,7 +11978,7 @@ async function runNonInteractive({
|
|
|
11962
11978
|
}
|
|
11963
11979
|
}
|
|
11964
11980
|
const stopMessage = typeof event.data?.["message"] === "string" ? event.data["message"] : "";
|
|
11965
|
-
if (stopMessage && config.getOutputFormat() ===
|
|
11981
|
+
if (stopMessage && config.getOutputFormat() === OutputFormat.TEXT) {
|
|
11966
11982
|
process.stderr.write(`Agent execution stopped: ${stopMessage}
|
|
11967
11983
|
`);
|
|
11968
11984
|
}
|
|
@@ -11992,7 +12008,7 @@ async function runNonInteractive({
|
|
|
11992
12008
|
abortController.signal.removeEventListener("abort", abortSession);
|
|
11993
12009
|
scheduler?.dispose();
|
|
11994
12010
|
consolePatcher.cleanup();
|
|
11995
|
-
coreEvents.off(
|
|
12011
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
11996
12012
|
}
|
|
11997
12013
|
if (errorToHandle) {
|
|
11998
12014
|
handleError(errorToHandle, config);
|
|
@@ -12020,7 +12036,7 @@ async function runNonInteractive2(params) {
|
|
|
12020
12036
|
}
|
|
12021
12037
|
});
|
|
12022
12038
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
12023
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
12039
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-REQSIEPU.js");
|
|
12024
12040
|
setupInitialActivityLogger(config);
|
|
12025
12041
|
}
|
|
12026
12042
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -12036,7 +12052,7 @@ async function runNonInteractive2(params) {
|
|
|
12036
12052
|
}
|
|
12037
12053
|
};
|
|
12038
12054
|
const startTime = Date.now();
|
|
12039
|
-
const streamFormatter = config.getOutputFormat() ===
|
|
12055
|
+
const streamFormatter = config.getOutputFormat() === OutputFormat.STREAM_JSON ? new StreamJsonFormatter() : null;
|
|
12040
12056
|
const abortController = new AbortController();
|
|
12041
12057
|
let isAborting = false;
|
|
12042
12058
|
let cancelMessageTimer = null;
|
|
@@ -12087,13 +12103,13 @@ async function runNonInteractive2(params) {
|
|
|
12087
12103
|
let scheduler;
|
|
12088
12104
|
try {
|
|
12089
12105
|
consolePatcher.patch();
|
|
12090
|
-
if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() ===
|
|
12106
|
+
if (config.getRawOutput() && !config.getAcceptRawOutputRisk() && config.getOutputFormat() === OutputFormat.TEXT) {
|
|
12091
12107
|
process.stderr.write(
|
|
12092
12108
|
"[WARNING] --raw-output is enabled. Model output is not sanitized and may contain harmful ANSI sequences (e.g. for phishing or command injection). Use --accept-raw-output-risk to suppress this warning.\n"
|
|
12093
12109
|
);
|
|
12094
12110
|
}
|
|
12095
12111
|
setupStdinCancellation();
|
|
12096
|
-
coreEvents.on(
|
|
12112
|
+
coreEvents.on(CoreEvent.UserFeedback, handleUserFeedback);
|
|
12097
12113
|
coreEvents.drainBacklogs();
|
|
12098
12114
|
process.stdout.on("error", (err) => {
|
|
12099
12115
|
if (err.code === "EPIPE") {
|
|
@@ -12117,7 +12133,7 @@ async function runNonInteractive2(params) {
|
|
|
12117
12133
|
}
|
|
12118
12134
|
if (streamFormatter) {
|
|
12119
12135
|
streamFormatter.emitEvent({
|
|
12120
|
-
type:
|
|
12136
|
+
type: JsonStreamEventType.INIT,
|
|
12121
12137
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12122
12138
|
session_id: config.getSessionId(),
|
|
12123
12139
|
model: config.getModel()
|
|
@@ -12155,7 +12171,7 @@ async function runNonInteractive2(params) {
|
|
|
12155
12171
|
}
|
|
12156
12172
|
if (streamFormatter) {
|
|
12157
12173
|
streamFormatter.emitEvent({
|
|
12158
|
-
type:
|
|
12174
|
+
type: JsonStreamEventType.MESSAGE,
|
|
12159
12175
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12160
12176
|
role: "user",
|
|
12161
12177
|
content: input
|
|
@@ -12183,28 +12199,28 @@ async function runNonInteractive2(params) {
|
|
|
12183
12199
|
if (abortController.signal.aborted) {
|
|
12184
12200
|
handleCancellationError(config);
|
|
12185
12201
|
}
|
|
12186
|
-
if (event.type ===
|
|
12202
|
+
if (event.type === GeminiEventType.Content) {
|
|
12187
12203
|
const isRaw = config.getRawOutput() || config.getAcceptRawOutputRisk();
|
|
12188
12204
|
const output = isRaw ? event.value : stripAnsi(event.value);
|
|
12189
12205
|
if (streamFormatter) {
|
|
12190
12206
|
streamFormatter.emitEvent({
|
|
12191
|
-
type:
|
|
12207
|
+
type: JsonStreamEventType.MESSAGE,
|
|
12192
12208
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12193
12209
|
role: "assistant",
|
|
12194
12210
|
content: output,
|
|
12195
12211
|
delta: true
|
|
12196
12212
|
});
|
|
12197
|
-
} else if (config.getOutputFormat() ===
|
|
12213
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
12198
12214
|
responseText += output;
|
|
12199
12215
|
} else {
|
|
12200
12216
|
if (event.value) {
|
|
12201
12217
|
textOutput.write(output);
|
|
12202
12218
|
}
|
|
12203
12219
|
}
|
|
12204
|
-
} else if (event.type ===
|
|
12220
|
+
} else if (event.type === GeminiEventType.ToolCallRequest) {
|
|
12205
12221
|
if (streamFormatter) {
|
|
12206
12222
|
streamFormatter.emitEvent({
|
|
12207
|
-
type:
|
|
12223
|
+
type: JsonStreamEventType.TOOL_USE,
|
|
12208
12224
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12209
12225
|
tool_name: event.value.name,
|
|
12210
12226
|
tool_id: event.value.callId,
|
|
@@ -12212,33 +12228,33 @@ async function runNonInteractive2(params) {
|
|
|
12212
12228
|
});
|
|
12213
12229
|
}
|
|
12214
12230
|
toolCallRequests.push(event.value);
|
|
12215
|
-
} else if (event.type ===
|
|
12231
|
+
} else if (event.type === GeminiEventType.LoopDetected) {
|
|
12216
12232
|
const message = "Loop detected, stopping execution";
|
|
12217
12233
|
if (streamFormatter) {
|
|
12218
12234
|
streamFormatter.emitEvent({
|
|
12219
|
-
type:
|
|
12235
|
+
type: JsonStreamEventType.ERROR,
|
|
12220
12236
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12221
12237
|
severity: "warning",
|
|
12222
12238
|
message
|
|
12223
12239
|
});
|
|
12224
12240
|
}
|
|
12225
12241
|
warnings.push(message);
|
|
12226
|
-
} else if (event.type ===
|
|
12242
|
+
} else if (event.type === GeminiEventType.MaxSessionTurns) {
|
|
12227
12243
|
const message = "Maximum session turns exceeded";
|
|
12228
12244
|
if (streamFormatter) {
|
|
12229
12245
|
streamFormatter.emitEvent({
|
|
12230
|
-
type:
|
|
12246
|
+
type: JsonStreamEventType.ERROR,
|
|
12231
12247
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12232
12248
|
severity: "error",
|
|
12233
12249
|
message
|
|
12234
12250
|
});
|
|
12235
12251
|
}
|
|
12236
12252
|
warnings.push(message);
|
|
12237
|
-
} else if (event.type ===
|
|
12253
|
+
} else if (event.type === GeminiEventType.Error) {
|
|
12238
12254
|
throw event.value.error;
|
|
12239
|
-
} else if (event.type ===
|
|
12255
|
+
} else if (event.type === GeminiEventType.AgentExecutionStopped) {
|
|
12240
12256
|
const stopMessage = `Agent execution stopped: ${event.value.systemMessage?.trim() || event.value.reason}`;
|
|
12241
|
-
if (config.getOutputFormat() ===
|
|
12257
|
+
if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
12242
12258
|
process.stderr.write(`${stopMessage}
|
|
12243
12259
|
`);
|
|
12244
12260
|
}
|
|
@@ -12246,7 +12262,7 @@ async function runNonInteractive2(params) {
|
|
|
12246
12262
|
const metrics = uiTelemetryService.getMetrics();
|
|
12247
12263
|
const durationMs = Date.now() - startTime;
|
|
12248
12264
|
streamFormatter.emitEvent({
|
|
12249
|
-
type:
|
|
12265
|
+
type: JsonStreamEventType.RESULT,
|
|
12250
12266
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12251
12267
|
status: "success",
|
|
12252
12268
|
stats: streamFormatter.convertToStreamStats(
|
|
@@ -12254,7 +12270,7 @@ async function runNonInteractive2(params) {
|
|
|
12254
12270
|
durationMs
|
|
12255
12271
|
)
|
|
12256
12272
|
});
|
|
12257
|
-
} else if (config.getOutputFormat() ===
|
|
12273
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
12258
12274
|
const formatter = new JsonFormatter();
|
|
12259
12275
|
const stats = uiTelemetryService.getMetrics();
|
|
12260
12276
|
textOutput.write(
|
|
@@ -12270,21 +12286,21 @@ async function runNonInteractive2(params) {
|
|
|
12270
12286
|
textOutput.ensureTrailingNewline();
|
|
12271
12287
|
}
|
|
12272
12288
|
return;
|
|
12273
|
-
} else if (event.type ===
|
|
12289
|
+
} else if (event.type === GeminiEventType.AgentExecutionBlocked) {
|
|
12274
12290
|
const blockMessage = `Agent execution blocked: ${event.value.systemMessage?.trim() || event.value.reason}`;
|
|
12275
|
-
if (config.getOutputFormat() ===
|
|
12291
|
+
if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
12276
12292
|
process.stderr.write(`[WARNING] ${blockMessage}
|
|
12277
12293
|
`);
|
|
12278
12294
|
} else if (streamFormatter) {
|
|
12279
12295
|
streamFormatter.emitEvent({
|
|
12280
|
-
type:
|
|
12296
|
+
type: JsonStreamEventType.ERROR,
|
|
12281
12297
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12282
12298
|
severity: "warning",
|
|
12283
12299
|
message: stripAnsi(blockMessage)
|
|
12284
12300
|
});
|
|
12285
12301
|
}
|
|
12286
12302
|
warnings.push(blockMessage);
|
|
12287
|
-
} else if (event.type ===
|
|
12303
|
+
} else if (event.type === GeminiEventType.InvalidStream) {
|
|
12288
12304
|
const eventValue = event.value;
|
|
12289
12305
|
if (eventValue?.type === "NO_RESPONSE_TEXT") {
|
|
12290
12306
|
invalidStreamError = TRUE_EMPTY_RESPONSE_MESSAGE;
|
|
@@ -12307,12 +12323,12 @@ async function runNonInteractive2(params) {
|
|
|
12307
12323
|
);
|
|
12308
12324
|
if (streamFormatter) {
|
|
12309
12325
|
streamFormatter.emitEvent({
|
|
12310
|
-
type:
|
|
12326
|
+
type: JsonStreamEventType.ERROR,
|
|
12311
12327
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12312
12328
|
severity: "error",
|
|
12313
12329
|
message: invalidStreamError
|
|
12314
12330
|
});
|
|
12315
|
-
} else if (config.getOutputFormat() ===
|
|
12331
|
+
} else if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
12316
12332
|
process.stderr.write(`[ERROR] ${invalidStreamError}
|
|
12317
12333
|
`);
|
|
12318
12334
|
}
|
|
@@ -12332,7 +12348,7 @@ async function runNonInteractive2(params) {
|
|
|
12332
12348
|
const requestInfo = completedToolCall.request;
|
|
12333
12349
|
if (streamFormatter) {
|
|
12334
12350
|
streamFormatter.emitEvent({
|
|
12335
|
-
type:
|
|
12351
|
+
type: JsonStreamEventType.TOOL_RESULT,
|
|
12336
12352
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12337
12353
|
tool_id: requestInfo.callId,
|
|
12338
12354
|
status: completedToolCall.status === "error" ? "error" : "success",
|
|
@@ -12366,11 +12382,11 @@ async function runNonInteractive2(params) {
|
|
|
12366
12382
|
);
|
|
12367
12383
|
}
|
|
12368
12384
|
const stopExecutionTool = completedToolCalls.find(
|
|
12369
|
-
(tc) => tc.response.errorType ===
|
|
12385
|
+
(tc) => tc.response.errorType === ToolErrorType.STOP_EXECUTION
|
|
12370
12386
|
);
|
|
12371
12387
|
if (stopExecutionTool && stopExecutionTool.response.error) {
|
|
12372
12388
|
const stopMessage = `Agent execution stopped: ${stopExecutionTool.response.error.message}`;
|
|
12373
|
-
if (config.getOutputFormat() ===
|
|
12389
|
+
if (config.getOutputFormat() === OutputFormat.TEXT) {
|
|
12374
12390
|
process.stderr.write(`${stopMessage}
|
|
12375
12391
|
`);
|
|
12376
12392
|
}
|
|
@@ -12378,7 +12394,7 @@ async function runNonInteractive2(params) {
|
|
|
12378
12394
|
const metrics = uiTelemetryService.getMetrics();
|
|
12379
12395
|
const durationMs = Date.now() - startTime;
|
|
12380
12396
|
streamFormatter.emitEvent({
|
|
12381
|
-
type:
|
|
12397
|
+
type: JsonStreamEventType.RESULT,
|
|
12382
12398
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12383
12399
|
status: "success",
|
|
12384
12400
|
stats: streamFormatter.convertToStreamStats(
|
|
@@ -12386,7 +12402,7 @@ async function runNonInteractive2(params) {
|
|
|
12386
12402
|
durationMs
|
|
12387
12403
|
)
|
|
12388
12404
|
});
|
|
12389
|
-
} else if (config.getOutputFormat() ===
|
|
12405
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
12390
12406
|
const formatter = new JsonFormatter();
|
|
12391
12407
|
const stats = uiTelemetryService.getMetrics();
|
|
12392
12408
|
textOutput.write(
|
|
@@ -12409,12 +12425,12 @@ async function runNonInteractive2(params) {
|
|
|
12409
12425
|
const metrics = uiTelemetryService.getMetrics();
|
|
12410
12426
|
const durationMs = Date.now() - startTime;
|
|
12411
12427
|
streamFormatter.emitEvent({
|
|
12412
|
-
type:
|
|
12428
|
+
type: JsonStreamEventType.RESULT,
|
|
12413
12429
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12414
12430
|
status: invalidStreamError ? "error" : "success",
|
|
12415
12431
|
stats: streamFormatter.convertToStreamStats(metrics, durationMs)
|
|
12416
12432
|
});
|
|
12417
|
-
} else if (config.getOutputFormat() ===
|
|
12433
|
+
} else if (config.getOutputFormat() === OutputFormat.JSON) {
|
|
12418
12434
|
const formatter = new JsonFormatter();
|
|
12419
12435
|
const stats = uiTelemetryService.getMetrics();
|
|
12420
12436
|
textOutput.write(
|
|
@@ -12438,7 +12454,7 @@ async function runNonInteractive2(params) {
|
|
|
12438
12454
|
cleanupStdinCancellation();
|
|
12439
12455
|
scheduler?.dispose();
|
|
12440
12456
|
consolePatcher.cleanup();
|
|
12441
|
-
coreEvents.off(
|
|
12457
|
+
coreEvents.off(CoreEvent.UserFeedback, handleUserFeedback);
|
|
12442
12458
|
}
|
|
12443
12459
|
if (errorToHandle) {
|
|
12444
12460
|
handleError(errorToHandle, config);
|
|
@@ -14829,12 +14845,12 @@ function toToolCallContent(toolResult) {
|
|
|
14829
14845
|
}
|
|
14830
14846
|
var basicPermissionOptions = [
|
|
14831
14847
|
{
|
|
14832
|
-
optionId:
|
|
14848
|
+
optionId: ToolConfirmationOutcome.ProceedOnce,
|
|
14833
14849
|
name: "Allow",
|
|
14834
14850
|
kind: "allow_once"
|
|
14835
14851
|
},
|
|
14836
14852
|
{
|
|
14837
|
-
optionId:
|
|
14853
|
+
optionId: ToolConfirmationOutcome.Cancel,
|
|
14838
14854
|
name: "Reject",
|
|
14839
14855
|
kind: "reject_once"
|
|
14840
14856
|
}
|
|
@@ -14846,13 +14862,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
|
|
|
14846
14862
|
switch (confirmation.type) {
|
|
14847
14863
|
case "edit":
|
|
14848
14864
|
options.push({
|
|
14849
|
-
optionId:
|
|
14865
|
+
optionId: ToolConfirmationOutcome.ProceedAlways,
|
|
14850
14866
|
name: "Allow for this session",
|
|
14851
14867
|
kind: "allow_always"
|
|
14852
14868
|
});
|
|
14853
14869
|
if (enablePermanentToolApproval) {
|
|
14854
14870
|
options.push({
|
|
14855
|
-
optionId:
|
|
14871
|
+
optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
14856
14872
|
name: "Allow for this file in all future sessions",
|
|
14857
14873
|
kind: "allow_always"
|
|
14858
14874
|
});
|
|
@@ -14860,13 +14876,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
|
|
|
14860
14876
|
break;
|
|
14861
14877
|
case "exec":
|
|
14862
14878
|
options.push({
|
|
14863
|
-
optionId:
|
|
14879
|
+
optionId: ToolConfirmationOutcome.ProceedAlways,
|
|
14864
14880
|
name: "Allow for this session",
|
|
14865
14881
|
kind: "allow_always"
|
|
14866
14882
|
});
|
|
14867
14883
|
if (enablePermanentToolApproval) {
|
|
14868
14884
|
options.push({
|
|
14869
|
-
optionId:
|
|
14885
|
+
optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
14870
14886
|
name: "Allow this command for all future sessions",
|
|
14871
14887
|
kind: "allow_always"
|
|
14872
14888
|
});
|
|
@@ -14875,19 +14891,19 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
|
|
|
14875
14891
|
case "mcp":
|
|
14876
14892
|
options.push(
|
|
14877
14893
|
{
|
|
14878
|
-
optionId:
|
|
14894
|
+
optionId: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
14879
14895
|
name: "Allow all server tools for this session",
|
|
14880
14896
|
kind: "allow_always"
|
|
14881
14897
|
},
|
|
14882
14898
|
{
|
|
14883
|
-
optionId:
|
|
14899
|
+
optionId: ToolConfirmationOutcome.ProceedAlwaysTool,
|
|
14884
14900
|
name: "Allow tool for this session",
|
|
14885
14901
|
kind: "allow_always"
|
|
14886
14902
|
}
|
|
14887
14903
|
);
|
|
14888
14904
|
if (enablePermanentToolApproval) {
|
|
14889
14905
|
options.push({
|
|
14890
|
-
optionId:
|
|
14906
|
+
optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
14891
14907
|
name: "Allow tool for all future sessions",
|
|
14892
14908
|
kind: "allow_always"
|
|
14893
14909
|
});
|
|
@@ -14895,13 +14911,13 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
|
|
|
14895
14911
|
break;
|
|
14896
14912
|
case "info":
|
|
14897
14913
|
options.push({
|
|
14898
|
-
optionId:
|
|
14914
|
+
optionId: ToolConfirmationOutcome.ProceedAlways,
|
|
14899
14915
|
name: "Allow for this session",
|
|
14900
14916
|
kind: "allow_always"
|
|
14901
14917
|
});
|
|
14902
14918
|
if (enablePermanentToolApproval) {
|
|
14903
14919
|
options.push({
|
|
14904
|
-
optionId:
|
|
14920
|
+
optionId: ToolConfirmationOutcome.ProceedAlwaysAndSave,
|
|
14905
14921
|
name: "Allow for all future sessions",
|
|
14906
14922
|
kind: "allow_always"
|
|
14907
14923
|
});
|
|
@@ -14933,21 +14949,21 @@ function toPermissionOptions(confirmation, config, enablePermanentToolApproval =
|
|
|
14933
14949
|
}
|
|
14934
14950
|
function toAcpToolKind(kind) {
|
|
14935
14951
|
switch (kind) {
|
|
14936
|
-
case
|
|
14937
|
-
case
|
|
14938
|
-
case
|
|
14939
|
-
case
|
|
14940
|
-
case
|
|
14941
|
-
case
|
|
14942
|
-
case
|
|
14943
|
-
case
|
|
14944
|
-
case
|
|
14945
|
-
case
|
|
14952
|
+
case Kind.Read:
|
|
14953
|
+
case Kind.Edit:
|
|
14954
|
+
case Kind.Execute:
|
|
14955
|
+
case Kind.Search:
|
|
14956
|
+
case Kind.Delete:
|
|
14957
|
+
case Kind.Move:
|
|
14958
|
+
case Kind.Think:
|
|
14959
|
+
case Kind.Fetch:
|
|
14960
|
+
case Kind.SwitchMode:
|
|
14961
|
+
case Kind.Other:
|
|
14946
14962
|
return kind;
|
|
14947
|
-
case
|
|
14963
|
+
case Kind.Agent:
|
|
14948
14964
|
return "think";
|
|
14949
|
-
case
|
|
14950
|
-
case
|
|
14965
|
+
case Kind.Plan:
|
|
14966
|
+
case Kind.Communicate:
|
|
14951
14967
|
default:
|
|
14952
14968
|
return "other";
|
|
14953
14969
|
}
|
|
@@ -14955,24 +14971,24 @@ function toAcpToolKind(kind) {
|
|
|
14955
14971
|
function buildAvailableModes(isPlanEnabled) {
|
|
14956
14972
|
const modes = [
|
|
14957
14973
|
{
|
|
14958
|
-
id:
|
|
14974
|
+
id: ApprovalMode.DEFAULT,
|
|
14959
14975
|
name: "Default",
|
|
14960
14976
|
description: "Prompts for approval"
|
|
14961
14977
|
},
|
|
14962
14978
|
{
|
|
14963
|
-
id:
|
|
14979
|
+
id: ApprovalMode.AUTO_EDIT,
|
|
14964
14980
|
name: "Auto Edit",
|
|
14965
14981
|
description: "Auto-approves edit tools"
|
|
14966
14982
|
},
|
|
14967
14983
|
{
|
|
14968
|
-
id:
|
|
14984
|
+
id: ApprovalMode.YOLO,
|
|
14969
14985
|
name: "YOLO",
|
|
14970
14986
|
description: "Auto-approves all tools"
|
|
14971
14987
|
}
|
|
14972
14988
|
];
|
|
14973
14989
|
if (isPlanEnabled) {
|
|
14974
14990
|
modes.push({
|
|
14975
|
-
id:
|
|
14991
|
+
id: ApprovalMode.PLAN,
|
|
14976
14992
|
name: "Plan",
|
|
14977
14993
|
description: "Read-only mode"
|
|
14978
14994
|
});
|
|
@@ -14986,7 +15002,7 @@ function buildAvailableModels(config, settings) {
|
|
|
14986
15002
|
const useLatestFlash = config.hasLatestFlashGAAccess?.() ?? false;
|
|
14987
15003
|
const useLatestFlashLite = config.hasLatestFlashLiteGAAccess?.() ?? false;
|
|
14988
15004
|
const selectedAuthType = settings.merged.security.auth.selectedType;
|
|
14989
|
-
const useCustomToolModel = useGemini31 && selectedAuthType ===
|
|
15005
|
+
const useCustomToolModel = useGemini31 && selectedAuthType === AuthType.USE_GEMINI;
|
|
14990
15006
|
if (config.getExperimentalDynamicModelConfiguration?.() === true && config.getModelConfigService) {
|
|
14991
15007
|
const options = config.getModelConfigService().getAvailableModelOptions({
|
|
14992
15008
|
useGemini3_1: useGemini31,
|
|
@@ -15073,11 +15089,11 @@ var Session = class {
|
|
|
15073
15089
|
this.connection = connection;
|
|
15074
15090
|
this.settings = settings;
|
|
15075
15091
|
coreEvents.on(
|
|
15076
|
-
|
|
15092
|
+
CoreEvent.ApprovalModeChanged,
|
|
15077
15093
|
this.handleApprovalModeChanged
|
|
15078
15094
|
);
|
|
15079
15095
|
this.context.config.getMessageBus()?.subscribe(
|
|
15080
|
-
|
|
15096
|
+
MessageBusType.TOOL_CONFIRMATION_REQUEST,
|
|
15081
15097
|
this.handleToolConfirmationRequest,
|
|
15082
15098
|
{ signal: this.disposeController.signal }
|
|
15083
15099
|
);
|
|
@@ -15101,7 +15117,7 @@ var Session = class {
|
|
|
15101
15117
|
"Policy engine missing. Denying tool confirmation request."
|
|
15102
15118
|
);
|
|
15103
15119
|
await messageBus.publish({
|
|
15104
|
-
type:
|
|
15120
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
15105
15121
|
correlationId: request.correlationId,
|
|
15106
15122
|
confirmed: false,
|
|
15107
15123
|
requiresUserConfirmation: false
|
|
@@ -15114,7 +15130,7 @@ var Session = class {
|
|
|
15114
15130
|
"Tool confirmation request missing tool name. Denying."
|
|
15115
15131
|
);
|
|
15116
15132
|
await messageBus.publish({
|
|
15117
|
-
type:
|
|
15133
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
15118
15134
|
correlationId: request.correlationId,
|
|
15119
15135
|
confirmed: false,
|
|
15120
15136
|
requiresUserConfirmation: false
|
|
@@ -15127,7 +15143,7 @@ var Session = class {
|
|
|
15127
15143
|
`Tool confirmation request for unknown tool: ${toolName}. Denying.`
|
|
15128
15144
|
);
|
|
15129
15145
|
await messageBus.publish({
|
|
15130
|
-
type:
|
|
15146
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
15131
15147
|
correlationId: request.correlationId,
|
|
15132
15148
|
confirmed: false,
|
|
15133
15149
|
requiresUserConfirmation: false
|
|
@@ -15143,15 +15159,15 @@ var Session = class {
|
|
|
15143
15159
|
request.subagent
|
|
15144
15160
|
);
|
|
15145
15161
|
await messageBus.publish({
|
|
15146
|
-
type:
|
|
15162
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
15147
15163
|
correlationId: request.correlationId,
|
|
15148
|
-
confirmed: result.decision ===
|
|
15149
|
-
requiresUserConfirmation: result.decision ===
|
|
15164
|
+
confirmed: result.decision === PolicyDecision.ALLOW,
|
|
15165
|
+
requiresUserConfirmation: result.decision === PolicyDecision.ASK_USER
|
|
15150
15166
|
});
|
|
15151
15167
|
} catch (error) {
|
|
15152
15168
|
debugLogger.error("Error handling tool confirmation request:", error);
|
|
15153
15169
|
await this.context.config.getMessageBus()?.publish({
|
|
15154
|
-
type:
|
|
15170
|
+
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
|
|
15155
15171
|
correlationId: request.correlationId,
|
|
15156
15172
|
confirmed: false,
|
|
15157
15173
|
requiresUserConfirmation: false
|
|
@@ -15171,7 +15187,7 @@ var Session = class {
|
|
|
15171
15187
|
};
|
|
15172
15188
|
dispose() {
|
|
15173
15189
|
coreEvents.off(
|
|
15174
|
-
|
|
15190
|
+
CoreEvent.ApprovalModeChanged,
|
|
15175
15191
|
this.handleApprovalModeChanged
|
|
15176
15192
|
);
|
|
15177
15193
|
this.disposeController.abort();
|
|
@@ -15260,7 +15276,7 @@ ${thought.description}`;
|
|
|
15260
15276
|
await this.sendUpdate({
|
|
15261
15277
|
sessionUpdate: "tool_call",
|
|
15262
15278
|
toolCallId: toolCall.id,
|
|
15263
|
-
status: toolCall.status ===
|
|
15279
|
+
status: toolCall.status === CoreToolCallStatus.Success ? "completed" : "failed",
|
|
15264
15280
|
title: toolCall.displayName || toolCall.name,
|
|
15265
15281
|
content: toolCallContent,
|
|
15266
15282
|
kind: tool ? toAcpToolKind(tool.kind) : "other"
|
|
@@ -15352,7 +15368,7 @@ ${thought.description}`;
|
|
|
15352
15368
|
return { stopReason: "cancelled" };
|
|
15353
15369
|
}
|
|
15354
15370
|
switch (event.type) {
|
|
15355
|
-
case
|
|
15371
|
+
case GeminiEventType.Content: {
|
|
15356
15372
|
const content = {
|
|
15357
15373
|
type: "text",
|
|
15358
15374
|
text: event.value
|
|
@@ -15363,7 +15379,7 @@ ${thought.description}`;
|
|
|
15363
15379
|
});
|
|
15364
15380
|
break;
|
|
15365
15381
|
}
|
|
15366
|
-
case
|
|
15382
|
+
case GeminiEventType.Thought: {
|
|
15367
15383
|
const thoughtText = `**${event.value.subject}**
|
|
15368
15384
|
${event.value.description}`;
|
|
15369
15385
|
await this.sendUpdate({
|
|
@@ -15372,10 +15388,10 @@ ${event.value.description}`;
|
|
|
15372
15388
|
});
|
|
15373
15389
|
break;
|
|
15374
15390
|
}
|
|
15375
|
-
case
|
|
15391
|
+
case GeminiEventType.ToolCallRequest:
|
|
15376
15392
|
toolCallRequests.push(event.value);
|
|
15377
15393
|
break;
|
|
15378
|
-
case
|
|
15394
|
+
case GeminiEventType.Finished: {
|
|
15379
15395
|
const usage2 = event.value.usageMetadata;
|
|
15380
15396
|
if (usage2) {
|
|
15381
15397
|
turnInputTokens = usage2.promptTokenCount ?? turnInputTokens;
|
|
@@ -15383,19 +15399,19 @@ ${event.value.description}`;
|
|
|
15383
15399
|
}
|
|
15384
15400
|
break;
|
|
15385
15401
|
}
|
|
15386
|
-
case
|
|
15402
|
+
case GeminiEventType.ModelInfo:
|
|
15387
15403
|
turnModelId = event.value;
|
|
15388
15404
|
break;
|
|
15389
|
-
case
|
|
15405
|
+
case GeminiEventType.MaxSessionTurns:
|
|
15390
15406
|
stopReason = "max_turn_requests";
|
|
15391
15407
|
break;
|
|
15392
|
-
case
|
|
15408
|
+
case GeminiEventType.LoopDetected:
|
|
15393
15409
|
stopReason = "max_turn_requests";
|
|
15394
15410
|
break;
|
|
15395
|
-
case
|
|
15411
|
+
case GeminiEventType.ContextWindowWillOverflow:
|
|
15396
15412
|
stopReason = "max_tokens";
|
|
15397
15413
|
break;
|
|
15398
|
-
case
|
|
15414
|
+
case GeminiEventType.Error: {
|
|
15399
15415
|
const parseResult = StructuredErrorSchema.safeParse(
|
|
15400
15416
|
event.value.error
|
|
15401
15417
|
);
|
|
@@ -15632,7 +15648,7 @@ ${event.value.description}`;
|
|
|
15632
15648
|
const output = RequestPermissionResponseSchema.parse(
|
|
15633
15649
|
await this.connection.requestPermission(params)
|
|
15634
15650
|
);
|
|
15635
|
-
const outcome = output.outcome.outcome === "cancelled" ?
|
|
15651
|
+
const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
|
|
15636
15652
|
await confirmationDetails.onConfirm(outcome);
|
|
15637
15653
|
await updatePolicy(
|
|
15638
15654
|
tool,
|
|
@@ -15643,7 +15659,7 @@ ${event.value.description}`;
|
|
|
15643
15659
|
invocation
|
|
15644
15660
|
);
|
|
15645
15661
|
switch (outcome) {
|
|
15646
|
-
case
|
|
15662
|
+
case ToolConfirmationOutcome.Cancel: {
|
|
15647
15663
|
const cancelError = new Error(
|
|
15648
15664
|
`Tool "${fc.name}" was canceled by the user.`
|
|
15649
15665
|
);
|
|
@@ -15661,12 +15677,12 @@ ${event.value.description}`;
|
|
|
15661
15677
|
});
|
|
15662
15678
|
return errorResponse(cancelError);
|
|
15663
15679
|
}
|
|
15664
|
-
case
|
|
15665
|
-
case
|
|
15666
|
-
case
|
|
15667
|
-
case
|
|
15668
|
-
case
|
|
15669
|
-
case
|
|
15680
|
+
case ToolConfirmationOutcome.ProceedOnce:
|
|
15681
|
+
case ToolConfirmationOutcome.ProceedAlways:
|
|
15682
|
+
case ToolConfirmationOutcome.ProceedAlwaysAndSave:
|
|
15683
|
+
case ToolConfirmationOutcome.ProceedAlwaysServer:
|
|
15684
|
+
case ToolConfirmationOutcome.ProceedAlwaysTool:
|
|
15685
|
+
case ToolConfirmationOutcome.ModifyWithEditor:
|
|
15670
15686
|
break;
|
|
15671
15687
|
default: {
|
|
15672
15688
|
const resultOutcome = outcome;
|
|
@@ -15720,7 +15736,7 @@ ${event.value.description}`;
|
|
|
15720
15736
|
);
|
|
15721
15737
|
this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
|
|
15722
15738
|
{
|
|
15723
|
-
status:
|
|
15739
|
+
status: CoreToolCallStatus.Success,
|
|
15724
15740
|
request: {
|
|
15725
15741
|
callId,
|
|
15726
15742
|
name: fc.name,
|
|
@@ -15765,7 +15781,7 @@ ${event.value.description}`;
|
|
|
15765
15781
|
});
|
|
15766
15782
|
this.chat.recordCompletedToolCalls(this.context.config.getActiveModel(), [
|
|
15767
15783
|
{
|
|
15768
|
-
status:
|
|
15784
|
+
status: CoreToolCallStatus.Error,
|
|
15769
15785
|
request: {
|
|
15770
15786
|
callId,
|
|
15771
15787
|
name: fc.name,
|
|
@@ -15893,12 +15909,12 @@ ${event.value.description}`;
|
|
|
15893
15909
|
sessionId: this.id,
|
|
15894
15910
|
options: [
|
|
15895
15911
|
{
|
|
15896
|
-
optionId:
|
|
15912
|
+
optionId: ToolConfirmationOutcome.ProceedOnce,
|
|
15897
15913
|
name: "Allow once",
|
|
15898
15914
|
kind: "allow_once"
|
|
15899
15915
|
},
|
|
15900
15916
|
{
|
|
15901
|
-
optionId:
|
|
15917
|
+
optionId: ToolConfirmationOutcome.Cancel,
|
|
15902
15918
|
name: "Deny",
|
|
15903
15919
|
kind: "reject_once"
|
|
15904
15920
|
}
|
|
@@ -15923,8 +15939,8 @@ ${event.value.description}`;
|
|
|
15923
15939
|
const output = RequestPermissionResponseSchema.parse(
|
|
15924
15940
|
await this.connection.requestPermission(params)
|
|
15925
15941
|
);
|
|
15926
|
-
const outcome = output.outcome.outcome === "cancelled" ?
|
|
15927
|
-
if (outcome ===
|
|
15942
|
+
const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
|
|
15943
|
+
if (outcome === ToolConfirmationOutcome.ProceedOnce) {
|
|
15928
15944
|
this.context.config.getWorkspaceContext().addReadOnlyPath(absolutePath);
|
|
15929
15945
|
validationError = null;
|
|
15930
15946
|
} else {
|
|
@@ -16362,7 +16378,7 @@ var AcpSessionManager = class {
|
|
|
16362
16378
|
mcpServers,
|
|
16363
16379
|
loadedSettings
|
|
16364
16380
|
);
|
|
16365
|
-
const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ?
|
|
16381
|
+
const authType = loadedSettings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : AuthType.USE_GEMINI);
|
|
16366
16382
|
let isAuthenticated = false;
|
|
16367
16383
|
let authErrorMessage = "";
|
|
16368
16384
|
try {
|
|
@@ -16374,7 +16390,7 @@ var AcpSessionManager = class {
|
|
|
16374
16390
|
);
|
|
16375
16391
|
isAuthenticated = true;
|
|
16376
16392
|
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
|
16377
|
-
if (authType ===
|
|
16393
|
+
if (authType === AuthType.USE_GEMINI && (!contentGeneratorConfig || !contentGeneratorConfig.apiKey)) {
|
|
16378
16394
|
isAuthenticated = false;
|
|
16379
16395
|
authErrorMessage = "Gemini API key is missing or not configured.";
|
|
16380
16396
|
}
|
|
@@ -16405,7 +16421,7 @@ var AcpSessionManager = class {
|
|
|
16405
16421
|
startupProfiler.flush(config);
|
|
16406
16422
|
startAutoMemoryIfEnabled(config);
|
|
16407
16423
|
const geminiClient = config.getGeminiClient();
|
|
16408
|
-
const chat = await geminiClient.startChat();
|
|
16424
|
+
const chat = geminiClient.isInitialized?.() ? geminiClient.getChat() : await geminiClient.startChat();
|
|
16409
16425
|
const session = new Session(
|
|
16410
16426
|
sessionId,
|
|
16411
16427
|
chat,
|
|
@@ -16435,17 +16451,20 @@ var AcpSessionManager = class {
|
|
|
16435
16451
|
return response;
|
|
16436
16452
|
}
|
|
16437
16453
|
async loadSession({ sessionId, cwd, mcpServers }, authDetails) {
|
|
16438
|
-
const config = await this.
|
|
16454
|
+
const config = await this.prepareSessionConfig(
|
|
16439
16455
|
sessionId,
|
|
16440
16456
|
cwd,
|
|
16441
16457
|
mcpServers,
|
|
16442
16458
|
authDetails
|
|
16443
16459
|
);
|
|
16460
|
+
await config.storage?.initialize?.();
|
|
16444
16461
|
const sessionSelector = new SessionSelector(config.storage);
|
|
16445
16462
|
const { sessionData, sessionPath } = await sessionSelector.resolveSession(sessionId);
|
|
16463
|
+
await config.initialize();
|
|
16464
|
+
startupProfiler.flush(config);
|
|
16465
|
+
startAutoMemoryIfEnabled(config);
|
|
16446
16466
|
const clientHistory = convertSessionToClientHistory(sessionData.messages);
|
|
16447
16467
|
const geminiClient = config.getGeminiClient();
|
|
16448
|
-
await geminiClient.initialize();
|
|
16449
16468
|
await geminiClient.resumeChat(clientHistory, {
|
|
16450
16469
|
conversation: sessionData,
|
|
16451
16470
|
filePath: sessionPath
|
|
@@ -16482,8 +16501,8 @@ var AcpSessionManager = class {
|
|
|
16482
16501
|
};
|
|
16483
16502
|
return response;
|
|
16484
16503
|
}
|
|
16485
|
-
async
|
|
16486
|
-
const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ?
|
|
16504
|
+
async prepareSessionConfig(sessionId, cwd, mcpServers, authDetails) {
|
|
16505
|
+
const selectedAuthType = this.settings.merged.security.auth.selectedType || (authDetails.baseUrl || process.env["GOOGLE_GEMINI_BASE_URL"] ? AuthType.GATEWAY : void 0);
|
|
16487
16506
|
if (!selectedAuthType) {
|
|
16488
16507
|
throw RequestError.authRequired();
|
|
16489
16508
|
}
|
|
@@ -16509,9 +16528,6 @@ var AcpSessionManager = class {
|
|
|
16509
16528
|
);
|
|
16510
16529
|
config.setFileSystemService(acpFileSystemService);
|
|
16511
16530
|
}
|
|
16512
|
-
await config.initialize();
|
|
16513
|
-
startupProfiler.flush(config);
|
|
16514
|
-
startAutoMemoryIfEnabled(config);
|
|
16515
16531
|
return config;
|
|
16516
16532
|
}
|
|
16517
16533
|
async newSessionConfig(sessionId, cwd, mcpServers, loadedSettings) {
|
|
@@ -16584,12 +16600,12 @@ var GeminiAgent = class {
|
|
|
16584
16600
|
}
|
|
16585
16601
|
const authMethods = [
|
|
16586
16602
|
{
|
|
16587
|
-
id:
|
|
16603
|
+
id: AuthType.LOGIN_WITH_GOOGLE,
|
|
16588
16604
|
name: "Log in with Google",
|
|
16589
16605
|
description: "Log in with your Google account"
|
|
16590
16606
|
},
|
|
16591
16607
|
{
|
|
16592
|
-
id:
|
|
16608
|
+
id: AuthType.USE_GEMINI,
|
|
16593
16609
|
name: "Gemini API key",
|
|
16594
16610
|
description: "Use an API key with Gemini Developer API",
|
|
16595
16611
|
_meta: {
|
|
@@ -16599,12 +16615,12 @@ var GeminiAgent = class {
|
|
|
16599
16615
|
}
|
|
16600
16616
|
},
|
|
16601
16617
|
{
|
|
16602
|
-
id:
|
|
16618
|
+
id: AuthType.USE_VERTEX_AI,
|
|
16603
16619
|
name: "Vertex AI",
|
|
16604
16620
|
description: "Use an API key with Vertex AI GenAI API"
|
|
16605
16621
|
},
|
|
16606
16622
|
{
|
|
16607
|
-
id:
|
|
16623
|
+
id: AuthType.GATEWAY,
|
|
16608
16624
|
name: "AI API Gateway",
|
|
16609
16625
|
description: "Use a custom AI API Gateway",
|
|
16610
16626
|
_meta: {
|
|
@@ -16777,7 +16793,7 @@ async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, n
|
|
|
16777
16793
|
}
|
|
16778
16794
|
return authType;
|
|
16779
16795
|
} catch (error) {
|
|
16780
|
-
if (nonInteractiveConfig.getOutputFormat() ===
|
|
16796
|
+
if (nonInteractiveConfig.getOutputFormat() === OutputFormat.JSON) {
|
|
16781
16797
|
handleError(
|
|
16782
16798
|
error instanceof Error ? error : new Error(String(error)),
|
|
16783
16799
|
nonInteractiveConfig,
|
|
@@ -16972,10 +16988,10 @@ var SlashCommandConflictHandler = class {
|
|
|
16972
16988
|
this.handleConflicts = this.handleConflicts.bind(this);
|
|
16973
16989
|
}
|
|
16974
16990
|
start() {
|
|
16975
|
-
coreEvents.on(
|
|
16991
|
+
coreEvents.on(CoreEvent.SlashCommandConflicts, this.handleConflicts);
|
|
16976
16992
|
}
|
|
16977
16993
|
stop() {
|
|
16978
|
-
coreEvents.off(
|
|
16994
|
+
coreEvents.off(CoreEvent.SlashCommandConflicts, this.handleConflicts);
|
|
16979
16995
|
if (this.flushTimeout) {
|
|
16980
16996
|
clearTimeout(this.flushTimeout);
|
|
16981
16997
|
this.flushTimeout = null;
|
|
@@ -17331,7 +17347,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
|
|
|
17331
17347
|
}
|
|
17332
17348
|
}
|
|
17333
17349
|
async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
|
|
17334
|
-
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-
|
|
17350
|
+
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-JF6LE6RN.js");
|
|
17335
17351
|
await doStartUI(
|
|
17336
17352
|
config,
|
|
17337
17353
|
settings,
|
|
@@ -17434,12 +17450,12 @@ async function main() {
|
|
|
17434
17450
|
dns.setDefaultResultOrder(
|
|
17435
17451
|
validateDnsResolutionOrder(settings.merged.advanced.dnsResolutionOrder)
|
|
17436
17452
|
);
|
|
17437
|
-
if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType ===
|
|
17453
|
+
if (!settings.merged.security.auth.selectedType || settings.merged.security.auth.selectedType === AuthType.LEGACY_CLOUD_SHELL) {
|
|
17438
17454
|
if (process.env["CLOUD_SHELL"] === "true" || process.env["GEMINI_CLI_USE_COMPUTE_ADC"] === "true") {
|
|
17439
17455
|
settings.setValue(
|
|
17440
17456
|
"User" /* User */,
|
|
17441
17457
|
"security.auth.selectedType",
|
|
17442
|
-
|
|
17458
|
+
AuthType.COMPUTE_ADC
|
|
17443
17459
|
);
|
|
17444
17460
|
}
|
|
17445
17461
|
}
|
|
@@ -17540,7 +17556,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
17540
17556
|
await config.storage.initialize();
|
|
17541
17557
|
adminControlsListner.setConfig(config);
|
|
17542
17558
|
if (config.isInteractive() && settings.merged.general.devtools) {
|
|
17543
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
17559
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-REQSIEPU.js");
|
|
17544
17560
|
setupInitialActivityLogger(config);
|
|
17545
17561
|
}
|
|
17546
17562
|
registerTelemetryConfig(config);
|
|
@@ -17548,7 +17564,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
17548
17564
|
const messageBus = config.getMessageBus();
|
|
17549
17565
|
createPolicyUpdater2(policyEngine, messageBus, config.storage);
|
|
17550
17566
|
registerCleanup(async () => {
|
|
17551
|
-
await config?.getHookSystem()?.fireSessionEndEvent(
|
|
17567
|
+
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
|
17552
17568
|
});
|
|
17553
17569
|
if (!config.getAcpMode()) {
|
|
17554
17570
|
registerCleanup(consolePatcher.cleanup);
|
|
@@ -17599,7 +17615,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
17599
17615
|
const initAppHandle = startupProfiler.start("initialize_app");
|
|
17600
17616
|
const initializationResult = await initializeApp(config, settings);
|
|
17601
17617
|
initAppHandle?.end();
|
|
17602
|
-
import("./liteRtServerManager-
|
|
17618
|
+
import("./liteRtServerManager-4LVWWKUV.js").then(({ LiteRtServerManager }) => {
|
|
17603
17619
|
const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
|
|
17604
17620
|
if (!mergedGemma) return;
|
|
17605
17621
|
const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
|
|
@@ -17609,7 +17625,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
17609
17625
|
autoStartServer: userGemma?.autoStartServer
|
|
17610
17626
|
});
|
|
17611
17627
|
}).catch((e) => debugLogger.warn("LiteRT auto-start import failed:", e));
|
|
17612
|
-
if (settings.merged.security.auth.selectedType ===
|
|
17628
|
+
if (settings.merged.security.auth.selectedType === AuthType.LOGIN_WITH_GOOGLE && config.isBrowserLaunchSuppressed()) {
|
|
17613
17629
|
await getOauthClient(settings.merged.security.auth.selectedType, config);
|
|
17614
17630
|
}
|
|
17615
17631
|
if (config.getAcpMode()) {
|
|
@@ -17625,7 +17641,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
17625
17641
|
...rawStartupWarnings.map((message) => ({
|
|
17626
17642
|
id: `startup-${createHash2("sha256").update(message).digest("hex").substring(0, 16)}`,
|
|
17627
17643
|
message,
|
|
17628
|
-
priority:
|
|
17644
|
+
priority: WarningPriority.High
|
|
17629
17645
|
})),
|
|
17630
17646
|
...await getUserStartupWarnings(settings.merged, void 0, {
|
|
17631
17647
|
isAlternateBuffer: useAlternateBuffer
|
|
@@ -17662,7 +17678,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
17662
17678
|
${input}` : stdinData;
|
|
17663
17679
|
}
|
|
17664
17680
|
}
|
|
17665
|
-
const sessionStartSource = resumedSessionData ?
|
|
17681
|
+
const sessionStartSource = resumedSessionData ? SessionStartSource.Resume : SessionStartSource.Startup;
|
|
17666
17682
|
const hookSystem = config?.getHookSystem();
|
|
17667
17683
|
if (hookSystem) {
|
|
17668
17684
|
const result = await hookSystem.fireSessionStartEvent(sessionStartSource);
|
|
@@ -17719,8 +17735,8 @@ ${input}` : wrappedContext;
|
|
|
17719
17735
|
}
|
|
17720
17736
|
}
|
|
17721
17737
|
function initializeOutputListenersAndFlush(config) {
|
|
17722
|
-
if (coreEvents.listenerCount(
|
|
17723
|
-
coreEvents.on(
|
|
17738
|
+
if (coreEvents.listenerCount(CoreEvent.Output) === 0) {
|
|
17739
|
+
coreEvents.on(CoreEvent.Output, (payload) => {
|
|
17724
17740
|
if (payload.isStderr) {
|
|
17725
17741
|
writeToStderr(payload.chunk, payload.encoding);
|
|
17726
17742
|
} else {
|
|
@@ -17728,8 +17744,8 @@ function initializeOutputListenersAndFlush(config) {
|
|
|
17728
17744
|
}
|
|
17729
17745
|
});
|
|
17730
17746
|
}
|
|
17731
|
-
if (coreEvents.listenerCount(
|
|
17732
|
-
coreEvents.on(
|
|
17747
|
+
if (coreEvents.listenerCount(CoreEvent.ConsoleLog) === 0) {
|
|
17748
|
+
coreEvents.on(CoreEvent.ConsoleLog, (payload) => {
|
|
17733
17749
|
if (payload.type === "error" || payload.type === "warn") {
|
|
17734
17750
|
writeToStderr(payload.content + "\n");
|
|
17735
17751
|
} else {
|
|
@@ -17737,8 +17753,8 @@ function initializeOutputListenersAndFlush(config) {
|
|
|
17737
17753
|
}
|
|
17738
17754
|
});
|
|
17739
17755
|
}
|
|
17740
|
-
if (coreEvents.listenerCount(
|
|
17741
|
-
coreEvents.on(
|
|
17756
|
+
if (coreEvents.listenerCount(CoreEvent.UserFeedback) === 0) {
|
|
17757
|
+
coreEvents.on(CoreEvent.UserFeedback, (payload) => {
|
|
17742
17758
|
writeToStderr(payload.message + "\n");
|
|
17743
17759
|
});
|
|
17744
17760
|
}
|
|
@@ -17746,7 +17762,7 @@ function initializeOutputListenersAndFlush(config) {
|
|
|
17746
17762
|
const forceToStderr = outputFormat === "json";
|
|
17747
17763
|
coreEvents.drainBacklogs(
|
|
17748
17764
|
(event, args) => {
|
|
17749
|
-
if (forceToStderr && event ===
|
|
17765
|
+
if (forceToStderr && event === CoreEvent.Output) {
|
|
17750
17766
|
const payload = args[0];
|
|
17751
17767
|
if (!payload.isStderr) {
|
|
17752
17768
|
return {
|