@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-56IGTM4O.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-BW65QRZA.js";
|
|
73
73
|
import {
|
|
74
74
|
isDevelopment,
|
|
75
75
|
require_semver
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-2E3ETS5J.js";
|
|
77
77
|
import {
|
|
78
78
|
emptyIcon,
|
|
79
79
|
mapCoreStatusToDisplayStatus,
|
|
80
80
|
require_react
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-YUO7RUF4.js";
|
|
82
82
|
import {
|
|
83
83
|
ALL_EDITORS,
|
|
84
84
|
ApprovalMode,
|
|
@@ -232,7 +232,6 @@ import {
|
|
|
232
232
|
require_cross_spawn,
|
|
233
233
|
require_is_stream,
|
|
234
234
|
require_path_key,
|
|
235
|
-
require_proper_lockfile,
|
|
236
235
|
require_pump,
|
|
237
236
|
require_toml,
|
|
238
237
|
resetBrowserSession,
|
|
@@ -253,7 +252,7 @@ import {
|
|
|
253
252
|
uiTelemetryService,
|
|
254
253
|
unescapePath,
|
|
255
254
|
validateUrlDestination
|
|
256
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-NGQU3QTQ.js";
|
|
257
256
|
import {
|
|
258
257
|
require_src
|
|
259
258
|
} from "./chunk-L6PII3GR.js";
|
|
@@ -6514,7 +6513,7 @@ var require_extract_zip = __commonJS({
|
|
|
6514
6513
|
var stream = __require("stream");
|
|
6515
6514
|
var yauzl = require_yauzl();
|
|
6516
6515
|
var openZip = promisify5(yauzl.open);
|
|
6517
|
-
var
|
|
6516
|
+
var pipeline2 = promisify5(stream.pipeline);
|
|
6518
6517
|
var Extractor = class {
|
|
6519
6518
|
constructor(zipPath, opts) {
|
|
6520
6519
|
this.zipPath = zipPath;
|
|
@@ -6602,7 +6601,7 @@ var require_extract_zip = __commonJS({
|
|
|
6602
6601
|
debug("creating symlink", link, dest);
|
|
6603
6602
|
await fs33.symlink(link, dest);
|
|
6604
6603
|
} else {
|
|
6605
|
-
await
|
|
6604
|
+
await pipeline2(readStream, createWriteStream5(dest, { mode: procMode }));
|
|
6606
6605
|
}
|
|
6607
6606
|
}
|
|
6608
6607
|
getExtractedMode(entryMode, isDir) {
|
|
@@ -15338,11 +15337,11 @@ var require_util4 = __commonJS({
|
|
|
15338
15337
|
var { isUint8Array } = __require("node:util/types");
|
|
15339
15338
|
var { webidl } = require_webidl();
|
|
15340
15339
|
var supportedHashes = [];
|
|
15341
|
-
var
|
|
15340
|
+
var crypto3;
|
|
15342
15341
|
try {
|
|
15343
|
-
|
|
15342
|
+
crypto3 = __require("node:crypto");
|
|
15344
15343
|
const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
|
|
15345
|
-
supportedHashes =
|
|
15344
|
+
supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
|
|
15346
15345
|
} catch {
|
|
15347
15346
|
}
|
|
15348
15347
|
function responseURL(response) {
|
|
@@ -15645,7 +15644,7 @@ var require_util4 = __commonJS({
|
|
|
15645
15644
|
return isOriginPotentiallyTrustworthy(url.origin);
|
|
15646
15645
|
}
|
|
15647
15646
|
function bytesMatch(bytes, metadataList) {
|
|
15648
|
-
if (
|
|
15647
|
+
if (crypto3 === void 0) {
|
|
15649
15648
|
return true;
|
|
15650
15649
|
}
|
|
15651
15650
|
const parsedMetadata = parseMetadata(metadataList);
|
|
@@ -15660,7 +15659,7 @@ var require_util4 = __commonJS({
|
|
|
15660
15659
|
for (const item of metadata) {
|
|
15661
15660
|
const algorithm = item.algo;
|
|
15662
15661
|
const expectedValue = item.hash;
|
|
15663
|
-
let actualValue =
|
|
15662
|
+
let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64");
|
|
15664
15663
|
if (actualValue[actualValue.length - 1] === "=") {
|
|
15665
15664
|
if (actualValue[actualValue.length - 2] === "=") {
|
|
15666
15665
|
actualValue = actualValue.slice(0, -2);
|
|
@@ -16678,8 +16677,8 @@ var require_body = __commonJS({
|
|
|
16678
16677
|
var { multipartFormDataParser } = require_formdata_parser();
|
|
16679
16678
|
var random;
|
|
16680
16679
|
try {
|
|
16681
|
-
const
|
|
16682
|
-
random = (max) =>
|
|
16680
|
+
const crypto3 = __require("node:crypto");
|
|
16681
|
+
random = (max) => crypto3.randomInt(0, max);
|
|
16683
16682
|
} catch {
|
|
16684
16683
|
random = (max) => Math.floor(Math.random() * max);
|
|
16685
16684
|
}
|
|
@@ -18130,7 +18129,7 @@ var require_client_h2 = __commonJS({
|
|
|
18130
18129
|
"packages/cli/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module) {
|
|
18131
18130
|
"use strict";
|
|
18132
18131
|
var assert = __require("node:assert");
|
|
18133
|
-
var { pipeline:
|
|
18132
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
18134
18133
|
var util2 = require_util3();
|
|
18135
18134
|
var {
|
|
18136
18135
|
RequestContentLengthMismatchError,
|
|
@@ -18625,7 +18624,7 @@ var require_client_h2 = __commonJS({
|
|
|
18625
18624
|
}
|
|
18626
18625
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
|
|
18627
18626
|
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
18628
|
-
const pipe =
|
|
18627
|
+
const pipe = pipeline2(
|
|
18629
18628
|
body,
|
|
18630
18629
|
h2stream,
|
|
18631
18630
|
(err) => {
|
|
@@ -21519,7 +21518,7 @@ var require_api_pipeline = __commonJS({
|
|
|
21519
21518
|
util2.destroy(ret, err);
|
|
21520
21519
|
}
|
|
21521
21520
|
};
|
|
21522
|
-
function
|
|
21521
|
+
function pipeline2(opts, handler2) {
|
|
21523
21522
|
try {
|
|
21524
21523
|
const pipelineHandler = new PipelineHandler(opts, handler2);
|
|
21525
21524
|
this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
|
|
@@ -21528,7 +21527,7 @@ var require_api_pipeline = __commonJS({
|
|
|
21528
21527
|
return new PassThrough().destroy(err);
|
|
21529
21528
|
}
|
|
21530
21529
|
}
|
|
21531
|
-
module.exports =
|
|
21530
|
+
module.exports = pipeline2;
|
|
21532
21531
|
}
|
|
21533
21532
|
});
|
|
21534
21533
|
|
|
@@ -26944,7 +26943,7 @@ var require_fetch = __commonJS({
|
|
|
26944
26943
|
subresourceSet
|
|
26945
26944
|
} = require_constants3();
|
|
26946
26945
|
var EE = __require("node:events");
|
|
26947
|
-
var { Readable, pipeline:
|
|
26946
|
+
var { Readable, pipeline: pipeline2, finished, isErrored, isReadable } = __require("node:stream");
|
|
26948
26947
|
var { addAbortListener, bufferToLowerCasedHeaderName } = require_util3();
|
|
26949
26948
|
var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
|
|
26950
26949
|
var { getGlobalDispatcher } = require_global2();
|
|
@@ -27887,7 +27886,7 @@ var require_fetch = __commonJS({
|
|
|
27887
27886
|
status,
|
|
27888
27887
|
statusText,
|
|
27889
27888
|
headersList,
|
|
27890
|
-
body: decoders.length ?
|
|
27889
|
+
body: decoders.length ? pipeline2(this.body, ...decoders, (err) => {
|
|
27891
27890
|
if (err) {
|
|
27892
27891
|
this.onError(err);
|
|
27893
27892
|
}
|
|
@@ -29596,13 +29595,13 @@ var require_frame = __commonJS({
|
|
|
29596
29595
|
"use strict";
|
|
29597
29596
|
var { maxUnsigned16Bit, opcodes } = require_constants5();
|
|
29598
29597
|
var BUFFER_SIZE = 8 * 1024;
|
|
29599
|
-
var
|
|
29598
|
+
var crypto3;
|
|
29600
29599
|
var buffer = null;
|
|
29601
29600
|
var bufIdx = BUFFER_SIZE;
|
|
29602
29601
|
try {
|
|
29603
|
-
|
|
29602
|
+
crypto3 = __require("node:crypto");
|
|
29604
29603
|
} catch {
|
|
29605
|
-
|
|
29604
|
+
crypto3 = {
|
|
29606
29605
|
// not full compatibility, but minimum.
|
|
29607
29606
|
randomFillSync: function randomFillSync(buffer2, _offset, _size) {
|
|
29608
29607
|
for (let i = 0; i < buffer2.length; ++i) {
|
|
@@ -29615,7 +29614,7 @@ var require_frame = __commonJS({
|
|
|
29615
29614
|
function generateMask() {
|
|
29616
29615
|
if (bufIdx === BUFFER_SIZE) {
|
|
29617
29616
|
bufIdx = 0;
|
|
29618
|
-
|
|
29617
|
+
crypto3.randomFillSync(buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
|
|
29619
29618
|
}
|
|
29620
29619
|
return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
|
|
29621
29620
|
}
|
|
@@ -29713,9 +29712,9 @@ var require_connection = __commonJS({
|
|
|
29713
29712
|
var { getDecodeSplit } = require_util4();
|
|
29714
29713
|
var { WebsocketFrameSend } = require_frame();
|
|
29715
29714
|
var assert = __require("node:assert");
|
|
29716
|
-
var
|
|
29715
|
+
var crypto3;
|
|
29717
29716
|
try {
|
|
29718
|
-
|
|
29717
|
+
crypto3 = __require("node:crypto");
|
|
29719
29718
|
} catch {
|
|
29720
29719
|
}
|
|
29721
29720
|
function establishWebSocketConnection(url, protocols, client, handler2, options) {
|
|
@@ -29735,7 +29734,7 @@ var require_connection = __commonJS({
|
|
|
29735
29734
|
const headersList = getHeadersList(new Headers(options.headers));
|
|
29736
29735
|
request.headersList = headersList;
|
|
29737
29736
|
}
|
|
29738
|
-
const keyValue =
|
|
29737
|
+
const keyValue = crypto3.randomBytes(16).toString("base64");
|
|
29739
29738
|
request.headersList.append("sec-websocket-key", keyValue, true);
|
|
29740
29739
|
request.headersList.append("sec-websocket-version", "13", true);
|
|
29741
29740
|
for (const protocol of protocols) {
|
|
@@ -29768,7 +29767,7 @@ var require_connection = __commonJS({
|
|
|
29768
29767
|
return;
|
|
29769
29768
|
}
|
|
29770
29769
|
const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
|
|
29771
|
-
const digest =
|
|
29770
|
+
const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64");
|
|
29772
29771
|
if (secWSAccept !== digest) {
|
|
29773
29772
|
failWebsocketConnection(handler2, 1002, "Incorrect hash received in Sec-WebSocket-Accept header.");
|
|
29774
29773
|
return;
|
|
@@ -31380,7 +31379,7 @@ ${value}`;
|
|
|
31380
31379
|
var require_eventsource = __commonJS({
|
|
31381
31380
|
"packages/cli/node_modules/undici/lib/web/eventsource/eventsource.js"(exports, module) {
|
|
31382
31381
|
"use strict";
|
|
31383
|
-
var { pipeline:
|
|
31382
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
31384
31383
|
var { fetching } = require_fetch();
|
|
31385
31384
|
var { makeRequest } = require_request2();
|
|
31386
31385
|
var { webidl } = require_webidl();
|
|
@@ -31541,7 +31540,7 @@ var require_eventsource = __commonJS({
|
|
|
31541
31540
|
));
|
|
31542
31541
|
}
|
|
31543
31542
|
});
|
|
31544
|
-
|
|
31543
|
+
pipeline2(
|
|
31545
31544
|
response.body.stream,
|
|
31546
31545
|
eventSourceStream,
|
|
31547
31546
|
(error) => {
|
|
@@ -38675,7 +38674,6 @@ async function getMissingSettings(extensionConfig, extensionId, workspaceDir) {
|
|
|
38675
38674
|
|
|
38676
38675
|
// packages/cli/src/config/extension-manager.ts
|
|
38677
38676
|
var import_chalk2 = __toESM(require_source(), 1);
|
|
38678
|
-
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
38679
38677
|
import * as fs12 from "node:fs";
|
|
38680
38678
|
import * as path9 from "node:path";
|
|
38681
38679
|
import { stat } from "node:fs/promises";
|
|
@@ -38847,7 +38845,7 @@ var ExtensionEnablementManager = class {
|
|
|
38847
38845
|
};
|
|
38848
38846
|
|
|
38849
38847
|
// packages/cli/src/config/extension-manager.ts
|
|
38850
|
-
import { createHash as createHash2, randomUUID
|
|
38848
|
+
import { createHash as createHash2, randomUUID } from "node:crypto";
|
|
38851
38849
|
|
|
38852
38850
|
// packages/cli/src/config/extension.ts
|
|
38853
38851
|
import * as fs8 from "node:fs";
|
|
@@ -38944,12 +38942,10 @@ function extensionUpdatesReducer(state, action) {
|
|
|
38944
38942
|
}
|
|
38945
38943
|
|
|
38946
38944
|
// packages/cli/src/config/extensions/github.ts
|
|
38947
|
-
import * as crypto2 from "node:crypto";
|
|
38948
38945
|
import * as os3 from "node:os";
|
|
38949
38946
|
import * as https2 from "node:https";
|
|
38950
38947
|
import * as fs10 from "node:fs";
|
|
38951
38948
|
import * as path8 from "node:path";
|
|
38952
|
-
import { pipeline } from "node:stream/promises";
|
|
38953
38949
|
|
|
38954
38950
|
// packages/cli/node_modules/tar/dist/esm/index.min.js
|
|
38955
38951
|
import Hr from "events";
|
|
@@ -41864,14 +41860,6 @@ import * as https from "node:https";
|
|
|
41864
41860
|
function getGitHubToken() {
|
|
41865
41861
|
return process.env["GITHUB_TOKEN"] || void 0;
|
|
41866
41862
|
}
|
|
41867
|
-
function isTrustedGitHubUrl(url) {
|
|
41868
|
-
try {
|
|
41869
|
-
const parsedUrl = new URL(url);
|
|
41870
|
-
return parsedUrl.protocol === "https:" && (parsedUrl.hostname === "github.com" || parsedUrl.hostname.endsWith(".github.com"));
|
|
41871
|
-
} catch {
|
|
41872
|
-
return false;
|
|
41873
|
-
}
|
|
41874
|
-
}
|
|
41875
41863
|
var lookupPublicAddress = (hostname, options, callback) => safeLookup(
|
|
41876
41864
|
hostname,
|
|
41877
41865
|
{
|
|
@@ -41881,7 +41869,6 @@ var lookupPublicAddress = (hostname, options, callback) => safeLookup(
|
|
|
41881
41869
|
callback
|
|
41882
41870
|
);
|
|
41883
41871
|
var REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
41884
|
-
var REQUEST_TIMEOUT_MS = 3e4;
|
|
41885
41872
|
async function fetchJson(url, redirectCount = 0) {
|
|
41886
41873
|
if (!await validateUrlDestination(url)) {
|
|
41887
41874
|
throw new Error(`Access to blocked or private host ${url} is not allowed.`);
|
|
@@ -41890,8 +41877,14 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
41890
41877
|
"User-Agent": "gemini-cli"
|
|
41891
41878
|
};
|
|
41892
41879
|
const token = getGitHubToken();
|
|
41893
|
-
if (token
|
|
41894
|
-
|
|
41880
|
+
if (token) {
|
|
41881
|
+
try {
|
|
41882
|
+
const parsedUrl = new URL(url);
|
|
41883
|
+
if (parsedUrl.protocol === "https:" && (parsedUrl.hostname === "github.com" || parsedUrl.hostname.endsWith(".github.com"))) {
|
|
41884
|
+
headers.Authorization = `token ${token}`;
|
|
41885
|
+
}
|
|
41886
|
+
} catch {
|
|
41887
|
+
}
|
|
41895
41888
|
}
|
|
41896
41889
|
return new Promise((resolve9, reject) => {
|
|
41897
41890
|
let settled = false;
|
|
@@ -41916,7 +41909,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
41916
41909
|
const requestOptions = {
|
|
41917
41910
|
headers,
|
|
41918
41911
|
lookup: lookupPublicAddress,
|
|
41919
|
-
timeout:
|
|
41912
|
+
timeout: 3e4
|
|
41920
41913
|
};
|
|
41921
41914
|
const req = https.get(url, requestOptions, (res) => {
|
|
41922
41915
|
res.on(
|
|
@@ -42009,9 +42002,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
42009
42002
|
});
|
|
42010
42003
|
req.on("error", (error) => failUnlessRedirecting(() => error));
|
|
42011
42004
|
req.on("timeout", () => {
|
|
42012
|
-
failUnlessRedirecting(
|
|
42013
|
-
() => new Error(`Request timed out after ${REQUEST_TIMEOUT_MS}ms`)
|
|
42014
|
-
);
|
|
42005
|
+
failUnlessRedirecting(() => new Error("Request timed out after 30000ms"));
|
|
42015
42006
|
req.destroy();
|
|
42016
42007
|
});
|
|
42017
42008
|
});
|
|
@@ -42081,7 +42072,7 @@ function tryParseGithubUrl(source2) {
|
|
|
42081
42072
|
);
|
|
42082
42073
|
}
|
|
42083
42074
|
const owner = parts[0];
|
|
42084
|
-
const repo = parts[1].replace(
|
|
42075
|
+
const repo = parts[1].replace(".git", "");
|
|
42085
42076
|
return {
|
|
42086
42077
|
owner,
|
|
42087
42078
|
repo
|
|
@@ -42362,175 +42353,39 @@ function findReleaseAsset(assets) {
|
|
|
42362
42353
|
return void 0;
|
|
42363
42354
|
}
|
|
42364
42355
|
async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
42365
|
-
let parsedUrl;
|
|
42366
|
-
try {
|
|
42367
|
-
parsedUrl = new URL(url);
|
|
42368
|
-
} catch (error) {
|
|
42369
|
-
throw new Error(`Invalid download URL ${url}: ${getErrorMessage(error)}`, {
|
|
42370
|
-
cause: error
|
|
42371
|
-
});
|
|
42372
|
-
}
|
|
42373
|
-
if (parsedUrl.protocol !== "https:") {
|
|
42374
|
-
throw new Error(
|
|
42375
|
-
`Refusing to download from insecure protocol ${parsedUrl.protocol} for URL ${url}. Only HTTPS is supported.`
|
|
42376
|
-
);
|
|
42377
|
-
}
|
|
42378
|
-
const requestUrl = parsedUrl.toString();
|
|
42379
|
-
if (!await validateUrlDestination(requestUrl)) {
|
|
42380
|
-
throw new Error(
|
|
42381
|
-
`Access to blocked or private host ${requestUrl} is not allowed.`
|
|
42382
|
-
);
|
|
42383
|
-
}
|
|
42384
42356
|
const headers = {
|
|
42385
42357
|
"User-agent": "gemini-cli",
|
|
42386
42358
|
Accept: "application/octet-stream",
|
|
42387
42359
|
...options?.headers
|
|
42388
42360
|
};
|
|
42389
|
-
const trustedGitHubUrl = isTrustedGitHubUrl(requestUrl);
|
|
42390
|
-
if (!trustedGitHubUrl) {
|
|
42391
|
-
for (const key of Object.keys(headers)) {
|
|
42392
|
-
if (key.toLowerCase() === "authorization") {
|
|
42393
|
-
delete headers[key];
|
|
42394
|
-
}
|
|
42395
|
-
}
|
|
42396
|
-
}
|
|
42397
42361
|
const token = getGitHubToken();
|
|
42398
|
-
if (token
|
|
42362
|
+
if (token) {
|
|
42399
42363
|
headers["Authorization"] = `token ${token}`;
|
|
42400
42364
|
}
|
|
42401
|
-
|
|
42402
|
-
|
|
42403
|
-
|
|
42404
|
-
|
|
42405
|
-
|
|
42406
|
-
let isRedirecting = false;
|
|
42407
|
-
let responseStream;
|
|
42408
|
-
const settleResolve = () => {
|
|
42409
|
-
if (!settled) {
|
|
42410
|
-
settled = true;
|
|
42411
|
-
resolve9();
|
|
42412
|
-
}
|
|
42413
|
-
};
|
|
42414
|
-
const settleReject = (error) => {
|
|
42415
|
-
if (!settled) {
|
|
42416
|
-
settled = true;
|
|
42417
|
-
reject(
|
|
42418
|
-
error instanceof Error ? error : new Error(getErrorMessage(error))
|
|
42419
|
-
);
|
|
42420
|
-
}
|
|
42421
|
-
};
|
|
42422
|
-
const requestOptions = {
|
|
42423
|
-
headers,
|
|
42424
|
-
lookup: lookupPublicAddress,
|
|
42425
|
-
timeout: REQUEST_TIMEOUT_MS
|
|
42426
|
-
};
|
|
42427
|
-
const req = https2.get(requestUrl, requestOptions, (res) => {
|
|
42428
|
-
res.on("error", (error) => {
|
|
42429
|
-
if (!isRedirecting) {
|
|
42430
|
-
settleReject(error);
|
|
42431
|
-
}
|
|
42432
|
-
});
|
|
42433
|
-
if (res.statusCode && REDIRECT_STATUS_CODES.has(res.statusCode)) {
|
|
42434
|
-
if (redirectCount >= 10) {
|
|
42435
|
-
res.resume?.();
|
|
42436
|
-
settleReject(new Error("Too many redirects"));
|
|
42437
|
-
return;
|
|
42438
|
-
}
|
|
42439
|
-
if (!res.headers.location) {
|
|
42440
|
-
res.resume?.();
|
|
42441
|
-
settleReject(
|
|
42442
|
-
new Error("Redirect response missing Location header")
|
|
42443
|
-
);
|
|
42444
|
-
return;
|
|
42445
|
-
}
|
|
42446
|
-
let redirectUrl;
|
|
42447
|
-
try {
|
|
42448
|
-
redirectUrl = new URL(res.headers.location, requestUrl).toString();
|
|
42449
|
-
} catch (error) {
|
|
42450
|
-
res.resume?.();
|
|
42451
|
-
settleReject(
|
|
42452
|
-
new Error(
|
|
42453
|
-
`Invalid redirect URL from ${requestUrl} (status ${res.statusCode}): ${getErrorMessage(error)}`,
|
|
42454
|
-
{ cause: error }
|
|
42455
|
-
)
|
|
42456
|
-
);
|
|
42457
|
-
return;
|
|
42458
|
-
}
|
|
42459
|
-
isRedirecting = true;
|
|
42460
|
-
res.resume?.();
|
|
42461
|
-
void downloadFile(redirectUrl, dest, options, redirectCount + 1).then(
|
|
42462
|
-
settleResolve,
|
|
42463
|
-
settleReject
|
|
42464
|
-
);
|
|
42465
|
-
return;
|
|
42466
|
-
}
|
|
42467
|
-
if (res.statusCode !== 200) {
|
|
42468
|
-
res.resume?.();
|
|
42469
|
-
settleReject(
|
|
42470
|
-
new Error(`Request failed with status code ${res.statusCode}`)
|
|
42471
|
-
);
|
|
42472
|
-
return;
|
|
42473
|
-
}
|
|
42474
|
-
responseStream = res;
|
|
42475
|
-
const currentTempDest = `${dest}.${crypto2.randomUUID()}.tmp`;
|
|
42476
|
-
tempDest = currentTempDest;
|
|
42477
|
-
let file;
|
|
42478
|
-
try {
|
|
42479
|
-
file = fs10.createWriteStream(currentTempDest);
|
|
42480
|
-
} catch (error) {
|
|
42481
|
-
res.destroy?.();
|
|
42482
|
-
settleReject(error);
|
|
42483
|
-
return;
|
|
42484
|
-
}
|
|
42485
|
-
file.on("error", settleReject);
|
|
42486
|
-
downloadPipeline = pipeline(res, file);
|
|
42487
|
-
void downloadPipeline.then(() => {
|
|
42488
|
-
if (res.complete === false) {
|
|
42489
|
-
settleReject(
|
|
42490
|
-
new Error(
|
|
42491
|
-
`Response ended prematurely while downloading ${requestUrl}`
|
|
42492
|
-
)
|
|
42493
|
-
);
|
|
42494
|
-
return;
|
|
42495
|
-
}
|
|
42496
|
-
settleResolve();
|
|
42497
|
-
}, settleReject);
|
|
42498
|
-
});
|
|
42499
|
-
req.on("error", (error) => {
|
|
42500
|
-
if (isRedirecting) {
|
|
42501
|
-
return;
|
|
42365
|
+
return new Promise((resolve9, reject) => {
|
|
42366
|
+
https2.get(url, { headers }, (res) => {
|
|
42367
|
+
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
42368
|
+
if (redirectCount >= 10) {
|
|
42369
|
+
return reject(new Error("Too many redirects"));
|
|
42502
42370
|
}
|
|
42503
|
-
|
|
42504
|
-
|
|
42505
|
-
|
|
42506
|
-
req.on("timeout", () => {
|
|
42507
|
-
if (!isRedirecting) {
|
|
42508
|
-
settleReject(
|
|
42509
|
-
new Error(`Request timed out after ${REQUEST_TIMEOUT_MS}ms`)
|
|
42371
|
+
if (!res.headers.location) {
|
|
42372
|
+
return reject(
|
|
42373
|
+
new Error("Redirect response missing Location header")
|
|
42510
42374
|
);
|
|
42511
|
-
responseStream?.destroy?.();
|
|
42512
42375
|
}
|
|
42513
|
-
|
|
42514
|
-
|
|
42515
|
-
});
|
|
42516
|
-
if (tempDest) {
|
|
42517
|
-
await fs10.promises.rename(tempDest, dest);
|
|
42518
|
-
}
|
|
42519
|
-
} catch (error) {
|
|
42520
|
-
if (downloadPipeline) {
|
|
42521
|
-
try {
|
|
42522
|
-
await downloadPipeline;
|
|
42523
|
-
} catch {
|
|
42376
|
+
downloadFile(res.headers.location, dest, options, redirectCount + 1).then(resolve9).catch(reject);
|
|
42377
|
+
return;
|
|
42524
42378
|
}
|
|
42525
|
-
|
|
42526
|
-
|
|
42527
|
-
|
|
42528
|
-
|
|
42529
|
-
} catch {
|
|
42379
|
+
if (res.statusCode !== 200) {
|
|
42380
|
+
return reject(
|
|
42381
|
+
new Error(`Request failed with status code ${res.statusCode}`)
|
|
42382
|
+
);
|
|
42530
42383
|
}
|
|
42531
|
-
|
|
42532
|
-
|
|
42533
|
-
|
|
42384
|
+
const file = fs10.createWriteStream(dest);
|
|
42385
|
+
res.pipe(file);
|
|
42386
|
+
file.on("finish", () => file.close(resolve9));
|
|
42387
|
+
}).on("error", reject);
|
|
42388
|
+
});
|
|
42534
42389
|
}
|
|
42535
42390
|
async function extractFile(file, dest) {
|
|
42536
42391
|
if (file.endsWith(".tar.gz")) {
|
|
@@ -42758,9 +42613,6 @@ async function removeDirectoryWithRetry(path37, options = {}) {
|
|
|
42758
42613
|
}
|
|
42759
42614
|
|
|
42760
42615
|
// packages/cli/src/config/extension-manager.ts
|
|
42761
|
-
var INSTALL_LOCK_SUFFIX = ".lock";
|
|
42762
|
-
var INSTALL_LOCK_STALE_MS = 15e3;
|
|
42763
|
-
var INSTALL_LOCK_RETRIES = { retries: 15, minTimeout: 200, maxTimeout: 500 };
|
|
42764
42616
|
var ExtensionManager = class extends ExtensionLoader {
|
|
42765
42617
|
extensionEnablementManager;
|
|
42766
42618
|
integrityManager;
|
|
@@ -42781,7 +42633,7 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
42781
42633
|
this.telemetryConfig = new Config({
|
|
42782
42634
|
telemetry: options.settings.telemetry,
|
|
42783
42635
|
interactive: false,
|
|
42784
|
-
sessionId:
|
|
42636
|
+
sessionId: randomUUID(),
|
|
42785
42637
|
clientVersion: options.clientVersion ?? "unknown",
|
|
42786
42638
|
targetDir: options.workspaceDir,
|
|
42787
42639
|
cwd: options.workspaceDir,
|
|
@@ -42905,7 +42757,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
42905
42757
|
} else {
|
|
42906
42758
|
throw new Error(`Unsupported install type: ${installMetadata.type}`);
|
|
42907
42759
|
}
|
|
42908
|
-
let releaseLock;
|
|
42909
42760
|
try {
|
|
42910
42761
|
newExtensionConfig = await this.loadExtensionConfig(localSourcePath);
|
|
42911
42762
|
const newExtensionName = newExtensionConfig.name;
|
|
@@ -42954,19 +42805,11 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
42954
42805
|
const destinationPath = new ExtensionStorage(
|
|
42955
42806
|
newExtensionName
|
|
42956
42807
|
).getExtensionDir();
|
|
42957
|
-
|
|
42958
|
-
|
|
42959
|
-
|
|
42960
|
-
|
|
42961
|
-
|
|
42962
|
-
}
|
|
42963
|
-
};
|
|
42964
|
-
assertDestinationIsAvailable();
|
|
42965
|
-
releaseLock = await acquireExtensionInstallLock(
|
|
42966
|
-
destinationPath,
|
|
42967
|
-
newExtensionName
|
|
42968
|
-
);
|
|
42969
|
-
assertDestinationIsAvailable();
|
|
42808
|
+
if ((!isUpdate || newExtensionName !== previousName) && fs12.existsSync(destinationPath)) {
|
|
42809
|
+
throw new Error(
|
|
42810
|
+
`Cannot install extension "${newExtensionName}" because a directory with that name already exists. Please remove it manually.`
|
|
42811
|
+
);
|
|
42812
|
+
}
|
|
42970
42813
|
let previousSettings;
|
|
42971
42814
|
let wasEnabledGlobally = false;
|
|
42972
42815
|
let wasEnabledWorkspace = false;
|
|
@@ -43079,15 +42922,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43079
42922
|
);
|
|
43080
42923
|
}
|
|
43081
42924
|
} finally {
|
|
43082
|
-
if (releaseLock) {
|
|
43083
|
-
try {
|
|
43084
|
-
await releaseLock();
|
|
43085
|
-
} catch (releaseError) {
|
|
43086
|
-
debugLogger.warn(
|
|
43087
|
-
`Failed to release the install lock for extension "${newExtensionConfig?.name}": ${getErrorMessage(releaseError)}`
|
|
43088
|
-
);
|
|
43089
|
-
}
|
|
43090
|
-
}
|
|
43091
42925
|
if (tempDir) {
|
|
43092
42926
|
try {
|
|
43093
42927
|
await removeDirectoryWithRetry(tempDir);
|
|
@@ -43258,9 +43092,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43258
43092
|
* Builds an extension without side effects (does not mutate loadedExtensions or start it).
|
|
43259
43093
|
*/
|
|
43260
43094
|
async _buildExtension(extensionDir) {
|
|
43261
|
-
if (path9.basename(extensionDir).endsWith(INSTALL_LOCK_SUFFIX)) {
|
|
43262
|
-
return null;
|
|
43263
|
-
}
|
|
43264
43095
|
try {
|
|
43265
43096
|
const stats = await fs12.promises.stat(extensionDir);
|
|
43266
43097
|
if (!stats.isDirectory()) {
|
|
@@ -43746,32 +43577,6 @@ async function copyExtension(source2, destination) {
|
|
|
43746
43577
|
await fs12.promises.cp(source2, destination, { recursive: true });
|
|
43747
43578
|
await makeWritableRecursive(destination);
|
|
43748
43579
|
}
|
|
43749
|
-
async function acquireExtensionInstallLock(destinationPath, extensionName) {
|
|
43750
|
-
await fs12.promises.mkdir(path9.dirname(destinationPath), { recursive: true });
|
|
43751
|
-
try {
|
|
43752
|
-
return await (0, import_proper_lockfile.lock)(destinationPath, {
|
|
43753
|
-
// `destinationPath` usually does not exist yet. With `realpath: false`,
|
|
43754
|
-
// proper-lockfile neither resolves nor stats it; it only creates and
|
|
43755
|
-
// checks the `<destinationPath>.lock` directory.
|
|
43756
|
-
realpath: false,
|
|
43757
|
-
stale: INSTALL_LOCK_STALE_MS,
|
|
43758
|
-
retries: INSTALL_LOCK_RETRIES,
|
|
43759
|
-
// The default handler throws from a timer, which would crash the CLI.
|
|
43760
|
-
onCompromised: (error) => {
|
|
43761
|
-
debugLogger.warn(
|
|
43762
|
-
`Lost the install lock for extension "${extensionName}": ${getErrorMessage(error)}`
|
|
43763
|
-
);
|
|
43764
|
-
}
|
|
43765
|
-
});
|
|
43766
|
-
} catch (error) {
|
|
43767
|
-
if (isNodeError(error) && error.code === "ELOCKED") {
|
|
43768
|
-
throw new Error(
|
|
43769
|
-
`Cannot install extension "${extensionName}" because another installation or update of it is already in progress. Please try again later.`
|
|
43770
|
-
);
|
|
43771
|
-
}
|
|
43772
|
-
throw error;
|
|
43773
|
-
}
|
|
43774
|
-
}
|
|
43775
43580
|
function getContextFileNames(config) {
|
|
43776
43581
|
if (!config.contextFileName) {
|
|
43777
43582
|
return ["GEMINI.md"];
|
|
@@ -44876,8 +44681,8 @@ var import_execa = __toESM(require_execa(), 1);
|
|
|
44876
44681
|
|
|
44877
44682
|
// node_modules/crypto-random-string/index.js
|
|
44878
44683
|
import { promisify } from "util";
|
|
44879
|
-
import
|
|
44880
|
-
var randomBytesAsync = promisify(
|
|
44684
|
+
import crypto2 from "crypto";
|
|
44685
|
+
var randomBytesAsync = promisify(crypto2.randomBytes);
|
|
44881
44686
|
var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split("");
|
|
44882
44687
|
var numericCharacters = "0123456789".split("");
|
|
44883
44688
|
var distinguishableCharacters = "CDEHKMPRTUWXY012458".split("");
|
|
@@ -44890,7 +44695,7 @@ var generateForCustomCharacters = (length, characters) => {
|
|
|
44890
44695
|
let string = "";
|
|
44891
44696
|
let stringLength = 0;
|
|
44892
44697
|
while (stringLength < length) {
|
|
44893
|
-
const entropy =
|
|
44698
|
+
const entropy = crypto2.randomBytes(entropyLength);
|
|
44894
44699
|
let entropyPosition = 0;
|
|
44895
44700
|
while (entropyPosition < entropyLength && stringLength < length) {
|
|
44896
44701
|
const entropyValue = entropy.readUInt16LE(entropyPosition);
|
|
@@ -44925,7 +44730,7 @@ var generateForCustomCharactersAsync = async (length, characters) => {
|
|
|
44925
44730
|
}
|
|
44926
44731
|
return string;
|
|
44927
44732
|
};
|
|
44928
|
-
var generateRandomBytes = (byteLength, type, length) =>
|
|
44733
|
+
var generateRandomBytes = (byteLength, type, length) => crypto2.randomBytes(byteLength).toString(type).slice(0, length);
|
|
44929
44734
|
var generateRandomBytesAsync = async (byteLength, type, length) => {
|
|
44930
44735
|
const buffer = await randomBytesAsync(byteLength);
|
|
44931
44736
|
return buffer.toString(type).slice(0, length);
|
|
@@ -53462,7 +53267,6 @@ var _ExpandableText = ({
|
|
|
53462
53267
|
maxWidth = MAX_WIDTH,
|
|
53463
53268
|
maxLines
|
|
53464
53269
|
}) => {
|
|
53465
|
-
const labelCharacters = Array.from(label);
|
|
53466
53270
|
const hasMatch = matchedIndex !== void 0 && matchedIndex >= 0 && matchedIndex < label.length && userInput.length > 0;
|
|
53467
53271
|
if (!hasMatch) {
|
|
53468
53272
|
let display = label;
|
|
@@ -53471,69 +53275,53 @@ var _ExpandableText = ({
|
|
|
53471
53275
|
const lines = label.split("\n");
|
|
53472
53276
|
let truncated = lines.slice(0, maxLines).join("\n");
|
|
53473
53277
|
const hasMoreLines = lines.length > maxLines;
|
|
53474
|
-
|
|
53475
|
-
|
|
53476
|
-
truncated = truncatedCharacters.slice(0, maxWidth).join("") + "...";
|
|
53278
|
+
if (truncated.length > maxWidth) {
|
|
53279
|
+
truncated = truncated.slice(0, maxWidth) + "...";
|
|
53477
53280
|
} else if (hasMoreLines) {
|
|
53478
53281
|
truncated += "...";
|
|
53479
53282
|
}
|
|
53480
53283
|
display = truncated;
|
|
53481
|
-
} else if (
|
|
53482
|
-
display =
|
|
53284
|
+
} else if (label.length > maxWidth) {
|
|
53285
|
+
display = label.slice(0, maxWidth) + "...";
|
|
53483
53286
|
}
|
|
53484
53287
|
}
|
|
53485
53288
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { wrap: "wrap", color: textColor, children: display });
|
|
53486
53289
|
}
|
|
53487
|
-
const
|
|
53488
|
-
let matchedCharacterIndex = 0;
|
|
53489
|
-
let matchedUtf16Index = 0;
|
|
53490
|
-
while (matchedCharacterIndex < labelCharacters.length && matchedUtf16Index < matchedIndex) {
|
|
53491
|
-
matchedUtf16Index += labelCharacters[matchedCharacterIndex].length;
|
|
53492
|
-
matchedCharacterIndex += 1;
|
|
53493
|
-
}
|
|
53290
|
+
const matchLength = userInput.length;
|
|
53494
53291
|
let before = "";
|
|
53495
53292
|
let match = "";
|
|
53496
53293
|
let after = "";
|
|
53497
|
-
if (isExpanded ||
|
|
53498
|
-
before =
|
|
53499
|
-
match =
|
|
53500
|
-
|
|
53501
|
-
|
|
53502
|
-
|
|
53503
|
-
after = labelCharacters.slice(matchedCharacterIndex + matchCharactersLength).join("");
|
|
53504
|
-
} else if (matchCharactersLength >= maxWidth) {
|
|
53505
|
-
match = labelCharacters.slice(matchedCharacterIndex, matchedCharacterIndex + maxWidth - 1).join("") + "...";
|
|
53294
|
+
if (isExpanded || label.length <= maxWidth) {
|
|
53295
|
+
before = label.slice(0, matchedIndex);
|
|
53296
|
+
match = label.slice(matchedIndex, matchedIndex + matchLength);
|
|
53297
|
+
after = label.slice(matchedIndex + matchLength);
|
|
53298
|
+
} else if (matchLength >= maxWidth) {
|
|
53299
|
+
match = label.slice(matchedIndex, matchedIndex + maxWidth - 1) + "...";
|
|
53506
53300
|
} else {
|
|
53507
|
-
const contextSpace = maxWidth -
|
|
53301
|
+
const contextSpace = maxWidth - matchLength;
|
|
53508
53302
|
const beforeSpace = Math.floor(contextSpace / 2);
|
|
53509
53303
|
const afterSpace = Math.ceil(contextSpace / 2);
|
|
53510
|
-
let start =
|
|
53511
|
-
let end =
|
|
53304
|
+
let start = matchedIndex - beforeSpace;
|
|
53305
|
+
let end = matchedIndex + matchLength + afterSpace;
|
|
53512
53306
|
if (start < 0) {
|
|
53513
53307
|
end += -start;
|
|
53514
53308
|
start = 0;
|
|
53515
53309
|
}
|
|
53516
|
-
if (end >
|
|
53517
|
-
start -= end -
|
|
53518
|
-
end =
|
|
53310
|
+
if (end > label.length) {
|
|
53311
|
+
start -= end - label.length;
|
|
53312
|
+
end = label.length;
|
|
53519
53313
|
}
|
|
53520
53314
|
start = Math.max(0, start);
|
|
53521
|
-
const finalMatchIndex =
|
|
53522
|
-
const slicedLabel =
|
|
53523
|
-
|
|
53524
|
-
match = slicedLabel.slice(finalMatchIndex, finalMatchIndex +
|
|
53525
|
-
|
|
53526
|
-
finalMatchIndex + matchCharactersLength
|
|
53527
|
-
);
|
|
53315
|
+
const finalMatchIndex = matchedIndex - start;
|
|
53316
|
+
const slicedLabel = label.slice(start, end);
|
|
53317
|
+
before = slicedLabel.slice(0, finalMatchIndex);
|
|
53318
|
+
match = slicedLabel.slice(finalMatchIndex, finalMatchIndex + matchLength);
|
|
53319
|
+
after = slicedLabel.slice(finalMatchIndex + matchLength);
|
|
53528
53320
|
if (start > 0) {
|
|
53529
|
-
before =
|
|
53530
|
-
} else {
|
|
53531
|
-
before = beforeChars.join("");
|
|
53321
|
+
before = before.length >= 3 ? "..." + before.slice(3) : "...";
|
|
53532
53322
|
}
|
|
53533
|
-
if (end <
|
|
53534
|
-
after =
|
|
53535
|
-
} else {
|
|
53536
|
-
after = afterChars.join("");
|
|
53323
|
+
if (end < label.length) {
|
|
53324
|
+
after = after.length >= 3 ? after.slice(0, -3) + "..." : "...";
|
|
53537
53325
|
}
|
|
53538
53326
|
}
|
|
53539
53327
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: textColor, wrap: "wrap", children: [
|
|
@@ -55243,7 +55031,7 @@ var authCommand = {
|
|
|
55243
55031
|
import process12 from "node:process";
|
|
55244
55032
|
|
|
55245
55033
|
// packages/cli/src/generated/git-commit.ts
|
|
55246
|
-
var GIT_COMMIT_INFO = "
|
|
55034
|
+
var GIT_COMMIT_INFO = "dc6602cec";
|
|
55247
55035
|
|
|
55248
55036
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
55249
55037
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -55293,13 +55081,13 @@ async function exportHistoryToFile(options) {
|
|
|
55293
55081
|
// packages/cli/src/ui/utils/memorySnapshot.ts
|
|
55294
55082
|
import { createWriteStream as createWriteStream3 } from "node:fs";
|
|
55295
55083
|
import { mkdir as mkdir3 } from "node:fs/promises";
|
|
55296
|
-
import { dirname as
|
|
55297
|
-
import { pipeline
|
|
55084
|
+
import { dirname as dirname4 } from "node:path";
|
|
55085
|
+
import { pipeline } from "node:stream/promises";
|
|
55298
55086
|
import { getHeapSnapshot } from "node:v8";
|
|
55299
55087
|
var MEMORY_SNAPSHOT_AUTO_THRESHOLD_BYTES = 2 * 1024 * 1024 * 1024;
|
|
55300
55088
|
async function captureHeapSnapshot(filePath) {
|
|
55301
|
-
await mkdir3(
|
|
55302
|
-
await
|
|
55089
|
+
await mkdir3(dirname4(filePath), { recursive: true });
|
|
55090
|
+
await pipeline(getHeapSnapshot(), createWriteStream3(filePath));
|
|
55303
55091
|
}
|
|
55304
55092
|
|
|
55305
55093
|
// packages/cli/src/ui/commands/bugCommand.ts
|
|
@@ -55877,7 +55665,7 @@ var chatCommand = {
|
|
|
55877
55665
|
};
|
|
55878
55666
|
|
|
55879
55667
|
// packages/cli/src/ui/commands/clearCommand.ts
|
|
55880
|
-
import { randomUUID as
|
|
55668
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
55881
55669
|
var clearCommand = {
|
|
55882
55670
|
name: "clear",
|
|
55883
55671
|
altNames: ["new"],
|
|
@@ -55894,7 +55682,7 @@ var clearCommand = {
|
|
|
55894
55682
|
config?.injectionService.clear();
|
|
55895
55683
|
let newSessionId;
|
|
55896
55684
|
if (config) {
|
|
55897
|
-
newSessionId =
|
|
55685
|
+
newSessionId = randomUUID2();
|
|
55898
55686
|
config.resetNewSessionState(newSessionId);
|
|
55899
55687
|
}
|
|
55900
55688
|
if (geminiClient) {
|
|
@@ -60005,16 +59793,7 @@ async function rewindConversation(context, client, recordingService, messageId,
|
|
|
60005
59793
|
const { uiHistory } = convertSessionToHistoryFormats(conversation.messages);
|
|
60006
59794
|
const clientHistory = convertSessionToClientHistory(conversation.messages);
|
|
60007
59795
|
client.setHistory(clientHistory);
|
|
60008
|
-
|
|
60009
|
-
const config = context.services.agentContext?.config;
|
|
60010
|
-
if (config) {
|
|
60011
|
-
config.getModelAvailabilityService?.()?.reset();
|
|
60012
|
-
const configuredModel = config.getModel?.();
|
|
60013
|
-
if (configuredModel) {
|
|
60014
|
-
config.setActiveModel?.(configuredModel);
|
|
60015
|
-
}
|
|
60016
|
-
await config.getMemoryContextManager()?.refresh();
|
|
60017
|
-
}
|
|
59796
|
+
await context.services.agentContext?.config.getMemoryContextManager()?.refresh();
|
|
60018
59797
|
const startId = 1;
|
|
60019
59798
|
const historyWithIds = uiHistory.map(
|
|
60020
59799
|
(item, idx) => ({
|
|
@@ -61059,7 +60838,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
61059
60838
|
type: "info",
|
|
61060
60839
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
61061
60840
|
});
|
|
61062
|
-
const { MCPOAuthProvider } = await import("./dist-
|
|
60841
|
+
const { MCPOAuthProvider } = await import("./dist-E6RCLXQU.js");
|
|
61063
60842
|
let oauthConfig = server.oauth;
|
|
61064
60843
|
if (!oauthConfig) {
|
|
61065
60844
|
oauthConfig = { enabled: false };
|