@google/gemini-cli 0.67.0 → 0.69.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/README.md +18 -24
- package/bundle/{chunk-IDJ4QXBF.js → chunk-2KKDGWF2.js} +1 -1
- package/bundle/{chunk-7LX6MRZ6.js → chunk-2ONJU4V7.js} +1 -1
- package/bundle/chunk-3HEOCQDN.js +65 -0
- package/bundle/{chunk-VO6PFWLY.js → chunk-4SOPZCNA.js} +29 -15
- package/bundle/{chunk-56IGTM4O.js → chunk-6KCLIS6W.js} +1 -1
- package/bundle/{chunk-2E3ETS5J.js → chunk-BRHBBQC5.js} +2 -2
- package/bundle/{chunk-M73CYIV5.js → chunk-C5BED6L6.js} +2 -2
- package/bundle/{chunk-VK766A3F.js → chunk-CGQSFR2I.js} +7 -2
- package/bundle/{chunk-OJ62HCXG.js → chunk-CWHEOJXF.js} +7 -2
- package/bundle/{chunk-LAR4JEC7.js → chunk-DWMZSQYG.js} +6050 -2877
- package/bundle/{chunk-QTXJG3I3.js → chunk-GDCMMKZ2.js} +1 -1
- package/bundle/{chunk-YUO7RUF4.js → chunk-GQ7FZNO2.js} +1 -1
- package/bundle/{chunk-GBUWHRK6.js → chunk-JJWPYMIO.js} +3 -3
- package/bundle/{chunk-NGQU3QTQ.js → chunk-KUXCUQKX.js} +5859 -2837
- package/bundle/{chunk-P62CI7AR.js → chunk-LYKP3S67.js} +29 -15
- package/bundle/{chunk-O7MGOE2I.js → chunk-MP4TVGOP.js} +6050 -2877
- package/bundle/{chunk-IGE3G3WZ.js → chunk-PH5XENTH.js} +1 -1
- package/bundle/{chunk-CJFBYU4J.js → chunk-RBDD6IBU.js} +937 -327
- package/bundle/{chunk-5RNHNFYV.js → chunk-SYOIMUZI.js} +937 -327
- package/bundle/{chunk-BW65QRZA.js → chunk-U3FFDEKY.js} +29 -15
- package/bundle/{chunk-MQNW2IRI.js → chunk-U5FJ6OGB.js} +2 -2
- package/bundle/{chunk-PUNFASKY.js → chunk-UAHZWXSG.js} +7 -2
- package/bundle/chunk-UW3ZS3BH.js +65 -0
- package/bundle/{chunk-4JH2G4F4.js → chunk-V7L3FMBE.js} +3 -3
- package/bundle/chunk-VQTELFV3.js +65 -0
- package/bundle/{chunk-QA5FT4VY.js → chunk-YODS6HR2.js} +3 -3
- package/bundle/{chunk-XETHQLRU.js → chunk-YP5TA33N.js} +937 -327
- package/bundle/{cleanup-B6AOSVD4.js → cleanup-3T2KXSP4.js} +2 -2
- package/bundle/{cleanup-BRFB47DL.js → cleanup-NNQCI4KC.js} +2 -2
- package/bundle/{cleanup-S5QFYCEP.js → cleanup-TA4VYDXQ.js} +2 -2
- package/bundle/{core-N27LU4DK.js → core-6XF5EO7Z.js} +37 -1
- package/bundle/{dist-E6RCLXQU.js → core-TUJHM7E7.js} +37 -1
- package/bundle/{devtoolsService-6V46WMXX.js → devtoolsService-7EMPANTX.js} +2 -2
- package/bundle/{devtoolsService-E74ZMDMM.js → devtoolsService-I7WFRUEA.js} +2 -2
- package/bundle/{devtoolsService-EFJXZRFD.js → devtoolsService-RCBUZGYD.js} +2 -2
- package/bundle/{core-GTUUQBGE.js → dist-OSQFIX7F.js} +37 -1
- package/bundle/docs/changelogs/index.md +42 -0
- package/bundle/docs/changelogs/latest.md +89 -91
- package/bundle/docs/changelogs/preview.md +106 -90
- package/bundle/docs/cli/sandbox.md +8 -2
- package/bundle/docs/cli/themes.md +56 -8
- package/bundle/docs/cli/trusted-folders.md +13 -0
- package/bundle/docs/extensions/releasing.md +32 -0
- package/bundle/docs/reference/commands.md +4 -0
- package/bundle/docs/reference/configuration.md +10 -10
- package/bundle/docs/reference/policy-engine.md +6 -0
- package/bundle/formatError-KEQ3HU3Y.js +14 -0
- package/bundle/formatError-LJFIC7G3.js +14 -0
- package/bundle/formatError-MIUNQEYE.js +14 -0
- package/bundle/{gemini-QWDTSJTS.js → gemini-22ON2CZG.js} +601 -142
- package/bundle/{gemini-4JPKPLQN.js → gemini-HLS52ZNZ.js} +601 -142
- package/bundle/{gemini-VF5FS3OM.js → gemini-ZZZEFPSK.js} +601 -142
- package/bundle/gemini.js +14 -13
- package/bundle/{interactiveCli-QJZZISQQ.js → interactiveCli-5HMWVTK2.js} +2967 -2329
- package/bundle/{interactiveCli-FQ3YKGOG.js → interactiveCli-HQBE3C3C.js} +2967 -2329
- package/bundle/{interactiveCli-F2YYMYTP.js → interactiveCli-NKFQZXB5.js} +2967 -2329
- package/bundle/{liteRtServerManager-JAV3GR4V.js → liteRtServerManager-2IOXWO76.js} +4 -4
- package/bundle/{liteRtServerManager-X5CCMKM6.js → liteRtServerManager-AG4Y5JMZ.js} +4 -4
- package/bundle/{liteRtServerManager-27R2M6XE.js → liteRtServerManager-OFNVXXQ4.js} +4 -4
- package/bundle/{oauth2-provider-6UCP23AQ.js → oauth2-provider-2DHNJ2S3.js} +1 -1
- package/bundle/{oauth2-provider-H2KV36NU.js → oauth2-provider-OEGXLWIL.js} +1 -1
- package/bundle/{oauth2-provider-C65IJMNQ.js → oauth2-provider-YDNSNN32.js} +1 -1
- package/bundle/policies/yolo.toml +1 -0
- package/bundle/sandbox-macos-permissive-open.sb +8 -0
- package/bundle/sandbox-macos-permissive-proxied.sb +8 -0
- package/bundle/sandbox-macos-restrictive-open.sb +1 -0
- package/bundle/sandbox-macos-restrictive-proxied.sb +1 -0
- package/bundle/sandbox-macos-strict-open.sb +1 -0
- package/bundle/sandbox-macos-strict-proxied.sb +1 -0
- package/bundle/{start-GNOA75NQ.js → start-7GJH3MKY.js} +6 -6
- package/bundle/{start-K2AYYNST.js → start-JSVKPUTV.js} +6 -6
- package/bundle/{start-E4ZL44QM.js → start-N33LF5WK.js} +6 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
require_react
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GQ7FZNO2.js";
|
|
5
5
|
import {
|
|
6
6
|
AuthProviderType,
|
|
7
7
|
AuthType,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
partListUnionToString,
|
|
38
38
|
require_strip_json_comments,
|
|
39
39
|
sanitizeFilenamePart
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KUXCUQKX.js";
|
|
41
41
|
import {
|
|
42
42
|
__commonJS,
|
|
43
43
|
__export,
|
|
@@ -31299,14 +31299,11 @@ function sanitizeForDisplay(str, maxLength) {
|
|
|
31299
31299
|
return "";
|
|
31300
31300
|
}
|
|
31301
31301
|
let sanitized = stripUnsafeCharacters(str).replace(/\s+/g, " ");
|
|
31302
|
-
if (maxLength && sanitized
|
|
31303
|
-
sanitized = sanitized.
|
|
31302
|
+
if (maxLength && cpLen(sanitized) > maxLength) {
|
|
31303
|
+
sanitized = cpSlice(sanitized, 0, Math.max(0, maxLength - 3)) + "...";
|
|
31304
31304
|
}
|
|
31305
31305
|
return sanitized;
|
|
31306
31306
|
}
|
|
31307
|
-
function normalizeEscapedNewlines(value) {
|
|
31308
|
-
return value.replace(/\\r\\n/g, "\n").replace(/\\n/g, "\n");
|
|
31309
|
-
}
|
|
31310
31307
|
var stringWidthCache = new import_lru_cache.default(
|
|
31311
31308
|
LRU_BUFFER_PERF_CACHE_LIMIT
|
|
31312
31309
|
);
|
|
@@ -33440,6 +33437,7 @@ var Theme = class _Theme {
|
|
|
33440
33437
|
}
|
|
33441
33438
|
};
|
|
33442
33439
|
function createCustomTheme(customTheme) {
|
|
33440
|
+
const focusColor = customTheme.ui?.focus ?? customTheme.status?.success ?? customTheme.AccentGreen ?? "#3CA84B";
|
|
33443
33441
|
const colors = {
|
|
33444
33442
|
type: "custom",
|
|
33445
33443
|
Background: customTheme.background?.primary ?? customTheme.Background ?? "",
|
|
@@ -33472,11 +33470,10 @@ function createCustomTheme(customTheme) {
|
|
|
33472
33470
|
),
|
|
33473
33471
|
FocusBackground: interpolateColor(
|
|
33474
33472
|
customTheme.background?.primary ?? customTheme.Background ?? "",
|
|
33475
|
-
|
|
33476
|
-
// Fallback to a default green if not found
|
|
33473
|
+
focusColor,
|
|
33477
33474
|
DEFAULT_SELECTION_OPACITY
|
|
33478
33475
|
),
|
|
33479
|
-
FocusColor:
|
|
33476
|
+
FocusColor: focusColor,
|
|
33480
33477
|
GradientColors: customTheme.ui?.gradient ?? customTheme.GradientColors
|
|
33481
33478
|
};
|
|
33482
33479
|
const rawMappings = {
|
|
@@ -34847,6 +34844,20 @@ var SETTINGS_SCHEMA = {
|
|
|
34847
34844
|
description: "Maximum number of user/model/tool turns to keep in a session. -1 means unlimited.",
|
|
34848
34845
|
showInDialog: true
|
|
34849
34846
|
},
|
|
34847
|
+
requestTimeoutMs: {
|
|
34848
|
+
type: "number",
|
|
34849
|
+
label: "Request Timeout (ms)",
|
|
34850
|
+
category: "Model",
|
|
34851
|
+
requiresRestart: true,
|
|
34852
|
+
default: void 0,
|
|
34853
|
+
minimum: 1,
|
|
34854
|
+
description: oneLine`
|
|
34855
|
+
How long to wait, in milliseconds, for the API to start responding
|
|
34856
|
+
before a request is aborted and retried. Defaults to 60000. Raise this
|
|
34857
|
+
if long-thinking requests are timing out.
|
|
34858
|
+
`,
|
|
34859
|
+
showInDialog: false
|
|
34860
|
+
},
|
|
34850
34861
|
summarizeToolOutput: {
|
|
34851
34862
|
type: "object",
|
|
34852
34863
|
label: "Summarize Tool Output",
|
|
@@ -37009,6 +37020,8 @@ var SETTINGS_SCHEMA_DEFINITIONS = {
|
|
|
37009
37020
|
properties: {
|
|
37010
37021
|
comment: { type: "string" },
|
|
37011
37022
|
symbol: { type: "string" },
|
|
37023
|
+
active: { type: "string" },
|
|
37024
|
+
focus: { type: "string" },
|
|
37012
37025
|
gradient: {
|
|
37013
37026
|
type: "array",
|
|
37014
37027
|
items: { type: "string" }
|
|
@@ -37595,18 +37608,20 @@ function buildObjectShapeFromProperties(properties) {
|
|
|
37595
37608
|
}
|
|
37596
37609
|
return shape;
|
|
37597
37610
|
}
|
|
37598
|
-
function buildPrimitiveSchema(type) {
|
|
37611
|
+
function buildPrimitiveSchema(type, minimum) {
|
|
37599
37612
|
switch (type) {
|
|
37600
37613
|
case "string":
|
|
37601
37614
|
return external_exports.string();
|
|
37602
|
-
case "number":
|
|
37615
|
+
case "number": {
|
|
37616
|
+
const numberSchema = minimum !== void 0 ? external_exports.number().min(minimum) : external_exports.number();
|
|
37603
37617
|
return external_exports.preprocess((val) => {
|
|
37604
37618
|
if (typeof val === "string" && val.trim() !== "") {
|
|
37605
37619
|
const num = Number(val);
|
|
37606
37620
|
if (!isNaN(num)) return num;
|
|
37607
37621
|
}
|
|
37608
37622
|
return val;
|
|
37609
|
-
},
|
|
37623
|
+
}, numberSchema);
|
|
37624
|
+
}
|
|
37610
37625
|
case "boolean":
|
|
37611
37626
|
return external_exports.preprocess((val) => {
|
|
37612
37627
|
if (typeof val === "string") {
|
|
@@ -37639,7 +37654,7 @@ function buildZodSchemaFromDefinition(definition) {
|
|
|
37639
37654
|
case "string":
|
|
37640
37655
|
case "number":
|
|
37641
37656
|
case "boolean":
|
|
37642
|
-
baseSchema = buildPrimitiveSchema(definition.type);
|
|
37657
|
+
baseSchema = buildPrimitiveSchema(definition.type, definition.minimum);
|
|
37643
37658
|
break;
|
|
37644
37659
|
case "enum": {
|
|
37645
37660
|
baseSchema = buildEnumSchema(definition.options);
|
|
@@ -39174,7 +39189,6 @@ export {
|
|
|
39174
39189
|
cpSlice,
|
|
39175
39190
|
stripUnsafeCharacters,
|
|
39176
39191
|
sanitizeForDisplay,
|
|
39177
|
-
normalizeEscapedNewlines,
|
|
39178
39192
|
setAmbiguousCharactersWide,
|
|
39179
39193
|
getCachedStringWidth,
|
|
39180
39194
|
escapeAnsiCtrlCodes,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CWHEOJXF.js";
|
|
5
5
|
import {
|
|
6
6
|
RELEASE_CHANNEL_STABILITY,
|
|
7
7
|
debugLogger,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
require_re,
|
|
18
18
|
require_semver,
|
|
19
19
|
require_valid
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DWMZSQYG.js";
|
|
21
21
|
import {
|
|
22
22
|
__commonJS,
|
|
23
23
|
__toESM
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
ExitCodes,
|
|
4
|
+
ShellExecutionService,
|
|
4
5
|
Storage,
|
|
5
6
|
isTelemetrySdkInitialized,
|
|
6
7
|
resetBrowserSession,
|
|
7
8
|
shutdownTelemetry
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MP4TVGOP.js";
|
|
9
10
|
|
|
10
11
|
// packages/cli/src/utils/cleanup.ts
|
|
11
12
|
import { promises as fs } from "node:fs";
|
|
@@ -87,6 +88,10 @@ async function runExitCleanup() {
|
|
|
87
88
|
await resetBrowserSession();
|
|
88
89
|
} catch {
|
|
89
90
|
}
|
|
91
|
+
try {
|
|
92
|
+
await ShellExecutionService.cleanupAllActiveProcesses();
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
90
95
|
if (configForTelemetry) {
|
|
91
96
|
try {
|
|
92
97
|
await configForTelemetry.dispose();
|
|
@@ -118,7 +123,7 @@ async function gracefulShutdown(reason) {
|
|
|
118
123
|
}
|
|
119
124
|
isShuttingDown = true;
|
|
120
125
|
await runExitCleanup();
|
|
121
|
-
const exitCode = reason === "SIGINT" ? 130 : reason === "SIGTERM" ? 143 : ExitCodes.SUCCESS;
|
|
126
|
+
const exitCode = reason === "SIGINT" ? 130 : reason === "SIGTERM" ? 143 : reason === "SIGHUP" ? 129 : ExitCodes.SUCCESS;
|
|
122
127
|
process.exit(exitCode);
|
|
123
128
|
}
|
|
124
129
|
function setupSignalHandlers() {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
normalizeError,
|
|
4
|
+
safeSerializeErrorValue
|
|
5
|
+
} from "./chunk-DWMZSQYG.js";
|
|
6
|
+
|
|
7
|
+
// packages/cli/src/utils/formatError.ts
|
|
8
|
+
function isCliDebugEnabled(argv = process.argv.slice(2), env = process.env) {
|
|
9
|
+
if ([env["DEBUG"], env["DEBUG_MODE"]].some((v) => v === "true" || v === "1")) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
for (const arg of argv) {
|
|
13
|
+
if (arg === "--") {
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
if (arg === "--debug" || arg === "-d" || arg === "--debug=true" || arg === "--debug=1") {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
function formatStatusSuffix(message, status) {
|
|
23
|
+
const statusText = typeof status === "string" ? status.trim() : status !== void 0 ? String(status) : "";
|
|
24
|
+
if (!statusText) {
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
27
|
+
if (message.toLowerCase().includes(statusText.toLowerCase())) {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
return ` (Status: ${statusText})`;
|
|
31
|
+
}
|
|
32
|
+
function formatCliError(error, options = {}) {
|
|
33
|
+
const normalized = normalizeError(error);
|
|
34
|
+
const prefix = options.prefix ?? "Error: ";
|
|
35
|
+
const statusSuffix = formatStatusSuffix(
|
|
36
|
+
normalized.message,
|
|
37
|
+
normalized.status
|
|
38
|
+
);
|
|
39
|
+
if (options.debug) {
|
|
40
|
+
if (error instanceof Error && error.stack) {
|
|
41
|
+
const stackStartsWithError = error.stack.startsWith("Error: ") || error.name.endsWith("Error") && error.stack.startsWith(`${error.name}: `);
|
|
42
|
+
const stackPrefix = prefix === "Error: " && stackStartsWithError ? "" : prefix;
|
|
43
|
+
let debugOutput = error.stack.includes(normalized.message) && !statusSuffix ? `${stackPrefix}${error.stack}` : `${prefix}${normalized.message}${statusSuffix}
|
|
44
|
+
${error.stack}`;
|
|
45
|
+
if (normalized.details !== void 0) {
|
|
46
|
+
debugOutput += `
|
|
47
|
+
Debug Details: ${safeSerializeErrorValue(normalized.details, 2)}`;
|
|
48
|
+
}
|
|
49
|
+
return debugOutput;
|
|
50
|
+
}
|
|
51
|
+
return `${prefix}${normalized.message}${statusSuffix}
|
|
52
|
+
Debug Context: ${safeSerializeErrorValue(normalized.originalError, 2)}`;
|
|
53
|
+
}
|
|
54
|
+
return `${prefix}${normalized.message}${statusSuffix}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
isCliDebugEnabled,
|
|
59
|
+
formatCliError
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2026 Google LLC
|
|
64
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
65
|
+
*/
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PH5XENTH.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_PORT,
|
|
8
8
|
SERVER_START_WAIT_MS,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
isServerRunning,
|
|
15
15
|
resolveGemmaConfig,
|
|
16
16
|
writeServerProcessInfo
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4SOPZCNA.js";
|
|
18
18
|
import {
|
|
19
19
|
debugLogger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MP4TVGOP.js";
|
|
21
21
|
import {
|
|
22
22
|
__toESM
|
|
23
23
|
} from "./chunk-34MYV7JD.js";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
normalizeError,
|
|
4
|
+
safeSerializeErrorValue
|
|
5
|
+
} from "./chunk-KUXCUQKX.js";
|
|
6
|
+
|
|
7
|
+
// packages/cli/src/utils/formatError.ts
|
|
8
|
+
function isCliDebugEnabled(argv = process.argv.slice(2), env = process.env) {
|
|
9
|
+
if ([env["DEBUG"], env["DEBUG_MODE"]].some((v) => v === "true" || v === "1")) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
for (const arg of argv) {
|
|
13
|
+
if (arg === "--") {
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
if (arg === "--debug" || arg === "-d" || arg === "--debug=true" || arg === "--debug=1") {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
function formatStatusSuffix(message, status) {
|
|
23
|
+
const statusText = typeof status === "string" ? status.trim() : status !== void 0 ? String(status) : "";
|
|
24
|
+
if (!statusText) {
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
27
|
+
if (message.toLowerCase().includes(statusText.toLowerCase())) {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
return ` (Status: ${statusText})`;
|
|
31
|
+
}
|
|
32
|
+
function formatCliError(error, options = {}) {
|
|
33
|
+
const normalized = normalizeError(error);
|
|
34
|
+
const prefix = options.prefix ?? "Error: ";
|
|
35
|
+
const statusSuffix = formatStatusSuffix(
|
|
36
|
+
normalized.message,
|
|
37
|
+
normalized.status
|
|
38
|
+
);
|
|
39
|
+
if (options.debug) {
|
|
40
|
+
if (error instanceof Error && error.stack) {
|
|
41
|
+
const stackStartsWithError = error.stack.startsWith("Error: ") || error.name.endsWith("Error") && error.stack.startsWith(`${error.name}: `);
|
|
42
|
+
const stackPrefix = prefix === "Error: " && stackStartsWithError ? "" : prefix;
|
|
43
|
+
let debugOutput = error.stack.includes(normalized.message) && !statusSuffix ? `${stackPrefix}${error.stack}` : `${prefix}${normalized.message}${statusSuffix}
|
|
44
|
+
${error.stack}`;
|
|
45
|
+
if (normalized.details !== void 0) {
|
|
46
|
+
debugOutput += `
|
|
47
|
+
Debug Details: ${safeSerializeErrorValue(normalized.details, 2)}`;
|
|
48
|
+
}
|
|
49
|
+
return debugOutput;
|
|
50
|
+
}
|
|
51
|
+
return `${prefix}${normalized.message}${statusSuffix}
|
|
52
|
+
Debug Context: ${safeSerializeErrorValue(normalized.originalError, 2)}`;
|
|
53
|
+
}
|
|
54
|
+
return `${prefix}${normalized.message}${statusSuffix}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
isCliDebugEnabled,
|
|
59
|
+
formatCliError
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2026 Google LLC
|
|
64
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
65
|
+
*/
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2ONJU4V7.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_PORT,
|
|
8
8
|
SERVER_START_WAIT_MS,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
isServerRunning,
|
|
15
15
|
resolveGemmaConfig,
|
|
16
16
|
writeServerProcessInfo
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-U3FFDEKY.js";
|
|
18
18
|
import {
|
|
19
19
|
debugLogger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KUXCUQKX.js";
|
|
21
21
|
import {
|
|
22
22
|
__toESM
|
|
23
23
|
} from "./chunk-34MYV7JD.js";
|