@google/gemini-cli 0.67.0-nightly.20261104.g89e9d25d6 → 0.67.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 +24 -18
- package/bundle/{chunk-TAYMSEDM.js → chunk-2E3ETS5J.js} +2 -2
- package/bundle/{chunk-2VRD7O3N.js → chunk-4JH2G4F4.js} +3 -3
- package/bundle/{chunk-AT7K3IZG.js → chunk-56IGTM4O.js} +1 -1
- package/bundle/{chunk-B2FKXXUH.js → chunk-5RNHNFYV.js} +106 -327
- package/bundle/{chunk-R7UEKGMB.js → chunk-7LX6MRZ6.js} +1 -1
- package/bundle/{chunk-HU3K5KGK.js → chunk-BW65QRZA.js} +11 -9
- package/bundle/{chunk-5WHCLVFH.js → chunk-CJFBYU4J.js} +157 -391
- package/bundle/{chunk-NMKJ47HQ.js → chunk-GBUWHRK6.js} +3 -3
- package/bundle/{chunk-VBHMFLBY.js → chunk-IDJ4QXBF.js} +1 -1
- package/bundle/{chunk-JMHCFAD6.js → chunk-IGE3G3WZ.js} +1 -1
- package/bundle/{chunk-RCF66HCI.js → chunk-LAR4JEC7.js} +1008 -1627
- package/bundle/{chunk-CXMHAFLN.js → chunk-M73CYIV5.js} +2 -2
- package/bundle/{chunk-TB5I5645.js → chunk-MQNW2IRI.js} +2 -2
- package/bundle/{chunk-DKKEYKSG.js → chunk-NGQU3QTQ.js} +996 -1558
- package/bundle/{chunk-VLYI5NP4.js → chunk-O7MGOE2I.js} +16023 -9466
- package/bundle/{chunk-RD2EMHV2.js → chunk-OJ62HCXG.js} +1 -1
- package/bundle/{chunk-HRM7UWGB.js → chunk-P62CI7AR.js} +11 -9
- package/bundle/{chunk-H3WGFU7D.js → chunk-PUNFASKY.js} +1 -1
- package/bundle/{chunk-L77QEOSK.js → chunk-QA5FT4VY.js} +3 -3
- package/bundle/{chunk-WY3X2UP2.js → chunk-QTXJG3I3.js} +8 -9
- package/bundle/{chunk-XBEZPOEF.js → chunk-VK766A3F.js} +1 -1
- package/bundle/{chunk-3DAQUNXR.js → chunk-VO6PFWLY.js} +15 -15
- package/bundle/{chunk-ILNZCTNC.js → chunk-XETHQLRU.js} +106 -327
- package/bundle/{chunk-7SSKD5HN.js → chunk-YUO7RUF4.js} +1 -1
- package/bundle/{cleanup-3ALSKRBJ.js → cleanup-B6AOSVD4.js} +2 -2
- package/bundle/{cleanup-6DVNSRQY.js → cleanup-BRFB47DL.js} +2 -2
- package/bundle/{cleanup-HRNPECKR.js → cleanup-S5QFYCEP.js} +2 -2
- package/bundle/{core-NQRKBS47.js → core-GTUUQBGE.js} +1 -3
- package/bundle/{dist-QYTQZ6QW.js → core-N27LU4DK.js} +1 -3
- package/bundle/{devtoolsService-EWNQDTC7.js → devtoolsService-6V46WMXX.js} +2 -2
- package/bundle/{devtoolsService-64TPRUWQ.js → devtoolsService-E74ZMDMM.js} +2 -2
- package/bundle/{devtoolsService-E6I4WSAL.js → devtoolsService-EFJXZRFD.js} +3 -4
- package/bundle/{dist-L5NYU7FF.js → dist-E6RCLXQU.js} +1 -3
- package/bundle/docs/changelogs/index.md +0 -24
- package/bundle/docs/changelogs/latest.md +90 -83
- package/bundle/docs/changelogs/preview.md +87 -89
- package/bundle/docs/cli/sandbox.md +2 -8
- package/bundle/docs/cli/themes.md +3 -6
- package/bundle/docs/extensions/releasing.md +0 -32
- package/bundle/docs/reference/configuration.md +10 -2
- package/bundle/{gemini-YFCTZ76S.js → gemini-4JPKPLQN.js} +24 -122
- package/bundle/{gemini-QAVNR7N4.js → gemini-QWDTSJTS.js} +209 -323
- package/bundle/{gemini-7USJ6MGR.js → gemini-VF5FS3OM.js} +24 -122
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-X54KN2EM.js → interactiveCli-F2YYMYTP.js} +1145 -1350
- package/bundle/{interactiveCli-XN43CGES.js → interactiveCli-FQ3YKGOG.js} +1428 -1652
- package/bundle/{interactiveCli-3VTQP4GH.js → interactiveCli-QJZZISQQ.js} +1145 -1350
- package/bundle/{liteRtServerManager-E4PDEWY3.js → liteRtServerManager-27R2M6XE.js} +4 -4
- package/bundle/{liteRtServerManager-ENSSU4TN.js → liteRtServerManager-JAV3GR4V.js} +4 -4
- package/bundle/{liteRtServerManager-FLPMMDNM.js → liteRtServerManager-X5CCMKM6.js} +4 -4
- package/bundle/{oauth2-provider-3MJNDLJF.js → oauth2-provider-6UCP23AQ.js} +1 -1
- package/bundle/{oauth2-provider-VMBYZOC7.js → oauth2-provider-C65IJMNQ.js} +1 -1
- package/bundle/{oauth2-provider-ZIZQIT7D.js → oauth2-provider-H2KV36NU.js} +79 -41
- package/bundle/{start-B63MUWDV.js → start-E4ZL44QM.js} +6 -6
- package/bundle/{start-DFHM4HI4.js → start-GNOA75NQ.js} +6 -6
- package/bundle/{start-OHBUJSIL.js → start-K2AYYNST.js} +6 -6
- package/package.json +1 -1
- package/bundle/chunk-674DJGDU.js +0 -512
- package/bundle/chunk-M4REEHDQ.js +0 -185
- package/bundle/chunk-NOMIJA6W.js +0 -1956
- package/bundle/chunk-ORXIIXSA.js +0 -80453
- package/bundle/chunk-Q3OUSMTD.js +0 -39405
- package/bundle/chunk-Q76ZDILI.js +0 -118
- package/bundle/chunk-T6YNV33L.js +0 -1571
- package/bundle/chunk-YTSRA7S6.js +0 -403181
- package/bundle/cleanup-OQV2G5Y3.js +0 -34
- package/bundle/devtoolsService-PG47POWV.js +0 -4422
- package/bundle/dist-LJVRZOCO.js +0 -2298
- package/bundle/gemini-QVVNPYKF.js +0 -19271
- package/bundle/interactiveCli-ELN2VGHK.js +0 -35871
- package/bundle/liteRtServerManager-TYCQMNCE.js +0 -65
- package/bundle/oauth2-provider-NLSE3P5W.js +0 -273
- package/bundle/start-V3EP7MBL.js +0 -18
|
@@ -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-7LX6MRZ6.js";
|
|
6
6
|
import {
|
|
7
7
|
AppEvent,
|
|
8
8
|
appEvents
|
|
@@ -69,16 +69,16 @@ import {
|
|
|
69
69
|
use_stdin_default,
|
|
70
70
|
use_stdout_default,
|
|
71
71
|
validateCustomTheme
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-VO6PFWLY.js";
|
|
73
73
|
import {
|
|
74
74
|
isDevelopment,
|
|
75
75
|
require_semver
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-MQNW2IRI.js";
|
|
77
77
|
import {
|
|
78
78
|
emptyIcon,
|
|
79
79
|
mapCoreStatusToDisplayStatus,
|
|
80
80
|
require_react
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-IDJ4QXBF.js";
|
|
82
82
|
import {
|
|
83
83
|
ALL_EDITORS,
|
|
84
84
|
ApprovalMode,
|
|
@@ -219,7 +219,6 @@ import {
|
|
|
219
219
|
require_cross_spawn,
|
|
220
220
|
require_is_stream,
|
|
221
221
|
require_path_key,
|
|
222
|
-
require_proper_lockfile,
|
|
223
222
|
require_pump,
|
|
224
223
|
require_toml,
|
|
225
224
|
resetBrowserSession,
|
|
@@ -240,7 +239,7 @@ import {
|
|
|
240
239
|
uiTelemetryService,
|
|
241
240
|
unescapePath,
|
|
242
241
|
validateUrlDestination
|
|
243
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-O7MGOE2I.js";
|
|
244
243
|
import {
|
|
245
244
|
require_src
|
|
246
245
|
} from "./chunk-L6PII3GR.js";
|
|
@@ -6501,7 +6500,7 @@ var require_extract_zip = __commonJS({
|
|
|
6501
6500
|
var stream = __require("stream");
|
|
6502
6501
|
var yauzl = require_yauzl();
|
|
6503
6502
|
var openZip = promisify5(yauzl.open);
|
|
6504
|
-
var
|
|
6503
|
+
var pipeline2 = promisify5(stream.pipeline);
|
|
6505
6504
|
var Extractor = class {
|
|
6506
6505
|
constructor(zipPath, opts) {
|
|
6507
6506
|
this.zipPath = zipPath;
|
|
@@ -6589,7 +6588,7 @@ var require_extract_zip = __commonJS({
|
|
|
6589
6588
|
debug("creating symlink", link, dest);
|
|
6590
6589
|
await fs33.symlink(link, dest);
|
|
6591
6590
|
} else {
|
|
6592
|
-
await
|
|
6591
|
+
await pipeline2(readStream, createWriteStream5(dest, { mode: procMode }));
|
|
6593
6592
|
}
|
|
6594
6593
|
}
|
|
6595
6594
|
getExtractedMode(entryMode, isDir) {
|
|
@@ -15325,11 +15324,11 @@ var require_util4 = __commonJS({
|
|
|
15325
15324
|
var { isUint8Array } = __require("node:util/types");
|
|
15326
15325
|
var { webidl } = require_webidl();
|
|
15327
15326
|
var supportedHashes = [];
|
|
15328
|
-
var
|
|
15327
|
+
var crypto3;
|
|
15329
15328
|
try {
|
|
15330
|
-
|
|
15329
|
+
crypto3 = __require("node:crypto");
|
|
15331
15330
|
const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
|
|
15332
|
-
supportedHashes =
|
|
15331
|
+
supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
|
|
15333
15332
|
} catch {
|
|
15334
15333
|
}
|
|
15335
15334
|
function responseURL(response) {
|
|
@@ -15632,7 +15631,7 @@ var require_util4 = __commonJS({
|
|
|
15632
15631
|
return isOriginPotentiallyTrustworthy(url.origin);
|
|
15633
15632
|
}
|
|
15634
15633
|
function bytesMatch(bytes, metadataList) {
|
|
15635
|
-
if (
|
|
15634
|
+
if (crypto3 === void 0) {
|
|
15636
15635
|
return true;
|
|
15637
15636
|
}
|
|
15638
15637
|
const parsedMetadata = parseMetadata(metadataList);
|
|
@@ -15647,7 +15646,7 @@ var require_util4 = __commonJS({
|
|
|
15647
15646
|
for (const item of metadata) {
|
|
15648
15647
|
const algorithm = item.algo;
|
|
15649
15648
|
const expectedValue = item.hash;
|
|
15650
|
-
let actualValue =
|
|
15649
|
+
let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64");
|
|
15651
15650
|
if (actualValue[actualValue.length - 1] === "=") {
|
|
15652
15651
|
if (actualValue[actualValue.length - 2] === "=") {
|
|
15653
15652
|
actualValue = actualValue.slice(0, -2);
|
|
@@ -16665,8 +16664,8 @@ var require_body = __commonJS({
|
|
|
16665
16664
|
var { multipartFormDataParser } = require_formdata_parser();
|
|
16666
16665
|
var random;
|
|
16667
16666
|
try {
|
|
16668
|
-
const
|
|
16669
|
-
random = (max) =>
|
|
16667
|
+
const crypto3 = __require("node:crypto");
|
|
16668
|
+
random = (max) => crypto3.randomInt(0, max);
|
|
16670
16669
|
} catch {
|
|
16671
16670
|
random = (max) => Math.floor(Math.random() * max);
|
|
16672
16671
|
}
|
|
@@ -18117,7 +18116,7 @@ var require_client_h2 = __commonJS({
|
|
|
18117
18116
|
"packages/cli/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module) {
|
|
18118
18117
|
"use strict";
|
|
18119
18118
|
var assert = __require("node:assert");
|
|
18120
|
-
var { pipeline:
|
|
18119
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
18121
18120
|
var util2 = require_util3();
|
|
18122
18121
|
var {
|
|
18123
18122
|
RequestContentLengthMismatchError,
|
|
@@ -18612,7 +18611,7 @@ var require_client_h2 = __commonJS({
|
|
|
18612
18611
|
}
|
|
18613
18612
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
|
|
18614
18613
|
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
18615
|
-
const pipe =
|
|
18614
|
+
const pipe = pipeline2(
|
|
18616
18615
|
body,
|
|
18617
18616
|
h2stream,
|
|
18618
18617
|
(err) => {
|
|
@@ -21506,7 +21505,7 @@ var require_api_pipeline = __commonJS({
|
|
|
21506
21505
|
util2.destroy(ret, err);
|
|
21507
21506
|
}
|
|
21508
21507
|
};
|
|
21509
|
-
function
|
|
21508
|
+
function pipeline2(opts, handler2) {
|
|
21510
21509
|
try {
|
|
21511
21510
|
const pipelineHandler = new PipelineHandler(opts, handler2);
|
|
21512
21511
|
this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
|
|
@@ -21515,7 +21514,7 @@ var require_api_pipeline = __commonJS({
|
|
|
21515
21514
|
return new PassThrough().destroy(err);
|
|
21516
21515
|
}
|
|
21517
21516
|
}
|
|
21518
|
-
module.exports =
|
|
21517
|
+
module.exports = pipeline2;
|
|
21519
21518
|
}
|
|
21520
21519
|
});
|
|
21521
21520
|
|
|
@@ -26931,7 +26930,7 @@ var require_fetch = __commonJS({
|
|
|
26931
26930
|
subresourceSet
|
|
26932
26931
|
} = require_constants3();
|
|
26933
26932
|
var EE = __require("node:events");
|
|
26934
|
-
var { Readable, pipeline:
|
|
26933
|
+
var { Readable, pipeline: pipeline2, finished, isErrored, isReadable } = __require("node:stream");
|
|
26935
26934
|
var { addAbortListener, bufferToLowerCasedHeaderName } = require_util3();
|
|
26936
26935
|
var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
|
|
26937
26936
|
var { getGlobalDispatcher } = require_global2();
|
|
@@ -27874,7 +27873,7 @@ var require_fetch = __commonJS({
|
|
|
27874
27873
|
status,
|
|
27875
27874
|
statusText,
|
|
27876
27875
|
headersList,
|
|
27877
|
-
body: decoders.length ?
|
|
27876
|
+
body: decoders.length ? pipeline2(this.body, ...decoders, (err) => {
|
|
27878
27877
|
if (err) {
|
|
27879
27878
|
this.onError(err);
|
|
27880
27879
|
}
|
|
@@ -29583,13 +29582,13 @@ var require_frame = __commonJS({
|
|
|
29583
29582
|
"use strict";
|
|
29584
29583
|
var { maxUnsigned16Bit, opcodes } = require_constants5();
|
|
29585
29584
|
var BUFFER_SIZE = 8 * 1024;
|
|
29586
|
-
var
|
|
29585
|
+
var crypto3;
|
|
29587
29586
|
var buffer = null;
|
|
29588
29587
|
var bufIdx = BUFFER_SIZE;
|
|
29589
29588
|
try {
|
|
29590
|
-
|
|
29589
|
+
crypto3 = __require("node:crypto");
|
|
29591
29590
|
} catch {
|
|
29592
|
-
|
|
29591
|
+
crypto3 = {
|
|
29593
29592
|
// not full compatibility, but minimum.
|
|
29594
29593
|
randomFillSync: function randomFillSync(buffer2, _offset, _size) {
|
|
29595
29594
|
for (let i = 0; i < buffer2.length; ++i) {
|
|
@@ -29602,7 +29601,7 @@ var require_frame = __commonJS({
|
|
|
29602
29601
|
function generateMask() {
|
|
29603
29602
|
if (bufIdx === BUFFER_SIZE) {
|
|
29604
29603
|
bufIdx = 0;
|
|
29605
|
-
|
|
29604
|
+
crypto3.randomFillSync(buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
|
|
29606
29605
|
}
|
|
29607
29606
|
return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
|
|
29608
29607
|
}
|
|
@@ -29700,9 +29699,9 @@ var require_connection = __commonJS({
|
|
|
29700
29699
|
var { getDecodeSplit } = require_util4();
|
|
29701
29700
|
var { WebsocketFrameSend } = require_frame();
|
|
29702
29701
|
var assert = __require("node:assert");
|
|
29703
|
-
var
|
|
29702
|
+
var crypto3;
|
|
29704
29703
|
try {
|
|
29705
|
-
|
|
29704
|
+
crypto3 = __require("node:crypto");
|
|
29706
29705
|
} catch {
|
|
29707
29706
|
}
|
|
29708
29707
|
function establishWebSocketConnection(url, protocols, client, handler2, options) {
|
|
@@ -29722,7 +29721,7 @@ var require_connection = __commonJS({
|
|
|
29722
29721
|
const headersList = getHeadersList(new Headers(options.headers));
|
|
29723
29722
|
request.headersList = headersList;
|
|
29724
29723
|
}
|
|
29725
|
-
const keyValue =
|
|
29724
|
+
const keyValue = crypto3.randomBytes(16).toString("base64");
|
|
29726
29725
|
request.headersList.append("sec-websocket-key", keyValue, true);
|
|
29727
29726
|
request.headersList.append("sec-websocket-version", "13", true);
|
|
29728
29727
|
for (const protocol of protocols) {
|
|
@@ -29755,7 +29754,7 @@ var require_connection = __commonJS({
|
|
|
29755
29754
|
return;
|
|
29756
29755
|
}
|
|
29757
29756
|
const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
|
|
29758
|
-
const digest =
|
|
29757
|
+
const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64");
|
|
29759
29758
|
if (secWSAccept !== digest) {
|
|
29760
29759
|
failWebsocketConnection(handler2, 1002, "Incorrect hash received in Sec-WebSocket-Accept header.");
|
|
29761
29760
|
return;
|
|
@@ -31367,7 +31366,7 @@ ${value}`;
|
|
|
31367
31366
|
var require_eventsource = __commonJS({
|
|
31368
31367
|
"packages/cli/node_modules/undici/lib/web/eventsource/eventsource.js"(exports, module) {
|
|
31369
31368
|
"use strict";
|
|
31370
|
-
var { pipeline:
|
|
31369
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
31371
31370
|
var { fetching } = require_fetch();
|
|
31372
31371
|
var { makeRequest } = require_request2();
|
|
31373
31372
|
var { webidl } = require_webidl();
|
|
@@ -31528,7 +31527,7 @@ var require_eventsource = __commonJS({
|
|
|
31528
31527
|
));
|
|
31529
31528
|
}
|
|
31530
31529
|
});
|
|
31531
|
-
|
|
31530
|
+
pipeline2(
|
|
31532
31531
|
response.body.stream,
|
|
31533
31532
|
eventSourceStream,
|
|
31534
31533
|
(error) => {
|
|
@@ -38662,7 +38661,6 @@ async function getMissingSettings(extensionConfig, extensionId, workspaceDir) {
|
|
|
38662
38661
|
|
|
38663
38662
|
// packages/cli/src/config/extension-manager.ts
|
|
38664
38663
|
var import_chalk2 = __toESM(require_source(), 1);
|
|
38665
|
-
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
38666
38664
|
import * as fs12 from "node:fs";
|
|
38667
38665
|
import * as path9 from "node:path";
|
|
38668
38666
|
import { stat } from "node:fs/promises";
|
|
@@ -38834,7 +38832,7 @@ var ExtensionEnablementManager = class {
|
|
|
38834
38832
|
};
|
|
38835
38833
|
|
|
38836
38834
|
// packages/cli/src/config/extension-manager.ts
|
|
38837
|
-
import { createHash as createHash2, randomUUID
|
|
38835
|
+
import { createHash as createHash2, randomUUID } from "node:crypto";
|
|
38838
38836
|
|
|
38839
38837
|
// packages/cli/src/config/extension.ts
|
|
38840
38838
|
import * as fs8 from "node:fs";
|
|
@@ -38931,12 +38929,10 @@ function extensionUpdatesReducer(state, action) {
|
|
|
38931
38929
|
}
|
|
38932
38930
|
|
|
38933
38931
|
// packages/cli/src/config/extensions/github.ts
|
|
38934
|
-
import * as crypto2 from "node:crypto";
|
|
38935
38932
|
import * as os3 from "node:os";
|
|
38936
38933
|
import * as https2 from "node:https";
|
|
38937
38934
|
import * as fs10 from "node:fs";
|
|
38938
38935
|
import * as path8 from "node:path";
|
|
38939
|
-
import { pipeline } from "node:stream/promises";
|
|
38940
38936
|
|
|
38941
38937
|
// packages/cli/node_modules/tar/dist/esm/index.min.js
|
|
38942
38938
|
import Hr from "events";
|
|
@@ -41851,14 +41847,6 @@ import * as https from "node:https";
|
|
|
41851
41847
|
function getGitHubToken() {
|
|
41852
41848
|
return process.env["GITHUB_TOKEN"] || void 0;
|
|
41853
41849
|
}
|
|
41854
|
-
function isTrustedGitHubUrl(url) {
|
|
41855
|
-
try {
|
|
41856
|
-
const parsedUrl = new URL(url);
|
|
41857
|
-
return parsedUrl.protocol === "https:" && (parsedUrl.hostname === "github.com" || parsedUrl.hostname.endsWith(".github.com"));
|
|
41858
|
-
} catch {
|
|
41859
|
-
return false;
|
|
41860
|
-
}
|
|
41861
|
-
}
|
|
41862
41850
|
var lookupPublicAddress = (hostname, options, callback) => safeLookup(
|
|
41863
41851
|
hostname,
|
|
41864
41852
|
{
|
|
@@ -41868,7 +41856,6 @@ var lookupPublicAddress = (hostname, options, callback) => safeLookup(
|
|
|
41868
41856
|
callback
|
|
41869
41857
|
);
|
|
41870
41858
|
var REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
41871
|
-
var REQUEST_TIMEOUT_MS = 3e4;
|
|
41872
41859
|
async function fetchJson(url, redirectCount = 0) {
|
|
41873
41860
|
if (!await validateUrlDestination(url)) {
|
|
41874
41861
|
throw new Error(`Access to blocked or private host ${url} is not allowed.`);
|
|
@@ -41877,8 +41864,14 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
41877
41864
|
"User-Agent": "gemini-cli"
|
|
41878
41865
|
};
|
|
41879
41866
|
const token = getGitHubToken();
|
|
41880
|
-
if (token
|
|
41881
|
-
|
|
41867
|
+
if (token) {
|
|
41868
|
+
try {
|
|
41869
|
+
const parsedUrl = new URL(url);
|
|
41870
|
+
if (parsedUrl.protocol === "https:" && (parsedUrl.hostname === "github.com" || parsedUrl.hostname.endsWith(".github.com"))) {
|
|
41871
|
+
headers.Authorization = `token ${token}`;
|
|
41872
|
+
}
|
|
41873
|
+
} catch {
|
|
41874
|
+
}
|
|
41882
41875
|
}
|
|
41883
41876
|
return new Promise((resolve9, reject) => {
|
|
41884
41877
|
let settled = false;
|
|
@@ -41903,7 +41896,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
41903
41896
|
const requestOptions = {
|
|
41904
41897
|
headers,
|
|
41905
41898
|
lookup: lookupPublicAddress,
|
|
41906
|
-
timeout:
|
|
41899
|
+
timeout: 3e4
|
|
41907
41900
|
};
|
|
41908
41901
|
const req = https.get(url, requestOptions, (res) => {
|
|
41909
41902
|
res.on(
|
|
@@ -41996,9 +41989,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
41996
41989
|
});
|
|
41997
41990
|
req.on("error", (error) => failUnlessRedirecting(() => error));
|
|
41998
41991
|
req.on("timeout", () => {
|
|
41999
|
-
failUnlessRedirecting(
|
|
42000
|
-
() => new Error(`Request timed out after ${REQUEST_TIMEOUT_MS}ms`)
|
|
42001
|
-
);
|
|
41992
|
+
failUnlessRedirecting(() => new Error("Request timed out after 30000ms"));
|
|
42002
41993
|
req.destroy();
|
|
42003
41994
|
});
|
|
42004
41995
|
});
|
|
@@ -42068,7 +42059,7 @@ function tryParseGithubUrl(source2) {
|
|
|
42068
42059
|
);
|
|
42069
42060
|
}
|
|
42070
42061
|
const owner = parts[0];
|
|
42071
|
-
const repo = parts[1].replace(
|
|
42062
|
+
const repo = parts[1].replace(".git", "");
|
|
42072
42063
|
return {
|
|
42073
42064
|
owner,
|
|
42074
42065
|
repo
|
|
@@ -42349,175 +42340,39 @@ function findReleaseAsset(assets) {
|
|
|
42349
42340
|
return void 0;
|
|
42350
42341
|
}
|
|
42351
42342
|
async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
42352
|
-
let parsedUrl;
|
|
42353
|
-
try {
|
|
42354
|
-
parsedUrl = new URL(url);
|
|
42355
|
-
} catch (error) {
|
|
42356
|
-
throw new Error(`Invalid download URL ${url}: ${getErrorMessage(error)}`, {
|
|
42357
|
-
cause: error
|
|
42358
|
-
});
|
|
42359
|
-
}
|
|
42360
|
-
if (parsedUrl.protocol !== "https:") {
|
|
42361
|
-
throw new Error(
|
|
42362
|
-
`Refusing to download from insecure protocol ${parsedUrl.protocol} for URL ${url}. Only HTTPS is supported.`
|
|
42363
|
-
);
|
|
42364
|
-
}
|
|
42365
|
-
const requestUrl = parsedUrl.toString();
|
|
42366
|
-
if (!await validateUrlDestination(requestUrl)) {
|
|
42367
|
-
throw new Error(
|
|
42368
|
-
`Access to blocked or private host ${requestUrl} is not allowed.`
|
|
42369
|
-
);
|
|
42370
|
-
}
|
|
42371
42343
|
const headers = {
|
|
42372
42344
|
"User-agent": "gemini-cli",
|
|
42373
42345
|
Accept: "application/octet-stream",
|
|
42374
42346
|
...options?.headers
|
|
42375
42347
|
};
|
|
42376
|
-
const trustedGitHubUrl = isTrustedGitHubUrl(requestUrl);
|
|
42377
|
-
if (!trustedGitHubUrl) {
|
|
42378
|
-
for (const key of Object.keys(headers)) {
|
|
42379
|
-
if (key.toLowerCase() === "authorization") {
|
|
42380
|
-
delete headers[key];
|
|
42381
|
-
}
|
|
42382
|
-
}
|
|
42383
|
-
}
|
|
42384
42348
|
const token = getGitHubToken();
|
|
42385
|
-
if (token
|
|
42349
|
+
if (token) {
|
|
42386
42350
|
headers["Authorization"] = `token ${token}`;
|
|
42387
42351
|
}
|
|
42388
|
-
|
|
42389
|
-
|
|
42390
|
-
|
|
42391
|
-
|
|
42392
|
-
|
|
42393
|
-
let isRedirecting = false;
|
|
42394
|
-
let responseStream;
|
|
42395
|
-
const settleResolve = () => {
|
|
42396
|
-
if (!settled) {
|
|
42397
|
-
settled = true;
|
|
42398
|
-
resolve9();
|
|
42399
|
-
}
|
|
42400
|
-
};
|
|
42401
|
-
const settleReject = (error) => {
|
|
42402
|
-
if (!settled) {
|
|
42403
|
-
settled = true;
|
|
42404
|
-
reject(
|
|
42405
|
-
error instanceof Error ? error : new Error(getErrorMessage(error))
|
|
42406
|
-
);
|
|
42407
|
-
}
|
|
42408
|
-
};
|
|
42409
|
-
const requestOptions = {
|
|
42410
|
-
headers,
|
|
42411
|
-
lookup: lookupPublicAddress,
|
|
42412
|
-
timeout: REQUEST_TIMEOUT_MS
|
|
42413
|
-
};
|
|
42414
|
-
const req = https2.get(requestUrl, requestOptions, (res) => {
|
|
42415
|
-
res.on("error", (error) => {
|
|
42416
|
-
if (!isRedirecting) {
|
|
42417
|
-
settleReject(error);
|
|
42418
|
-
}
|
|
42419
|
-
});
|
|
42420
|
-
if (res.statusCode && REDIRECT_STATUS_CODES.has(res.statusCode)) {
|
|
42421
|
-
if (redirectCount >= 10) {
|
|
42422
|
-
res.resume?.();
|
|
42423
|
-
settleReject(new Error("Too many redirects"));
|
|
42424
|
-
return;
|
|
42425
|
-
}
|
|
42426
|
-
if (!res.headers.location) {
|
|
42427
|
-
res.resume?.();
|
|
42428
|
-
settleReject(
|
|
42429
|
-
new Error("Redirect response missing Location header")
|
|
42430
|
-
);
|
|
42431
|
-
return;
|
|
42432
|
-
}
|
|
42433
|
-
let redirectUrl;
|
|
42434
|
-
try {
|
|
42435
|
-
redirectUrl = new URL(res.headers.location, requestUrl).toString();
|
|
42436
|
-
} catch (error) {
|
|
42437
|
-
res.resume?.();
|
|
42438
|
-
settleReject(
|
|
42439
|
-
new Error(
|
|
42440
|
-
`Invalid redirect URL from ${requestUrl} (status ${res.statusCode}): ${getErrorMessage(error)}`,
|
|
42441
|
-
{ cause: error }
|
|
42442
|
-
)
|
|
42443
|
-
);
|
|
42444
|
-
return;
|
|
42445
|
-
}
|
|
42446
|
-
isRedirecting = true;
|
|
42447
|
-
res.resume?.();
|
|
42448
|
-
void downloadFile(redirectUrl, dest, options, redirectCount + 1).then(
|
|
42449
|
-
settleResolve,
|
|
42450
|
-
settleReject
|
|
42451
|
-
);
|
|
42452
|
-
return;
|
|
42453
|
-
}
|
|
42454
|
-
if (res.statusCode !== 200) {
|
|
42455
|
-
res.resume?.();
|
|
42456
|
-
settleReject(
|
|
42457
|
-
new Error(`Request failed with status code ${res.statusCode}`)
|
|
42458
|
-
);
|
|
42459
|
-
return;
|
|
42460
|
-
}
|
|
42461
|
-
responseStream = res;
|
|
42462
|
-
const currentTempDest = `${dest}.${crypto2.randomUUID()}.tmp`;
|
|
42463
|
-
tempDest = currentTempDest;
|
|
42464
|
-
let file;
|
|
42465
|
-
try {
|
|
42466
|
-
file = fs10.createWriteStream(currentTempDest);
|
|
42467
|
-
} catch (error) {
|
|
42468
|
-
res.destroy?.();
|
|
42469
|
-
settleReject(error);
|
|
42470
|
-
return;
|
|
42471
|
-
}
|
|
42472
|
-
file.on("error", settleReject);
|
|
42473
|
-
downloadPipeline = pipeline(res, file);
|
|
42474
|
-
void downloadPipeline.then(() => {
|
|
42475
|
-
if (res.complete === false) {
|
|
42476
|
-
settleReject(
|
|
42477
|
-
new Error(
|
|
42478
|
-
`Response ended prematurely while downloading ${requestUrl}`
|
|
42479
|
-
)
|
|
42480
|
-
);
|
|
42481
|
-
return;
|
|
42482
|
-
}
|
|
42483
|
-
settleResolve();
|
|
42484
|
-
}, settleReject);
|
|
42485
|
-
});
|
|
42486
|
-
req.on("error", (error) => {
|
|
42487
|
-
if (isRedirecting) {
|
|
42488
|
-
return;
|
|
42352
|
+
return new Promise((resolve9, reject) => {
|
|
42353
|
+
https2.get(url, { headers }, (res) => {
|
|
42354
|
+
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
42355
|
+
if (redirectCount >= 10) {
|
|
42356
|
+
return reject(new Error("Too many redirects"));
|
|
42489
42357
|
}
|
|
42490
|
-
|
|
42491
|
-
|
|
42492
|
-
|
|
42493
|
-
req.on("timeout", () => {
|
|
42494
|
-
if (!isRedirecting) {
|
|
42495
|
-
settleReject(
|
|
42496
|
-
new Error(`Request timed out after ${REQUEST_TIMEOUT_MS}ms`)
|
|
42358
|
+
if (!res.headers.location) {
|
|
42359
|
+
return reject(
|
|
42360
|
+
new Error("Redirect response missing Location header")
|
|
42497
42361
|
);
|
|
42498
|
-
responseStream?.destroy?.();
|
|
42499
42362
|
}
|
|
42500
|
-
|
|
42501
|
-
|
|
42502
|
-
});
|
|
42503
|
-
if (tempDest) {
|
|
42504
|
-
await fs10.promises.rename(tempDest, dest);
|
|
42505
|
-
}
|
|
42506
|
-
} catch (error) {
|
|
42507
|
-
if (downloadPipeline) {
|
|
42508
|
-
try {
|
|
42509
|
-
await downloadPipeline;
|
|
42510
|
-
} catch {
|
|
42363
|
+
downloadFile(res.headers.location, dest, options, redirectCount + 1).then(resolve9).catch(reject);
|
|
42364
|
+
return;
|
|
42511
42365
|
}
|
|
42512
|
-
|
|
42513
|
-
|
|
42514
|
-
|
|
42515
|
-
|
|
42516
|
-
} catch {
|
|
42366
|
+
if (res.statusCode !== 200) {
|
|
42367
|
+
return reject(
|
|
42368
|
+
new Error(`Request failed with status code ${res.statusCode}`)
|
|
42369
|
+
);
|
|
42517
42370
|
}
|
|
42518
|
-
|
|
42519
|
-
|
|
42520
|
-
|
|
42371
|
+
const file = fs10.createWriteStream(dest);
|
|
42372
|
+
res.pipe(file);
|
|
42373
|
+
file.on("finish", () => file.close(resolve9));
|
|
42374
|
+
}).on("error", reject);
|
|
42375
|
+
});
|
|
42521
42376
|
}
|
|
42522
42377
|
async function extractFile(file, dest) {
|
|
42523
42378
|
if (file.endsWith(".tar.gz")) {
|
|
@@ -42745,9 +42600,6 @@ async function removeDirectoryWithRetry(path37, options = {}) {
|
|
|
42745
42600
|
}
|
|
42746
42601
|
|
|
42747
42602
|
// packages/cli/src/config/extension-manager.ts
|
|
42748
|
-
var INSTALL_LOCK_SUFFIX = ".lock";
|
|
42749
|
-
var INSTALL_LOCK_STALE_MS = 15e3;
|
|
42750
|
-
var INSTALL_LOCK_RETRIES = { retries: 15, minTimeout: 200, maxTimeout: 500 };
|
|
42751
42603
|
var ExtensionManager = class extends ExtensionLoader {
|
|
42752
42604
|
extensionEnablementManager;
|
|
42753
42605
|
integrityManager;
|
|
@@ -42768,7 +42620,7 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
42768
42620
|
this.telemetryConfig = new Config({
|
|
42769
42621
|
telemetry: options.settings.telemetry,
|
|
42770
42622
|
interactive: false,
|
|
42771
|
-
sessionId:
|
|
42623
|
+
sessionId: randomUUID(),
|
|
42772
42624
|
clientVersion: options.clientVersion ?? "unknown",
|
|
42773
42625
|
targetDir: options.workspaceDir,
|
|
42774
42626
|
cwd: options.workspaceDir,
|
|
@@ -42892,7 +42744,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
42892
42744
|
} else {
|
|
42893
42745
|
throw new Error(`Unsupported install type: ${installMetadata.type}`);
|
|
42894
42746
|
}
|
|
42895
|
-
let releaseLock;
|
|
42896
42747
|
try {
|
|
42897
42748
|
newExtensionConfig = await this.loadExtensionConfig(localSourcePath);
|
|
42898
42749
|
const newExtensionName = newExtensionConfig.name;
|
|
@@ -42941,19 +42792,11 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
42941
42792
|
const destinationPath = new ExtensionStorage(
|
|
42942
42793
|
newExtensionName
|
|
42943
42794
|
).getExtensionDir();
|
|
42944
|
-
|
|
42945
|
-
|
|
42946
|
-
|
|
42947
|
-
|
|
42948
|
-
|
|
42949
|
-
}
|
|
42950
|
-
};
|
|
42951
|
-
assertDestinationIsAvailable();
|
|
42952
|
-
releaseLock = await acquireExtensionInstallLock(
|
|
42953
|
-
destinationPath,
|
|
42954
|
-
newExtensionName
|
|
42955
|
-
);
|
|
42956
|
-
assertDestinationIsAvailable();
|
|
42795
|
+
if ((!isUpdate || newExtensionName !== previousName) && fs12.existsSync(destinationPath)) {
|
|
42796
|
+
throw new Error(
|
|
42797
|
+
`Cannot install extension "${newExtensionName}" because a directory with that name already exists. Please remove it manually.`
|
|
42798
|
+
);
|
|
42799
|
+
}
|
|
42957
42800
|
let previousSettings;
|
|
42958
42801
|
let wasEnabledGlobally = false;
|
|
42959
42802
|
let wasEnabledWorkspace = false;
|
|
@@ -43066,15 +42909,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43066
42909
|
);
|
|
43067
42910
|
}
|
|
43068
42911
|
} finally {
|
|
43069
|
-
if (releaseLock) {
|
|
43070
|
-
try {
|
|
43071
|
-
await releaseLock();
|
|
43072
|
-
} catch (releaseError) {
|
|
43073
|
-
debugLogger.warn(
|
|
43074
|
-
`Failed to release the install lock for extension "${newExtensionConfig?.name}": ${getErrorMessage(releaseError)}`
|
|
43075
|
-
);
|
|
43076
|
-
}
|
|
43077
|
-
}
|
|
43078
42912
|
if (tempDir) {
|
|
43079
42913
|
try {
|
|
43080
42914
|
await removeDirectoryWithRetry(tempDir);
|
|
@@ -43245,9 +43079,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43245
43079
|
* Builds an extension without side effects (does not mutate loadedExtensions or start it).
|
|
43246
43080
|
*/
|
|
43247
43081
|
async _buildExtension(extensionDir) {
|
|
43248
|
-
if (path9.basename(extensionDir).endsWith(INSTALL_LOCK_SUFFIX)) {
|
|
43249
|
-
return null;
|
|
43250
|
-
}
|
|
43251
43082
|
try {
|
|
43252
43083
|
const stats = await fs12.promises.stat(extensionDir);
|
|
43253
43084
|
if (!stats.isDirectory()) {
|
|
@@ -43733,32 +43564,6 @@ async function copyExtension(source2, destination) {
|
|
|
43733
43564
|
await fs12.promises.cp(source2, destination, { recursive: true });
|
|
43734
43565
|
await makeWritableRecursive(destination);
|
|
43735
43566
|
}
|
|
43736
|
-
async function acquireExtensionInstallLock(destinationPath, extensionName) {
|
|
43737
|
-
await fs12.promises.mkdir(path9.dirname(destinationPath), { recursive: true });
|
|
43738
|
-
try {
|
|
43739
|
-
return await (0, import_proper_lockfile.lock)(destinationPath, {
|
|
43740
|
-
// `destinationPath` usually does not exist yet. With `realpath: false`,
|
|
43741
|
-
// proper-lockfile neither resolves nor stats it; it only creates and
|
|
43742
|
-
// checks the `<destinationPath>.lock` directory.
|
|
43743
|
-
realpath: false,
|
|
43744
|
-
stale: INSTALL_LOCK_STALE_MS,
|
|
43745
|
-
retries: INSTALL_LOCK_RETRIES,
|
|
43746
|
-
// The default handler throws from a timer, which would crash the CLI.
|
|
43747
|
-
onCompromised: (error) => {
|
|
43748
|
-
debugLogger.warn(
|
|
43749
|
-
`Lost the install lock for extension "${extensionName}": ${getErrorMessage(error)}`
|
|
43750
|
-
);
|
|
43751
|
-
}
|
|
43752
|
-
});
|
|
43753
|
-
} catch (error) {
|
|
43754
|
-
if (isNodeError(error) && error.code === "ELOCKED") {
|
|
43755
|
-
throw new Error(
|
|
43756
|
-
`Cannot install extension "${extensionName}" because another installation or update of it is already in progress. Please try again later.`
|
|
43757
|
-
);
|
|
43758
|
-
}
|
|
43759
|
-
throw error;
|
|
43760
|
-
}
|
|
43761
|
-
}
|
|
43762
43567
|
function getContextFileNames(config) {
|
|
43763
43568
|
if (!config.contextFileName) {
|
|
43764
43569
|
return ["GEMINI.md"];
|
|
@@ -44863,8 +44668,8 @@ var import_execa = __toESM(require_execa(), 1);
|
|
|
44863
44668
|
|
|
44864
44669
|
// node_modules/crypto-random-string/index.js
|
|
44865
44670
|
import { promisify } from "util";
|
|
44866
|
-
import
|
|
44867
|
-
var randomBytesAsync = promisify(
|
|
44671
|
+
import crypto2 from "crypto";
|
|
44672
|
+
var randomBytesAsync = promisify(crypto2.randomBytes);
|
|
44868
44673
|
var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split("");
|
|
44869
44674
|
var numericCharacters = "0123456789".split("");
|
|
44870
44675
|
var distinguishableCharacters = "CDEHKMPRTUWXY012458".split("");
|
|
@@ -44877,7 +44682,7 @@ var generateForCustomCharacters = (length, characters) => {
|
|
|
44877
44682
|
let string = "";
|
|
44878
44683
|
let stringLength = 0;
|
|
44879
44684
|
while (stringLength < length) {
|
|
44880
|
-
const entropy =
|
|
44685
|
+
const entropy = crypto2.randomBytes(entropyLength);
|
|
44881
44686
|
let entropyPosition = 0;
|
|
44882
44687
|
while (entropyPosition < entropyLength && stringLength < length) {
|
|
44883
44688
|
const entropyValue = entropy.readUInt16LE(entropyPosition);
|
|
@@ -44912,7 +44717,7 @@ var generateForCustomCharactersAsync = async (length, characters) => {
|
|
|
44912
44717
|
}
|
|
44913
44718
|
return string;
|
|
44914
44719
|
};
|
|
44915
|
-
var generateRandomBytes = (byteLength, type, length) =>
|
|
44720
|
+
var generateRandomBytes = (byteLength, type, length) => crypto2.randomBytes(byteLength).toString(type).slice(0, length);
|
|
44916
44721
|
var generateRandomBytesAsync = async (byteLength, type, length) => {
|
|
44917
44722
|
const buffer = await randomBytesAsync(byteLength);
|
|
44918
44723
|
return buffer.toString(type).slice(0, length);
|
|
@@ -53449,7 +53254,6 @@ var _ExpandableText = ({
|
|
|
53449
53254
|
maxWidth = MAX_WIDTH,
|
|
53450
53255
|
maxLines
|
|
53451
53256
|
}) => {
|
|
53452
|
-
const labelCharacters = Array.from(label);
|
|
53453
53257
|
const hasMatch = matchedIndex !== void 0 && matchedIndex >= 0 && matchedIndex < label.length && userInput.length > 0;
|
|
53454
53258
|
if (!hasMatch) {
|
|
53455
53259
|
let display = label;
|
|
@@ -53458,69 +53262,53 @@ var _ExpandableText = ({
|
|
|
53458
53262
|
const lines = label.split("\n");
|
|
53459
53263
|
let truncated = lines.slice(0, maxLines).join("\n");
|
|
53460
53264
|
const hasMoreLines = lines.length > maxLines;
|
|
53461
|
-
|
|
53462
|
-
|
|
53463
|
-
truncated = truncatedCharacters.slice(0, maxWidth).join("") + "...";
|
|
53265
|
+
if (truncated.length > maxWidth) {
|
|
53266
|
+
truncated = truncated.slice(0, maxWidth) + "...";
|
|
53464
53267
|
} else if (hasMoreLines) {
|
|
53465
53268
|
truncated += "...";
|
|
53466
53269
|
}
|
|
53467
53270
|
display = truncated;
|
|
53468
|
-
} else if (
|
|
53469
|
-
display =
|
|
53271
|
+
} else if (label.length > maxWidth) {
|
|
53272
|
+
display = label.slice(0, maxWidth) + "...";
|
|
53470
53273
|
}
|
|
53471
53274
|
}
|
|
53472
53275
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { wrap: "wrap", color: textColor, children: display });
|
|
53473
53276
|
}
|
|
53474
|
-
const
|
|
53475
|
-
let matchedCharacterIndex = 0;
|
|
53476
|
-
let matchedUtf16Index = 0;
|
|
53477
|
-
while (matchedCharacterIndex < labelCharacters.length && matchedUtf16Index < matchedIndex) {
|
|
53478
|
-
matchedUtf16Index += labelCharacters[matchedCharacterIndex].length;
|
|
53479
|
-
matchedCharacterIndex += 1;
|
|
53480
|
-
}
|
|
53277
|
+
const matchLength = userInput.length;
|
|
53481
53278
|
let before = "";
|
|
53482
53279
|
let match = "";
|
|
53483
53280
|
let after = "";
|
|
53484
|
-
if (isExpanded ||
|
|
53485
|
-
before =
|
|
53486
|
-
match =
|
|
53487
|
-
|
|
53488
|
-
|
|
53489
|
-
|
|
53490
|
-
after = labelCharacters.slice(matchedCharacterIndex + matchCharactersLength).join("");
|
|
53491
|
-
} else if (matchCharactersLength >= maxWidth) {
|
|
53492
|
-
match = labelCharacters.slice(matchedCharacterIndex, matchedCharacterIndex + maxWidth - 1).join("") + "...";
|
|
53281
|
+
if (isExpanded || label.length <= maxWidth) {
|
|
53282
|
+
before = label.slice(0, matchedIndex);
|
|
53283
|
+
match = label.slice(matchedIndex, matchedIndex + matchLength);
|
|
53284
|
+
after = label.slice(matchedIndex + matchLength);
|
|
53285
|
+
} else if (matchLength >= maxWidth) {
|
|
53286
|
+
match = label.slice(matchedIndex, matchedIndex + maxWidth - 1) + "...";
|
|
53493
53287
|
} else {
|
|
53494
|
-
const contextSpace = maxWidth -
|
|
53288
|
+
const contextSpace = maxWidth - matchLength;
|
|
53495
53289
|
const beforeSpace = Math.floor(contextSpace / 2);
|
|
53496
53290
|
const afterSpace = Math.ceil(contextSpace / 2);
|
|
53497
|
-
let start =
|
|
53498
|
-
let end =
|
|
53291
|
+
let start = matchedIndex - beforeSpace;
|
|
53292
|
+
let end = matchedIndex + matchLength + afterSpace;
|
|
53499
53293
|
if (start < 0) {
|
|
53500
53294
|
end += -start;
|
|
53501
53295
|
start = 0;
|
|
53502
53296
|
}
|
|
53503
|
-
if (end >
|
|
53504
|
-
start -= end -
|
|
53505
|
-
end =
|
|
53297
|
+
if (end > label.length) {
|
|
53298
|
+
start -= end - label.length;
|
|
53299
|
+
end = label.length;
|
|
53506
53300
|
}
|
|
53507
53301
|
start = Math.max(0, start);
|
|
53508
|
-
const finalMatchIndex =
|
|
53509
|
-
const slicedLabel =
|
|
53510
|
-
|
|
53511
|
-
match = slicedLabel.slice(finalMatchIndex, finalMatchIndex +
|
|
53512
|
-
|
|
53513
|
-
finalMatchIndex + matchCharactersLength
|
|
53514
|
-
);
|
|
53302
|
+
const finalMatchIndex = matchedIndex - start;
|
|
53303
|
+
const slicedLabel = label.slice(start, end);
|
|
53304
|
+
before = slicedLabel.slice(0, finalMatchIndex);
|
|
53305
|
+
match = slicedLabel.slice(finalMatchIndex, finalMatchIndex + matchLength);
|
|
53306
|
+
after = slicedLabel.slice(finalMatchIndex + matchLength);
|
|
53515
53307
|
if (start > 0) {
|
|
53516
|
-
before =
|
|
53517
|
-
} else {
|
|
53518
|
-
before = beforeChars.join("");
|
|
53308
|
+
before = before.length >= 3 ? "..." + before.slice(3) : "...";
|
|
53519
53309
|
}
|
|
53520
|
-
if (end <
|
|
53521
|
-
after =
|
|
53522
|
-
} else {
|
|
53523
|
-
after = afterChars.join("");
|
|
53310
|
+
if (end < label.length) {
|
|
53311
|
+
after = after.length >= 3 ? after.slice(0, -3) + "..." : "...";
|
|
53524
53312
|
}
|
|
53525
53313
|
}
|
|
53526
53314
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: textColor, wrap: "wrap", children: [
|
|
@@ -55230,7 +55018,7 @@ var authCommand = {
|
|
|
55230
55018
|
import process12 from "node:process";
|
|
55231
55019
|
|
|
55232
55020
|
// packages/cli/src/generated/git-commit.ts
|
|
55233
|
-
var GIT_COMMIT_INFO = "
|
|
55021
|
+
var GIT_COMMIT_INFO = "b367c7296";
|
|
55234
55022
|
|
|
55235
55023
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
55236
55024
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -55280,13 +55068,13 @@ async function exportHistoryToFile(options) {
|
|
|
55280
55068
|
// packages/cli/src/ui/utils/memorySnapshot.ts
|
|
55281
55069
|
import { createWriteStream as createWriteStream3 } from "node:fs";
|
|
55282
55070
|
import { mkdir as mkdir3 } from "node:fs/promises";
|
|
55283
|
-
import { dirname as
|
|
55284
|
-
import { pipeline
|
|
55071
|
+
import { dirname as dirname4 } from "node:path";
|
|
55072
|
+
import { pipeline } from "node:stream/promises";
|
|
55285
55073
|
import { getHeapSnapshot } from "node:v8";
|
|
55286
55074
|
var MEMORY_SNAPSHOT_AUTO_THRESHOLD_BYTES = 2 * 1024 * 1024 * 1024;
|
|
55287
55075
|
async function captureHeapSnapshot(filePath) {
|
|
55288
|
-
await mkdir3(
|
|
55289
|
-
await
|
|
55076
|
+
await mkdir3(dirname4(filePath), { recursive: true });
|
|
55077
|
+
await pipeline(getHeapSnapshot(), createWriteStream3(filePath));
|
|
55290
55078
|
}
|
|
55291
55079
|
|
|
55292
55080
|
// packages/cli/src/ui/commands/bugCommand.ts
|
|
@@ -55864,7 +55652,7 @@ var chatCommand = {
|
|
|
55864
55652
|
};
|
|
55865
55653
|
|
|
55866
55654
|
// packages/cli/src/ui/commands/clearCommand.ts
|
|
55867
|
-
import { randomUUID as
|
|
55655
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
55868
55656
|
var clearCommand = {
|
|
55869
55657
|
name: "clear",
|
|
55870
55658
|
altNames: ["new"],
|
|
@@ -55881,7 +55669,7 @@ var clearCommand = {
|
|
|
55881
55669
|
config?.injectionService.clear();
|
|
55882
55670
|
let newSessionId;
|
|
55883
55671
|
if (config) {
|
|
55884
|
-
newSessionId =
|
|
55672
|
+
newSessionId = randomUUID2();
|
|
55885
55673
|
config.resetNewSessionState(newSessionId);
|
|
55886
55674
|
}
|
|
55887
55675
|
if (geminiClient) {
|
|
@@ -59992,16 +59780,7 @@ async function rewindConversation(context, client, recordingService, messageId,
|
|
|
59992
59780
|
const { uiHistory } = convertSessionToHistoryFormats(conversation.messages);
|
|
59993
59781
|
const clientHistory = convertSessionToClientHistory(conversation.messages);
|
|
59994
59782
|
client.setHistory(clientHistory);
|
|
59995
|
-
|
|
59996
|
-
const config = context.services.agentContext?.config;
|
|
59997
|
-
if (config) {
|
|
59998
|
-
config.getModelAvailabilityService?.()?.reset();
|
|
59999
|
-
const configuredModel = config.getModel?.();
|
|
60000
|
-
if (configuredModel) {
|
|
60001
|
-
config.setActiveModel?.(configuredModel);
|
|
60002
|
-
}
|
|
60003
|
-
await config.getMemoryContextManager()?.refresh();
|
|
60004
|
-
}
|
|
59783
|
+
await context.services.agentContext?.config.getMemoryContextManager()?.refresh();
|
|
60005
59784
|
const startId = 1;
|
|
60006
59785
|
const historyWithIds = uiHistory.map(
|
|
60007
59786
|
(item, idx) => ({
|
|
@@ -61046,7 +60825,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
61046
60825
|
type: "info",
|
|
61047
60826
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
61048
60827
|
});
|
|
61049
|
-
const { MCPOAuthProvider } = await import("./core-
|
|
60828
|
+
const { MCPOAuthProvider } = await import("./core-N27LU4DK.js");
|
|
61050
60829
|
let oauthConfig = server.oauth;
|
|
61051
60830
|
if (!oauthConfig) {
|
|
61052
60831
|
oauthConfig = { enabled: false };
|