@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-IGE3G3WZ.js";
|
|
6
6
|
import {
|
|
7
7
|
AppEvent,
|
|
8
8
|
appEvents
|
|
@@ -69,24 +69,22 @@ import {
|
|
|
69
69
|
use_stdin_default,
|
|
70
70
|
use_stdout_default,
|
|
71
71
|
validateCustomTheme
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-P62CI7AR.js";
|
|
73
73
|
import {
|
|
74
74
|
isDevelopment,
|
|
75
75
|
require_semver
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-M73CYIV5.js";
|
|
77
77
|
import {
|
|
78
78
|
emptyIcon,
|
|
79
79
|
mapCoreStatusToDisplayStatus,
|
|
80
80
|
require_react
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-QTXJG3I3.js";
|
|
82
82
|
import {
|
|
83
83
|
ALL_EDITORS,
|
|
84
84
|
ApprovalMode,
|
|
85
85
|
AsyncFzf,
|
|
86
|
-
AuthType,
|
|
87
86
|
Config,
|
|
88
87
|
CoreEvent,
|
|
89
|
-
CoreToolCallStatus,
|
|
90
88
|
DiscoveredMCPTool,
|
|
91
89
|
ExtensionDisableEvent,
|
|
92
90
|
ExtensionEnableEvent,
|
|
@@ -97,32 +95,21 @@ import {
|
|
|
97
95
|
ExtensionUpdateEvent,
|
|
98
96
|
GEMINI_CLI_COMPANION_EXTENSION_NAME,
|
|
99
97
|
GEMINI_DIR,
|
|
100
|
-
HookType,
|
|
101
|
-
IDEConnectionStatus,
|
|
102
98
|
INITIAL_HISTORY_LENGTH,
|
|
103
99
|
IdeClient,
|
|
104
100
|
IdeConnectionEvent,
|
|
105
|
-
IdeConnectionType,
|
|
106
|
-
IntegrityDataStatus,
|
|
107
101
|
KeychainTokenStorage,
|
|
108
|
-
LlmRole,
|
|
109
|
-
MCPDiscoveryState,
|
|
110
102
|
MCPOAuthTokenStorage,
|
|
111
|
-
MCPServerStatus,
|
|
112
103
|
ModelSlashCommandEvent,
|
|
113
|
-
PolicyDecision,
|
|
114
104
|
ProjectIdRequiredError,
|
|
115
105
|
REFERENCE_CONTENT_END,
|
|
116
106
|
REFERENCE_CONTENT_START,
|
|
117
107
|
ReadManyFilesTool,
|
|
118
108
|
RewindEvent,
|
|
119
109
|
SHELL_TOOL_NAME,
|
|
120
|
-
SessionEndReason,
|
|
121
|
-
SessionStartSource,
|
|
122
110
|
ShellExecutionService,
|
|
123
111
|
StartSessionEvent,
|
|
124
112
|
Storage,
|
|
125
|
-
TrustLevel,
|
|
126
113
|
UPGRADE_URL_PAGE,
|
|
127
114
|
UserAccountManager,
|
|
128
115
|
ValidationRequiredError,
|
|
@@ -232,7 +219,6 @@ import {
|
|
|
232
219
|
require_cross_spawn,
|
|
233
220
|
require_is_stream,
|
|
234
221
|
require_path_key,
|
|
235
|
-
require_proper_lockfile,
|
|
236
222
|
require_pump,
|
|
237
223
|
require_toml,
|
|
238
224
|
resetBrowserSession,
|
|
@@ -253,7 +239,7 @@ import {
|
|
|
253
239
|
uiTelemetryService,
|
|
254
240
|
unescapePath,
|
|
255
241
|
validateUrlDestination
|
|
256
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-LAR4JEC7.js";
|
|
257
243
|
import {
|
|
258
244
|
require_src
|
|
259
245
|
} from "./chunk-L6PII3GR.js";
|
|
@@ -6514,7 +6500,7 @@ var require_extract_zip = __commonJS({
|
|
|
6514
6500
|
var stream = __require("stream");
|
|
6515
6501
|
var yauzl = require_yauzl();
|
|
6516
6502
|
var openZip = promisify5(yauzl.open);
|
|
6517
|
-
var
|
|
6503
|
+
var pipeline2 = promisify5(stream.pipeline);
|
|
6518
6504
|
var Extractor = class {
|
|
6519
6505
|
constructor(zipPath, opts) {
|
|
6520
6506
|
this.zipPath = zipPath;
|
|
@@ -6602,7 +6588,7 @@ var require_extract_zip = __commonJS({
|
|
|
6602
6588
|
debug("creating symlink", link, dest);
|
|
6603
6589
|
await fs33.symlink(link, dest);
|
|
6604
6590
|
} else {
|
|
6605
|
-
await
|
|
6591
|
+
await pipeline2(readStream, createWriteStream5(dest, { mode: procMode }));
|
|
6606
6592
|
}
|
|
6607
6593
|
}
|
|
6608
6594
|
getExtractedMode(entryMode, isDir) {
|
|
@@ -15338,11 +15324,11 @@ var require_util4 = __commonJS({
|
|
|
15338
15324
|
var { isUint8Array } = __require("node:util/types");
|
|
15339
15325
|
var { webidl } = require_webidl();
|
|
15340
15326
|
var supportedHashes = [];
|
|
15341
|
-
var
|
|
15327
|
+
var crypto3;
|
|
15342
15328
|
try {
|
|
15343
|
-
|
|
15329
|
+
crypto3 = __require("node:crypto");
|
|
15344
15330
|
const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
|
|
15345
|
-
supportedHashes =
|
|
15331
|
+
supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
|
|
15346
15332
|
} catch {
|
|
15347
15333
|
}
|
|
15348
15334
|
function responseURL(response) {
|
|
@@ -15645,7 +15631,7 @@ var require_util4 = __commonJS({
|
|
|
15645
15631
|
return isOriginPotentiallyTrustworthy(url.origin);
|
|
15646
15632
|
}
|
|
15647
15633
|
function bytesMatch(bytes, metadataList) {
|
|
15648
|
-
if (
|
|
15634
|
+
if (crypto3 === void 0) {
|
|
15649
15635
|
return true;
|
|
15650
15636
|
}
|
|
15651
15637
|
const parsedMetadata = parseMetadata(metadataList);
|
|
@@ -15660,7 +15646,7 @@ var require_util4 = __commonJS({
|
|
|
15660
15646
|
for (const item of metadata) {
|
|
15661
15647
|
const algorithm = item.algo;
|
|
15662
15648
|
const expectedValue = item.hash;
|
|
15663
|
-
let actualValue =
|
|
15649
|
+
let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64");
|
|
15664
15650
|
if (actualValue[actualValue.length - 1] === "=") {
|
|
15665
15651
|
if (actualValue[actualValue.length - 2] === "=") {
|
|
15666
15652
|
actualValue = actualValue.slice(0, -2);
|
|
@@ -16678,8 +16664,8 @@ var require_body = __commonJS({
|
|
|
16678
16664
|
var { multipartFormDataParser } = require_formdata_parser();
|
|
16679
16665
|
var random;
|
|
16680
16666
|
try {
|
|
16681
|
-
const
|
|
16682
|
-
random = (max) =>
|
|
16667
|
+
const crypto3 = __require("node:crypto");
|
|
16668
|
+
random = (max) => crypto3.randomInt(0, max);
|
|
16683
16669
|
} catch {
|
|
16684
16670
|
random = (max) => Math.floor(Math.random() * max);
|
|
16685
16671
|
}
|
|
@@ -18130,7 +18116,7 @@ var require_client_h2 = __commonJS({
|
|
|
18130
18116
|
"packages/cli/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module) {
|
|
18131
18117
|
"use strict";
|
|
18132
18118
|
var assert = __require("node:assert");
|
|
18133
|
-
var { pipeline:
|
|
18119
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
18134
18120
|
var util2 = require_util3();
|
|
18135
18121
|
var {
|
|
18136
18122
|
RequestContentLengthMismatchError,
|
|
@@ -18625,7 +18611,7 @@ var require_client_h2 = __commonJS({
|
|
|
18625
18611
|
}
|
|
18626
18612
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
|
|
18627
18613
|
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
18628
|
-
const pipe =
|
|
18614
|
+
const pipe = pipeline2(
|
|
18629
18615
|
body,
|
|
18630
18616
|
h2stream,
|
|
18631
18617
|
(err) => {
|
|
@@ -21519,7 +21505,7 @@ var require_api_pipeline = __commonJS({
|
|
|
21519
21505
|
util2.destroy(ret, err);
|
|
21520
21506
|
}
|
|
21521
21507
|
};
|
|
21522
|
-
function
|
|
21508
|
+
function pipeline2(opts, handler2) {
|
|
21523
21509
|
try {
|
|
21524
21510
|
const pipelineHandler = new PipelineHandler(opts, handler2);
|
|
21525
21511
|
this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
|
|
@@ -21528,7 +21514,7 @@ var require_api_pipeline = __commonJS({
|
|
|
21528
21514
|
return new PassThrough().destroy(err);
|
|
21529
21515
|
}
|
|
21530
21516
|
}
|
|
21531
|
-
module.exports =
|
|
21517
|
+
module.exports = pipeline2;
|
|
21532
21518
|
}
|
|
21533
21519
|
});
|
|
21534
21520
|
|
|
@@ -26944,7 +26930,7 @@ var require_fetch = __commonJS({
|
|
|
26944
26930
|
subresourceSet
|
|
26945
26931
|
} = require_constants3();
|
|
26946
26932
|
var EE = __require("node:events");
|
|
26947
|
-
var { Readable, pipeline:
|
|
26933
|
+
var { Readable, pipeline: pipeline2, finished, isErrored, isReadable } = __require("node:stream");
|
|
26948
26934
|
var { addAbortListener, bufferToLowerCasedHeaderName } = require_util3();
|
|
26949
26935
|
var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
|
|
26950
26936
|
var { getGlobalDispatcher } = require_global2();
|
|
@@ -27887,7 +27873,7 @@ var require_fetch = __commonJS({
|
|
|
27887
27873
|
status,
|
|
27888
27874
|
statusText,
|
|
27889
27875
|
headersList,
|
|
27890
|
-
body: decoders.length ?
|
|
27876
|
+
body: decoders.length ? pipeline2(this.body, ...decoders, (err) => {
|
|
27891
27877
|
if (err) {
|
|
27892
27878
|
this.onError(err);
|
|
27893
27879
|
}
|
|
@@ -29596,13 +29582,13 @@ var require_frame = __commonJS({
|
|
|
29596
29582
|
"use strict";
|
|
29597
29583
|
var { maxUnsigned16Bit, opcodes } = require_constants5();
|
|
29598
29584
|
var BUFFER_SIZE = 8 * 1024;
|
|
29599
|
-
var
|
|
29585
|
+
var crypto3;
|
|
29600
29586
|
var buffer = null;
|
|
29601
29587
|
var bufIdx = BUFFER_SIZE;
|
|
29602
29588
|
try {
|
|
29603
|
-
|
|
29589
|
+
crypto3 = __require("node:crypto");
|
|
29604
29590
|
} catch {
|
|
29605
|
-
|
|
29591
|
+
crypto3 = {
|
|
29606
29592
|
// not full compatibility, but minimum.
|
|
29607
29593
|
randomFillSync: function randomFillSync(buffer2, _offset, _size) {
|
|
29608
29594
|
for (let i = 0; i < buffer2.length; ++i) {
|
|
@@ -29615,7 +29601,7 @@ var require_frame = __commonJS({
|
|
|
29615
29601
|
function generateMask() {
|
|
29616
29602
|
if (bufIdx === BUFFER_SIZE) {
|
|
29617
29603
|
bufIdx = 0;
|
|
29618
|
-
|
|
29604
|
+
crypto3.randomFillSync(buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
|
|
29619
29605
|
}
|
|
29620
29606
|
return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
|
|
29621
29607
|
}
|
|
@@ -29713,9 +29699,9 @@ var require_connection = __commonJS({
|
|
|
29713
29699
|
var { getDecodeSplit } = require_util4();
|
|
29714
29700
|
var { WebsocketFrameSend } = require_frame();
|
|
29715
29701
|
var assert = __require("node:assert");
|
|
29716
|
-
var
|
|
29702
|
+
var crypto3;
|
|
29717
29703
|
try {
|
|
29718
|
-
|
|
29704
|
+
crypto3 = __require("node:crypto");
|
|
29719
29705
|
} catch {
|
|
29720
29706
|
}
|
|
29721
29707
|
function establishWebSocketConnection(url, protocols, client, handler2, options) {
|
|
@@ -29735,7 +29721,7 @@ var require_connection = __commonJS({
|
|
|
29735
29721
|
const headersList = getHeadersList(new Headers(options.headers));
|
|
29736
29722
|
request.headersList = headersList;
|
|
29737
29723
|
}
|
|
29738
|
-
const keyValue =
|
|
29724
|
+
const keyValue = crypto3.randomBytes(16).toString("base64");
|
|
29739
29725
|
request.headersList.append("sec-websocket-key", keyValue, true);
|
|
29740
29726
|
request.headersList.append("sec-websocket-version", "13", true);
|
|
29741
29727
|
for (const protocol of protocols) {
|
|
@@ -29768,7 +29754,7 @@ var require_connection = __commonJS({
|
|
|
29768
29754
|
return;
|
|
29769
29755
|
}
|
|
29770
29756
|
const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
|
|
29771
|
-
const digest =
|
|
29757
|
+
const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64");
|
|
29772
29758
|
if (secWSAccept !== digest) {
|
|
29773
29759
|
failWebsocketConnection(handler2, 1002, "Incorrect hash received in Sec-WebSocket-Accept header.");
|
|
29774
29760
|
return;
|
|
@@ -31380,7 +31366,7 @@ ${value}`;
|
|
|
31380
31366
|
var require_eventsource = __commonJS({
|
|
31381
31367
|
"packages/cli/node_modules/undici/lib/web/eventsource/eventsource.js"(exports, module) {
|
|
31382
31368
|
"use strict";
|
|
31383
|
-
var { pipeline:
|
|
31369
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
31384
31370
|
var { fetching } = require_fetch();
|
|
31385
31371
|
var { makeRequest } = require_request2();
|
|
31386
31372
|
var { webidl } = require_webidl();
|
|
@@ -31541,7 +31527,7 @@ var require_eventsource = __commonJS({
|
|
|
31541
31527
|
));
|
|
31542
31528
|
}
|
|
31543
31529
|
});
|
|
31544
|
-
|
|
31530
|
+
pipeline2(
|
|
31545
31531
|
response.body.stream,
|
|
31546
31532
|
eventSourceStream,
|
|
31547
31533
|
(error) => {
|
|
@@ -37261,7 +37247,7 @@ var import_react8 = __toESM(require_react(), 1);
|
|
|
37261
37247
|
function useIdeTrustListener() {
|
|
37262
37248
|
const settings = useSettings();
|
|
37263
37249
|
const [connectionStatus, setConnectionStatus] = (0, import_react8.useState)(
|
|
37264
|
-
|
|
37250
|
+
"disconnected" /* Disconnected */
|
|
37265
37251
|
);
|
|
37266
37252
|
const previousTrust = (0, import_react8.useRef)(void 0);
|
|
37267
37253
|
const [restartReason, setRestartReason] = (0, import_react8.useState)("NONE");
|
|
@@ -37291,7 +37277,7 @@ function useIdeTrustListener() {
|
|
|
37291
37277
|
};
|
|
37292
37278
|
}, []);
|
|
37293
37279
|
const getSnapshot = () => {
|
|
37294
|
-
if (connectionStatus !==
|
|
37280
|
+
if (connectionStatus !== "connected" /* Connected */) {
|
|
37295
37281
|
return void 0;
|
|
37296
37282
|
}
|
|
37297
37283
|
return ideContextStore.get()?.workspaceState?.isTrusted;
|
|
@@ -37996,7 +37982,7 @@ async function initializeApp(config, settings) {
|
|
|
37996
37982
|
await ideClient.connect();
|
|
37997
37983
|
logIdeConnection(
|
|
37998
37984
|
config,
|
|
37999
|
-
new IdeConnectionEvent(
|
|
37985
|
+
new IdeConnectionEvent("start" /* START */)
|
|
38000
37986
|
);
|
|
38001
37987
|
}).catch((e) => {
|
|
38002
37988
|
debugLogger.error("Failed to initialize IDE client:", e);
|
|
@@ -38014,17 +38000,17 @@ async function initializeApp(config, settings) {
|
|
|
38014
38000
|
// packages/cli/src/config/auth.ts
|
|
38015
38001
|
async function validateAuthMethod(authMethod) {
|
|
38016
38002
|
loadEnvironment(loadSettings().merged, process.cwd());
|
|
38017
|
-
if (authMethod ===
|
|
38003
|
+
if (authMethod === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authMethod === "compute-default-credentials" /* COMPUTE_ADC */) {
|
|
38018
38004
|
return null;
|
|
38019
38005
|
}
|
|
38020
|
-
if (authMethod ===
|
|
38006
|
+
if (authMethod === "gemini-api-key" /* USE_GEMINI */) {
|
|
38021
38007
|
const key = process.env["GEMINI_API_KEY"] || await loadApiKey();
|
|
38022
38008
|
if (!key) {
|
|
38023
38009
|
return "When using Gemini API, you must specify the GEMINI_API_KEY environment variable.\nUpdate your environment and try again (no reload needed if using .env)!";
|
|
38024
38010
|
}
|
|
38025
38011
|
return null;
|
|
38026
38012
|
}
|
|
38027
|
-
if (authMethod ===
|
|
38013
|
+
if (authMethod === "vertex-ai" /* USE_VERTEX_AI */) {
|
|
38028
38014
|
const hasVertexProjectLocationConfig = !!process.env["GOOGLE_CLOUD_PROJECT"] && !!process.env["GOOGLE_CLOUD_LOCATION"];
|
|
38029
38015
|
const hasGoogleApiKey = !!process.env["GOOGLE_API_KEY"];
|
|
38030
38016
|
if (!hasVertexProjectLocationConfig && !hasGoogleApiKey) {
|
|
@@ -38675,7 +38661,6 @@ async function getMissingSettings(extensionConfig, extensionId, workspaceDir) {
|
|
|
38675
38661
|
|
|
38676
38662
|
// packages/cli/src/config/extension-manager.ts
|
|
38677
38663
|
var import_chalk2 = __toESM(require_source(), 1);
|
|
38678
|
-
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
38679
38664
|
import * as fs12 from "node:fs";
|
|
38680
38665
|
import * as path9 from "node:path";
|
|
38681
38666
|
import { stat } from "node:fs/promises";
|
|
@@ -38847,7 +38832,7 @@ var ExtensionEnablementManager = class {
|
|
|
38847
38832
|
};
|
|
38848
38833
|
|
|
38849
38834
|
// packages/cli/src/config/extension-manager.ts
|
|
38850
|
-
import { createHash as createHash2, randomUUID
|
|
38835
|
+
import { createHash as createHash2, randomUUID } from "node:crypto";
|
|
38851
38836
|
|
|
38852
38837
|
// packages/cli/src/config/extension.ts
|
|
38853
38838
|
import * as fs8 from "node:fs";
|
|
@@ -38944,12 +38929,10 @@ function extensionUpdatesReducer(state, action) {
|
|
|
38944
38929
|
}
|
|
38945
38930
|
|
|
38946
38931
|
// packages/cli/src/config/extensions/github.ts
|
|
38947
|
-
import * as crypto2 from "node:crypto";
|
|
38948
38932
|
import * as os3 from "node:os";
|
|
38949
38933
|
import * as https2 from "node:https";
|
|
38950
38934
|
import * as fs10 from "node:fs";
|
|
38951
38935
|
import * as path8 from "node:path";
|
|
38952
|
-
import { pipeline } from "node:stream/promises";
|
|
38953
38936
|
|
|
38954
38937
|
// packages/cli/node_modules/tar/dist/esm/index.min.js
|
|
38955
38938
|
import Hr from "events";
|
|
@@ -41864,14 +41847,6 @@ import * as https from "node:https";
|
|
|
41864
41847
|
function getGitHubToken() {
|
|
41865
41848
|
return process.env["GITHUB_TOKEN"] || void 0;
|
|
41866
41849
|
}
|
|
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
41850
|
var lookupPublicAddress = (hostname, options, callback) => safeLookup(
|
|
41876
41851
|
hostname,
|
|
41877
41852
|
{
|
|
@@ -41881,7 +41856,6 @@ var lookupPublicAddress = (hostname, options, callback) => safeLookup(
|
|
|
41881
41856
|
callback
|
|
41882
41857
|
);
|
|
41883
41858
|
var REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
41884
|
-
var REQUEST_TIMEOUT_MS = 3e4;
|
|
41885
41859
|
async function fetchJson(url, redirectCount = 0) {
|
|
41886
41860
|
if (!await validateUrlDestination(url)) {
|
|
41887
41861
|
throw new Error(`Access to blocked or private host ${url} is not allowed.`);
|
|
@@ -41890,8 +41864,14 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
41890
41864
|
"User-Agent": "gemini-cli"
|
|
41891
41865
|
};
|
|
41892
41866
|
const token = getGitHubToken();
|
|
41893
|
-
if (token
|
|
41894
|
-
|
|
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
|
+
}
|
|
41895
41875
|
}
|
|
41896
41876
|
return new Promise((resolve9, reject) => {
|
|
41897
41877
|
let settled = false;
|
|
@@ -41916,7 +41896,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
41916
41896
|
const requestOptions = {
|
|
41917
41897
|
headers,
|
|
41918
41898
|
lookup: lookupPublicAddress,
|
|
41919
|
-
timeout:
|
|
41899
|
+
timeout: 3e4
|
|
41920
41900
|
};
|
|
41921
41901
|
const req = https.get(url, requestOptions, (res) => {
|
|
41922
41902
|
res.on(
|
|
@@ -42009,9 +41989,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
42009
41989
|
});
|
|
42010
41990
|
req.on("error", (error) => failUnlessRedirecting(() => error));
|
|
42011
41991
|
req.on("timeout", () => {
|
|
42012
|
-
failUnlessRedirecting(
|
|
42013
|
-
() => new Error(`Request timed out after ${REQUEST_TIMEOUT_MS}ms`)
|
|
42014
|
-
);
|
|
41992
|
+
failUnlessRedirecting(() => new Error("Request timed out after 30000ms"));
|
|
42015
41993
|
req.destroy();
|
|
42016
41994
|
});
|
|
42017
41995
|
});
|
|
@@ -42081,7 +42059,7 @@ function tryParseGithubUrl(source2) {
|
|
|
42081
42059
|
);
|
|
42082
42060
|
}
|
|
42083
42061
|
const owner = parts[0];
|
|
42084
|
-
const repo = parts[1].replace(
|
|
42062
|
+
const repo = parts[1].replace(".git", "");
|
|
42085
42063
|
return {
|
|
42086
42064
|
owner,
|
|
42087
42065
|
repo
|
|
@@ -42362,175 +42340,39 @@ function findReleaseAsset(assets) {
|
|
|
42362
42340
|
return void 0;
|
|
42363
42341
|
}
|
|
42364
42342
|
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
42343
|
const headers = {
|
|
42385
42344
|
"User-agent": "gemini-cli",
|
|
42386
42345
|
Accept: "application/octet-stream",
|
|
42387
42346
|
...options?.headers
|
|
42388
42347
|
};
|
|
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
42348
|
const token = getGitHubToken();
|
|
42398
|
-
if (token
|
|
42349
|
+
if (token) {
|
|
42399
42350
|
headers["Authorization"] = `token ${token}`;
|
|
42400
42351
|
}
|
|
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;
|
|
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"));
|
|
42502
42357
|
}
|
|
42503
|
-
|
|
42504
|
-
|
|
42505
|
-
|
|
42506
|
-
req.on("timeout", () => {
|
|
42507
|
-
if (!isRedirecting) {
|
|
42508
|
-
settleReject(
|
|
42509
|
-
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")
|
|
42510
42361
|
);
|
|
42511
|
-
responseStream?.destroy?.();
|
|
42512
42362
|
}
|
|
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 {
|
|
42363
|
+
downloadFile(res.headers.location, dest, options, redirectCount + 1).then(resolve9).catch(reject);
|
|
42364
|
+
return;
|
|
42524
42365
|
}
|
|
42525
|
-
|
|
42526
|
-
|
|
42527
|
-
|
|
42528
|
-
|
|
42529
|
-
} catch {
|
|
42366
|
+
if (res.statusCode !== 200) {
|
|
42367
|
+
return reject(
|
|
42368
|
+
new Error(`Request failed with status code ${res.statusCode}`)
|
|
42369
|
+
);
|
|
42530
42370
|
}
|
|
42531
|
-
|
|
42532
|
-
|
|
42533
|
-
|
|
42371
|
+
const file = fs10.createWriteStream(dest);
|
|
42372
|
+
res.pipe(file);
|
|
42373
|
+
file.on("finish", () => file.close(resolve9));
|
|
42374
|
+
}).on("error", reject);
|
|
42375
|
+
});
|
|
42534
42376
|
}
|
|
42535
42377
|
async function extractFile(file, dest) {
|
|
42536
42378
|
if (file.endsWith(".tar.gz")) {
|
|
@@ -42758,9 +42600,6 @@ async function removeDirectoryWithRetry(path37, options = {}) {
|
|
|
42758
42600
|
}
|
|
42759
42601
|
|
|
42760
42602
|
// 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
42603
|
var ExtensionManager = class extends ExtensionLoader {
|
|
42765
42604
|
extensionEnablementManager;
|
|
42766
42605
|
integrityManager;
|
|
@@ -42781,7 +42620,7 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
42781
42620
|
this.telemetryConfig = new Config({
|
|
42782
42621
|
telemetry: options.settings.telemetry,
|
|
42783
42622
|
interactive: false,
|
|
42784
|
-
sessionId:
|
|
42623
|
+
sessionId: randomUUID(),
|
|
42785
42624
|
clientVersion: options.clientVersion ?? "unknown",
|
|
42786
42625
|
targetDir: options.workspaceDir,
|
|
42787
42626
|
cwd: options.workspaceDir,
|
|
@@ -42852,7 +42691,7 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
42852
42691
|
const trustedFolders = loadTrustedFolders();
|
|
42853
42692
|
await trustedFolders.setValue(
|
|
42854
42693
|
this.workspaceDir,
|
|
42855
|
-
|
|
42694
|
+
"TRUST_FOLDER" /* TRUST_FOLDER */
|
|
42856
42695
|
);
|
|
42857
42696
|
} else {
|
|
42858
42697
|
throw new Error(
|
|
@@ -42905,7 +42744,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
42905
42744
|
} else {
|
|
42906
42745
|
throw new Error(`Unsupported install type: ${installMetadata.type}`);
|
|
42907
42746
|
}
|
|
42908
|
-
let releaseLock;
|
|
42909
42747
|
try {
|
|
42910
42748
|
newExtensionConfig = await this.loadExtensionConfig(localSourcePath);
|
|
42911
42749
|
const newExtensionName = newExtensionConfig.name;
|
|
@@ -42954,19 +42792,11 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
42954
42792
|
const destinationPath = new ExtensionStorage(
|
|
42955
42793
|
newExtensionName
|
|
42956
42794
|
).getExtensionDir();
|
|
42957
|
-
|
|
42958
|
-
|
|
42959
|
-
|
|
42960
|
-
|
|
42961
|
-
|
|
42962
|
-
}
|
|
42963
|
-
};
|
|
42964
|
-
assertDestinationIsAvailable();
|
|
42965
|
-
releaseLock = await acquireExtensionInstallLock(
|
|
42966
|
-
destinationPath,
|
|
42967
|
-
newExtensionName
|
|
42968
|
-
);
|
|
42969
|
-
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
|
+
}
|
|
42970
42800
|
let previousSettings;
|
|
42971
42801
|
let wasEnabledGlobally = false;
|
|
42972
42802
|
let wasEnabledWorkspace = false;
|
|
@@ -43047,7 +42877,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43047
42877
|
newExtensionConfig.version,
|
|
43048
42878
|
previousExtensionConfig.version,
|
|
43049
42879
|
installMetadata.type,
|
|
43050
|
-
|
|
42880
|
+
"success" /* Success */
|
|
43051
42881
|
)
|
|
43052
42882
|
);
|
|
43053
42883
|
if (newExtensionName !== previousName) {
|
|
@@ -43070,7 +42900,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43070
42900
|
getExtensionId(newExtensionConfig, installMetadata),
|
|
43071
42901
|
newExtensionConfig.version,
|
|
43072
42902
|
installMetadata.type,
|
|
43073
|
-
|
|
42903
|
+
"success" /* Success */
|
|
43074
42904
|
)
|
|
43075
42905
|
);
|
|
43076
42906
|
await this.enableExtension(
|
|
@@ -43079,15 +42909,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43079
42909
|
);
|
|
43080
42910
|
}
|
|
43081
42911
|
} 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
42912
|
if (tempDir) {
|
|
43092
42913
|
try {
|
|
43093
42914
|
await removeDirectoryWithRetry(tempDir);
|
|
@@ -43118,7 +42939,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43118
42939
|
newExtensionConfig?.version ?? "",
|
|
43119
42940
|
previousExtensionConfig.version,
|
|
43120
42941
|
installMetadata.type,
|
|
43121
|
-
|
|
42942
|
+
"error" /* Error */
|
|
43122
42943
|
)
|
|
43123
42944
|
);
|
|
43124
42945
|
} else {
|
|
@@ -43130,7 +42951,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43130
42951
|
extensionId ?? "",
|
|
43131
42952
|
newExtensionConfig?.version ?? "",
|
|
43132
42953
|
installMetadata.type,
|
|
43133
|
-
|
|
42954
|
+
"error" /* Error */
|
|
43134
42955
|
)
|
|
43135
42956
|
);
|
|
43136
42957
|
}
|
|
@@ -43158,7 +42979,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43158
42979
|
extension.name,
|
|
43159
42980
|
hashValue(extension.name),
|
|
43160
42981
|
extension.id,
|
|
43161
|
-
|
|
42982
|
+
"success" /* Success */
|
|
43162
42983
|
)
|
|
43163
42984
|
);
|
|
43164
42985
|
}
|
|
@@ -43258,9 +43079,6 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43258
43079
|
* Builds an extension without side effects (does not mutate loadedExtensions or start it).
|
|
43259
43080
|
*/
|
|
43260
43081
|
async _buildExtension(extensionDir) {
|
|
43261
|
-
if (path9.basename(extensionDir).endsWith(INSTALL_LOCK_SUFFIX)) {
|
|
43262
|
-
return null;
|
|
43263
|
-
}
|
|
43264
43082
|
try {
|
|
43265
43083
|
const stats = await fs12.promises.stat(extensionDir);
|
|
43266
43084
|
if (!stats.isDirectory()) {
|
|
@@ -43424,7 +43242,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
43424
43242
|
if (eventHooks) {
|
|
43425
43243
|
for (const definition of eventHooks) {
|
|
43426
43244
|
for (const hook of definition.hooks) {
|
|
43427
|
-
if (hook.type ===
|
|
43245
|
+
if (hook.type === "command" /* Command */) {
|
|
43428
43246
|
hook.env = { ...hook.env, ...hookEnv };
|
|
43429
43247
|
}
|
|
43430
43248
|
}
|
|
@@ -43746,32 +43564,6 @@ async function copyExtension(source2, destination) {
|
|
|
43746
43564
|
await fs12.promises.cp(source2, destination, { recursive: true });
|
|
43747
43565
|
await makeWritableRecursive(destination);
|
|
43748
43566
|
}
|
|
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
43567
|
function getContextFileNames(config) {
|
|
43776
43568
|
if (!config.contextFileName) {
|
|
43777
43569
|
return ["GEMINI.md"];
|
|
@@ -44587,7 +44379,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
44587
44379
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
44588
44380
|
name: `resources/read (${resource.serverName})`,
|
|
44589
44381
|
description: resource.uri,
|
|
44590
|
-
status:
|
|
44382
|
+
status: "success" /* Success */,
|
|
44591
44383
|
isClientInitiated: true,
|
|
44592
44384
|
resultDisplay: `Successfully read resource ${resource.uri}`,
|
|
44593
44385
|
confirmationDetails: void 0
|
|
@@ -44602,7 +44394,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
44602
44394
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
44603
44395
|
name: `resources/read (${resource.serverName})`,
|
|
44604
44396
|
description: resource.uri,
|
|
44605
|
-
status:
|
|
44397
|
+
status: "error" /* Error */,
|
|
44606
44398
|
isClientInitiated: true,
|
|
44607
44399
|
resultDisplay: `Error reading resource ${resource.uri}: ${getErrorMessage(error)}`,
|
|
44608
44400
|
confirmationDetails: void 0
|
|
@@ -44627,7 +44419,7 @@ Content from @${result.uri}:
|
|
|
44627
44419
|
}
|
|
44628
44420
|
if (hasError) {
|
|
44629
44421
|
const firstError = displays.find(
|
|
44630
|
-
(d) => d.status ===
|
|
44422
|
+
(d) => d.status === "error" /* Error */
|
|
44631
44423
|
);
|
|
44632
44424
|
return {
|
|
44633
44425
|
parts: [],
|
|
@@ -44666,7 +44458,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
|
|
|
44666
44458
|
callId: `client-read-${userMessageTimestamp}`,
|
|
44667
44459
|
name: readManyFilesTool.displayName,
|
|
44668
44460
|
description: invocation.getDescription(),
|
|
44669
|
-
status:
|
|
44461
|
+
status: "success" /* Success */,
|
|
44670
44462
|
isClientInitiated: true,
|
|
44671
44463
|
resultDisplay: result.returnDisplay || `Successfully read: ${fileLabelsForDisplay.join(", ")}`,
|
|
44672
44464
|
confirmationDetails: void 0
|
|
@@ -44713,7 +44505,7 @@ Content from @${displayPath}:
|
|
|
44713
44505
|
callId: `client-read-${userMessageTimestamp}`,
|
|
44714
44506
|
name: readManyFilesTool.displayName,
|
|
44715
44507
|
description: invocation?.getDescription() ?? "Error attempting to execute tool to read files",
|
|
44716
|
-
status:
|
|
44508
|
+
status: "error" /* Error */,
|
|
44717
44509
|
isClientInitiated: true,
|
|
44718
44510
|
resultDisplay: `Error reading files (${fileLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
|
|
44719
44511
|
confirmationDetails: void 0
|
|
@@ -44876,8 +44668,8 @@ var import_execa = __toESM(require_execa(), 1);
|
|
|
44876
44668
|
|
|
44877
44669
|
// node_modules/crypto-random-string/index.js
|
|
44878
44670
|
import { promisify } from "util";
|
|
44879
|
-
import
|
|
44880
|
-
var randomBytesAsync = promisify(
|
|
44671
|
+
import crypto2 from "crypto";
|
|
44672
|
+
var randomBytesAsync = promisify(crypto2.randomBytes);
|
|
44881
44673
|
var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split("");
|
|
44882
44674
|
var numericCharacters = "0123456789".split("");
|
|
44883
44675
|
var distinguishableCharacters = "CDEHKMPRTUWXY012458".split("");
|
|
@@ -44890,7 +44682,7 @@ var generateForCustomCharacters = (length, characters) => {
|
|
|
44890
44682
|
let string = "";
|
|
44891
44683
|
let stringLength = 0;
|
|
44892
44684
|
while (stringLength < length) {
|
|
44893
|
-
const entropy =
|
|
44685
|
+
const entropy = crypto2.randomBytes(entropyLength);
|
|
44894
44686
|
let entropyPosition = 0;
|
|
44895
44687
|
while (entropyPosition < entropyLength && stringLength < length) {
|
|
44896
44688
|
const entropyValue = entropy.readUInt16LE(entropyPosition);
|
|
@@ -44925,7 +44717,7 @@ var generateForCustomCharactersAsync = async (length, characters) => {
|
|
|
44925
44717
|
}
|
|
44926
44718
|
return string;
|
|
44927
44719
|
};
|
|
44928
|
-
var generateRandomBytes = (byteLength, type, length) =>
|
|
44720
|
+
var generateRandomBytes = (byteLength, type, length) => crypto2.randomBytes(byteLength).toString(type).slice(0, length);
|
|
44929
44721
|
var generateRandomBytesAsync = async (byteLength, type, length) => {
|
|
44930
44722
|
const buffer = await randomBytesAsync(byteLength);
|
|
44931
44723
|
return buffer.toString(type).slice(0, length);
|
|
@@ -47980,7 +47772,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
47980
47772
|
if (wasRaw) {
|
|
47981
47773
|
setRawMode?.(true);
|
|
47982
47774
|
}
|
|
47983
|
-
coreEvents.emit(
|
|
47775
|
+
coreEvents.emit("external-editor-closed" /* ExternalEditorClosed */);
|
|
47984
47776
|
}
|
|
47985
47777
|
}
|
|
47986
47778
|
|
|
@@ -50674,7 +50466,7 @@ async function updateExtension(extension, extensionManager, currentState, dispat
|
|
|
50674
50466
|
extension.name,
|
|
50675
50467
|
installMetadata
|
|
50676
50468
|
);
|
|
50677
|
-
if (status ===
|
|
50469
|
+
if (status === "invalid" /* INVALID */) {
|
|
50678
50470
|
throw new Error("Extension integrity cannot be verified");
|
|
50679
50471
|
}
|
|
50680
50472
|
} catch (e) {
|
|
@@ -52170,11 +51962,11 @@ var ShellProcessor = class {
|
|
|
52170
51962
|
},
|
|
52171
51963
|
void 0
|
|
52172
51964
|
);
|
|
52173
|
-
if (decision ===
|
|
51965
|
+
if (decision === "deny" /* DENY */) {
|
|
52174
51966
|
throw new Error(
|
|
52175
51967
|
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
52176
51968
|
);
|
|
52177
|
-
} else if (decision ===
|
|
51969
|
+
} else if (decision === "ask_user" /* ASK_USER */) {
|
|
52178
51970
|
commandsToConfirm.add(command);
|
|
52179
51971
|
}
|
|
52180
51972
|
}
|
|
@@ -53304,7 +53096,7 @@ var MultiFolderTrustDialog = ({
|
|
|
53304
53096
|
if (choice === 1 /* YES_AND_REMEMBER */) {
|
|
53305
53097
|
await trustedFolders.setValue(
|
|
53306
53098
|
expandedPath,
|
|
53307
|
-
|
|
53099
|
+
"TRUST_FOLDER" /* TRUST_FOLDER */
|
|
53308
53100
|
);
|
|
53309
53101
|
}
|
|
53310
53102
|
workspaceContext.addDirectory(expandedPath);
|
|
@@ -53462,7 +53254,6 @@ var _ExpandableText = ({
|
|
|
53462
53254
|
maxWidth = MAX_WIDTH,
|
|
53463
53255
|
maxLines
|
|
53464
53256
|
}) => {
|
|
53465
|
-
const labelCharacters = Array.from(label);
|
|
53466
53257
|
const hasMatch = matchedIndex !== void 0 && matchedIndex >= 0 && matchedIndex < label.length && userInput.length > 0;
|
|
53467
53258
|
if (!hasMatch) {
|
|
53468
53259
|
let display = label;
|
|
@@ -53471,69 +53262,53 @@ var _ExpandableText = ({
|
|
|
53471
53262
|
const lines = label.split("\n");
|
|
53472
53263
|
let truncated = lines.slice(0, maxLines).join("\n");
|
|
53473
53264
|
const hasMoreLines = lines.length > maxLines;
|
|
53474
|
-
|
|
53475
|
-
|
|
53476
|
-
truncated = truncatedCharacters.slice(0, maxWidth).join("") + "...";
|
|
53265
|
+
if (truncated.length > maxWidth) {
|
|
53266
|
+
truncated = truncated.slice(0, maxWidth) + "...";
|
|
53477
53267
|
} else if (hasMoreLines) {
|
|
53478
53268
|
truncated += "...";
|
|
53479
53269
|
}
|
|
53480
53270
|
display = truncated;
|
|
53481
|
-
} else if (
|
|
53482
|
-
display =
|
|
53271
|
+
} else if (label.length > maxWidth) {
|
|
53272
|
+
display = label.slice(0, maxWidth) + "...";
|
|
53483
53273
|
}
|
|
53484
53274
|
}
|
|
53485
53275
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text, { wrap: "wrap", color: textColor, children: display });
|
|
53486
53276
|
}
|
|
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
|
-
}
|
|
53277
|
+
const matchLength = userInput.length;
|
|
53494
53278
|
let before = "";
|
|
53495
53279
|
let match = "";
|
|
53496
53280
|
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("") + "...";
|
|
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) + "...";
|
|
53506
53287
|
} else {
|
|
53507
|
-
const contextSpace = maxWidth -
|
|
53288
|
+
const contextSpace = maxWidth - matchLength;
|
|
53508
53289
|
const beforeSpace = Math.floor(contextSpace / 2);
|
|
53509
53290
|
const afterSpace = Math.ceil(contextSpace / 2);
|
|
53510
|
-
let start =
|
|
53511
|
-
let end =
|
|
53291
|
+
let start = matchedIndex - beforeSpace;
|
|
53292
|
+
let end = matchedIndex + matchLength + afterSpace;
|
|
53512
53293
|
if (start < 0) {
|
|
53513
53294
|
end += -start;
|
|
53514
53295
|
start = 0;
|
|
53515
53296
|
}
|
|
53516
|
-
if (end >
|
|
53517
|
-
start -= end -
|
|
53518
|
-
end =
|
|
53297
|
+
if (end > label.length) {
|
|
53298
|
+
start -= end - label.length;
|
|
53299
|
+
end = label.length;
|
|
53519
53300
|
}
|
|
53520
53301
|
start = Math.max(0, start);
|
|
53521
|
-
const finalMatchIndex =
|
|
53522
|
-
const slicedLabel =
|
|
53523
|
-
|
|
53524
|
-
match = slicedLabel.slice(finalMatchIndex, finalMatchIndex +
|
|
53525
|
-
|
|
53526
|
-
finalMatchIndex + matchCharactersLength
|
|
53527
|
-
);
|
|
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);
|
|
53528
53307
|
if (start > 0) {
|
|
53529
|
-
before =
|
|
53530
|
-
} else {
|
|
53531
|
-
before = beforeChars.join("");
|
|
53308
|
+
before = before.length >= 3 ? "..." + before.slice(3) : "...";
|
|
53532
53309
|
}
|
|
53533
|
-
if (end <
|
|
53534
|
-
after =
|
|
53535
|
-
} else {
|
|
53536
|
-
after = afterChars.join("");
|
|
53310
|
+
if (end < label.length) {
|
|
53311
|
+
after = after.length >= 3 ? after.slice(0, -3) + "..." : "...";
|
|
53537
53312
|
}
|
|
53538
53313
|
}
|
|
53539
53314
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text, { color: textColor, wrap: "wrap", children: [
|
|
@@ -53635,10 +53410,10 @@ function isShellTool(name) {
|
|
|
53635
53410
|
return name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME || normalized === "shell";
|
|
53636
53411
|
}
|
|
53637
53412
|
function isThisShellFocusable(name, status, config) {
|
|
53638
|
-
return !!(isShellTool(name) && status ===
|
|
53413
|
+
return !!(isShellTool(name) && status === "executing" /* Executing */ && config?.getEnableInteractiveShell());
|
|
53639
53414
|
}
|
|
53640
53415
|
function isThisShellFocused(name, status, ptyId, activeShellPtyId, embeddedShellFocused) {
|
|
53641
|
-
return !!(isShellTool(name) && status ===
|
|
53416
|
+
return !!(isShellTool(name) && status === "executing" /* Executing */ && ptyId === activeShellPtyId && embeddedShellFocused);
|
|
53642
53417
|
}
|
|
53643
53418
|
function useFocusHint(isThisShellFocusable2, isThisShellFocused2, resultDisplay) {
|
|
53644
53419
|
const [userHasFocused, setUserHasFocused] = (0, import_react30.useState)(false);
|
|
@@ -53798,14 +53573,14 @@ function getToolGroupBorderAppearance(item, activeShellPtyId, embeddedShellFocus
|
|
|
53798
53573
|
if (isTrackedToolCall(t)) {
|
|
53799
53574
|
return t.status !== "success" && t.status !== "error" && t.status !== "cancelled";
|
|
53800
53575
|
} else {
|
|
53801
|
-
return t.status !==
|
|
53576
|
+
return t.status !== "success" /* Success */ && t.status !== "error" /* Error */ && t.status !== "cancelled" /* Cancelled */;
|
|
53802
53577
|
}
|
|
53803
53578
|
});
|
|
53804
53579
|
const isEmbeddedShellFocused = toolsToInspect.some((t) => {
|
|
53805
53580
|
if (isTrackedToolCall(t)) {
|
|
53806
53581
|
return isShellTool(t.request.name) && t.status === "executing" && t.pid === activeShellPtyId && !!embeddedShellFocused;
|
|
53807
53582
|
} else {
|
|
53808
|
-
return isShellTool(t.name) && t.status ===
|
|
53583
|
+
return isShellTool(t.name) && t.status === "executing" /* Executing */ && t.ptyId === activeShellPtyId && !!embeddedShellFocused;
|
|
53809
53584
|
}
|
|
53810
53585
|
});
|
|
53811
53586
|
const isShellCommand = toolsToInspect.some((t) => {
|
|
@@ -55243,7 +55018,7 @@ var authCommand = {
|
|
|
55243
55018
|
import process12 from "node:process";
|
|
55244
55019
|
|
|
55245
55020
|
// packages/cli/src/generated/git-commit.ts
|
|
55246
|
-
var GIT_COMMIT_INFO = "
|
|
55021
|
+
var GIT_COMMIT_INFO = "b367c7296";
|
|
55247
55022
|
|
|
55248
55023
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
55249
55024
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -55293,13 +55068,13 @@ async function exportHistoryToFile(options) {
|
|
|
55293
55068
|
// packages/cli/src/ui/utils/memorySnapshot.ts
|
|
55294
55069
|
import { createWriteStream as createWriteStream3 } from "node:fs";
|
|
55295
55070
|
import { mkdir as mkdir3 } from "node:fs/promises";
|
|
55296
|
-
import { dirname as
|
|
55297
|
-
import { pipeline
|
|
55071
|
+
import { dirname as dirname4 } from "node:path";
|
|
55072
|
+
import { pipeline } from "node:stream/promises";
|
|
55298
55073
|
import { getHeapSnapshot } from "node:v8";
|
|
55299
55074
|
var MEMORY_SNAPSHOT_AUTO_THRESHOLD_BYTES = 2 * 1024 * 1024 * 1024;
|
|
55300
55075
|
async function captureHeapSnapshot(filePath) {
|
|
55301
|
-
await mkdir3(
|
|
55302
|
-
await
|
|
55076
|
+
await mkdir3(dirname4(filePath), { recursive: true });
|
|
55077
|
+
await pipeline(getHeapSnapshot(), createWriteStream3(filePath));
|
|
55303
55078
|
}
|
|
55304
55079
|
|
|
55305
55080
|
// packages/cli/src/ui/commands/bugCommand.ts
|
|
@@ -55877,7 +55652,7 @@ var chatCommand = {
|
|
|
55877
55652
|
};
|
|
55878
55653
|
|
|
55879
55654
|
// packages/cli/src/ui/commands/clearCommand.ts
|
|
55880
|
-
import { randomUUID as
|
|
55655
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
55881
55656
|
var clearCommand = {
|
|
55882
55657
|
name: "clear",
|
|
55883
55658
|
altNames: ["new"],
|
|
@@ -55889,12 +55664,12 @@ var clearCommand = {
|
|
|
55889
55664
|
const config = context.services.agentContext?.config;
|
|
55890
55665
|
const hookSystem = config?.getHookSystem();
|
|
55891
55666
|
if (hookSystem) {
|
|
55892
|
-
await hookSystem.fireSessionEndEvent(
|
|
55667
|
+
await hookSystem.fireSessionEndEvent("clear" /* Clear */);
|
|
55893
55668
|
}
|
|
55894
55669
|
config?.injectionService.clear();
|
|
55895
55670
|
let newSessionId;
|
|
55896
55671
|
if (config) {
|
|
55897
|
-
newSessionId =
|
|
55672
|
+
newSessionId = randomUUID2();
|
|
55898
55673
|
config.resetNewSessionState(newSessionId);
|
|
55899
55674
|
}
|
|
55900
55675
|
if (geminiClient) {
|
|
@@ -55906,7 +55681,7 @@ var clearCommand = {
|
|
|
55906
55681
|
}
|
|
55907
55682
|
let result;
|
|
55908
55683
|
if (hookSystem) {
|
|
55909
|
-
result = await hookSystem.fireSessionStartEvent(
|
|
55684
|
+
result = await hookSystem.fireSessionStartEvent("clear" /* Clear */);
|
|
55910
55685
|
}
|
|
55911
55686
|
await new Promise((resolve9) => setImmediate(resolve9));
|
|
55912
55687
|
if (config) {
|
|
@@ -58915,7 +58690,7 @@ var Footer = () => {
|
|
|
58915
58690
|
case "auth": {
|
|
58916
58691
|
if (!settings.merged.ui.showUserIdentity) break;
|
|
58917
58692
|
if (!authType) break;
|
|
58918
|
-
const displayStr = authType ===
|
|
58693
|
+
const displayStr = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? email ?? "google" : authType;
|
|
58919
58694
|
addCol(
|
|
58920
58695
|
id,
|
|
58921
58696
|
header,
|
|
@@ -60005,16 +59780,7 @@ async function rewindConversation(context, client, recordingService, messageId,
|
|
|
60005
59780
|
const { uiHistory } = convertSessionToHistoryFormats(conversation.messages);
|
|
60006
59781
|
const clientHistory = convertSessionToClientHistory(conversation.messages);
|
|
60007
59782
|
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
|
-
}
|
|
59783
|
+
await context.services.agentContext?.config.getMemoryContextManager()?.refresh();
|
|
60018
59784
|
const startId = 1;
|
|
60019
59785
|
const historyWithIds = uiHistory.map(
|
|
60020
59786
|
(item, idx) => ({
|
|
@@ -60708,12 +60474,12 @@ import path28 from "node:path";
|
|
|
60708
60474
|
function getIdeStatusMessage(ideClient) {
|
|
60709
60475
|
const connection = ideClient.getConnectionStatus();
|
|
60710
60476
|
switch (connection.status) {
|
|
60711
|
-
case
|
|
60477
|
+
case "connected" /* Connected */:
|
|
60712
60478
|
return {
|
|
60713
60479
|
messageType: "info",
|
|
60714
60480
|
content: `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`
|
|
60715
60481
|
};
|
|
60716
|
-
case
|
|
60482
|
+
case "connecting" /* Connecting */:
|
|
60717
60483
|
return {
|
|
60718
60484
|
messageType: "info",
|
|
60719
60485
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -60754,7 +60520,7 @@ ${infoMessage}`;
|
|
|
60754
60520
|
async function getIdeStatusMessageWithFiles(ideClient) {
|
|
60755
60521
|
const connection = ideClient.getConnectionStatus();
|
|
60756
60522
|
switch (connection.status) {
|
|
60757
|
-
case
|
|
60523
|
+
case "connected" /* Connected */: {
|
|
60758
60524
|
let content = `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`;
|
|
60759
60525
|
const context = ideContextStore.get();
|
|
60760
60526
|
const openFiles = context?.workspaceState?.openFiles;
|
|
@@ -60766,7 +60532,7 @@ async function getIdeStatusMessageWithFiles(ideClient) {
|
|
|
60766
60532
|
content
|
|
60767
60533
|
};
|
|
60768
60534
|
}
|
|
60769
|
-
case
|
|
60535
|
+
case "connecting" /* Connecting */:
|
|
60770
60536
|
return {
|
|
60771
60537
|
messageType: "info",
|
|
60772
60538
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -60788,7 +60554,7 @@ async function setIdeModeAndSyncConnection(config, value, options = {}) {
|
|
|
60788
60554
|
const ideClient = await IdeClient.getInstance();
|
|
60789
60555
|
if (value) {
|
|
60790
60556
|
await ideClient.connect(options);
|
|
60791
|
-
logIdeConnection(config, new IdeConnectionEvent(
|
|
60557
|
+
logIdeConnection(config, new IdeConnectionEvent("session" /* SESSION */));
|
|
60792
60558
|
} else {
|
|
60793
60559
|
await ideClient.disconnect();
|
|
60794
60560
|
}
|
|
@@ -60876,7 +60642,7 @@ var ideCommand = async () => {
|
|
|
60876
60642
|
logToConsole: false
|
|
60877
60643
|
}
|
|
60878
60644
|
);
|
|
60879
|
-
if (ideClient.getConnectionStatus().status ===
|
|
60645
|
+
if (ideClient.getConnectionStatus().status === "connected" /* Connected */) {
|
|
60880
60646
|
break;
|
|
60881
60647
|
}
|
|
60882
60648
|
await new Promise((resolve9) => setTimeout(resolve9, 500));
|
|
@@ -60953,7 +60719,7 @@ var ideCommand = async () => {
|
|
|
60953
60719
|
}
|
|
60954
60720
|
};
|
|
60955
60721
|
const { status } = ideClient.getConnectionStatus();
|
|
60956
|
-
const isConnected = status ===
|
|
60722
|
+
const isConnected = status === "connected" /* Connected */;
|
|
60957
60723
|
if (isConnected) {
|
|
60958
60724
|
ideSlashCommand.subCommands = [statusCommand2, disableCommand5];
|
|
60959
60725
|
} else {
|
|
@@ -61053,13 +60819,13 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
61053
60819
|
const displayListener = (message) => {
|
|
61054
60820
|
context.ui.addItem({ type: "info", text: message });
|
|
61055
60821
|
};
|
|
61056
|
-
coreEvents.on(
|
|
60822
|
+
coreEvents.on("oauth-display-message" /* OauthDisplayMessage */, displayListener);
|
|
61057
60823
|
try {
|
|
61058
60824
|
context.ui.addItem({
|
|
61059
60825
|
type: "info",
|
|
61060
60826
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
61061
60827
|
});
|
|
61062
|
-
const { MCPOAuthProvider } = await import("./
|
|
60828
|
+
const { MCPOAuthProvider } = await import("./core-GTUUQBGE.js");
|
|
61063
60829
|
let oauthConfig = server.oauth;
|
|
61064
60830
|
if (!oauthConfig) {
|
|
61065
60831
|
oauthConfig = { enabled: false };
|
|
@@ -61096,7 +60862,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
61096
60862
|
content: `Failed to authenticate with MCP server '${serverName}': ${getErrorMessage(error)}`
|
|
61097
60863
|
};
|
|
61098
60864
|
} finally {
|
|
61099
|
-
coreEvents.removeListener(
|
|
60865
|
+
coreEvents.removeListener("oauth-display-message" /* OauthDisplayMessage */, displayListener);
|
|
61100
60866
|
}
|
|
61101
60867
|
},
|
|
61102
60868
|
completion: async (context, partialArg) => {
|
|
@@ -61142,10 +60908,10 @@ var listAction2 = async (context, showDescriptions = false, showSchema = false,
|
|
|
61142
60908
|
}
|
|
61143
60909
|
const serverNames = Object.keys(mcpServers);
|
|
61144
60910
|
const connectingServers = serverNames.filter(
|
|
61145
|
-
(name) => getMCPServerStatus(name) ===
|
|
60911
|
+
(name) => getMCPServerStatus(name) === "connecting" /* CONNECTING */
|
|
61146
60912
|
);
|
|
61147
60913
|
const discoveryState = getMCPDiscoveryState();
|
|
61148
|
-
const discoveryInProgress = discoveryState ===
|
|
60914
|
+
const discoveryInProgress = discoveryState === "in_progress" /* IN_PROGRESS */ || connectingServers.length > 0;
|
|
61149
60915
|
const allTools = toolRegistry.getAllTools();
|
|
61150
60916
|
const mcpTools = allTools.filter((tool) => tool instanceof DiscoveredMCPTool);
|
|
61151
60917
|
const promptRegistry = config.getPromptRegistry();
|
|
@@ -76923,7 +76689,7 @@ Return a JSON object with:
|
|
|
76923
76689
|
},
|
|
76924
76690
|
abortSignal: new AbortController().signal,
|
|
76925
76691
|
promptId: "triage-duplicates",
|
|
76926
|
-
role:
|
|
76692
|
+
role: "utility_tool" /* UTILITY_TOOL */
|
|
76927
76693
|
});
|
|
76928
76694
|
const rec = response;
|
|
76929
76695
|
let canonical;
|
|
@@ -77757,7 +77523,7 @@ Return a JSON object with:
|
|
|
77757
77523
|
},
|
|
77758
77524
|
abortSignal: abortControllerRef.current.signal,
|
|
77759
77525
|
promptId: "triage-issues",
|
|
77760
|
-
role:
|
|
77526
|
+
role: "utility_tool" /* UTILITY_TOOL */
|
|
77761
77527
|
});
|
|
77762
77528
|
return response;
|
|
77763
77529
|
},
|
|
@@ -78331,8 +78097,8 @@ var planCommand = {
|
|
|
78331
78097
|
return;
|
|
78332
78098
|
}
|
|
78333
78099
|
const previousApprovalMode = config.getApprovalMode();
|
|
78334
|
-
config.setApprovalMode(
|
|
78335
|
-
if (previousApprovalMode !==
|
|
78100
|
+
config.setApprovalMode("plan" /* PLAN */);
|
|
78101
|
+
if (previousApprovalMode !== "plan" /* PLAN */) {
|
|
78336
78102
|
coreEvents.emitFeedback("info", "Switched to Plan Mode.");
|
|
78337
78103
|
}
|
|
78338
78104
|
if (context.invocation?.args) {
|
|
@@ -78391,10 +78157,10 @@ var categorizeRulesByMode = (rules) => {
|
|
|
78391
78157
|
rules.forEach((rule) => {
|
|
78392
78158
|
const modes = rule.modes?.length ? rule.modes : ALL_MODES;
|
|
78393
78159
|
const modeSet = new Set(modes);
|
|
78394
|
-
if (modeSet.has(
|
|
78395
|
-
if (modeSet.has(
|
|
78396
|
-
if (modeSet.has(
|
|
78397
|
-
if (modeSet.has(
|
|
78160
|
+
if (modeSet.has("default" /* DEFAULT */)) result.normal.push(rule);
|
|
78161
|
+
if (modeSet.has("autoEdit" /* AUTO_EDIT */)) result.autoEdit.push(rule);
|
|
78162
|
+
if (modeSet.has("yolo" /* YOLO */)) result.yolo.push(rule);
|
|
78163
|
+
if (modeSet.has("plan" /* PLAN */)) result.plan.push(rule);
|
|
78398
78164
|
});
|
|
78399
78165
|
return result;
|
|
78400
78166
|
};
|
|
@@ -79775,7 +79541,7 @@ var upgradeCommand = {
|
|
|
79775
79541
|
action: async (context) => {
|
|
79776
79542
|
const config = context.services.agentContext?.config;
|
|
79777
79543
|
const authType = config?.getContentGeneratorConfig()?.authType;
|
|
79778
|
-
if (authType !==
|
|
79544
|
+
if (authType !== "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
|
|
79779
79545
|
return {
|
|
79780
79546
|
type: "message",
|
|
79781
79547
|
messageType: "error",
|
|
@@ -80004,7 +79770,7 @@ var BuiltinCommandLoader = class {
|
|
|
80004
79770
|
setupGithubCommand,
|
|
80005
79771
|
terminalSetupCommand,
|
|
80006
79772
|
...this.config?.isVoiceModeEnabled() ? [voiceCommand] : [],
|
|
80007
|
-
...this.config?.getContentGeneratorConfig()?.authType ===
|
|
79773
|
+
...this.config?.getContentGeneratorConfig()?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? [upgradeCommand] : []
|
|
80008
79774
|
];
|
|
80009
79775
|
handle?.end();
|
|
80010
79776
|
return allDefinitions.filter((cmd) => cmd !== null);
|