@google/gemini-cli 0.41.0-preview.1 → 0.42.0-nightly.20260501.gcaa046641
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{chunk-36LZQV4W.js → chunk-2HOG45IA.js} +1047 -1240
- package/bundle/{chunk-NGB7ZVQL.js → chunk-2WK6K7H4.js} +67 -507
- package/bundle/{chunk-DOHALVIP.js → chunk-3Y7ZPPS2.js} +1047 -1240
- package/bundle/chunk-4SBF4FWA.js +512 -0
- package/bundle/{chunk-XRLFHCHC.js → chunk-533APETE.js} +30 -12
- package/bundle/{chunk-T5I4M6M4.js → chunk-747IFMEA.js} +3 -3
- package/bundle/chunk-CTSXRP2T.js +512 -0
- package/bundle/{chunk-DCHOW6BK.js → chunk-CVJABGPV.js} +2 -2
- package/bundle/{chunk-VWYB6GSK.js → chunk-DDX3KSOF.js} +67 -507
- package/bundle/{chunk-DAEE6Y5T.js → chunk-EGV36KAI.js} +1047 -1240
- package/bundle/chunk-ESRGVL52.js +512 -0
- package/bundle/{chunk-SAJ72M2G.js → chunk-FABHOVMY.js} +23 -7
- package/bundle/chunk-FNLKMX3W.js +391 -0
- package/bundle/chunk-FTIY7CSS.js +391 -0
- package/bundle/{chunk-C5CRFFTY.js → chunk-GXIITUGM.js} +1 -1
- package/bundle/{chunk-45OGXTFK.js → chunk-HIYYW6PF.js} +3 -3
- package/bundle/chunk-IDYSRNE5.js +511 -0
- package/bundle/{chunk-QRSHDIRX.js → chunk-IJA7QQHF.js} +1 -1
- package/bundle/{chunk-U6WUS35U.js → chunk-ILECTCCH.js} +2 -2
- package/bundle/{chunk-R4LSW45D.js → chunk-J44J2AAV.js} +1 -1
- package/bundle/{chunk-KCDF3RDO.js → chunk-JPGLBVDA.js} +3 -3
- package/bundle/{chunk-VJ6K3S57.js → chunk-K5CA5JX2.js} +2 -2
- package/bundle/{chunk-6NFVEILC.js → chunk-L6URBAMF.js} +262 -81
- package/bundle/{chunk-5Z2T77EB.js → chunk-NNAHWZGK.js} +66 -507
- package/bundle/{chunk-KJ4M7JXR.js → chunk-SFDJ7FIE.js} +2 -2
- package/bundle/{chunk-QY23ZEK3.js → chunk-SYZNFSS3.js} +262 -81
- package/bundle/chunk-TBIPLAJP.js +391 -0
- package/bundle/{chunk-FFVUMIL3.js → chunk-TMQACI5N.js} +1047 -1240
- package/bundle/{chunk-XO6NKGWV.js → chunk-UCTXAZT6.js} +262 -81
- package/bundle/{chunk-VLSVN2FJ.js → chunk-USFRINC4.js} +1 -1
- package/bundle/chunk-VJOUKBFO.js +391 -0
- package/bundle/{chunk-EQSLZT5Z.js → chunk-VUMF52YD.js} +271 -81
- package/bundle/{chunk-5QI3ZXQB.js → chunk-WGWUS5AF.js} +67 -507
- package/bundle/{chunk-TBBDQEFQ.js → chunk-WTLXL6OZ.js} +3 -3
- package/bundle/{cleanup-3COTQVPP.js → cleanup-GQXJGC2H.js} +3 -3
- package/bundle/{cleanup-FIE6MCAE.js → cleanup-OSSEOJVY.js} +3 -3
- package/bundle/{cleanup-PREOBLFK.js → cleanup-TDBASRR5.js} +3 -3
- package/bundle/{cleanup-YY2EUT56.js → cleanup-XLWNSNLT.js} +3 -3
- package/bundle/{core-GZOFEER4.js → core-JH4LXS4F.js} +8 -2
- package/bundle/{devtoolsService-QXOHXSMJ.js → devtoolsService-DFWZ34A5.js} +3 -3
- package/bundle/{devtoolsService-DV36S632.js → devtoolsService-KZLK5WRW.js} +3 -3
- package/bundle/{devtoolsService-JPBL5I7F.js → devtoolsService-XIWMIEMB.js} +3 -3
- package/bundle/{devtoolsService-M4LZEBZD.js → devtoolsService-ZV5MJUBY.js} +3 -3
- package/bundle/{dist-HASTHPE3.js → dist-ATBEVH4R.js} +8 -2
- package/bundle/{dist-JVRDP7SO.js → dist-BOCIGIGG.js} +8 -2
- package/bundle/{dist-NSJ6AA4L.js → dist-TDGPCKNF.js} +8 -2
- package/bundle/docs/changelogs/index.md +18 -0
- package/bundle/docs/changelogs/latest.md +167 -242
- package/bundle/docs/changelogs/preview.md +99 -385
- package/bundle/docs/cli/cli-reference.md +1 -0
- package/bundle/docs/cli/creating-skills.md +165 -38
- package/bundle/docs/cli/custom-commands.md +1 -0
- package/bundle/docs/cli/model-routing.md +3 -3
- package/bundle/docs/cli/plan-mode.md +2 -1
- package/bundle/docs/cli/skills-best-practices.md +78 -0
- package/bundle/docs/cli/skills.md +98 -93
- package/bundle/docs/cli/tutorials/session-management.md +13 -0
- package/bundle/docs/cli/tutorials/skills-getting-started.md +140 -92
- package/bundle/docs/cli/using-agent-skills.md +89 -0
- package/bundle/docs/core/gemma-setup.md +83 -0
- package/bundle/docs/core/index.md +3 -2
- package/bundle/docs/core/local-model-routing.md +14 -7
- package/bundle/docs/reference/commands.md +14 -4
- package/bundle/docs/reference/configuration.md +76 -4
- package/bundle/docs/reference/keyboard-shortcuts.md +1 -1
- package/bundle/docs/reference/policy-engine.md +14 -3
- package/bundle/docs/sidebar.json +24 -2
- package/bundle/docs/tools/activate-skill.md +1 -1
- package/bundle/{gemini-IGRTXHCM.js → gemini-ETBA6M7V.js} +1067 -850
- package/bundle/{gemini-KIM7O55W.js → gemini-FUGMMZB7.js} +1067 -850
- package/bundle/{gemini-SFFHSCEY.js → gemini-QDNEMFTK.js} +1067 -850
- package/bundle/{gemini-FTUVOUHP.js → gemini-TZ26TZKD.js} +1067 -848
- package/bundle/gemini.js +20 -13
- package/bundle/{interactiveCli-LTPR447O.js → interactiveCli-74QXEIGP.js} +682 -609
- package/bundle/{interactiveCli-K4FIT7TA.js → interactiveCli-IBVICRF7.js} +682 -609
- package/bundle/{interactiveCli-7HPLINVC.js → interactiveCli-OKS4NPC7.js} +682 -609
- package/bundle/{interactiveCli-JOX7MFFH.js → interactiveCli-ZS4ZQWNV.js} +682 -609
- package/bundle/{liteRtServerManager-BENLLSF2.js → liteRtServerManager-I5CSGWRL.js} +5 -4
- package/bundle/{liteRtServerManager-KDO6UAQ5.js → liteRtServerManager-IDNLXYHP.js} +5 -4
- package/bundle/{liteRtServerManager-MQIQXXZQ.js → liteRtServerManager-J33F7APP.js} +5 -4
- package/bundle/{liteRtServerManager-VGYEHFUE.js → liteRtServerManager-RJF74BUI.js} +5 -4
- package/bundle/{memoryDiscovery-FN3IAPBT.js → memoryDiscovery-LIJKMASE.js} +1 -1
- package/bundle/{memoryDiscovery-R7PAR2NY.js → memoryDiscovery-WVH7QDNJ.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-JPCBTTS2.js → oauth2-provider-7UM3XCQ4.js} +2 -2
- package/bundle/{oauth2-provider-EWMNT6D6.js → oauth2-provider-BFW5HE2U.js} +2 -2
- package/bundle/{oauth2-provider-M3WV4GJM.js → oauth2-provider-LONBXYVY.js} +2 -2
- package/bundle/{oauth2-provider-UVXCM7G3.js → oauth2-provider-N65VILW5.js} +2 -2
- package/bundle/{start-4MSISK2E.js → start-3B4FNGNM.js} +7 -6
- package/bundle/{start-ATOE57Z4.js → start-3OM5OXD2.js} +7 -6
- package/bundle/{start-AVEON6UU.js → start-N3S3BSEF.js} +7 -6
- package/bundle/{start-KBB2UTE5.js → start-PLPHF43U.js} +7 -6
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
exitCli,
|
|
8
8
|
require_source
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-USFRINC4.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_BACKGROUND_OPACITY,
|
|
12
12
|
DEFAULT_BORDER_OPACITY,
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
darkTheme,
|
|
29
29
|
detectPlatform,
|
|
30
30
|
eastAsianWidth,
|
|
31
|
-
emptyIcon,
|
|
32
31
|
escapeAnsiCtrlCodes,
|
|
33
32
|
getBinaryPath,
|
|
34
33
|
getCachedStringWidth,
|
|
@@ -50,7 +49,6 @@ import {
|
|
|
50
49
|
loadTrustedFolders,
|
|
51
50
|
readServerPid,
|
|
52
51
|
require_main,
|
|
53
|
-
require_react,
|
|
54
52
|
require_src as require_src2,
|
|
55
53
|
resolveColor,
|
|
56
54
|
resolveEnvVarsInObject,
|
|
@@ -59,10 +57,14 @@ import {
|
|
|
59
57
|
stripUnsafeCharacters,
|
|
60
58
|
toCodePoints,
|
|
61
59
|
validateCustomTheme
|
|
62
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-DDX3KSOF.js";
|
|
61
|
+
import {
|
|
62
|
+
isDevelopment
|
|
63
|
+
} from "./chunk-VJOUKBFO.js";
|
|
63
64
|
import {
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
emptyIcon,
|
|
66
|
+
require_react
|
|
67
|
+
} from "./chunk-CTSXRP2T.js";
|
|
66
68
|
import {
|
|
67
69
|
AsyncFzf,
|
|
68
70
|
AuthType,
|
|
@@ -148,7 +150,6 @@ import {
|
|
|
148
150
|
import_lru_cache,
|
|
149
151
|
import_lru_map_with_delete,
|
|
150
152
|
import_multi_map,
|
|
151
|
-
isGitRepository,
|
|
152
153
|
isGuiEditor,
|
|
153
154
|
isNightly,
|
|
154
155
|
isPrivateIp,
|
|
@@ -208,7 +209,7 @@ import {
|
|
|
208
209
|
stripAnsi,
|
|
209
210
|
tokenLimit,
|
|
210
211
|
uiTelemetryService
|
|
211
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-UCTXAZT6.js";
|
|
212
213
|
import {
|
|
213
214
|
ApprovalMode,
|
|
214
215
|
CoreEvent,
|
|
@@ -235,7 +236,7 @@ import {
|
|
|
235
236
|
shortenPath,
|
|
236
237
|
tildeifyPath,
|
|
237
238
|
unescapePath
|
|
238
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-FABHOVMY.js";
|
|
239
240
|
import {
|
|
240
241
|
require_src
|
|
241
242
|
} from "./chunk-RJTRUG2J.js";
|
|
@@ -286,11 +287,11 @@ var require_signals = __commonJS({
|
|
|
286
287
|
// node_modules/ink/node_modules/signal-exit/index.js
|
|
287
288
|
var require_signal_exit = __commonJS({
|
|
288
289
|
"node_modules/ink/node_modules/signal-exit/index.js"(exports, module) {
|
|
289
|
-
var
|
|
290
|
-
var processOk = function(
|
|
291
|
-
return
|
|
290
|
+
var process34 = global.process;
|
|
291
|
+
var processOk = function(process35) {
|
|
292
|
+
return process35 && typeof process35 === "object" && typeof process35.removeListener === "function" && typeof process35.emit === "function" && typeof process35.reallyExit === "function" && typeof process35.listeners === "function" && typeof process35.kill === "function" && typeof process35.pid === "number" && typeof process35.on === "function";
|
|
292
293
|
};
|
|
293
|
-
if (!processOk(
|
|
294
|
+
if (!processOk(process34)) {
|
|
294
295
|
module.exports = function() {
|
|
295
296
|
return function() {
|
|
296
297
|
};
|
|
@@ -298,15 +299,15 @@ var require_signal_exit = __commonJS({
|
|
|
298
299
|
} else {
|
|
299
300
|
assert = __require("assert");
|
|
300
301
|
signals = require_signals();
|
|
301
|
-
isWin = /^win/i.test(
|
|
302
|
+
isWin = /^win/i.test(process34.platform);
|
|
302
303
|
EE = __require("events");
|
|
303
304
|
if (typeof EE !== "function") {
|
|
304
305
|
EE = EE.EventEmitter;
|
|
305
306
|
}
|
|
306
|
-
if (
|
|
307
|
-
emitter =
|
|
307
|
+
if (process34.__signal_exit_emitter__) {
|
|
308
|
+
emitter = process34.__signal_exit_emitter__;
|
|
308
309
|
} else {
|
|
309
|
-
emitter =
|
|
310
|
+
emitter = process34.__signal_exit_emitter__ = new EE();
|
|
310
311
|
emitter.count = 0;
|
|
311
312
|
emitter.emitted = {};
|
|
312
313
|
}
|
|
@@ -343,12 +344,12 @@ var require_signal_exit = __commonJS({
|
|
|
343
344
|
loaded = false;
|
|
344
345
|
signals.forEach(function(sig) {
|
|
345
346
|
try {
|
|
346
|
-
|
|
347
|
+
process34.removeListener(sig, sigListeners[sig]);
|
|
347
348
|
} catch (er2) {
|
|
348
349
|
}
|
|
349
350
|
});
|
|
350
|
-
|
|
351
|
-
|
|
351
|
+
process34.emit = originalProcessEmit;
|
|
352
|
+
process34.reallyExit = originalProcessReallyExit;
|
|
352
353
|
emitter.count -= 1;
|
|
353
354
|
};
|
|
354
355
|
module.exports.unload = unload;
|
|
@@ -365,7 +366,7 @@ var require_signal_exit = __commonJS({
|
|
|
365
366
|
if (!processOk(global.process)) {
|
|
366
367
|
return;
|
|
367
368
|
}
|
|
368
|
-
var listeners =
|
|
369
|
+
var listeners = process34.listeners(sig);
|
|
369
370
|
if (listeners.length === emitter.count) {
|
|
370
371
|
unload();
|
|
371
372
|
emit("exit", null, sig);
|
|
@@ -373,7 +374,7 @@ var require_signal_exit = __commonJS({
|
|
|
373
374
|
if (isWin && sig === "SIGHUP") {
|
|
374
375
|
sig = "SIGINT";
|
|
375
376
|
}
|
|
376
|
-
|
|
377
|
+
process34.kill(process34.pid, sig);
|
|
377
378
|
}
|
|
378
379
|
};
|
|
379
380
|
});
|
|
@@ -389,36 +390,36 @@ var require_signal_exit = __commonJS({
|
|
|
389
390
|
emitter.count += 1;
|
|
390
391
|
signals = signals.filter(function(sig) {
|
|
391
392
|
try {
|
|
392
|
-
|
|
393
|
+
process34.on(sig, sigListeners[sig]);
|
|
393
394
|
return true;
|
|
394
395
|
} catch (er2) {
|
|
395
396
|
return false;
|
|
396
397
|
}
|
|
397
398
|
});
|
|
398
|
-
|
|
399
|
-
|
|
399
|
+
process34.emit = processEmit;
|
|
400
|
+
process34.reallyExit = processReallyExit;
|
|
400
401
|
};
|
|
401
402
|
module.exports.load = load;
|
|
402
|
-
originalProcessReallyExit =
|
|
403
|
+
originalProcessReallyExit = process34.reallyExit;
|
|
403
404
|
processReallyExit = function processReallyExit2(code) {
|
|
404
405
|
if (!processOk(global.process)) {
|
|
405
406
|
return;
|
|
406
407
|
}
|
|
407
|
-
|
|
408
|
+
process34.exitCode = code || /* istanbul ignore next */
|
|
408
409
|
0;
|
|
409
|
-
emit("exit",
|
|
410
|
-
emit("afterexit",
|
|
411
|
-
originalProcessReallyExit.call(
|
|
410
|
+
emit("exit", process34.exitCode, null);
|
|
411
|
+
emit("afterexit", process34.exitCode, null);
|
|
412
|
+
originalProcessReallyExit.call(process34, process34.exitCode);
|
|
412
413
|
};
|
|
413
|
-
originalProcessEmit =
|
|
414
|
+
originalProcessEmit = process34.emit;
|
|
414
415
|
processEmit = function processEmit2(ev, arg) {
|
|
415
416
|
if (ev === "exit" && processOk(global.process)) {
|
|
416
417
|
if (arg !== void 0) {
|
|
417
|
-
|
|
418
|
+
process34.exitCode = arg;
|
|
418
419
|
}
|
|
419
420
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
420
|
-
emit("exit",
|
|
421
|
-
emit("afterexit",
|
|
421
|
+
emit("exit", process34.exitCode, null);
|
|
422
|
+
emit("afterexit", process34.exitCode, null);
|
|
422
423
|
return ret;
|
|
423
424
|
} else {
|
|
424
425
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -8799,11 +8800,11 @@ var require_signals2 = __commonJS({
|
|
|
8799
8800
|
// node_modules/restore-cursor/node_modules/signal-exit/index.js
|
|
8800
8801
|
var require_signal_exit2 = __commonJS({
|
|
8801
8802
|
"node_modules/restore-cursor/node_modules/signal-exit/index.js"(exports, module) {
|
|
8802
|
-
var
|
|
8803
|
-
var processOk = function(
|
|
8804
|
-
return
|
|
8803
|
+
var process34 = global.process;
|
|
8804
|
+
var processOk = function(process35) {
|
|
8805
|
+
return process35 && typeof process35 === "object" && typeof process35.removeListener === "function" && typeof process35.emit === "function" && typeof process35.reallyExit === "function" && typeof process35.listeners === "function" && typeof process35.kill === "function" && typeof process35.pid === "number" && typeof process35.on === "function";
|
|
8805
8806
|
};
|
|
8806
|
-
if (!processOk(
|
|
8807
|
+
if (!processOk(process34)) {
|
|
8807
8808
|
module.exports = function() {
|
|
8808
8809
|
return function() {
|
|
8809
8810
|
};
|
|
@@ -8811,15 +8812,15 @@ var require_signal_exit2 = __commonJS({
|
|
|
8811
8812
|
} else {
|
|
8812
8813
|
assert = __require("assert");
|
|
8813
8814
|
signals = require_signals2();
|
|
8814
|
-
isWin = /^win/i.test(
|
|
8815
|
+
isWin = /^win/i.test(process34.platform);
|
|
8815
8816
|
EE = __require("events");
|
|
8816
8817
|
if (typeof EE !== "function") {
|
|
8817
8818
|
EE = EE.EventEmitter;
|
|
8818
8819
|
}
|
|
8819
|
-
if (
|
|
8820
|
-
emitter =
|
|
8820
|
+
if (process34.__signal_exit_emitter__) {
|
|
8821
|
+
emitter = process34.__signal_exit_emitter__;
|
|
8821
8822
|
} else {
|
|
8822
|
-
emitter =
|
|
8823
|
+
emitter = process34.__signal_exit_emitter__ = new EE();
|
|
8823
8824
|
emitter.count = 0;
|
|
8824
8825
|
emitter.emitted = {};
|
|
8825
8826
|
}
|
|
@@ -8856,12 +8857,12 @@ var require_signal_exit2 = __commonJS({
|
|
|
8856
8857
|
loaded = false;
|
|
8857
8858
|
signals.forEach(function(sig) {
|
|
8858
8859
|
try {
|
|
8859
|
-
|
|
8860
|
+
process34.removeListener(sig, sigListeners[sig]);
|
|
8860
8861
|
} catch (er2) {
|
|
8861
8862
|
}
|
|
8862
8863
|
});
|
|
8863
|
-
|
|
8864
|
-
|
|
8864
|
+
process34.emit = originalProcessEmit;
|
|
8865
|
+
process34.reallyExit = originalProcessReallyExit;
|
|
8865
8866
|
emitter.count -= 1;
|
|
8866
8867
|
};
|
|
8867
8868
|
module.exports.unload = unload;
|
|
@@ -8878,7 +8879,7 @@ var require_signal_exit2 = __commonJS({
|
|
|
8878
8879
|
if (!processOk(global.process)) {
|
|
8879
8880
|
return;
|
|
8880
8881
|
}
|
|
8881
|
-
var listeners =
|
|
8882
|
+
var listeners = process34.listeners(sig);
|
|
8882
8883
|
if (listeners.length === emitter.count) {
|
|
8883
8884
|
unload();
|
|
8884
8885
|
emit("exit", null, sig);
|
|
@@ -8886,7 +8887,7 @@ var require_signal_exit2 = __commonJS({
|
|
|
8886
8887
|
if (isWin && sig === "SIGHUP") {
|
|
8887
8888
|
sig = "SIGINT";
|
|
8888
8889
|
}
|
|
8889
|
-
|
|
8890
|
+
process34.kill(process34.pid, sig);
|
|
8890
8891
|
}
|
|
8891
8892
|
};
|
|
8892
8893
|
});
|
|
@@ -8902,36 +8903,36 @@ var require_signal_exit2 = __commonJS({
|
|
|
8902
8903
|
emitter.count += 1;
|
|
8903
8904
|
signals = signals.filter(function(sig) {
|
|
8904
8905
|
try {
|
|
8905
|
-
|
|
8906
|
+
process34.on(sig, sigListeners[sig]);
|
|
8906
8907
|
return true;
|
|
8907
8908
|
} catch (er2) {
|
|
8908
8909
|
return false;
|
|
8909
8910
|
}
|
|
8910
8911
|
});
|
|
8911
|
-
|
|
8912
|
-
|
|
8912
|
+
process34.emit = processEmit;
|
|
8913
|
+
process34.reallyExit = processReallyExit;
|
|
8913
8914
|
};
|
|
8914
8915
|
module.exports.load = load;
|
|
8915
|
-
originalProcessReallyExit =
|
|
8916
|
+
originalProcessReallyExit = process34.reallyExit;
|
|
8916
8917
|
processReallyExit = function processReallyExit2(code) {
|
|
8917
8918
|
if (!processOk(global.process)) {
|
|
8918
8919
|
return;
|
|
8919
8920
|
}
|
|
8920
|
-
|
|
8921
|
+
process34.exitCode = code || /* istanbul ignore next */
|
|
8921
8922
|
0;
|
|
8922
|
-
emit("exit",
|
|
8923
|
-
emit("afterexit",
|
|
8924
|
-
originalProcessReallyExit.call(
|
|
8923
|
+
emit("exit", process34.exitCode, null);
|
|
8924
|
+
emit("afterexit", process34.exitCode, null);
|
|
8925
|
+
originalProcessReallyExit.call(process34, process34.exitCode);
|
|
8925
8926
|
};
|
|
8926
|
-
originalProcessEmit =
|
|
8927
|
+
originalProcessEmit = process34.emit;
|
|
8927
8928
|
processEmit = function processEmit2(ev, arg) {
|
|
8928
8929
|
if (ev === "exit" && processOk(global.process)) {
|
|
8929
8930
|
if (arg !== void 0) {
|
|
8930
|
-
|
|
8931
|
+
process34.exitCode = arg;
|
|
8931
8932
|
}
|
|
8932
8933
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
8933
|
-
emit("exit",
|
|
8934
|
-
emit("afterexit",
|
|
8934
|
+
emit("exit", process34.exitCode, null);
|
|
8935
|
+
emit("afterexit", process34.exitCode, null);
|
|
8935
8936
|
return ret;
|
|
8936
8937
|
} else {
|
|
8937
8938
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -9695,12 +9696,12 @@ var require_prompt = __commonJS({
|
|
|
9695
9696
|
var readline = __require("readline");
|
|
9696
9697
|
var _require = require_util();
|
|
9697
9698
|
var action = _require.action;
|
|
9698
|
-
var
|
|
9699
|
+
var EventEmitter3 = __require("events");
|
|
9699
9700
|
var _require2 = require_src3();
|
|
9700
9701
|
var beep2 = _require2.beep;
|
|
9701
9702
|
var cursor = _require2.cursor;
|
|
9702
9703
|
var color = require_kleur();
|
|
9703
|
-
var Prompt = class extends
|
|
9704
|
+
var Prompt = class extends EventEmitter3 {
|
|
9704
9705
|
constructor(opts = {}) {
|
|
9705
9706
|
super();
|
|
9706
9707
|
this.firstRender = true;
|
|
@@ -12160,10 +12161,10 @@ var require_prompt2 = __commonJS({
|
|
|
12160
12161
|
"use strict";
|
|
12161
12162
|
var readline = __require("readline");
|
|
12162
12163
|
var { action } = require_util2();
|
|
12163
|
-
var
|
|
12164
|
+
var EventEmitter3 = __require("events");
|
|
12164
12165
|
var { beep: beep2, cursor } = require_src3();
|
|
12165
12166
|
var color = require_kleur();
|
|
12166
|
-
var Prompt = class extends
|
|
12167
|
+
var Prompt = class extends EventEmitter3 {
|
|
12167
12168
|
constructor(opts = {}) {
|
|
12168
12169
|
super();
|
|
12169
12170
|
this.firstRender = true;
|
|
@@ -14270,22 +14271,22 @@ var require_pend = __commonJS({
|
|
|
14270
14271
|
// node_modules/fd-slicer/index.js
|
|
14271
14272
|
var require_fd_slicer = __commonJS({
|
|
14272
14273
|
"node_modules/fd-slicer/index.js"(exports) {
|
|
14273
|
-
var
|
|
14274
|
+
var fs38 = __require("fs");
|
|
14274
14275
|
var util2 = __require("util");
|
|
14275
14276
|
var stream = __require("stream");
|
|
14276
14277
|
var Readable = stream.Readable;
|
|
14277
14278
|
var Writable2 = stream.Writable;
|
|
14278
14279
|
var PassThrough2 = stream.PassThrough;
|
|
14279
14280
|
var Pend = require_pend();
|
|
14280
|
-
var
|
|
14281
|
+
var EventEmitter3 = __require("events").EventEmitter;
|
|
14281
14282
|
exports.createFromBuffer = createFromBuffer;
|
|
14282
14283
|
exports.createFromFd = createFromFd;
|
|
14283
14284
|
exports.BufferSlicer = BufferSlicer;
|
|
14284
14285
|
exports.FdSlicer = FdSlicer;
|
|
14285
|
-
util2.inherits(FdSlicer,
|
|
14286
|
+
util2.inherits(FdSlicer, EventEmitter3);
|
|
14286
14287
|
function FdSlicer(fd, options) {
|
|
14287
14288
|
options = options || {};
|
|
14288
|
-
|
|
14289
|
+
EventEmitter3.call(this);
|
|
14289
14290
|
this.fd = fd;
|
|
14290
14291
|
this.pend = new Pend();
|
|
14291
14292
|
this.pend.max = 1;
|
|
@@ -14295,7 +14296,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14295
14296
|
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
14296
14297
|
var self = this;
|
|
14297
14298
|
self.pend.go(function(cb) {
|
|
14298
|
-
|
|
14299
|
+
fs38.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
|
|
14299
14300
|
cb();
|
|
14300
14301
|
callback(err, bytesRead, buffer2);
|
|
14301
14302
|
});
|
|
@@ -14304,7 +14305,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14304
14305
|
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
14305
14306
|
var self = this;
|
|
14306
14307
|
self.pend.go(function(cb) {
|
|
14307
|
-
|
|
14308
|
+
fs38.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) {
|
|
14308
14309
|
cb();
|
|
14309
14310
|
callback(err, written, buffer2);
|
|
14310
14311
|
});
|
|
@@ -14325,7 +14326,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14325
14326
|
if (self.refCount > 0) return;
|
|
14326
14327
|
if (self.refCount < 0) throw new Error("invalid unref");
|
|
14327
14328
|
if (self.autoClose) {
|
|
14328
|
-
|
|
14329
|
+
fs38.close(self.fd, onCloseDone);
|
|
14329
14330
|
}
|
|
14330
14331
|
function onCloseDone(err) {
|
|
14331
14332
|
if (err) {
|
|
@@ -14362,7 +14363,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14362
14363
|
self.context.pend.go(function(cb) {
|
|
14363
14364
|
if (self.destroyed) return cb();
|
|
14364
14365
|
var buffer = new Buffer(toRead);
|
|
14365
|
-
|
|
14366
|
+
fs38.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
14366
14367
|
if (err) {
|
|
14367
14368
|
self.destroy(err);
|
|
14368
14369
|
} else if (bytesRead === 0) {
|
|
@@ -14409,7 +14410,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14409
14410
|
}
|
|
14410
14411
|
self.context.pend.go(function(cb) {
|
|
14411
14412
|
if (self.destroyed) return cb();
|
|
14412
|
-
|
|
14413
|
+
fs38.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) {
|
|
14413
14414
|
if (err2) {
|
|
14414
14415
|
self.destroy();
|
|
14415
14416
|
cb();
|
|
@@ -14429,9 +14430,9 @@ var require_fd_slicer = __commonJS({
|
|
|
14429
14430
|
this.destroyed = true;
|
|
14430
14431
|
this.context.unref();
|
|
14431
14432
|
};
|
|
14432
|
-
util2.inherits(BufferSlicer,
|
|
14433
|
+
util2.inherits(BufferSlicer, EventEmitter3);
|
|
14433
14434
|
function BufferSlicer(buffer, options) {
|
|
14434
|
-
|
|
14435
|
+
EventEmitter3.call(this);
|
|
14435
14436
|
options = options || {};
|
|
14436
14437
|
this.refCount = 0;
|
|
14437
14438
|
this.buffer = buffer;
|
|
@@ -14836,12 +14837,12 @@ var require_buffer_crc32 = __commonJS({
|
|
|
14836
14837
|
// node_modules/yauzl/index.js
|
|
14837
14838
|
var require_yauzl = __commonJS({
|
|
14838
14839
|
"node_modules/yauzl/index.js"(exports) {
|
|
14839
|
-
var
|
|
14840
|
+
var fs38 = __require("fs");
|
|
14840
14841
|
var zlib = __require("zlib");
|
|
14841
14842
|
var fd_slicer = require_fd_slicer();
|
|
14842
14843
|
var crc32 = require_buffer_crc32();
|
|
14843
14844
|
var util2 = __require("util");
|
|
14844
|
-
var
|
|
14845
|
+
var EventEmitter3 = __require("events").EventEmitter;
|
|
14845
14846
|
var Transform2 = __require("stream").Transform;
|
|
14846
14847
|
var PassThrough2 = __require("stream").PassThrough;
|
|
14847
14848
|
var Writable2 = __require("stream").Writable;
|
|
@@ -14854,7 +14855,7 @@ var require_yauzl = __commonJS({
|
|
|
14854
14855
|
exports.ZipFile = ZipFile;
|
|
14855
14856
|
exports.Entry = Entry;
|
|
14856
14857
|
exports.RandomAccessReader = RandomAccessReader;
|
|
14857
|
-
function open(
|
|
14858
|
+
function open(path36, options, callback) {
|
|
14858
14859
|
if (typeof options === "function") {
|
|
14859
14860
|
callback = options;
|
|
14860
14861
|
options = null;
|
|
@@ -14866,10 +14867,10 @@ var require_yauzl = __commonJS({
|
|
|
14866
14867
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14867
14868
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14868
14869
|
if (callback == null) callback = defaultCallback;
|
|
14869
|
-
|
|
14870
|
+
fs38.open(path36, "r", function(err, fd) {
|
|
14870
14871
|
if (err) return callback(err);
|
|
14871
14872
|
fromFd(fd, options, function(err2, zipfile) {
|
|
14872
|
-
if (err2)
|
|
14873
|
+
if (err2) fs38.close(fd, defaultCallback);
|
|
14873
14874
|
callback(err2, zipfile);
|
|
14874
14875
|
});
|
|
14875
14876
|
});
|
|
@@ -14886,7 +14887,7 @@ var require_yauzl = __commonJS({
|
|
|
14886
14887
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14887
14888
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14888
14889
|
if (callback == null) callback = defaultCallback;
|
|
14889
|
-
|
|
14890
|
+
fs38.fstat(fd, function(err, stats) {
|
|
14890
14891
|
if (err) return callback(err);
|
|
14891
14892
|
var reader = fd_slicer.createFromFd(fd, { autoClose: true });
|
|
14892
14893
|
fromRandomAccessReader(reader, stats.size, options, callback);
|
|
@@ -14973,10 +14974,10 @@ var require_yauzl = __commonJS({
|
|
|
14973
14974
|
callback(new Error("end of central directory record signature not found"));
|
|
14974
14975
|
});
|
|
14975
14976
|
}
|
|
14976
|
-
util2.inherits(ZipFile,
|
|
14977
|
+
util2.inherits(ZipFile, EventEmitter3);
|
|
14977
14978
|
function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
|
|
14978
14979
|
var self = this;
|
|
14979
|
-
|
|
14980
|
+
EventEmitter3.call(self);
|
|
14980
14981
|
self.reader = reader;
|
|
14981
14982
|
self.reader.on("error", function(err) {
|
|
14982
14983
|
emitError(self, err);
|
|
@@ -15337,9 +15338,9 @@ var require_yauzl = __commonJS({
|
|
|
15337
15338
|
}
|
|
15338
15339
|
cb();
|
|
15339
15340
|
};
|
|
15340
|
-
util2.inherits(RandomAccessReader,
|
|
15341
|
+
util2.inherits(RandomAccessReader, EventEmitter3);
|
|
15341
15342
|
function RandomAccessReader() {
|
|
15342
|
-
|
|
15343
|
+
EventEmitter3.call(this);
|
|
15343
15344
|
this.refCount = 0;
|
|
15344
15345
|
}
|
|
15345
15346
|
RandomAccessReader.prototype.ref = function() {
|
|
@@ -15466,9 +15467,9 @@ var require_yauzl = __commonJS({
|
|
|
15466
15467
|
var require_extract_zip = __commonJS({
|
|
15467
15468
|
"node_modules/extract-zip/index.js"(exports, module) {
|
|
15468
15469
|
var debug = require_src()("extract-zip");
|
|
15469
|
-
var { createWriteStream: createWriteStream4, promises:
|
|
15470
|
+
var { createWriteStream: createWriteStream4, promises: fs38 } = __require("fs");
|
|
15470
15471
|
var getStream = require_get_stream();
|
|
15471
|
-
var
|
|
15472
|
+
var path36 = __require("path");
|
|
15472
15473
|
var { promisify: promisify5 } = __require("util");
|
|
15473
15474
|
var stream = __require("stream");
|
|
15474
15475
|
var yauzl = require_yauzl();
|
|
@@ -15505,12 +15506,12 @@ var require_extract_zip = __commonJS({
|
|
|
15505
15506
|
this.zipfile.readEntry();
|
|
15506
15507
|
return;
|
|
15507
15508
|
}
|
|
15508
|
-
const destDir =
|
|
15509
|
+
const destDir = path36.dirname(path36.join(this.opts.dir, entry.fileName));
|
|
15509
15510
|
try {
|
|
15510
|
-
await
|
|
15511
|
-
const canonicalDestDir = await
|
|
15512
|
-
const relativeDestDir =
|
|
15513
|
-
if (relativeDestDir.split(
|
|
15511
|
+
await fs38.mkdir(destDir, { recursive: true });
|
|
15512
|
+
const canonicalDestDir = await fs38.realpath(destDir);
|
|
15513
|
+
const relativeDestDir = path36.relative(this.opts.dir, canonicalDestDir);
|
|
15514
|
+
if (relativeDestDir.split(path36.sep).includes("..")) {
|
|
15514
15515
|
throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
|
|
15515
15516
|
}
|
|
15516
15517
|
await this.extractEntry(entry);
|
|
@@ -15532,7 +15533,7 @@ var require_extract_zip = __commonJS({
|
|
|
15532
15533
|
if (this.opts.onEntry) {
|
|
15533
15534
|
this.opts.onEntry(entry, this.zipfile);
|
|
15534
15535
|
}
|
|
15535
|
-
const dest =
|
|
15536
|
+
const dest = path36.join(this.opts.dir, entry.fileName);
|
|
15536
15537
|
const mode = entry.externalFileAttributes >> 16 & 65535;
|
|
15537
15538
|
const IFMT = 61440;
|
|
15538
15539
|
const IFDIR = 16384;
|
|
@@ -15546,20 +15547,20 @@ var require_extract_zip = __commonJS({
|
|
|
15546
15547
|
if (!isDir) isDir = madeBy === 0 && entry.externalFileAttributes === 16;
|
|
15547
15548
|
debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink2 });
|
|
15548
15549
|
const procMode = this.getExtractedMode(mode, isDir) & 511;
|
|
15549
|
-
const destDir = isDir ? dest :
|
|
15550
|
+
const destDir = isDir ? dest : path36.dirname(dest);
|
|
15550
15551
|
const mkdirOptions = { recursive: true };
|
|
15551
15552
|
if (isDir) {
|
|
15552
15553
|
mkdirOptions.mode = procMode;
|
|
15553
15554
|
}
|
|
15554
15555
|
debug("mkdir", { dir: destDir, ...mkdirOptions });
|
|
15555
|
-
await
|
|
15556
|
+
await fs38.mkdir(destDir, mkdirOptions);
|
|
15556
15557
|
if (isDir) return;
|
|
15557
15558
|
debug("opening read stream", dest);
|
|
15558
15559
|
const readStream = await promisify5(this.zipfile.openReadStream.bind(this.zipfile))(entry);
|
|
15559
15560
|
if (symlink2) {
|
|
15560
15561
|
const link2 = await getStream(readStream);
|
|
15561
15562
|
debug("creating symlink", link2, dest);
|
|
15562
|
-
await
|
|
15563
|
+
await fs38.symlink(link2, dest);
|
|
15563
15564
|
} else {
|
|
15564
15565
|
await pipeline(readStream, createWriteStream4(dest, { mode: procMode }));
|
|
15565
15566
|
}
|
|
@@ -15588,11 +15589,11 @@ var require_extract_zip = __commonJS({
|
|
|
15588
15589
|
};
|
|
15589
15590
|
module.exports = async function(zipPath, opts) {
|
|
15590
15591
|
debug("creating target directory", opts.dir);
|
|
15591
|
-
if (!
|
|
15592
|
+
if (!path36.isAbsolute(opts.dir)) {
|
|
15592
15593
|
throw new Error("Target directory is expected to be absolute");
|
|
15593
15594
|
}
|
|
15594
|
-
await
|
|
15595
|
-
opts.dir = await
|
|
15595
|
+
await fs38.mkdir(opts.dir, { recursive: true });
|
|
15596
|
+
opts.dir = await fs38.realpath(opts.dir);
|
|
15596
15597
|
return new Extractor(zipPath, opts).extract();
|
|
15597
15598
|
};
|
|
15598
15599
|
}
|
|
@@ -17049,7 +17050,7 @@ var require_strip_final_newline = __commonJS({
|
|
|
17049
17050
|
var require_npm_run_path = __commonJS({
|
|
17050
17051
|
"node_modules/run-jxa/node_modules/npm-run-path/index.js"(exports, module) {
|
|
17051
17052
|
"use strict";
|
|
17052
|
-
var
|
|
17053
|
+
var path36 = __require("path");
|
|
17053
17054
|
var pathKey = require_path_key();
|
|
17054
17055
|
var npmRunPath = (options) => {
|
|
17055
17056
|
options = {
|
|
@@ -17059,16 +17060,16 @@ var require_npm_run_path = __commonJS({
|
|
|
17059
17060
|
...options
|
|
17060
17061
|
};
|
|
17061
17062
|
let previous;
|
|
17062
|
-
let cwdPath =
|
|
17063
|
+
let cwdPath = path36.resolve(options.cwd);
|
|
17063
17064
|
const result = [];
|
|
17064
17065
|
while (previous !== cwdPath) {
|
|
17065
|
-
result.push(
|
|
17066
|
+
result.push(path36.join(cwdPath, "node_modules/.bin"));
|
|
17066
17067
|
previous = cwdPath;
|
|
17067
|
-
cwdPath =
|
|
17068
|
+
cwdPath = path36.resolve(cwdPath, "..");
|
|
17068
17069
|
}
|
|
17069
|
-
const execPathDir =
|
|
17070
|
+
const execPathDir = path36.resolve(options.cwd, options.execPath, "..");
|
|
17070
17071
|
result.push(execPathDir);
|
|
17071
|
-
return result.concat(options.path).join(
|
|
17072
|
+
return result.concat(options.path).join(path36.delimiter);
|
|
17072
17073
|
};
|
|
17073
17074
|
module.exports = npmRunPath;
|
|
17074
17075
|
module.exports.default = npmRunPath;
|
|
@@ -17078,9 +17079,9 @@ var require_npm_run_path = __commonJS({
|
|
|
17078
17079
|
...options
|
|
17079
17080
|
};
|
|
17080
17081
|
const env3 = { ...options.env };
|
|
17081
|
-
const
|
|
17082
|
-
options.path = env3[
|
|
17083
|
-
env3[
|
|
17082
|
+
const path37 = pathKey({ env: env3 });
|
|
17083
|
+
options.path = env3[path37];
|
|
17084
|
+
env3[path37] = module.exports(options);
|
|
17084
17085
|
return env3;
|
|
17085
17086
|
};
|
|
17086
17087
|
}
|
|
@@ -17643,11 +17644,11 @@ var require_signals4 = __commonJS({
|
|
|
17643
17644
|
// node_modules/run-jxa/node_modules/signal-exit/index.js
|
|
17644
17645
|
var require_signal_exit3 = __commonJS({
|
|
17645
17646
|
"node_modules/run-jxa/node_modules/signal-exit/index.js"(exports, module) {
|
|
17646
|
-
var
|
|
17647
|
-
var processOk = function(
|
|
17648
|
-
return
|
|
17647
|
+
var process34 = global.process;
|
|
17648
|
+
var processOk = function(process35) {
|
|
17649
|
+
return process35 && typeof process35 === "object" && typeof process35.removeListener === "function" && typeof process35.emit === "function" && typeof process35.reallyExit === "function" && typeof process35.listeners === "function" && typeof process35.kill === "function" && typeof process35.pid === "number" && typeof process35.on === "function";
|
|
17649
17650
|
};
|
|
17650
|
-
if (!processOk(
|
|
17651
|
+
if (!processOk(process34)) {
|
|
17651
17652
|
module.exports = function() {
|
|
17652
17653
|
return function() {
|
|
17653
17654
|
};
|
|
@@ -17655,15 +17656,15 @@ var require_signal_exit3 = __commonJS({
|
|
|
17655
17656
|
} else {
|
|
17656
17657
|
assert = __require("assert");
|
|
17657
17658
|
signals = require_signals4();
|
|
17658
|
-
isWin = /^win/i.test(
|
|
17659
|
+
isWin = /^win/i.test(process34.platform);
|
|
17659
17660
|
EE = __require("events");
|
|
17660
17661
|
if (typeof EE !== "function") {
|
|
17661
17662
|
EE = EE.EventEmitter;
|
|
17662
17663
|
}
|
|
17663
|
-
if (
|
|
17664
|
-
emitter =
|
|
17664
|
+
if (process34.__signal_exit_emitter__) {
|
|
17665
|
+
emitter = process34.__signal_exit_emitter__;
|
|
17665
17666
|
} else {
|
|
17666
|
-
emitter =
|
|
17667
|
+
emitter = process34.__signal_exit_emitter__ = new EE();
|
|
17667
17668
|
emitter.count = 0;
|
|
17668
17669
|
emitter.emitted = {};
|
|
17669
17670
|
}
|
|
@@ -17700,12 +17701,12 @@ var require_signal_exit3 = __commonJS({
|
|
|
17700
17701
|
loaded = false;
|
|
17701
17702
|
signals.forEach(function(sig) {
|
|
17702
17703
|
try {
|
|
17703
|
-
|
|
17704
|
+
process34.removeListener(sig, sigListeners[sig]);
|
|
17704
17705
|
} catch (er2) {
|
|
17705
17706
|
}
|
|
17706
17707
|
});
|
|
17707
|
-
|
|
17708
|
-
|
|
17708
|
+
process34.emit = originalProcessEmit;
|
|
17709
|
+
process34.reallyExit = originalProcessReallyExit;
|
|
17709
17710
|
emitter.count -= 1;
|
|
17710
17711
|
};
|
|
17711
17712
|
module.exports.unload = unload;
|
|
@@ -17722,7 +17723,7 @@ var require_signal_exit3 = __commonJS({
|
|
|
17722
17723
|
if (!processOk(global.process)) {
|
|
17723
17724
|
return;
|
|
17724
17725
|
}
|
|
17725
|
-
var listeners =
|
|
17726
|
+
var listeners = process34.listeners(sig);
|
|
17726
17727
|
if (listeners.length === emitter.count) {
|
|
17727
17728
|
unload();
|
|
17728
17729
|
emit("exit", null, sig);
|
|
@@ -17730,7 +17731,7 @@ var require_signal_exit3 = __commonJS({
|
|
|
17730
17731
|
if (isWin && sig === "SIGHUP") {
|
|
17731
17732
|
sig = "SIGINT";
|
|
17732
17733
|
}
|
|
17733
|
-
|
|
17734
|
+
process34.kill(process34.pid, sig);
|
|
17734
17735
|
}
|
|
17735
17736
|
};
|
|
17736
17737
|
});
|
|
@@ -17746,36 +17747,36 @@ var require_signal_exit3 = __commonJS({
|
|
|
17746
17747
|
emitter.count += 1;
|
|
17747
17748
|
signals = signals.filter(function(sig) {
|
|
17748
17749
|
try {
|
|
17749
|
-
|
|
17750
|
+
process34.on(sig, sigListeners[sig]);
|
|
17750
17751
|
return true;
|
|
17751
17752
|
} catch (er2) {
|
|
17752
17753
|
return false;
|
|
17753
17754
|
}
|
|
17754
17755
|
});
|
|
17755
|
-
|
|
17756
|
-
|
|
17756
|
+
process34.emit = processEmit;
|
|
17757
|
+
process34.reallyExit = processReallyExit;
|
|
17757
17758
|
};
|
|
17758
17759
|
module.exports.load = load;
|
|
17759
|
-
originalProcessReallyExit =
|
|
17760
|
+
originalProcessReallyExit = process34.reallyExit;
|
|
17760
17761
|
processReallyExit = function processReallyExit2(code) {
|
|
17761
17762
|
if (!processOk(global.process)) {
|
|
17762
17763
|
return;
|
|
17763
17764
|
}
|
|
17764
|
-
|
|
17765
|
+
process34.exitCode = code || /* istanbul ignore next */
|
|
17765
17766
|
0;
|
|
17766
|
-
emit("exit",
|
|
17767
|
-
emit("afterexit",
|
|
17768
|
-
originalProcessReallyExit.call(
|
|
17767
|
+
emit("exit", process34.exitCode, null);
|
|
17768
|
+
emit("afterexit", process34.exitCode, null);
|
|
17769
|
+
originalProcessReallyExit.call(process34, process34.exitCode);
|
|
17769
17770
|
};
|
|
17770
|
-
originalProcessEmit =
|
|
17771
|
+
originalProcessEmit = process34.emit;
|
|
17771
17772
|
processEmit = function processEmit2(ev, arg) {
|
|
17772
17773
|
if (ev === "exit" && processOk(global.process)) {
|
|
17773
17774
|
if (arg !== void 0) {
|
|
17774
|
-
|
|
17775
|
+
process34.exitCode = arg;
|
|
17775
17776
|
}
|
|
17776
17777
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
17777
|
-
emit("exit",
|
|
17778
|
-
emit("afterexit",
|
|
17778
|
+
emit("exit", process34.exitCode, null);
|
|
17779
|
+
emit("afterexit", process34.exitCode, null);
|
|
17779
17780
|
return ret;
|
|
17780
17781
|
} else {
|
|
17781
17782
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -18196,8 +18197,8 @@ var require_command = __commonJS({
|
|
|
18196
18197
|
var require_execa = __commonJS({
|
|
18197
18198
|
"node_modules/run-jxa/node_modules/execa/index.js"(exports, module) {
|
|
18198
18199
|
"use strict";
|
|
18199
|
-
var
|
|
18200
|
-
var
|
|
18200
|
+
var path36 = __require("path");
|
|
18201
|
+
var childProcess3 = __require("child_process");
|
|
18201
18202
|
var crossSpawn = require_cross_spawn();
|
|
18202
18203
|
var stripFinalNewline = require_strip_final_newline();
|
|
18203
18204
|
var npmRunPath = require_npm_run_path();
|
|
@@ -18238,7 +18239,7 @@ var require_execa = __commonJS({
|
|
|
18238
18239
|
};
|
|
18239
18240
|
options.env = getEnv(options);
|
|
18240
18241
|
options.stdio = normalizeStdio(options);
|
|
18241
|
-
if (process.platform === "win32" &&
|
|
18242
|
+
if (process.platform === "win32" && path36.basename(file, ".exe") === "cmd") {
|
|
18242
18243
|
args.unshift("/q");
|
|
18243
18244
|
}
|
|
18244
18245
|
return { file, args, options, parsed };
|
|
@@ -18259,9 +18260,9 @@ var require_execa = __commonJS({
|
|
|
18259
18260
|
validateTimeout(parsed.options);
|
|
18260
18261
|
let spawned;
|
|
18261
18262
|
try {
|
|
18262
|
-
spawned =
|
|
18263
|
+
spawned = childProcess3.spawn(parsed.file, parsed.args, parsed.options);
|
|
18263
18264
|
} catch (error) {
|
|
18264
|
-
const dummySpawned = new
|
|
18265
|
+
const dummySpawned = new childProcess3.ChildProcess();
|
|
18265
18266
|
const errorPromise = Promise.reject(makeError3({
|
|
18266
18267
|
error,
|
|
18267
18268
|
stdout: "",
|
|
@@ -18333,7 +18334,7 @@ var require_execa = __commonJS({
|
|
|
18333
18334
|
validateInputSync(parsed.options);
|
|
18334
18335
|
let result;
|
|
18335
18336
|
try {
|
|
18336
|
-
result =
|
|
18337
|
+
result = childProcess3.spawnSync(parsed.file, parsed.args, parsed.options);
|
|
18337
18338
|
} catch (error) {
|
|
18338
18339
|
throw makeError3({
|
|
18339
18340
|
error,
|
|
@@ -25595,13 +25596,13 @@ var setTextNodeValue = (node, text) => {
|
|
|
25595
25596
|
markNodeAsDirty(node);
|
|
25596
25597
|
};
|
|
25597
25598
|
var getPathToRoot = (node) => {
|
|
25598
|
-
const
|
|
25599
|
+
const path36 = [];
|
|
25599
25600
|
let current = node;
|
|
25600
25601
|
while (current) {
|
|
25601
|
-
|
|
25602
|
+
path36.unshift(current);
|
|
25602
25603
|
current = current.parentNode;
|
|
25603
25604
|
}
|
|
25604
|
-
return
|
|
25605
|
+
return path36;
|
|
25605
25606
|
};
|
|
25606
25607
|
var isNodeSelectable = (node) => {
|
|
25607
25608
|
let current = node;
|
|
@@ -30079,8 +30080,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
30079
30080
|
}
|
|
30080
30081
|
|
|
30081
30082
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
30082
|
-
var cleanupPath = (
|
|
30083
|
-
return
|
|
30083
|
+
var cleanupPath = (path36) => {
|
|
30084
|
+
return path36?.replace(`file://${cwd()}/`, "");
|
|
30084
30085
|
};
|
|
30085
30086
|
var stackUtils = new import_stack_utils.default({
|
|
30086
30087
|
cwd: cwd(),
|
|
@@ -34710,6 +34711,7 @@ var ESC_TIMEOUT = 50;
|
|
|
34710
34711
|
var PASTE_TIMEOUT = 3e4;
|
|
34711
34712
|
var FAST_RETURN_TIMEOUT = 30;
|
|
34712
34713
|
var KEY_INFO_MAP = {
|
|
34714
|
+
OM: { name: "enter" },
|
|
34713
34715
|
"[200~": { name: "paste-start" },
|
|
34714
34716
|
"[201~": { name: "paste-end" },
|
|
34715
34717
|
"[[A": { name: "f1" },
|
|
@@ -35595,15 +35597,8 @@ var defaultKeyBindingConfig = /* @__PURE__ */ new Map([
|
|
|
35595
35597
|
"edit.deleteRight" /* DELETE_CHAR_RIGHT */,
|
|
35596
35598
|
[new KeyBinding("delete"), new KeyBinding("ctrl+d")]
|
|
35597
35599
|
],
|
|
35598
|
-
["edit.undo" /* UNDO */,
|
|
35599
|
-
[
|
|
35600
|
-
"edit.redo" /* REDO */,
|
|
35601
|
-
[
|
|
35602
|
-
new KeyBinding("ctrl+shift+z"),
|
|
35603
|
-
new KeyBinding("cmd+shift+z"),
|
|
35604
|
-
new KeyBinding("alt+shift+z")
|
|
35605
|
-
]
|
|
35606
|
-
],
|
|
35600
|
+
["edit.undo" /* UNDO */, getPlatformUndoBindings(process.platform)],
|
|
35601
|
+
["edit.redo" /* REDO */, getPlatformRedoBindings(process.platform)],
|
|
35607
35602
|
// Scrolling
|
|
35608
35603
|
["scroll.up" /* SCROLL_UP */, [new KeyBinding("shift+up")]],
|
|
35609
35604
|
["scroll.down" /* SCROLL_DOWN */, [new KeyBinding("shift+down")]],
|
|
@@ -35775,6 +35770,26 @@ async function loadCustomKeybindings() {
|
|
|
35775
35770
|
}
|
|
35776
35771
|
return { config, errors };
|
|
35777
35772
|
}
|
|
35773
|
+
function getPlatformUndoBindings(platform5) {
|
|
35774
|
+
if (platform5 === "win32") {
|
|
35775
|
+
return [new KeyBinding("ctrl+z"), new KeyBinding("alt+z")];
|
|
35776
|
+
}
|
|
35777
|
+
if (platform5 === "darwin") {
|
|
35778
|
+
return [new KeyBinding("cmd+z"), new KeyBinding("alt+z")];
|
|
35779
|
+
}
|
|
35780
|
+
return [
|
|
35781
|
+
new KeyBinding("alt+z"),
|
|
35782
|
+
new KeyBinding("cmd+z"),
|
|
35783
|
+
new KeyBinding("ctrl+z")
|
|
35784
|
+
];
|
|
35785
|
+
}
|
|
35786
|
+
function getPlatformRedoBindings(_platform) {
|
|
35787
|
+
return [
|
|
35788
|
+
new KeyBinding("ctrl+shift+z"),
|
|
35789
|
+
new KeyBinding("cmd+shift+z"),
|
|
35790
|
+
new KeyBinding("alt+shift+z")
|
|
35791
|
+
];
|
|
35792
|
+
}
|
|
35778
35793
|
|
|
35779
35794
|
// packages/cli/src/ui/key/keyMatchers.ts
|
|
35780
35795
|
function matchCommand(command, key, config = defaultKeyBindingConfig) {
|
|
@@ -39894,308 +39909,9 @@ function validateAuthMethod(authMethod) {
|
|
|
39894
39909
|
return "Invalid auth method selected.";
|
|
39895
39910
|
}
|
|
39896
39911
|
|
|
39897
|
-
// packages/cli/src/utils/installationInfo.ts
|
|
39898
|
-
import * as fs9 from "node:fs";
|
|
39899
|
-
import * as path3 from "node:path";
|
|
39900
|
-
import * as childProcess from "node:child_process";
|
|
39901
|
-
import process20 from "node:process";
|
|
39902
|
-
var isDevelopment = process20.env["NODE_ENV"] === "development";
|
|
39903
|
-
function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
|
|
39904
|
-
const cliPath = process20.argv[1];
|
|
39905
|
-
if (!cliPath) {
|
|
39906
|
-
return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
|
|
39907
|
-
}
|
|
39908
|
-
try {
|
|
39909
|
-
if (process20.env["IS_BINARY"] === "true") {
|
|
39910
|
-
return {
|
|
39911
|
-
packageManager: "binary" /* BINARY */,
|
|
39912
|
-
isGlobal: true,
|
|
39913
|
-
updateMessage: "Running as a standalone binary. Please update by downloading the latest version from GitHub."
|
|
39914
|
-
};
|
|
39915
|
-
}
|
|
39916
|
-
const realPath = fs9.realpathSync(cliPath).replace(/\\/g, "/");
|
|
39917
|
-
const normalizedProjectRoot = projectRoot?.replace(/\\/g, "/");
|
|
39918
|
-
const isGit = isGitRepository(process20.cwd());
|
|
39919
|
-
if (isGit && normalizedProjectRoot && realPath.startsWith(normalizedProjectRoot) && !realPath.includes("/node_modules/")) {
|
|
39920
|
-
return {
|
|
39921
|
-
packageManager: "unknown" /* UNKNOWN */,
|
|
39922
|
-
// Not managed by a package manager in this sense
|
|
39923
|
-
isGlobal: false,
|
|
39924
|
-
updateMessage: 'Running from a local git clone. Please update with "git pull".'
|
|
39925
|
-
};
|
|
39926
|
-
}
|
|
39927
|
-
if (realPath.includes("/.npm/_npx") || realPath.includes("/npm/_npx")) {
|
|
39928
|
-
return {
|
|
39929
|
-
packageManager: "npx" /* NPX */,
|
|
39930
|
-
isGlobal: false,
|
|
39931
|
-
updateMessage: "Running via npx, update not applicable."
|
|
39932
|
-
};
|
|
39933
|
-
}
|
|
39934
|
-
if (realPath.includes("/.pnpm/_pnpx") || realPath.includes("/.cache/pnpm/dlx")) {
|
|
39935
|
-
return {
|
|
39936
|
-
packageManager: "pnpx" /* PNPX */,
|
|
39937
|
-
isGlobal: false,
|
|
39938
|
-
updateMessage: "Running via pnpx, update not applicable."
|
|
39939
|
-
};
|
|
39940
|
-
}
|
|
39941
|
-
if (process20.platform === "darwin") {
|
|
39942
|
-
try {
|
|
39943
|
-
const brewPrefix = childProcess.execSync("brew --prefix gemini-cli", {
|
|
39944
|
-
encoding: "utf8",
|
|
39945
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
39946
|
-
}).trim();
|
|
39947
|
-
const brewRealPath = fs9.realpathSync(brewPrefix);
|
|
39948
|
-
if (realPath.startsWith(brewRealPath)) {
|
|
39949
|
-
return {
|
|
39950
|
-
packageManager: "homebrew" /* HOMEBREW */,
|
|
39951
|
-
isGlobal: true,
|
|
39952
|
-
updateMessage: 'Installed via Homebrew. Please update with "brew upgrade gemini-cli".'
|
|
39953
|
-
};
|
|
39954
|
-
}
|
|
39955
|
-
} catch {
|
|
39956
|
-
}
|
|
39957
|
-
}
|
|
39958
|
-
if (realPath.includes("/.pnpm/global") || realPath.includes("/.local/share/pnpm")) {
|
|
39959
|
-
const updateCommand2 = "pnpm add -g @google/gemini-cli@latest";
|
|
39960
|
-
return {
|
|
39961
|
-
packageManager: "pnpm" /* PNPM */,
|
|
39962
|
-
isGlobal: true,
|
|
39963
|
-
updateCommand: updateCommand2,
|
|
39964
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with pnpm. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
39965
|
-
};
|
|
39966
|
-
}
|
|
39967
|
-
if (realPath.includes("/.yarn/global")) {
|
|
39968
|
-
const updateCommand2 = "yarn global add @google/gemini-cli@latest";
|
|
39969
|
-
return {
|
|
39970
|
-
packageManager: "yarn" /* YARN */,
|
|
39971
|
-
isGlobal: true,
|
|
39972
|
-
updateCommand: updateCommand2,
|
|
39973
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with yarn. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
39974
|
-
};
|
|
39975
|
-
}
|
|
39976
|
-
if (realPath.includes("/.bun/install/cache")) {
|
|
39977
|
-
return {
|
|
39978
|
-
packageManager: "bunx" /* BUNX */,
|
|
39979
|
-
isGlobal: false,
|
|
39980
|
-
updateMessage: "Running via bunx, update not applicable."
|
|
39981
|
-
};
|
|
39982
|
-
}
|
|
39983
|
-
if (realPath.includes("/.bun/install/global")) {
|
|
39984
|
-
const updateCommand2 = "bun add -g @google/gemini-cli@latest";
|
|
39985
|
-
return {
|
|
39986
|
-
packageManager: "bun" /* BUN */,
|
|
39987
|
-
isGlobal: true,
|
|
39988
|
-
updateCommand: updateCommand2,
|
|
39989
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with bun. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
39990
|
-
};
|
|
39991
|
-
}
|
|
39992
|
-
if (normalizedProjectRoot && realPath.startsWith(`${normalizedProjectRoot}/node_modules`)) {
|
|
39993
|
-
let pm = "npm" /* NPM */;
|
|
39994
|
-
if (fs9.existsSync(path3.join(projectRoot, "yarn.lock"))) {
|
|
39995
|
-
pm = "yarn" /* YARN */;
|
|
39996
|
-
} else if (fs9.existsSync(path3.join(projectRoot, "pnpm-lock.yaml"))) {
|
|
39997
|
-
pm = "pnpm" /* PNPM */;
|
|
39998
|
-
} else if (fs9.existsSync(path3.join(projectRoot, "bun.lockb"))) {
|
|
39999
|
-
pm = "bun" /* BUN */;
|
|
40000
|
-
}
|
|
40001
|
-
return {
|
|
40002
|
-
packageManager: pm,
|
|
40003
|
-
isGlobal: false,
|
|
40004
|
-
updateMessage: "Locally installed. Please update via your project's package.json."
|
|
40005
|
-
};
|
|
40006
|
-
}
|
|
40007
|
-
const updateCommand = "npm install -g @google/gemini-cli@latest";
|
|
40008
|
-
return {
|
|
40009
|
-
packageManager: "npm" /* NPM */,
|
|
40010
|
-
isGlobal: true,
|
|
40011
|
-
updateCommand,
|
|
40012
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with npm. Attempting to automatically update now..." : `Please run ${updateCommand} to update`
|
|
40013
|
-
};
|
|
40014
|
-
} catch (error) {
|
|
40015
|
-
debugLogger.log(error);
|
|
40016
|
-
return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
|
|
40017
|
-
}
|
|
40018
|
-
}
|
|
40019
|
-
|
|
40020
|
-
// packages/cli/src/utils/updateEventEmitter.ts
|
|
40021
|
-
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
40022
|
-
var updateEventEmitter = new EventEmitter3();
|
|
40023
|
-
|
|
40024
|
-
// packages/cli/src/utils/spawnWrapper.ts
|
|
40025
|
-
import { spawn } from "node:child_process";
|
|
40026
|
-
var spawnWrapper = spawn;
|
|
40027
|
-
|
|
40028
|
-
// packages/cli/src/utils/handleAutoUpdate.ts
|
|
40029
|
-
var _updateInProgress = false;
|
|
40030
|
-
async function waitForUpdateCompletion(timeoutMs = 3e4) {
|
|
40031
|
-
if (!_updateInProgress) {
|
|
40032
|
-
return;
|
|
40033
|
-
}
|
|
40034
|
-
debugLogger.log(
|
|
40035
|
-
"\nGemini CLI is waiting for a background update to complete before restarting..."
|
|
40036
|
-
);
|
|
40037
|
-
return new Promise((resolve8) => {
|
|
40038
|
-
if (!_updateInProgress) {
|
|
40039
|
-
resolve8();
|
|
40040
|
-
return;
|
|
40041
|
-
}
|
|
40042
|
-
const timer = setTimeout(cleanup, timeoutMs);
|
|
40043
|
-
function cleanup() {
|
|
40044
|
-
clearTimeout(timer);
|
|
40045
|
-
updateEventEmitter.off("update-success", cleanup);
|
|
40046
|
-
updateEventEmitter.off("update-failed", cleanup);
|
|
40047
|
-
resolve8();
|
|
40048
|
-
}
|
|
40049
|
-
updateEventEmitter.once("update-success", cleanup);
|
|
40050
|
-
updateEventEmitter.once("update-failed", cleanup);
|
|
40051
|
-
});
|
|
40052
|
-
}
|
|
40053
|
-
function handleAutoUpdate(info, settings, projectRoot, spawnFn = spawnWrapper) {
|
|
40054
|
-
if (!info) {
|
|
40055
|
-
return;
|
|
40056
|
-
}
|
|
40057
|
-
if (settings.merged.tools.sandbox || process.env["GEMINI_SANDBOX"]) {
|
|
40058
|
-
updateEventEmitter.emit("update-info", {
|
|
40059
|
-
message: `${info.message}
|
|
40060
|
-
Automatic update is not available in sandbox mode.`
|
|
40061
|
-
});
|
|
40062
|
-
return;
|
|
40063
|
-
}
|
|
40064
|
-
if (!settings.merged.general.enableAutoUpdateNotification) {
|
|
40065
|
-
return;
|
|
40066
|
-
}
|
|
40067
|
-
const installationInfo = getInstallationInfo(
|
|
40068
|
-
projectRoot,
|
|
40069
|
-
settings.merged.general.enableAutoUpdate
|
|
40070
|
-
);
|
|
40071
|
-
if ([
|
|
40072
|
-
"npx" /* NPX */,
|
|
40073
|
-
"pnpx" /* PNPX */,
|
|
40074
|
-
"bunx" /* BUNX */,
|
|
40075
|
-
"binary" /* BINARY */
|
|
40076
|
-
].includes(installationInfo.packageManager)) {
|
|
40077
|
-
return;
|
|
40078
|
-
}
|
|
40079
|
-
let combinedMessage = info.message;
|
|
40080
|
-
if (installationInfo.updateMessage) {
|
|
40081
|
-
combinedMessage += `
|
|
40082
|
-
${installationInfo.updateMessage}`;
|
|
40083
|
-
}
|
|
40084
|
-
if (!installationInfo.updateCommand || !settings.merged.general.enableAutoUpdate) {
|
|
40085
|
-
updateEventEmitter.emit("update-received", {
|
|
40086
|
-
...info,
|
|
40087
|
-
message: combinedMessage,
|
|
40088
|
-
isUpdating: false
|
|
40089
|
-
});
|
|
40090
|
-
return;
|
|
40091
|
-
}
|
|
40092
|
-
updateEventEmitter.emit("update-received", {
|
|
40093
|
-
...info,
|
|
40094
|
-
message: combinedMessage,
|
|
40095
|
-
isUpdating: true
|
|
40096
|
-
});
|
|
40097
|
-
if (_updateInProgress) {
|
|
40098
|
-
return;
|
|
40099
|
-
}
|
|
40100
|
-
const isNightly2 = info.update.latest.includes("nightly");
|
|
40101
|
-
const updateCommand = installationInfo.updateCommand.replace(
|
|
40102
|
-
"@latest",
|
|
40103
|
-
isNightly2 ? "@nightly" : `@${info.update.latest}`
|
|
40104
|
-
);
|
|
40105
|
-
const updateProcess = spawnFn(updateCommand, {
|
|
40106
|
-
stdio: "ignore",
|
|
40107
|
-
shell: true,
|
|
40108
|
-
detached: true
|
|
40109
|
-
});
|
|
40110
|
-
_updateInProgress = true;
|
|
40111
|
-
updateProcess.unref();
|
|
40112
|
-
updateProcess.on("close", (code) => {
|
|
40113
|
-
_updateInProgress = false;
|
|
40114
|
-
if (code === 0) {
|
|
40115
|
-
updateEventEmitter.emit("update-success", {
|
|
40116
|
-
message: "Update successful! The new version will be used on your next run."
|
|
40117
|
-
});
|
|
40118
|
-
} else {
|
|
40119
|
-
updateEventEmitter.emit("update-failed", {
|
|
40120
|
-
message: `Automatic update failed. Please try updating manually:
|
|
40121
|
-
|
|
40122
|
-
${updateCommand}`
|
|
40123
|
-
});
|
|
40124
|
-
}
|
|
40125
|
-
});
|
|
40126
|
-
updateProcess.on("error", (err) => {
|
|
40127
|
-
_updateInProgress = false;
|
|
40128
|
-
updateEventEmitter.emit("update-failed", {
|
|
40129
|
-
message: `Automatic update failed. Please try updating manually. (error: ${err.message})
|
|
40130
|
-
|
|
40131
|
-
${updateCommand}`
|
|
40132
|
-
});
|
|
40133
|
-
});
|
|
40134
|
-
return updateProcess;
|
|
40135
|
-
}
|
|
40136
|
-
function setUpdateHandler(addItem, setUpdateInfo) {
|
|
40137
|
-
let successfullyInstalled = false;
|
|
40138
|
-
const handleUpdateReceived = (info) => {
|
|
40139
|
-
setUpdateInfo(info);
|
|
40140
|
-
const savedMessage = info.message;
|
|
40141
|
-
setTimeout(() => {
|
|
40142
|
-
if (!successfullyInstalled) {
|
|
40143
|
-
addItem(
|
|
40144
|
-
{
|
|
40145
|
-
type: "info" /* INFO */,
|
|
40146
|
-
text: savedMessage
|
|
40147
|
-
},
|
|
40148
|
-
Date.now()
|
|
40149
|
-
);
|
|
40150
|
-
}
|
|
40151
|
-
setUpdateInfo(null);
|
|
40152
|
-
}, 6e4);
|
|
40153
|
-
};
|
|
40154
|
-
const handleUpdateFailed = (data) => {
|
|
40155
|
-
setUpdateInfo(null);
|
|
40156
|
-
addItem(
|
|
40157
|
-
{
|
|
40158
|
-
type: "error" /* ERROR */,
|
|
40159
|
-
text: data?.message || `Automatic update failed. Please try updating manually`
|
|
40160
|
-
},
|
|
40161
|
-
Date.now()
|
|
40162
|
-
);
|
|
40163
|
-
};
|
|
40164
|
-
const handleUpdateSuccess = () => {
|
|
40165
|
-
successfullyInstalled = true;
|
|
40166
|
-
setUpdateInfo(null);
|
|
40167
|
-
addItem(
|
|
40168
|
-
{
|
|
40169
|
-
type: "info" /* INFO */,
|
|
40170
|
-
text: `Update successful! The new version will be used on your next run.`
|
|
40171
|
-
},
|
|
40172
|
-
Date.now()
|
|
40173
|
-
);
|
|
40174
|
-
};
|
|
40175
|
-
const handleUpdateInfo = (data) => {
|
|
40176
|
-
addItem(
|
|
40177
|
-
{
|
|
40178
|
-
type: "info" /* INFO */,
|
|
40179
|
-
text: data.message
|
|
40180
|
-
},
|
|
40181
|
-
Date.now()
|
|
40182
|
-
);
|
|
40183
|
-
};
|
|
40184
|
-
updateEventEmitter.on("update-received", handleUpdateReceived);
|
|
40185
|
-
updateEventEmitter.on("update-failed", handleUpdateFailed);
|
|
40186
|
-
updateEventEmitter.on("update-success", handleUpdateSuccess);
|
|
40187
|
-
updateEventEmitter.on("update-info", handleUpdateInfo);
|
|
40188
|
-
return () => {
|
|
40189
|
-
updateEventEmitter.off("update-received", handleUpdateReceived);
|
|
40190
|
-
updateEventEmitter.off("update-failed", handleUpdateFailed);
|
|
40191
|
-
updateEventEmitter.off("update-success", handleUpdateSuccess);
|
|
40192
|
-
updateEventEmitter.off("update-info", handleUpdateInfo);
|
|
40193
|
-
};
|
|
40194
|
-
}
|
|
40195
|
-
|
|
40196
39912
|
// packages/cli/src/config/extensions/consent.ts
|
|
40197
|
-
import * as
|
|
40198
|
-
import * as
|
|
39913
|
+
import * as fs9 from "node:fs/promises";
|
|
39914
|
+
import * as path3 from "node:path";
|
|
40199
39915
|
var import_chalk4 = __toESM(require_source(), 1);
|
|
40200
39916
|
var INSTALL_WARNING_MESSAGE = import_chalk4.default.yellow(
|
|
40201
39917
|
"The extension you are about to install may have been created by a third-party developer and sourced from a public repository. Google does not vet, endorse, or guarantee the functionality or security of extensions. Please carefully inspect any extension and its source code before installing to understand the permissions it requires and the actions it may perform."
|
|
@@ -40321,10 +40037,10 @@ async function renderSkillsList(skills) {
|
|
|
40321
40037
|
const output = [];
|
|
40322
40038
|
for (const skill of skills) {
|
|
40323
40039
|
output.push(` * ${import_chalk4.default.bold(skill.name)}: ${skill.description}`);
|
|
40324
|
-
const skillDir =
|
|
40040
|
+
const skillDir = path3.dirname(skill.location);
|
|
40325
40041
|
let fileCountStr = "";
|
|
40326
40042
|
try {
|
|
40327
|
-
const skillDirItems = await
|
|
40043
|
+
const skillDirItems = await fs9.readdir(skillDir);
|
|
40328
40044
|
fileCountStr = ` (${skillDirItems.length} items in directory)`;
|
|
40329
40045
|
} catch {
|
|
40330
40046
|
fileCountStr = ` ${import_chalk4.default.red("\u26A0\uFE0F (Could not count items in directory)")}`;
|
|
@@ -40359,17 +40075,17 @@ async function maybeRequestConsentOrFail(extensionConfig, requestConsent, hasHoo
|
|
|
40359
40075
|
|
|
40360
40076
|
// packages/cli/src/config/extensions/extensionSettings.ts
|
|
40361
40077
|
var dotenv = __toESM(require_main(), 1);
|
|
40362
|
-
import * as
|
|
40078
|
+
import * as fs11 from "node:fs/promises";
|
|
40363
40079
|
import * as fsSync from "node:fs";
|
|
40364
|
-
import * as
|
|
40080
|
+
import * as path6 from "node:path";
|
|
40365
40081
|
|
|
40366
40082
|
// packages/cli/src/config/extensions/storage.ts
|
|
40367
|
-
import * as
|
|
40368
|
-
import * as
|
|
40083
|
+
import * as path5 from "node:path";
|
|
40084
|
+
import * as fs10 from "node:fs";
|
|
40369
40085
|
import * as os2 from "node:os";
|
|
40370
40086
|
|
|
40371
40087
|
// packages/cli/src/config/extensions/variables.ts
|
|
40372
|
-
import * as
|
|
40088
|
+
import * as path4 from "node:path";
|
|
40373
40089
|
|
|
40374
40090
|
// packages/cli/src/config/extensions/variableSchema.ts
|
|
40375
40091
|
var PATH_SEPARATOR_DEFINITION = {
|
|
@@ -40395,7 +40111,7 @@ var UNMARSHALL_KEY_IGNORE_LIST = /* @__PURE__ */ new Set([
|
|
|
40395
40111
|
"constructor",
|
|
40396
40112
|
"prototype"
|
|
40397
40113
|
]);
|
|
40398
|
-
var EXTENSIONS_DIRECTORY_NAME =
|
|
40114
|
+
var EXTENSIONS_DIRECTORY_NAME = path4.join(GEMINI_DIR, "extensions");
|
|
40399
40115
|
var EXTENSIONS_CONFIG_FILENAME = "gemini-extension.json";
|
|
40400
40116
|
var INSTALL_METADATA_FILENAME = ".gemini-extension-install.json";
|
|
40401
40117
|
var EXTENSION_SETTINGS_FILENAME = ".env";
|
|
@@ -40450,22 +40166,22 @@ var ExtensionStorage = class _ExtensionStorage {
|
|
|
40450
40166
|
this.extensionName = extensionName;
|
|
40451
40167
|
}
|
|
40452
40168
|
getExtensionDir() {
|
|
40453
|
-
return
|
|
40169
|
+
return path5.join(
|
|
40454
40170
|
_ExtensionStorage.getUserExtensionsDir(),
|
|
40455
40171
|
this.extensionName
|
|
40456
40172
|
);
|
|
40457
40173
|
}
|
|
40458
40174
|
getConfigPath() {
|
|
40459
|
-
return
|
|
40175
|
+
return path5.join(this.getExtensionDir(), EXTENSIONS_CONFIG_FILENAME);
|
|
40460
40176
|
}
|
|
40461
40177
|
getEnvFilePath() {
|
|
40462
|
-
return
|
|
40178
|
+
return path5.join(this.getExtensionDir(), EXTENSION_SETTINGS_FILENAME);
|
|
40463
40179
|
}
|
|
40464
40180
|
static getUserExtensionsDir() {
|
|
40465
40181
|
return new Storage(homedir()).getExtensionsDir();
|
|
40466
40182
|
}
|
|
40467
40183
|
static async createTmpDir() {
|
|
40468
|
-
return
|
|
40184
|
+
return fs10.promises.mkdtemp(path5.join(os2.tmpdir(), "gemini-extension"));
|
|
40469
40185
|
}
|
|
40470
40186
|
};
|
|
40471
40187
|
|
|
@@ -40486,7 +40202,7 @@ var getEnvFilePath = (extensionName, scope, workspaceDir) => {
|
|
|
40486
40202
|
if (!workspaceDir) {
|
|
40487
40203
|
throw new Error("Workspace directory is required for workspace scope");
|
|
40488
40204
|
}
|
|
40489
|
-
return
|
|
40205
|
+
return path6.join(workspaceDir, EXTENSION_SETTINGS_FILENAME);
|
|
40490
40206
|
}
|
|
40491
40207
|
return new ExtensionStorage(extensionName).getEnvFilePath();
|
|
40492
40208
|
};
|
|
@@ -40542,7 +40258,7 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
|
|
|
40542
40258
|
);
|
|
40543
40259
|
}
|
|
40544
40260
|
}
|
|
40545
|
-
await
|
|
40261
|
+
await fs11.writeFile(envFilePath, envContent);
|
|
40546
40262
|
}
|
|
40547
40263
|
function formatEnvContent(settings) {
|
|
40548
40264
|
let envContent = "";
|
|
@@ -40652,7 +40368,7 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40652
40368
|
`Cannot write extension settings to ${envFilePath} because it is a directory.`
|
|
40653
40369
|
);
|
|
40654
40370
|
}
|
|
40655
|
-
envContent = await
|
|
40371
|
+
envContent = await fs11.readFile(envFilePath, "utf-8");
|
|
40656
40372
|
}
|
|
40657
40373
|
const parsedEnv = dotenv.parse(envContent);
|
|
40658
40374
|
if (!newValue) {
|
|
@@ -40670,7 +40386,7 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40670
40386
|
}
|
|
40671
40387
|
}
|
|
40672
40388
|
const newEnvContent = formatEnvContent(nonSensitiveSettings);
|
|
40673
|
-
await
|
|
40389
|
+
await fs11.writeFile(envFilePath, newEnvContent);
|
|
40674
40390
|
}
|
|
40675
40391
|
function getSettingsChanges(settings, oldSettings) {
|
|
40676
40392
|
const isSameSetting = (a, b2) => a.envVar === b2.envVar && (a.sensitive ?? false) === (b2.sensitive ?? false);
|
|
@@ -40697,7 +40413,7 @@ async function clearSettings(envFilePath, keychain) {
|
|
|
40697
40413
|
if (fsSync.existsSync(envFilePath)) {
|
|
40698
40414
|
const stat7 = fsSync.statSync(envFilePath);
|
|
40699
40415
|
if (!stat7.isDirectory()) {
|
|
40700
|
-
await
|
|
40416
|
+
await fs11.writeFile(envFilePath, "");
|
|
40701
40417
|
}
|
|
40702
40418
|
}
|
|
40703
40419
|
if (!await keychain.isAvailable()) {
|
|
@@ -40730,13 +40446,13 @@ async function getMissingSettings(extensionConfig, extensionId, workspaceDir) {
|
|
|
40730
40446
|
|
|
40731
40447
|
// packages/cli/src/config/extension-manager.ts
|
|
40732
40448
|
var import_chalk5 = __toESM(require_source(), 1);
|
|
40733
|
-
import * as
|
|
40734
|
-
import * as
|
|
40449
|
+
import * as fs16 from "node:fs";
|
|
40450
|
+
import * as path10 from "node:path";
|
|
40735
40451
|
import { stat } from "node:fs/promises";
|
|
40736
40452
|
|
|
40737
40453
|
// packages/cli/src/config/extensions/extensionEnablement.ts
|
|
40738
|
-
import
|
|
40739
|
-
import
|
|
40454
|
+
import fs12 from "node:fs";
|
|
40455
|
+
import path7 from "node:path";
|
|
40740
40456
|
var Override = class _Override {
|
|
40741
40457
|
constructor(baseRule, isDisable, includeSubdirs) {
|
|
40742
40458
|
this.baseRule = baseRule;
|
|
@@ -40777,8 +40493,8 @@ var Override = class _Override {
|
|
|
40777
40493
|
output() {
|
|
40778
40494
|
return `${this.isDisable ? "!" : ""}${this.baseRule}${this.includeSubdirs ? "*" : ""}`;
|
|
40779
40495
|
}
|
|
40780
|
-
matchesPath(
|
|
40781
|
-
return this.asRegex().test(
|
|
40496
|
+
matchesPath(path36) {
|
|
40497
|
+
return this.asRegex().test(path36);
|
|
40782
40498
|
}
|
|
40783
40499
|
};
|
|
40784
40500
|
var ensureLeadingAndTrailingSlash = function(dirPath) {
|
|
@@ -40803,7 +40519,7 @@ var ExtensionEnablementManager = class {
|
|
|
40803
40519
|
enabledExtensionNamesOverride;
|
|
40804
40520
|
constructor(enabledExtensionNames) {
|
|
40805
40521
|
this.configDir = ExtensionStorage.getUserExtensionsDir();
|
|
40806
|
-
this.configFilePath =
|
|
40522
|
+
this.configFilePath = path7.join(
|
|
40807
40523
|
this.configDir,
|
|
40808
40524
|
"extension-enablement.json"
|
|
40809
40525
|
);
|
|
@@ -40848,7 +40564,7 @@ var ExtensionEnablementManager = class {
|
|
|
40848
40564
|
}
|
|
40849
40565
|
readConfig() {
|
|
40850
40566
|
try {
|
|
40851
|
-
const content =
|
|
40567
|
+
const content = fs12.readFileSync(this.configFilePath, "utf-8");
|
|
40852
40568
|
return JSON.parse(content);
|
|
40853
40569
|
} catch (error) {
|
|
40854
40570
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
@@ -40863,8 +40579,8 @@ var ExtensionEnablementManager = class {
|
|
|
40863
40579
|
}
|
|
40864
40580
|
}
|
|
40865
40581
|
writeConfig(config) {
|
|
40866
|
-
|
|
40867
|
-
|
|
40582
|
+
fs12.mkdirSync(this.configDir, { recursive: true });
|
|
40583
|
+
fs12.writeFileSync(this.configFilePath, JSON.stringify(config, null, 2));
|
|
40868
40584
|
}
|
|
40869
40585
|
enable(extensionName, includeSubdirs, scopePath) {
|
|
40870
40586
|
const config = this.readConfig();
|
|
@@ -40899,12 +40615,12 @@ var ExtensionEnablementManager = class {
|
|
|
40899
40615
|
import { createHash, randomUUID } from "node:crypto";
|
|
40900
40616
|
|
|
40901
40617
|
// packages/cli/src/config/extension.ts
|
|
40902
|
-
import * as
|
|
40903
|
-
import * as
|
|
40618
|
+
import * as fs13 from "node:fs";
|
|
40619
|
+
import * as path8 from "node:path";
|
|
40904
40620
|
function loadInstallMetadata(extensionDir) {
|
|
40905
|
-
const metadataFilePath =
|
|
40621
|
+
const metadataFilePath = path8.join(extensionDir, INSTALL_METADATA_FILENAME);
|
|
40906
40622
|
try {
|
|
40907
|
-
const configContent =
|
|
40623
|
+
const configContent = fs13.readFileSync(metadataFilePath, "utf-8");
|
|
40908
40624
|
const metadata = JSON.parse(configContent);
|
|
40909
40625
|
return metadata;
|
|
40910
40626
|
} catch {
|
|
@@ -40995,8 +40711,8 @@ function extensionUpdatesReducer(state, action) {
|
|
|
40995
40711
|
// packages/cli/src/config/extensions/github.ts
|
|
40996
40712
|
import * as os4 from "node:os";
|
|
40997
40713
|
import * as https2 from "node:https";
|
|
40998
|
-
import * as
|
|
40999
|
-
import * as
|
|
40714
|
+
import * as fs15 from "node:fs";
|
|
40715
|
+
import * as path9 from "node:path";
|
|
41000
40716
|
|
|
41001
40717
|
// packages/cli/node_modules/tar/dist/esm/index.min.js
|
|
41002
40718
|
import Hr from "events";
|
|
@@ -43122,7 +42838,7 @@ var di = (s3, t, e, i) => {
|
|
|
43122
42838
|
});
|
|
43123
42839
|
};
|
|
43124
42840
|
var $n = (s3, t, e, i, r2) => {
|
|
43125
|
-
if (t.isDirectory())
|
|
42841
|
+
if (t.isDirectory()) fs14(Ee.resolve(s3, t.name), e, i, (n) => {
|
|
43126
42842
|
if (n) return r2(n);
|
|
43127
42843
|
let o = Ee.resolve(s3, t.name);
|
|
43128
42844
|
di(o, e, i, r2);
|
|
@@ -43132,7 +42848,7 @@ var $n = (s3, t, e, i, r2) => {
|
|
|
43132
42848
|
di(n, e, i, r2);
|
|
43133
42849
|
}
|
|
43134
42850
|
};
|
|
43135
|
-
var
|
|
42851
|
+
var fs14 = (s3, t, e, i) => {
|
|
43136
42852
|
ui.readdir(s3, { withFileTypes: true }, (r2, n) => {
|
|
43137
42853
|
if (r2) {
|
|
43138
42854
|
if (r2.code === "ENOENT") return i();
|
|
@@ -43195,7 +42911,7 @@ var jn = (s3, t) => {
|
|
|
43195
42911
|
var fr = (s3, t, e) => {
|
|
43196
42912
|
s3 = f(s3);
|
|
43197
42913
|
let i = t.umask ?? 18, r2 = t.mode | 448, n = (r2 & i) !== 0, o = t.uid, h = t.gid, a = typeof o == "number" && typeof h == "number" && (o !== t.processUid || h !== t.processGid), l = t.preserve, c2 = t.unlink, d = f(t.cwd), S = (E, x) => {
|
|
43198
|
-
E ? e(E) : x && a ?
|
|
42914
|
+
E ? e(E) : x && a ? fs14(x, o, h, (_s) => S(_s)) : n ? k.chmod(s3, r2, e) : e();
|
|
43199
42915
|
};
|
|
43200
42916
|
if (s3 === d) return jn(s3, S);
|
|
43201
42917
|
if (l) return qn.mkdir(s3, { mode: r2, recursive: true }).then((E) => S(null, E ?? void 0), S);
|
|
@@ -44201,9 +43917,9 @@ async function downloadFromGitHubRelease(installMetadata, destination, githubRep
|
|
|
44201
43917
|
};
|
|
44202
43918
|
}
|
|
44203
43919
|
if (!fileName) {
|
|
44204
|
-
fileName =
|
|
43920
|
+
fileName = path9.basename(new URL(archiveUrl).pathname);
|
|
44205
43921
|
}
|
|
44206
|
-
let downloadedAssetPath =
|
|
43922
|
+
let downloadedAssetPath = path9.join(destination, fileName);
|
|
44207
43923
|
if (isTar && !downloadedAssetPath.endsWith(".tar.gz")) {
|
|
44208
43924
|
downloadedAssetPath += ".tar.gz";
|
|
44209
43925
|
} else if (isZip && !downloadedAssetPath.endsWith(".zip")) {
|
|
@@ -44234,26 +43950,26 @@ async function downloadFromGitHubRelease(installMetadata, destination, githubRep
|
|
|
44234
43950
|
errorMessage: `Failed to extract asset from ${downloadedAssetPath}: ${getErrorMessage(error)}`
|
|
44235
43951
|
};
|
|
44236
43952
|
}
|
|
44237
|
-
const entries = await
|
|
43953
|
+
const entries = await fs15.promises.readdir(destination, {
|
|
44238
43954
|
withFileTypes: true
|
|
44239
43955
|
});
|
|
44240
43956
|
if (entries.length === 2) {
|
|
44241
43957
|
const lonelyDir = entries.find((entry) => entry.isDirectory());
|
|
44242
|
-
if (lonelyDir &&
|
|
44243
|
-
|
|
43958
|
+
if (lonelyDir && fs15.existsSync(
|
|
43959
|
+
path9.join(destination, lonelyDir.name, EXTENSIONS_CONFIG_FILENAME)
|
|
44244
43960
|
)) {
|
|
44245
|
-
const dirPathToExtract =
|
|
44246
|
-
const extractedDirFiles = await
|
|
43961
|
+
const dirPathToExtract = path9.join(destination, lonelyDir.name);
|
|
43962
|
+
const extractedDirFiles = await fs15.promises.readdir(dirPathToExtract);
|
|
44247
43963
|
for (const file of extractedDirFiles) {
|
|
44248
|
-
await
|
|
44249
|
-
|
|
44250
|
-
|
|
43964
|
+
await fs15.promises.rename(
|
|
43965
|
+
path9.join(dirPathToExtract, file),
|
|
43966
|
+
path9.join(destination, file)
|
|
44251
43967
|
);
|
|
44252
43968
|
}
|
|
44253
|
-
await
|
|
43969
|
+
await fs15.promises.rmdir(dirPathToExtract);
|
|
44254
43970
|
}
|
|
44255
43971
|
}
|
|
44256
|
-
await
|
|
43972
|
+
await fs15.promises.unlink(downloadedAssetPath);
|
|
44257
43973
|
return {
|
|
44258
43974
|
tagName: releaseData.tag_name,
|
|
44259
43975
|
type: "github-release",
|
|
@@ -44323,7 +44039,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44323
44039
|
new Error(`Request failed with status code ${res.statusCode}`)
|
|
44324
44040
|
);
|
|
44325
44041
|
}
|
|
44326
|
-
const file =
|
|
44042
|
+
const file = fs15.createWriteStream(dest);
|
|
44327
44043
|
res.pipe(file);
|
|
44328
44044
|
file.on("finish", () => file.close(resolve8));
|
|
44329
44045
|
}).on("error", reject);
|
|
@@ -44609,9 +44325,9 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
44609
44325
|
}
|
|
44610
44326
|
}
|
|
44611
44327
|
const extensionsDir = ExtensionStorage.getUserExtensionsDir();
|
|
44612
|
-
await
|
|
44328
|
+
await fs16.promises.mkdir(extensionsDir, { recursive: true });
|
|
44613
44329
|
if (installMetadata.type === "local" || installMetadata.type === "link") {
|
|
44614
|
-
installMetadata.source =
|
|
44330
|
+
installMetadata.source = path10.isAbsolute(installMetadata.source) ? installMetadata.source : path10.resolve(this.workspaceDir, installMetadata.source);
|
|
44615
44331
|
}
|
|
44616
44332
|
let tempDir;
|
|
44617
44333
|
if (installMetadata.type === "git" || installMetadata.type === "github-release") {
|
|
@@ -44676,12 +44392,12 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44676
44392
|
`Cannot update to "${newExtensionName}" because an extension with that name is already installed.`
|
|
44677
44393
|
);
|
|
44678
44394
|
}
|
|
44679
|
-
const newHasHooks =
|
|
44680
|
-
|
|
44395
|
+
const newHasHooks = fs16.existsSync(
|
|
44396
|
+
path10.join(localSourcePath, "hooks", "hooks.json")
|
|
44681
44397
|
);
|
|
44682
44398
|
const previousHasHooks = !!(isUpdate && previous && previous.hooks && Object.keys(previous.hooks).length > 0);
|
|
44683
44399
|
const newSkills = await loadSkillsFromDir(
|
|
44684
|
-
|
|
44400
|
+
path10.join(localSourcePath, "skills")
|
|
44685
44401
|
);
|
|
44686
44402
|
const previousSkills = previous?.skills ?? [];
|
|
44687
44403
|
const isMigrating = Boolean(
|
|
@@ -44701,7 +44417,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44701
44417
|
const destinationPath = new ExtensionStorage(
|
|
44702
44418
|
newExtensionName
|
|
44703
44419
|
).getExtensionDir();
|
|
44704
|
-
if ((!isUpdate || newExtensionName !== previousName) &&
|
|
44420
|
+
if ((!isUpdate || newExtensionName !== previousName) && fs16.existsSync(destinationPath)) {
|
|
44705
44421
|
throw new Error(
|
|
44706
44422
|
`Cannot install extension "${newExtensionName}" because a directory with that name already exists. Please remove it manually.`
|
|
44707
44423
|
);
|
|
@@ -44729,7 +44445,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44729
44445
|
}
|
|
44730
44446
|
await this.uninstallExtension(previousName, isUpdate);
|
|
44731
44447
|
}
|
|
44732
|
-
await
|
|
44448
|
+
await fs16.promises.mkdir(destinationPath, { recursive: true });
|
|
44733
44449
|
if (this.requestSetting && this.settings.experimental.extensionConfig) {
|
|
44734
44450
|
if (isUpdate) {
|
|
44735
44451
|
await maybePromptForSettings(
|
|
@@ -44763,11 +44479,11 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44763
44479
|
await copyExtension(localSourcePath, destinationPath);
|
|
44764
44480
|
}
|
|
44765
44481
|
const metadataString = JSON.stringify(installMetadata, null, 2);
|
|
44766
|
-
const metadataPath =
|
|
44482
|
+
const metadataPath = path10.join(
|
|
44767
44483
|
destinationPath,
|
|
44768
44484
|
INSTALL_METADATA_FILENAME
|
|
44769
44485
|
);
|
|
44770
|
-
await
|
|
44486
|
+
await fs16.promises.writeFile(metadataPath, metadataString);
|
|
44771
44487
|
await this.storeExtensionIntegrity(
|
|
44772
44488
|
newExtensionConfig.name,
|
|
44773
44489
|
installMetadata
|
|
@@ -44819,7 +44535,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44819
44535
|
}
|
|
44820
44536
|
} finally {
|
|
44821
44537
|
if (tempDir) {
|
|
44822
|
-
await
|
|
44538
|
+
await fs16.promises.rm(tempDir, { recursive: true, force: true });
|
|
44823
44539
|
}
|
|
44824
44540
|
}
|
|
44825
44541
|
return extension;
|
|
@@ -44871,9 +44587,9 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44871
44587
|
}
|
|
44872
44588
|
await this.unloadExtension(extension);
|
|
44873
44589
|
const storage = new ExtensionStorage(
|
|
44874
|
-
extension.installMetadata?.type === "link" ? extension.name :
|
|
44590
|
+
extension.installMetadata?.type === "link" ? extension.name : path10.basename(extension.path)
|
|
44875
44591
|
);
|
|
44876
|
-
await
|
|
44592
|
+
await fs16.promises.rm(storage.getExtensionDir(), {
|
|
44877
44593
|
recursive: true,
|
|
44878
44594
|
force: true
|
|
44879
44595
|
});
|
|
@@ -44918,13 +44634,13 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44918
44634
|
return this.loadedExtensions;
|
|
44919
44635
|
}
|
|
44920
44636
|
const extensionsDir = ExtensionStorage.getUserExtensionsDir();
|
|
44921
|
-
if (!
|
|
44637
|
+
if (!fs16.existsSync(extensionsDir)) {
|
|
44922
44638
|
this.loadedExtensions = [];
|
|
44923
44639
|
return this.loadedExtensions;
|
|
44924
44640
|
}
|
|
44925
|
-
const subdirs = await
|
|
44641
|
+
const subdirs = await fs16.promises.readdir(extensionsDir);
|
|
44926
44642
|
const extensionPromises = subdirs.map((subdir) => {
|
|
44927
|
-
const extensionDir =
|
|
44643
|
+
const extensionDir = path10.join(extensionsDir, subdir);
|
|
44928
44644
|
return this._buildExtension(extensionDir);
|
|
44929
44645
|
});
|
|
44930
44646
|
const builtExtensionsOrNull = await Promise.all(extensionPromises);
|
|
@@ -44986,7 +44702,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44986
44702
|
*/
|
|
44987
44703
|
async _buildExtension(extensionDir) {
|
|
44988
44704
|
try {
|
|
44989
|
-
const stats = await
|
|
44705
|
+
const stats = await fs16.promises.stat(extensionDir);
|
|
44990
44706
|
if (!stats.isDirectory()) {
|
|
44991
44707
|
return null;
|
|
44992
44708
|
}
|
|
@@ -45116,7 +44832,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45116
44832
|
}
|
|
45117
44833
|
}
|
|
45118
44834
|
const contextFiles = getContextFileNames(config).map((contextFileName) => {
|
|
45119
|
-
const contextFilePath =
|
|
44835
|
+
const contextFilePath = path10.join(
|
|
45120
44836
|
effectiveExtensionPath,
|
|
45121
44837
|
contextFileName
|
|
45122
44838
|
);
|
|
@@ -45126,12 +44842,12 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45126
44842
|
);
|
|
45127
44843
|
}
|
|
45128
44844
|
return contextFilePath;
|
|
45129
|
-
}).filter((contextFilePath) =>
|
|
44845
|
+
}).filter((contextFilePath) => fs16.existsSync(contextFilePath));
|
|
45130
44846
|
const hydrationContext = {
|
|
45131
44847
|
extensionPath: effectiveExtensionPath,
|
|
45132
44848
|
workspacePath: this.workspaceDir,
|
|
45133
|
-
"/":
|
|
45134
|
-
pathSeparator:
|
|
44849
|
+
"/": path10.sep,
|
|
44850
|
+
pathSeparator: path10.sep,
|
|
45135
44851
|
...customEnv
|
|
45136
44852
|
};
|
|
45137
44853
|
let hooks;
|
|
@@ -45165,7 +44881,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45165
44881
|
}
|
|
45166
44882
|
}
|
|
45167
44883
|
let skills = await loadSkillsFromDir(
|
|
45168
|
-
|
|
44884
|
+
path10.join(effectiveExtensionPath, "skills")
|
|
45169
44885
|
);
|
|
45170
44886
|
skills = skills.map((skill) => ({
|
|
45171
44887
|
...recursivelyHydrateStrings(skill, hydrationContext),
|
|
@@ -45173,8 +44889,8 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45173
44889
|
}));
|
|
45174
44890
|
let rules;
|
|
45175
44891
|
let checkers;
|
|
45176
|
-
const policyDir =
|
|
45177
|
-
if (
|
|
44892
|
+
const policyDir = path10.join(effectiveExtensionPath, "policies");
|
|
44893
|
+
if (fs16.existsSync(policyDir)) {
|
|
45178
44894
|
const result = await loadExtensionPolicies(config.name, policyDir);
|
|
45179
44895
|
rules = result.rules;
|
|
45180
44896
|
checkers = result.checkers;
|
|
@@ -45188,7 +44904,7 @@ Details: ${error.details}` : ""}`
|
|
|
45188
44904
|
}
|
|
45189
44905
|
}
|
|
45190
44906
|
const agentLoadResult = await loadAgentsFromDirectory(
|
|
45191
|
-
|
|
44907
|
+
path10.join(effectiveExtensionPath, "agents")
|
|
45192
44908
|
);
|
|
45193
44909
|
agentLoadResult.agents = agentLoadResult.agents.map((agent) => ({
|
|
45194
44910
|
...recursivelyHydrateStrings(agent, hydrationContext),
|
|
@@ -45248,12 +44964,12 @@ Details: ${error.details}` : ""}`
|
|
|
45248
44964
|
return this.maybeStopExtension(extension);
|
|
45249
44965
|
}
|
|
45250
44966
|
async loadExtensionConfig(extensionDir) {
|
|
45251
|
-
const configFilePath =
|
|
45252
|
-
if (!
|
|
44967
|
+
const configFilePath = path10.join(extensionDir, EXTENSIONS_CONFIG_FILENAME);
|
|
44968
|
+
if (!fs16.existsSync(configFilePath)) {
|
|
45253
44969
|
throw new Error(`Configuration file not found at ${configFilePath}`);
|
|
45254
44970
|
}
|
|
45255
44971
|
try {
|
|
45256
|
-
const configContent = await
|
|
44972
|
+
const configContent = await fs16.promises.readFile(configFilePath, "utf-8");
|
|
45257
44973
|
const rawConfig = JSON.parse(configContent);
|
|
45258
44974
|
if (!rawConfig.name || !rawConfig.version) {
|
|
45259
44975
|
throw new Error(
|
|
@@ -45266,8 +44982,8 @@ Details: ${error.details}` : ""}`
|
|
|
45266
44982
|
{
|
|
45267
44983
|
extensionPath: extensionDir,
|
|
45268
44984
|
workspacePath: this.workspaceDir,
|
|
45269
|
-
"/":
|
|
45270
|
-
pathSeparator:
|
|
44985
|
+
"/": path10.sep,
|
|
44986
|
+
pathSeparator: path10.sep
|
|
45271
44987
|
}
|
|
45272
44988
|
);
|
|
45273
44989
|
validateName(config.name);
|
|
@@ -45281,9 +44997,9 @@ Details: ${error.details}` : ""}`
|
|
|
45281
44997
|
}
|
|
45282
44998
|
}
|
|
45283
44999
|
async loadExtensionHooks(extensionDir, context) {
|
|
45284
|
-
const hooksFilePath =
|
|
45000
|
+
const hooksFilePath = path10.join(extensionDir, "hooks", "hooks.json");
|
|
45285
45001
|
try {
|
|
45286
|
-
const hooksContent = await
|
|
45002
|
+
const hooksContent = await fs16.promises.readFile(hooksFilePath, "utf-8");
|
|
45287
45003
|
const rawHooks = JSON.parse(hooksContent);
|
|
45288
45004
|
if (!rawHooks || typeof rawHooks !== "object" || typeof rawHooks.hooks !== "object" || rawHooks.hooks === null || Array.isArray(rawHooks.hooks)) {
|
|
45289
45005
|
debugLogger.warn(
|
|
@@ -45296,8 +45012,8 @@ Details: ${error.details}` : ""}`
|
|
|
45296
45012
|
rawHooks.hooks,
|
|
45297
45013
|
{
|
|
45298
45014
|
...context,
|
|
45299
|
-
"/":
|
|
45300
|
-
pathSeparator:
|
|
45015
|
+
"/": path10.sep,
|
|
45016
|
+
pathSeparator: path10.sep
|
|
45301
45017
|
}
|
|
45302
45018
|
);
|
|
45303
45019
|
return hydratedHooks;
|
|
@@ -45453,19 +45169,19 @@ function filterMcpConfig(original) {
|
|
|
45453
45169
|
return Object.freeze(rest);
|
|
45454
45170
|
}
|
|
45455
45171
|
async function makeWritableRecursive(targetPath) {
|
|
45456
|
-
const stats = await
|
|
45172
|
+
const stats = await fs16.promises.lstat(targetPath);
|
|
45457
45173
|
if (stats.isDirectory()) {
|
|
45458
|
-
await
|
|
45459
|
-
const children = await
|
|
45174
|
+
await fs16.promises.chmod(targetPath, stats.mode | 448);
|
|
45175
|
+
const children = await fs16.promises.readdir(targetPath);
|
|
45460
45176
|
for (const child of children) {
|
|
45461
|
-
await makeWritableRecursive(
|
|
45177
|
+
await makeWritableRecursive(path10.join(targetPath, child));
|
|
45462
45178
|
}
|
|
45463
45179
|
} else if (stats.isFile()) {
|
|
45464
|
-
await
|
|
45180
|
+
await fs16.promises.chmod(targetPath, stats.mode | 384);
|
|
45465
45181
|
}
|
|
45466
45182
|
}
|
|
45467
45183
|
async function copyExtension(source2, destination) {
|
|
45468
|
-
await
|
|
45184
|
+
await fs16.promises.cp(source2, destination, { recursive: true });
|
|
45469
45185
|
await makeWritableRecursive(destination);
|
|
45470
45186
|
}
|
|
45471
45187
|
function getContextFileNames(config) {
|
|
@@ -45524,8 +45240,8 @@ function hashValue(value) {
|
|
|
45524
45240
|
}
|
|
45525
45241
|
|
|
45526
45242
|
// packages/cli/src/config/mcp/mcpServerEnablement.ts
|
|
45527
|
-
import
|
|
45528
|
-
import
|
|
45243
|
+
import fs17 from "node:fs/promises";
|
|
45244
|
+
import path11 from "node:path";
|
|
45529
45245
|
function normalizeServerId(serverId) {
|
|
45530
45246
|
return serverId.toLowerCase().trim();
|
|
45531
45247
|
}
|
|
@@ -45626,7 +45342,7 @@ var McpServerEnablementManager = class _McpServerEnablementManager {
|
|
|
45626
45342
|
}
|
|
45627
45343
|
constructor() {
|
|
45628
45344
|
this.configDir = Storage.getGlobalGeminiDir();
|
|
45629
|
-
this.configFilePath =
|
|
45345
|
+
this.configFilePath = path11.join(this.configDir, MCP_ENABLEMENT_FILENAME);
|
|
45630
45346
|
}
|
|
45631
45347
|
/**
|
|
45632
45348
|
* Check if server is enabled in FILE (persistent config only).
|
|
@@ -45746,7 +45462,7 @@ var McpServerEnablementManager = class _McpServerEnablementManager {
|
|
|
45746
45462
|
*/
|
|
45747
45463
|
async readConfig() {
|
|
45748
45464
|
try {
|
|
45749
|
-
const content = await
|
|
45465
|
+
const content = await fs17.readFile(this.configFilePath, "utf-8");
|
|
45750
45466
|
return JSON.parse(content);
|
|
45751
45467
|
} catch (error) {
|
|
45752
45468
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
@@ -45764,8 +45480,8 @@ var McpServerEnablementManager = class _McpServerEnablementManager {
|
|
|
45764
45480
|
* Write config to file asynchronously.
|
|
45765
45481
|
*/
|
|
45766
45482
|
async writeConfig(config) {
|
|
45767
|
-
await
|
|
45768
|
-
await
|
|
45483
|
+
await fs17.mkdir(this.configDir, { recursive: true });
|
|
45484
|
+
await fs17.writeFile(this.configFilePath, JSON.stringify(config, null, 2));
|
|
45769
45485
|
}
|
|
45770
45486
|
};
|
|
45771
45487
|
|
|
@@ -45806,9 +45522,9 @@ function isSettingsValue(value) {
|
|
|
45806
45522
|
const type = typeof value;
|
|
45807
45523
|
return type === "string" || type === "number" || type === "boolean" || type === "object";
|
|
45808
45524
|
}
|
|
45809
|
-
function getNestedValue(obj,
|
|
45525
|
+
function getNestedValue(obj, path36) {
|
|
45810
45526
|
let current = obj;
|
|
45811
|
-
for (const key of
|
|
45527
|
+
for (const key of path36) {
|
|
45812
45528
|
if (!isRecord(current) || !(key in current)) {
|
|
45813
45529
|
return void 0;
|
|
45814
45530
|
}
|
|
@@ -45821,8 +45537,8 @@ function getEffectiveValue(key, settings) {
|
|
|
45821
45537
|
if (!definition) {
|
|
45822
45538
|
return void 0;
|
|
45823
45539
|
}
|
|
45824
|
-
const
|
|
45825
|
-
const value = getNestedValue(settings,
|
|
45540
|
+
const path36 = key.split(".");
|
|
45541
|
+
const value = getNestedValue(settings, path36);
|
|
45826
45542
|
if (value !== void 0 && isSettingsValue(value)) {
|
|
45827
45543
|
return value;
|
|
45828
45544
|
}
|
|
@@ -45832,8 +45548,8 @@ function getDialogSettingKeys() {
|
|
|
45832
45548
|
return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
|
|
45833
45549
|
}
|
|
45834
45550
|
function isInSettingsScope(key, scopeSettings) {
|
|
45835
|
-
const
|
|
45836
|
-
const value = getNestedValue(scopeSettings,
|
|
45551
|
+
const path36 = key.split(".");
|
|
45552
|
+
const value = getNestedValue(scopeSettings, path36);
|
|
45837
45553
|
return value !== void 0;
|
|
45838
45554
|
}
|
|
45839
45555
|
function getDisplayValue(key, scopeSettings, _mergedSettings) {
|
|
@@ -45929,8 +45645,8 @@ function getEditValue(type, rawValue) {
|
|
|
45929
45645
|
}
|
|
45930
45646
|
|
|
45931
45647
|
// packages/cli/src/ui/hooks/atCommandProcessor.ts
|
|
45932
|
-
import * as
|
|
45933
|
-
import * as
|
|
45648
|
+
import * as fs18 from "node:fs/promises";
|
|
45649
|
+
import * as path12 from "node:path";
|
|
45934
45650
|
import { Buffer as Buffer5 } from "node:buffer";
|
|
45935
45651
|
var REF_CONTENT_HEADER = `
|
|
45936
45652
|
${REFERENCE_CONTENT_START}`;
|
|
@@ -46009,7 +45725,7 @@ async function checkPermissions(query, config) {
|
|
|
46009
45725
|
const pathName = part.content.substring(1);
|
|
46010
45726
|
if (!pathName) continue;
|
|
46011
45727
|
const resolvedPathName = resolveToRealPath(
|
|
46012
|
-
|
|
45728
|
+
path12.resolve(config.getTargetDir(), pathName)
|
|
46013
45729
|
);
|
|
46014
45730
|
if (config.validatePathAccess(resolvedPathName, "read")) {
|
|
46015
45731
|
if (await fileExists(resolvedPathName)) {
|
|
@@ -46049,15 +45765,15 @@ async function resolveFilePaths(fileParts, config, onDebugMessage, signal) {
|
|
|
46049
45765
|
}
|
|
46050
45766
|
for (const dir of config.getWorkspaceContext().getDirectories()) {
|
|
46051
45767
|
try {
|
|
46052
|
-
const absolutePath =
|
|
46053
|
-
const stats = await
|
|
46054
|
-
const relativePath =
|
|
45768
|
+
const absolutePath = path12.resolve(dir, pathName);
|
|
45769
|
+
const stats = await fs18.stat(absolutePath);
|
|
45770
|
+
const relativePath = path12.isAbsolute(pathName) ? path12.relative(dir, absolutePath) : pathName;
|
|
46055
45771
|
if (stats.isDirectory()) {
|
|
46056
|
-
const pathSpec =
|
|
45772
|
+
const pathSpec = path12.join(relativePath, "**");
|
|
46057
45773
|
resolvedFiles.push({
|
|
46058
45774
|
part,
|
|
46059
45775
|
pathSpec,
|
|
46060
|
-
displayLabel:
|
|
45776
|
+
displayLabel: path12.isAbsolute(pathName) ? relativePath : pathName,
|
|
46061
45777
|
absolutePath
|
|
46062
45778
|
});
|
|
46063
45779
|
onDebugMessage(
|
|
@@ -46067,7 +45783,7 @@ async function resolveFilePaths(fileParts, config, onDebugMessage, signal) {
|
|
|
46067
45783
|
resolvedFiles.push({
|
|
46068
45784
|
part,
|
|
46069
45785
|
pathSpec: relativePath,
|
|
46070
|
-
displayLabel:
|
|
45786
|
+
displayLabel: path12.isAbsolute(pathName) ? relativePath : pathName,
|
|
46071
45787
|
absolutePath
|
|
46072
45788
|
});
|
|
46073
45789
|
onDebugMessage(
|
|
@@ -46093,11 +45809,11 @@ async function resolveFilePaths(fileParts, config, onDebugMessage, signal) {
|
|
|
46093
45809
|
const lines = globResult.llmContent.split("\n");
|
|
46094
45810
|
if (lines.length > 1 && lines[1]) {
|
|
46095
45811
|
const firstMatchAbsolute = lines[1].trim();
|
|
46096
|
-
const pathSpec =
|
|
45812
|
+
const pathSpec = path12.relative(dir, firstMatchAbsolute);
|
|
46097
45813
|
resolvedFiles.push({
|
|
46098
45814
|
part,
|
|
46099
45815
|
pathSpec,
|
|
46100
|
-
displayLabel:
|
|
45816
|
+
displayLabel: path12.isAbsolute(pathName) ? pathSpec : pathName
|
|
46101
45817
|
});
|
|
46102
45818
|
onDebugMessage(
|
|
46103
45819
|
`Glob search for ${pathName} found ${firstMatchAbsolute}, using relative path: ${pathSpec}`
|
|
@@ -46284,7 +46000,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
|
|
|
46284
46000
|
if (!displayPath) {
|
|
46285
46001
|
for (const dir of config.getWorkspaceContext().getDirectories()) {
|
|
46286
46002
|
if (filePathSpecInContent.startsWith(dir)) {
|
|
46287
|
-
displayPath =
|
|
46003
|
+
displayPath = path12.relative(dir, filePathSpecInContent);
|
|
46288
46004
|
break;
|
|
46289
46005
|
}
|
|
46290
46006
|
}
|
|
@@ -46447,25 +46163,25 @@ function convertResourceContentsToParts(response) {
|
|
|
46447
46163
|
}
|
|
46448
46164
|
|
|
46449
46165
|
// packages/cli/node_modules/clipboardy/index.js
|
|
46450
|
-
import
|
|
46166
|
+
import process25 from "node:process";
|
|
46451
46167
|
|
|
46452
46168
|
// node_modules/is-wayland/index.js
|
|
46453
|
-
import
|
|
46169
|
+
import process20 from "node:process";
|
|
46454
46170
|
function isWayland() {
|
|
46455
|
-
if (
|
|
46171
|
+
if (process20.platform !== "linux") {
|
|
46456
46172
|
return false;
|
|
46457
46173
|
}
|
|
46458
|
-
if (
|
|
46174
|
+
if (process20.env.WAYLAND_DISPLAY) {
|
|
46459
46175
|
return true;
|
|
46460
46176
|
}
|
|
46461
|
-
if (
|
|
46177
|
+
if (process20.env.XDG_SESSION_TYPE === "wayland") {
|
|
46462
46178
|
return true;
|
|
46463
46179
|
}
|
|
46464
46180
|
return false;
|
|
46465
46181
|
}
|
|
46466
46182
|
|
|
46467
46183
|
// node_modules/clipboard-image/index.js
|
|
46468
|
-
import
|
|
46184
|
+
import process22 from "node:process";
|
|
46469
46185
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
46470
46186
|
|
|
46471
46187
|
// node_modules/run-jxa/index.js
|
|
@@ -46705,9 +46421,9 @@ var Subsume = class _Subsume {
|
|
|
46705
46421
|
|
|
46706
46422
|
// node_modules/macos-version/index.js
|
|
46707
46423
|
var import_semver = __toESM(require_semver2(), 1);
|
|
46708
|
-
import
|
|
46709
|
-
import
|
|
46710
|
-
var isMacOS =
|
|
46424
|
+
import process21 from "node:process";
|
|
46425
|
+
import fs19 from "node:fs";
|
|
46426
|
+
var isMacOS = process21.platform === "darwin";
|
|
46711
46427
|
var version;
|
|
46712
46428
|
var clean = (version2) => {
|
|
46713
46429
|
const { length } = version2.split(".");
|
|
@@ -46731,7 +46447,7 @@ function macOSVersion() {
|
|
|
46731
46447
|
return;
|
|
46732
46448
|
}
|
|
46733
46449
|
if (!version) {
|
|
46734
|
-
const file =
|
|
46450
|
+
const file = fs19.readFileSync("/System/Library/CoreServices/SystemVersion.plist", "utf8");
|
|
46735
46451
|
const matches = parseVersion(file);
|
|
46736
46452
|
if (!matches) {
|
|
46737
46453
|
return;
|
|
@@ -46740,7 +46456,7 @@ function macOSVersion() {
|
|
|
46740
46456
|
}
|
|
46741
46457
|
return version;
|
|
46742
46458
|
}
|
|
46743
|
-
if (
|
|
46459
|
+
if (process21.env.NODE_ENV === "test") {
|
|
46744
46460
|
macOSVersion._parseVersion = parseVersion;
|
|
46745
46461
|
}
|
|
46746
46462
|
function isMacOSVersionGreaterThanOrEqualTo(version2) {
|
|
@@ -46787,7 +46503,7 @@ async function runJxa(input, arguments_) {
|
|
|
46787
46503
|
|
|
46788
46504
|
// node_modules/clipboard-image/index.js
|
|
46789
46505
|
async function hasClipboardImages() {
|
|
46790
|
-
if (
|
|
46506
|
+
if (process22.platform !== "darwin") {
|
|
46791
46507
|
return false;
|
|
46792
46508
|
}
|
|
46793
46509
|
const result = await runJxa(() => {
|
|
@@ -46813,7 +46529,7 @@ async function hasClipboardImages() {
|
|
|
46813
46529
|
return result;
|
|
46814
46530
|
}
|
|
46815
46531
|
async function readClipboardImages() {
|
|
46816
|
-
if (
|
|
46532
|
+
if (process22.platform !== "darwin") {
|
|
46817
46533
|
return [];
|
|
46818
46534
|
}
|
|
46819
46535
|
const result = await runJxa(() => {
|
|
@@ -46895,10 +46611,10 @@ async function readClipboardImages() {
|
|
|
46895
46611
|
return result;
|
|
46896
46612
|
}
|
|
46897
46613
|
async function writeClipboardImages(filePaths) {
|
|
46898
|
-
if (
|
|
46614
|
+
if (process22.platform !== "darwin") {
|
|
46899
46615
|
return;
|
|
46900
46616
|
}
|
|
46901
|
-
const paths = filePaths.map((
|
|
46617
|
+
const paths = filePaths.map((path36) => path36 instanceof URL ? fileURLToPath2(path36) : path36);
|
|
46902
46618
|
await runJxa((...paths2) => {
|
|
46903
46619
|
ObjC.import("AppKit");
|
|
46904
46620
|
ObjC.import("Foundation");
|
|
@@ -46978,13 +46694,13 @@ var clipboard = {
|
|
|
46978
46694
|
var termux_default = clipboard;
|
|
46979
46695
|
|
|
46980
46696
|
// packages/cli/node_modules/clipboardy/lib/linux.js
|
|
46981
|
-
import
|
|
46982
|
-
import
|
|
46697
|
+
import fs20 from "node:fs";
|
|
46698
|
+
import path13 from "node:path";
|
|
46983
46699
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
46984
|
-
var __dirname =
|
|
46700
|
+
var __dirname = path13.dirname(fileURLToPath3(import.meta.url));
|
|
46985
46701
|
var xsel = "xsel";
|
|
46986
|
-
var xselFallbackPath =
|
|
46987
|
-
var hasXselFallback =
|
|
46702
|
+
var xselFallbackPath = path13.join(__dirname, "../fallbacks/linux/xsel");
|
|
46703
|
+
var hasXselFallback = fs20.existsSync(xselFallbackPath);
|
|
46988
46704
|
var copyArguments = ["--clipboard", "--input"];
|
|
46989
46705
|
var pasteArguments = ["--clipboard", "--output"];
|
|
46990
46706
|
var isDisplayError = (error) => /Can't open display|Inappropriate ioctl/i.test(error.stderr ?? "");
|
|
@@ -47120,19 +46836,19 @@ var clipboard4 = {
|
|
|
47120
46836
|
var macos_default = clipboard4;
|
|
47121
46837
|
|
|
47122
46838
|
// packages/cli/node_modules/clipboardy/lib/windows.js
|
|
47123
|
-
import
|
|
47124
|
-
import
|
|
46839
|
+
import fs21 from "node:fs";
|
|
46840
|
+
import path14 from "node:path";
|
|
47125
46841
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
47126
46842
|
|
|
47127
46843
|
// node_modules/system-architecture/index.js
|
|
47128
46844
|
import { promisify as promisify2 } from "node:util";
|
|
47129
|
-
import
|
|
47130
|
-
import
|
|
47131
|
-
var execFilePromises = promisify2(
|
|
46845
|
+
import process23 from "node:process";
|
|
46846
|
+
import childProcess from "node:child_process";
|
|
46847
|
+
var execFilePromises = promisify2(childProcess.execFile);
|
|
47132
46848
|
function systemArchitectureSync() {
|
|
47133
|
-
const { arch: arch2, platform: platform5, env: env3 } =
|
|
46849
|
+
const { arch: arch2, platform: platform5, env: env3 } = process23;
|
|
47134
46850
|
if (platform5 === "darwin" && arch2 === "x64") {
|
|
47135
|
-
const stdout =
|
|
46851
|
+
const stdout = childProcess.execFileSync("sysctl", ["-inq", "sysctl.proc_translated"], { encoding: "utf8" });
|
|
47136
46852
|
return stdout.trim() === "1" ? "arm64" : "x64";
|
|
47137
46853
|
}
|
|
47138
46854
|
if (arch2 === "arm64" || arch2 === "x64") {
|
|
@@ -47142,7 +46858,7 @@ function systemArchitectureSync() {
|
|
|
47142
46858
|
return "x64";
|
|
47143
46859
|
}
|
|
47144
46860
|
if (platform5 === "linux") {
|
|
47145
|
-
const stdout =
|
|
46861
|
+
const stdout = childProcess.execFileSync("getconf", ["LONG_BIT"], { encoding: "utf8" });
|
|
47146
46862
|
if (stdout.trim() === "64") {
|
|
47147
46863
|
return "x64";
|
|
47148
46864
|
}
|
|
@@ -47162,12 +46878,12 @@ function is64bitSync() {
|
|
|
47162
46878
|
}
|
|
47163
46879
|
|
|
47164
46880
|
// node_modules/powershell-utils/index.js
|
|
47165
|
-
import
|
|
46881
|
+
import process24 from "node:process";
|
|
47166
46882
|
import { Buffer as Buffer6 } from "node:buffer";
|
|
47167
46883
|
import { promisify as promisify3 } from "node:util";
|
|
47168
|
-
import
|
|
47169
|
-
var execFile = promisify3(
|
|
47170
|
-
var powerShellPath = () => `${
|
|
46884
|
+
import childProcess2 from "node:child_process";
|
|
46885
|
+
var execFile = promisify3(childProcess2.execFile);
|
|
46886
|
+
var powerShellPath = () => `${process24.env.SYSTEMROOT || process24.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
47171
46887
|
var argumentsPrefix = [
|
|
47172
46888
|
"-NoProfile",
|
|
47173
46889
|
"-NonInteractive",
|
|
@@ -47198,10 +46914,10 @@ executePowerShell.escapeArgument = escapeArgument;
|
|
|
47198
46914
|
executePowerShell.createArguments = createArguments;
|
|
47199
46915
|
|
|
47200
46916
|
// packages/cli/node_modules/clipboardy/lib/windows.js
|
|
47201
|
-
var __dirname2 =
|
|
46917
|
+
var __dirname2 = path14.dirname(fileURLToPath4(import.meta.url));
|
|
47202
46918
|
var binarySuffix = is64bitSync() ? "x86_64" : "i686";
|
|
47203
|
-
var windowBinaryPath =
|
|
47204
|
-
var hasWindowsBinaryFallback =
|
|
46919
|
+
var windowBinaryPath = path14.join(__dirname2, `../fallbacks/windows/clipboard_${binarySuffix}.exe`);
|
|
46920
|
+
var hasWindowsBinaryFallback = fs21.existsSync(windowBinaryPath);
|
|
47205
46921
|
var psCopyScript = `
|
|
47206
46922
|
try {
|
|
47207
46923
|
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -47316,7 +47032,7 @@ var wsl_default = clipboard6;
|
|
|
47316
47032
|
|
|
47317
47033
|
// packages/cli/node_modules/clipboardy/index.js
|
|
47318
47034
|
var platformLib = (() => {
|
|
47319
|
-
switch (
|
|
47035
|
+
switch (process25.platform) {
|
|
47320
47036
|
case "darwin": {
|
|
47321
47037
|
return macos_default;
|
|
47322
47038
|
}
|
|
@@ -47324,7 +47040,7 @@ var platformLib = (() => {
|
|
|
47324
47040
|
return windows_default;
|
|
47325
47041
|
}
|
|
47326
47042
|
case "android": {
|
|
47327
|
-
if (
|
|
47043
|
+
if (process25.env.TERMUX_VERSION === void 0) {
|
|
47328
47044
|
throw new Error("You need to install Termux for this module to work on Android: https://termux.com");
|
|
47329
47045
|
}
|
|
47330
47046
|
return termux_default;
|
|
@@ -47375,7 +47091,7 @@ var clipboard7 = {
|
|
|
47375
47091
|
var clipboardy_default = clipboard7;
|
|
47376
47092
|
|
|
47377
47093
|
// packages/cli/src/ui/utils/commandUtils.ts
|
|
47378
|
-
import
|
|
47094
|
+
import fs22 from "node:fs";
|
|
47379
47095
|
var AT_COMMAND_DETECT_REGEX = new RegExp(
|
|
47380
47096
|
`(?<!\\\\)@${AT_COMMAND_PATH_REGEX_SOURCE}`
|
|
47381
47097
|
);
|
|
@@ -47404,7 +47120,7 @@ var SCREEN_DCS_CHUNK_SIZE = 240;
|
|
|
47404
47120
|
var pickTty = () => new Promise((resolve8) => {
|
|
47405
47121
|
if (process.platform !== "win32") {
|
|
47406
47122
|
try {
|
|
47407
|
-
const devTty =
|
|
47123
|
+
const devTty = fs22.createWriteStream("/dev/tty");
|
|
47408
47124
|
const timeout = setTimeout(() => {
|
|
47409
47125
|
devTty.removeAllListeners("open");
|
|
47410
47126
|
devTty.removeAllListeners("error");
|
|
@@ -47485,7 +47201,7 @@ var writeAll = (stream, data) => new Promise((resolve8, reject) => {
|
|
|
47485
47201
|
const fd = stream.fd;
|
|
47486
47202
|
if (process.platform === "win32" && typeof fd === "number" && (stream === process.stdout || stream === process.stderr)) {
|
|
47487
47203
|
try {
|
|
47488
|
-
|
|
47204
|
+
fs22.writeSync(fd, data);
|
|
47489
47205
|
resolve8();
|
|
47490
47206
|
return;
|
|
47491
47207
|
} catch (e) {
|
|
@@ -47601,16 +47317,16 @@ var parseSlashCommand = (query, commands) => {
|
|
|
47601
47317
|
|
|
47602
47318
|
// packages/cli/src/ui/components/shared/text-buffer.ts
|
|
47603
47319
|
var import_react39 = __toESM(require_react(), 1);
|
|
47604
|
-
import
|
|
47320
|
+
import fs24 from "node:fs";
|
|
47605
47321
|
import os5 from "node:os";
|
|
47606
47322
|
import pathMod from "node:path";
|
|
47607
|
-
import * as
|
|
47323
|
+
import * as path16 from "node:path";
|
|
47608
47324
|
|
|
47609
47325
|
// packages/cli/src/ui/utils/clipboardUtils.ts
|
|
47610
|
-
import * as
|
|
47611
|
-
import { createWriteStream as createWriteStream2, existsSync as
|
|
47612
|
-
import { execSync
|
|
47613
|
-
import * as
|
|
47326
|
+
import * as fs23 from "node:fs/promises";
|
|
47327
|
+
import { createWriteStream as createWriteStream2, existsSync as existsSync5, statSync as statSync2 } from "node:fs";
|
|
47328
|
+
import { execSync, spawn } from "node:child_process";
|
|
47329
|
+
import * as path15 from "node:path";
|
|
47614
47330
|
var IMAGE_EXTENSIONS = [
|
|
47615
47331
|
".png",
|
|
47616
47332
|
".jpg",
|
|
@@ -47631,7 +47347,7 @@ function getUserLinuxClipboardTool() {
|
|
|
47631
47347
|
else if (displayServer === "x11") toolName = "xclip";
|
|
47632
47348
|
else return null;
|
|
47633
47349
|
try {
|
|
47634
|
-
|
|
47350
|
+
execSync(`command -v ${toolName}`, { stdio: "ignore" });
|
|
47635
47351
|
linuxClipboardTool = toolName;
|
|
47636
47352
|
return toolName;
|
|
47637
47353
|
} catch (e) {
|
|
@@ -47641,7 +47357,7 @@ function getUserLinuxClipboardTool() {
|
|
|
47641
47357
|
}
|
|
47642
47358
|
async function saveFromCommand(command, args, destination) {
|
|
47643
47359
|
return new Promise((resolve8) => {
|
|
47644
|
-
const child =
|
|
47360
|
+
const child = spawn(command, args);
|
|
47645
47361
|
const fileStream = createWriteStream2(destination);
|
|
47646
47362
|
let resolved = false;
|
|
47647
47363
|
const safeResolve = (value) => {
|
|
@@ -47670,7 +47386,7 @@ async function saveFromCommand(command, args, destination) {
|
|
|
47670
47386
|
}
|
|
47671
47387
|
const checkFile = async () => {
|
|
47672
47388
|
try {
|
|
47673
|
-
const stats = await
|
|
47389
|
+
const stats = await fs23.stat(destination);
|
|
47674
47390
|
safeResolve(stats.size > 0);
|
|
47675
47391
|
} catch (e) {
|
|
47676
47392
|
debugLogger.debug(`Failed to stat output file ${destination}:`, e);
|
|
@@ -47757,7 +47473,7 @@ async function saveFileWithWlPaste(tempFilePath) {
|
|
|
47757
47473
|
return true;
|
|
47758
47474
|
}
|
|
47759
47475
|
try {
|
|
47760
|
-
await
|
|
47476
|
+
await fs23.unlink(tempFilePath);
|
|
47761
47477
|
} catch {
|
|
47762
47478
|
}
|
|
47763
47479
|
return false;
|
|
@@ -47772,7 +47488,7 @@ var saveFileWithXclip = async (tempFilePath) => {
|
|
|
47772
47488
|
return true;
|
|
47773
47489
|
}
|
|
47774
47490
|
try {
|
|
47775
|
-
await
|
|
47491
|
+
await fs23.unlink(tempFilePath);
|
|
47776
47492
|
} catch {
|
|
47777
47493
|
}
|
|
47778
47494
|
return false;
|
|
@@ -47781,15 +47497,15 @@ async function getProjectClipboardImagesDir(targetDir) {
|
|
|
47781
47497
|
const storage = new Storage(targetDir);
|
|
47782
47498
|
await storage.initialize();
|
|
47783
47499
|
const baseDir = storage.getProjectTempDir();
|
|
47784
|
-
return
|
|
47500
|
+
return path15.join(baseDir, "images");
|
|
47785
47501
|
}
|
|
47786
47502
|
async function saveClipboardImage(targetDir) {
|
|
47787
47503
|
try {
|
|
47788
47504
|
const tempDir = await getProjectClipboardImagesDir(targetDir);
|
|
47789
|
-
await
|
|
47505
|
+
await fs23.mkdir(tempDir, { recursive: true });
|
|
47790
47506
|
const timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
47791
47507
|
if (process.platform === "linux") {
|
|
47792
|
-
const tempFilePath =
|
|
47508
|
+
const tempFilePath = path15.join(tempDir, `clipboard-${timestamp}.png`);
|
|
47793
47509
|
const tool = getUserLinuxClipboardTool();
|
|
47794
47510
|
if (tool === "wl-paste") {
|
|
47795
47511
|
if (await saveFileWithWlPaste(tempFilePath)) return tempFilePath;
|
|
@@ -47802,7 +47518,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47802
47518
|
return null;
|
|
47803
47519
|
}
|
|
47804
47520
|
if (process.platform === "win32") {
|
|
47805
|
-
const tempFilePath =
|
|
47521
|
+
const tempFilePath = path15.join(tempDir, `clipboard-${timestamp}.png`);
|
|
47806
47522
|
const psPath = tempFilePath.replace(/'/g, "''");
|
|
47807
47523
|
const script = `
|
|
47808
47524
|
Add-Type -AssemblyName System.Windows.Forms
|
|
@@ -47820,7 +47536,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47820
47536
|
]);
|
|
47821
47537
|
if (stdout.trim() === "success") {
|
|
47822
47538
|
try {
|
|
47823
|
-
const stats = await
|
|
47539
|
+
const stats = await fs23.stat(tempFilePath);
|
|
47824
47540
|
if (stats.size > 0) {
|
|
47825
47541
|
return tempFilePath;
|
|
47826
47542
|
}
|
|
@@ -47834,7 +47550,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47834
47550
|
{ class: "JPEG", extension: "jpg" }
|
|
47835
47551
|
];
|
|
47836
47552
|
for (const format of formats) {
|
|
47837
|
-
const tempFilePath =
|
|
47553
|
+
const tempFilePath = path15.join(
|
|
47838
47554
|
tempDir,
|
|
47839
47555
|
`clipboard-${timestamp}.${format.extension}`
|
|
47840
47556
|
);
|
|
@@ -47855,7 +47571,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47855
47571
|
const { stdout } = await spawnAsync("osascript", ["-e", script]);
|
|
47856
47572
|
if (stdout.trim() === "success") {
|
|
47857
47573
|
try {
|
|
47858
|
-
const stats = await
|
|
47574
|
+
const stats = await fs23.stat(tempFilePath);
|
|
47859
47575
|
if (stats.size > 0) {
|
|
47860
47576
|
return tempFilePath;
|
|
47861
47577
|
}
|
|
@@ -47864,7 +47580,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47864
47580
|
}
|
|
47865
47581
|
}
|
|
47866
47582
|
try {
|
|
47867
|
-
await
|
|
47583
|
+
await fs23.unlink(tempFilePath);
|
|
47868
47584
|
} catch (e) {
|
|
47869
47585
|
debugLogger.debug("Failed to clean up temp file:", tempFilePath, e);
|
|
47870
47586
|
}
|
|
@@ -47878,15 +47594,15 @@ async function saveClipboardImage(targetDir) {
|
|
|
47878
47594
|
async function cleanupOldClipboardImages(targetDir) {
|
|
47879
47595
|
try {
|
|
47880
47596
|
const tempDir = await getProjectClipboardImagesDir(targetDir);
|
|
47881
|
-
const files = await
|
|
47597
|
+
const files = await fs23.readdir(tempDir);
|
|
47882
47598
|
const oneHourAgo = Date.now() - 60 * 60 * 1e3;
|
|
47883
47599
|
for (const file of files) {
|
|
47884
|
-
const ext =
|
|
47600
|
+
const ext = path15.extname(file).toLowerCase();
|
|
47885
47601
|
if (file.startsWith("clipboard-") && IMAGE_EXTENSIONS.includes(ext)) {
|
|
47886
|
-
const filePath =
|
|
47887
|
-
const stats = await
|
|
47602
|
+
const filePath = path15.join(tempDir, file);
|
|
47603
|
+
const stats = await fs23.stat(filePath);
|
|
47888
47604
|
if (stats.mtimeMs < oneHourAgo) {
|
|
47889
|
-
await
|
|
47605
|
+
await fs23.unlink(filePath);
|
|
47890
47606
|
}
|
|
47891
47607
|
}
|
|
47892
47608
|
}
|
|
@@ -47941,7 +47657,7 @@ function* splitDragAndDropPaths(text) {
|
|
|
47941
47657
|
}
|
|
47942
47658
|
function isValidFilePath(p2) {
|
|
47943
47659
|
try {
|
|
47944
|
-
return PATH_PREFIX_PATTERN.test(p2) &&
|
|
47660
|
+
return PATH_PREFIX_PATTERN.test(p2) && existsSync5(p2) && statSync2(p2).isFile();
|
|
47945
47661
|
} catch {
|
|
47946
47662
|
return false;
|
|
47947
47663
|
}
|
|
@@ -49446,7 +49162,7 @@ function handleVimAction(state, action) {
|
|
|
49446
49162
|
}
|
|
49447
49163
|
|
|
49448
49164
|
// packages/cli/src/ui/utils/editorUtils.ts
|
|
49449
|
-
import { spawn as
|
|
49165
|
+
import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
49450
49166
|
async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType) {
|
|
49451
49167
|
let command = void 0;
|
|
49452
49168
|
const args = [filePath];
|
|
@@ -49506,7 +49222,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49506
49222
|
}
|
|
49507
49223
|
} else {
|
|
49508
49224
|
await new Promise((resolve8, reject) => {
|
|
49509
|
-
const child =
|
|
49225
|
+
const child = spawn2(executable, [...initialArgs, ...args], {
|
|
49510
49226
|
stdio: "inherit",
|
|
49511
49227
|
shell: process.platform === "win32"
|
|
49512
49228
|
});
|
|
@@ -50023,8 +49739,8 @@ function getTransformedImagePath(filePath) {
|
|
|
50023
49739
|
unescaped.lastIndexOf("\\")
|
|
50024
49740
|
);
|
|
50025
49741
|
const fileName = lastSepIndex >= 0 ? unescaped.slice(lastSepIndex + 1) : unescaped;
|
|
50026
|
-
const extension =
|
|
50027
|
-
const baseName =
|
|
49742
|
+
const extension = path16.extname(fileName);
|
|
49743
|
+
const baseName = path16.basename(fileName, extension);
|
|
50028
49744
|
const maxBaseLength = 10;
|
|
50029
49745
|
const truncatedBase = baseName.length > maxBaseLength ? `...${baseName.slice(-maxBaseLength)}` : baseName;
|
|
50030
49746
|
return `[Image ${truncatedBase}${extension}]`;
|
|
@@ -51351,7 +51067,9 @@ function useTextBuffer({
|
|
|
51351
51067
|
visualLayout,
|
|
51352
51068
|
transformationsByLine,
|
|
51353
51069
|
pastedContent,
|
|
51354
|
-
expandedPaste
|
|
51070
|
+
expandedPaste,
|
|
51071
|
+
undoStack,
|
|
51072
|
+
redoStack
|
|
51355
51073
|
} = state;
|
|
51356
51074
|
const text = (0, import_react39.useMemo)(() => lines.join("\n"), [lines]);
|
|
51357
51075
|
const visualCursor = (0, import_react39.useMemo)(
|
|
@@ -51677,10 +51395,10 @@ function useTextBuffer({
|
|
|
51677
51395
|
dispatch({ type: "vim_paste_before", payload: { count } });
|
|
51678
51396
|
}, []);
|
|
51679
51397
|
const openInExternalEditor = (0, import_react39.useCallback)(async () => {
|
|
51680
|
-
const tmpDir =
|
|
51398
|
+
const tmpDir = fs24.mkdtempSync(pathMod.join(os5.tmpdir(), "gemini-edit-"));
|
|
51681
51399
|
const filePath = pathMod.join(tmpDir, "buffer.txt");
|
|
51682
51400
|
const expandedText = expandPastePlaceholders(text, pastedContent);
|
|
51683
|
-
|
|
51401
|
+
fs24.writeFileSync(filePath, expandedText, "utf8");
|
|
51684
51402
|
dispatch({ type: "create_undo_snapshot" });
|
|
51685
51403
|
try {
|
|
51686
51404
|
await openFileInEditor(
|
|
@@ -51689,7 +51407,7 @@ function useTextBuffer({
|
|
|
51689
51407
|
setRawMode,
|
|
51690
51408
|
getPreferredEditor?.()
|
|
51691
51409
|
);
|
|
51692
|
-
let newText =
|
|
51410
|
+
let newText = fs24.readFileSync(filePath, "utf8");
|
|
51693
51411
|
newText = newText.replace(/\r\n?/g, "\n");
|
|
51694
51412
|
const sortedPlaceholders = Object.entries(pastedContent).sort(
|
|
51695
51413
|
(a, b2) => b2[1].length - a[1].length
|
|
@@ -51708,11 +51426,11 @@ function useTextBuffer({
|
|
|
51708
51426
|
);
|
|
51709
51427
|
} finally {
|
|
51710
51428
|
try {
|
|
51711
|
-
|
|
51429
|
+
fs24.unlinkSync(filePath);
|
|
51712
51430
|
} catch {
|
|
51713
51431
|
}
|
|
51714
51432
|
try {
|
|
51715
|
-
|
|
51433
|
+
fs24.rmdirSync(tmpDir);
|
|
51716
51434
|
} catch {
|
|
51717
51435
|
}
|
|
51718
51436
|
}
|
|
@@ -51805,10 +51523,16 @@ function useTextBuffer({
|
|
|
51805
51523
|
return true;
|
|
51806
51524
|
}
|
|
51807
51525
|
if (keyMatchers["edit.undo" /* UNDO */](key)) {
|
|
51526
|
+
if (undoStack.length === 0) {
|
|
51527
|
+
return false;
|
|
51528
|
+
}
|
|
51808
51529
|
undo();
|
|
51809
51530
|
return true;
|
|
51810
51531
|
}
|
|
51811
51532
|
if (keyMatchers["edit.redo" /* REDO */](key)) {
|
|
51533
|
+
if (redoStack.length === 0) {
|
|
51534
|
+
return false;
|
|
51535
|
+
}
|
|
51812
51536
|
redo();
|
|
51813
51537
|
return true;
|
|
51814
51538
|
}
|
|
@@ -51836,7 +51560,9 @@ function useTextBuffer({
|
|
|
51836
51560
|
text,
|
|
51837
51561
|
visualCursor,
|
|
51838
51562
|
visualLines,
|
|
51839
|
-
keyMatchers
|
|
51563
|
+
keyMatchers,
|
|
51564
|
+
undoStack.length,
|
|
51565
|
+
redoStack.length
|
|
51840
51566
|
]
|
|
51841
51567
|
);
|
|
51842
51568
|
const visualScrollRow = (0, import_react39.useMemo)(() => {
|
|
@@ -52195,7 +51921,7 @@ function useTextBuffer({
|
|
|
52195
51921
|
var import_react40 = __toESM(require_react(), 1);
|
|
52196
51922
|
|
|
52197
51923
|
// packages/cli/src/config/extensions/update.ts
|
|
52198
|
-
import * as
|
|
51924
|
+
import * as fs25 from "node:fs";
|
|
52199
51925
|
async function updateExtension(extension, extensionManager, currentState, dispatchExtensionStateUpdate, enableExtensionReloading) {
|
|
52200
51926
|
if (currentState === "updating" /* UPDATING */) {
|
|
52201
51927
|
return void 0;
|
|
@@ -52297,7 +52023,7 @@ ${e}`
|
|
|
52297
52023
|
await copyExtension(tempDir, extension.path);
|
|
52298
52024
|
throw e;
|
|
52299
52025
|
} finally {
|
|
52300
|
-
await
|
|
52026
|
+
await fs25.promises.rm(tempDir, { recursive: true, force: true });
|
|
52301
52027
|
}
|
|
52302
52028
|
}
|
|
52303
52029
|
async function updateAllUpdatableExtensions(extensions, extensionsState, extensionManager, dispatch, enableExtensionReloading) {
|
|
@@ -52572,7 +52298,7 @@ var useInputState = () => {
|
|
|
52572
52298
|
|
|
52573
52299
|
// packages/cli/src/ui/hooks/useSessionBrowser.ts
|
|
52574
52300
|
var import_react44 = __toESM(require_react(), 1);
|
|
52575
|
-
import
|
|
52301
|
+
import path17 from "node:path";
|
|
52576
52302
|
var useSessionBrowser = (config, onLoadHistory) => {
|
|
52577
52303
|
const [isSessionBrowserOpen, setIsSessionBrowserOpen] = (0, import_react44.useState)(false);
|
|
52578
52304
|
return {
|
|
@@ -52589,12 +52315,12 @@ var useSessionBrowser = (config, onLoadHistory) => {
|
|
|
52589
52315
|
handleResumeSession: (0, import_react44.useCallback)(
|
|
52590
52316
|
async (session) => {
|
|
52591
52317
|
try {
|
|
52592
|
-
const chatsDir =
|
|
52318
|
+
const chatsDir = path17.join(
|
|
52593
52319
|
config.storage.getProjectTempDir(),
|
|
52594
52320
|
"chats"
|
|
52595
52321
|
);
|
|
52596
52322
|
const fileName = session.fileName;
|
|
52597
|
-
const originalFilePath =
|
|
52323
|
+
const originalFilePath = path17.join(chatsDir, fileName);
|
|
52598
52324
|
const conversation = await loadConversationRecord(originalFilePath);
|
|
52599
52325
|
if (!conversation) {
|
|
52600
52326
|
throw new Error(
|
|
@@ -52645,23 +52371,23 @@ var useSessionBrowser = (config, onLoadHistory) => {
|
|
|
52645
52371
|
};
|
|
52646
52372
|
|
|
52647
52373
|
// packages/cli/src/ui/utils/terminalSetup.ts
|
|
52648
|
-
import { promises as
|
|
52374
|
+
import { promises as fs27 } from "node:fs";
|
|
52649
52375
|
import * as os6 from "node:os";
|
|
52650
|
-
import * as
|
|
52376
|
+
import * as path19 from "node:path";
|
|
52651
52377
|
import { exec as exec2 } from "node:child_process";
|
|
52652
52378
|
import { promisify as promisify4 } from "node:util";
|
|
52653
52379
|
var import_react45 = __toESM(require_react(), 1);
|
|
52654
52380
|
|
|
52655
52381
|
// packages/cli/src/utils/persistentState.ts
|
|
52656
|
-
import * as
|
|
52657
|
-
import * as
|
|
52382
|
+
import * as fs26 from "node:fs";
|
|
52383
|
+
import * as path18 from "node:path";
|
|
52658
52384
|
var STATE_FILENAME = "state.json";
|
|
52659
52385
|
var PersistentState = class {
|
|
52660
52386
|
cache = null;
|
|
52661
52387
|
filePath = null;
|
|
52662
52388
|
getPath() {
|
|
52663
52389
|
if (!this.filePath) {
|
|
52664
|
-
this.filePath =
|
|
52390
|
+
this.filePath = path18.join(Storage.getGlobalGeminiDir(), STATE_FILENAME);
|
|
52665
52391
|
}
|
|
52666
52392
|
return this.filePath;
|
|
52667
52393
|
}
|
|
@@ -52671,8 +52397,8 @@ var PersistentState = class {
|
|
|
52671
52397
|
}
|
|
52672
52398
|
try {
|
|
52673
52399
|
const filePath = this.getPath();
|
|
52674
|
-
if (
|
|
52675
|
-
const content =
|
|
52400
|
+
if (fs26.existsSync(filePath)) {
|
|
52401
|
+
const content = fs26.readFileSync(filePath, "utf-8");
|
|
52676
52402
|
this.cache = JSON.parse(content);
|
|
52677
52403
|
} else {
|
|
52678
52404
|
this.cache = {};
|
|
@@ -52687,11 +52413,11 @@ var PersistentState = class {
|
|
|
52687
52413
|
if (!this.cache) return;
|
|
52688
52414
|
try {
|
|
52689
52415
|
const filePath = this.getPath();
|
|
52690
|
-
const dir =
|
|
52691
|
-
if (!
|
|
52692
|
-
|
|
52416
|
+
const dir = path18.dirname(filePath);
|
|
52417
|
+
if (!fs26.existsSync(dir)) {
|
|
52418
|
+
fs26.mkdirSync(dir, { recursive: true });
|
|
52693
52419
|
}
|
|
52694
|
-
|
|
52420
|
+
fs26.writeFileSync(filePath, JSON.stringify(this.cache, null, 2));
|
|
52695
52421
|
} catch (error) {
|
|
52696
52422
|
debugLogger.warn("Failed to save persistent state:", error);
|
|
52697
52423
|
}
|
|
@@ -52774,7 +52500,7 @@ async function backupFile(filePath) {
|
|
|
52774
52500
|
try {
|
|
52775
52501
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
52776
52502
|
const backupPath = `${filePath}.backup.${timestamp}`;
|
|
52777
|
-
await
|
|
52503
|
+
await fs27.copyFile(filePath, backupPath);
|
|
52778
52504
|
} catch (error) {
|
|
52779
52505
|
debugLogger.warn(`Failed to create backup of ${filePath}:`, error);
|
|
52780
52506
|
}
|
|
@@ -52782,7 +52508,7 @@ async function backupFile(filePath) {
|
|
|
52782
52508
|
function getVSCodeStyleConfigDir(appName) {
|
|
52783
52509
|
const platform5 = os6.platform();
|
|
52784
52510
|
if (platform5 === "darwin") {
|
|
52785
|
-
return
|
|
52511
|
+
return path19.join(
|
|
52786
52512
|
homedir(),
|
|
52787
52513
|
"Library",
|
|
52788
52514
|
"Application Support",
|
|
@@ -52793,9 +52519,9 @@ function getVSCodeStyleConfigDir(appName) {
|
|
|
52793
52519
|
if (!process.env["APPDATA"]) {
|
|
52794
52520
|
return null;
|
|
52795
52521
|
}
|
|
52796
|
-
return
|
|
52522
|
+
return path19.join(process.env["APPDATA"], appName, "User");
|
|
52797
52523
|
} else {
|
|
52798
|
-
return
|
|
52524
|
+
return path19.join(homedir(), ".config", appName, "User");
|
|
52799
52525
|
}
|
|
52800
52526
|
}
|
|
52801
52527
|
async function configureVSCodeStyle(terminalName, appName) {
|
|
@@ -52806,12 +52532,12 @@ async function configureVSCodeStyle(terminalName, appName) {
|
|
|
52806
52532
|
message: `Could not determine ${terminalName} config path on Windows: APPDATA environment variable is not set.`
|
|
52807
52533
|
};
|
|
52808
52534
|
}
|
|
52809
|
-
const keybindingsFile =
|
|
52535
|
+
const keybindingsFile = path19.join(configDir, "keybindings.json");
|
|
52810
52536
|
try {
|
|
52811
|
-
await
|
|
52537
|
+
await fs27.mkdir(configDir, { recursive: true });
|
|
52812
52538
|
let keybindings = [];
|
|
52813
52539
|
try {
|
|
52814
|
-
const content = await
|
|
52540
|
+
const content = await fs27.readFile(keybindingsFile, "utf8");
|
|
52815
52541
|
await backupFile(keybindingsFile);
|
|
52816
52542
|
try {
|
|
52817
52543
|
const cleanContent = stripJsonComments(content);
|
|
@@ -52909,7 +52635,7 @@ Please check and modify manually if needed: ${keybindingsFile}`
|
|
|
52909
52635
|
keybindings.unshift(target);
|
|
52910
52636
|
}
|
|
52911
52637
|
}
|
|
52912
|
-
await
|
|
52638
|
+
await fs27.writeFile(keybindingsFile, JSON.stringify(keybindings, null, 4));
|
|
52913
52639
|
return {
|
|
52914
52640
|
success: true,
|
|
52915
52641
|
message: `Added ${targetBindings.map((b2) => b2.key.charAt(0).toUpperCase() + b2.key.slice(1)).join(
|
|
@@ -52943,9 +52669,9 @@ async function shouldPromptForTerminalSetup() {
|
|
|
52943
52669
|
if (!configDir) {
|
|
52944
52670
|
return false;
|
|
52945
52671
|
}
|
|
52946
|
-
const keybindingsFile =
|
|
52672
|
+
const keybindingsFile = path19.join(configDir, "keybindings.json");
|
|
52947
52673
|
try {
|
|
52948
|
-
const content = await
|
|
52674
|
+
const content = await fs27.readFile(keybindingsFile, "utf8");
|
|
52949
52675
|
const cleanContent = stripJsonComments(content);
|
|
52950
52676
|
const parsedContent = JSON.parse(cleanContent);
|
|
52951
52677
|
if (!Array.isArray(parsedContent)) {
|
|
@@ -53037,17 +52763,6 @@ function startAutoMemoryIfEnabled(config) {
|
|
|
53037
52763
|
});
|
|
53038
52764
|
}
|
|
53039
52765
|
|
|
53040
|
-
// packages/cli/src/utils/processUtils.ts
|
|
53041
|
-
var RELAUNCH_EXIT_CODE = 199;
|
|
53042
|
-
var isRelaunching = false;
|
|
53043
|
-
async function relaunchApp() {
|
|
53044
|
-
if (isRelaunching) return;
|
|
53045
|
-
isRelaunching = true;
|
|
53046
|
-
await waitForUpdateCompletion();
|
|
53047
|
-
await runExitCleanup();
|
|
53048
|
-
process.exit(RELAUNCH_EXIT_CODE);
|
|
53049
|
-
}
|
|
53050
|
-
|
|
53051
52766
|
// packages/cli/src/commands/gemma/status.ts
|
|
53052
52767
|
var import_chalk6 = __toESM(require_source(), 1);
|
|
53053
52768
|
async function checkGemmaStatus(port) {
|
|
@@ -53512,6 +53227,549 @@ var formatResetTime = (resetTime, format = "full") => {
|
|
|
53512
53227
|
return `${duration} at ${timeStr}`;
|
|
53513
53228
|
};
|
|
53514
53229
|
|
|
53230
|
+
// packages/cli/src/services/FileCommandLoader.ts
|
|
53231
|
+
var import_toml = __toESM(require_toml(), 1);
|
|
53232
|
+
import { promises as fs28 } from "node:fs";
|
|
53233
|
+
import path20 from "node:path";
|
|
53234
|
+
|
|
53235
|
+
// packages/cli/src/services/prompt-processors/argumentProcessor.ts
|
|
53236
|
+
var DefaultArgumentProcessor = class {
|
|
53237
|
+
async process(prompt, context) {
|
|
53238
|
+
if (context.invocation?.args) {
|
|
53239
|
+
return appendToLastTextPart(prompt, context.invocation.raw);
|
|
53240
|
+
}
|
|
53241
|
+
return prompt;
|
|
53242
|
+
}
|
|
53243
|
+
};
|
|
53244
|
+
|
|
53245
|
+
// packages/cli/src/services/prompt-processors/types.ts
|
|
53246
|
+
var SHORTHAND_ARGS_PLACEHOLDER = "{{args}}";
|
|
53247
|
+
var SHELL_INJECTION_TRIGGER = "!{";
|
|
53248
|
+
var AT_FILE_INJECTION_TRIGGER = "@{";
|
|
53249
|
+
|
|
53250
|
+
// packages/cli/src/services/prompt-processors/injectionParser.ts
|
|
53251
|
+
function extractInjections(prompt, trigger, contextName) {
|
|
53252
|
+
const injections = [];
|
|
53253
|
+
let index = 0;
|
|
53254
|
+
while (index < prompt.length) {
|
|
53255
|
+
const startIndex = prompt.indexOf(trigger, index);
|
|
53256
|
+
if (startIndex === -1) {
|
|
53257
|
+
break;
|
|
53258
|
+
}
|
|
53259
|
+
let currentIndex = startIndex + trigger.length;
|
|
53260
|
+
let braceCount = 1;
|
|
53261
|
+
let foundEnd = false;
|
|
53262
|
+
while (currentIndex < prompt.length) {
|
|
53263
|
+
const char = prompt[currentIndex];
|
|
53264
|
+
if (char === "{") {
|
|
53265
|
+
braceCount++;
|
|
53266
|
+
} else if (char === "}") {
|
|
53267
|
+
braceCount--;
|
|
53268
|
+
if (braceCount === 0) {
|
|
53269
|
+
const injectionContent = prompt.substring(
|
|
53270
|
+
startIndex + trigger.length,
|
|
53271
|
+
currentIndex
|
|
53272
|
+
);
|
|
53273
|
+
const endIndex = currentIndex + 1;
|
|
53274
|
+
injections.push({
|
|
53275
|
+
content: injectionContent.trim(),
|
|
53276
|
+
startIndex,
|
|
53277
|
+
endIndex
|
|
53278
|
+
});
|
|
53279
|
+
index = endIndex;
|
|
53280
|
+
foundEnd = true;
|
|
53281
|
+
break;
|
|
53282
|
+
}
|
|
53283
|
+
}
|
|
53284
|
+
currentIndex++;
|
|
53285
|
+
}
|
|
53286
|
+
if (!foundEnd) {
|
|
53287
|
+
const contextInfo = contextName ? ` in command '${contextName}'` : "";
|
|
53288
|
+
throw new Error(
|
|
53289
|
+
`Invalid syntax${contextInfo}: Unclosed injection starting at index ${startIndex} ('${trigger}'). Ensure braces are balanced. Paths or commands with unbalanced braces are not supported directly.`
|
|
53290
|
+
);
|
|
53291
|
+
}
|
|
53292
|
+
}
|
|
53293
|
+
return injections;
|
|
53294
|
+
}
|
|
53295
|
+
|
|
53296
|
+
// packages/cli/src/services/prompt-processors/shellProcessor.ts
|
|
53297
|
+
var ConfirmationRequiredError = class extends Error {
|
|
53298
|
+
constructor(message, commandsToConfirm) {
|
|
53299
|
+
super(message);
|
|
53300
|
+
this.commandsToConfirm = commandsToConfirm;
|
|
53301
|
+
this.name = "ConfirmationRequiredError";
|
|
53302
|
+
}
|
|
53303
|
+
};
|
|
53304
|
+
var ShellProcessor = class {
|
|
53305
|
+
constructor(commandName) {
|
|
53306
|
+
this.commandName = commandName;
|
|
53307
|
+
}
|
|
53308
|
+
async process(prompt, context) {
|
|
53309
|
+
return flatMapTextParts(
|
|
53310
|
+
prompt,
|
|
53311
|
+
(text) => this.processString(text, context)
|
|
53312
|
+
);
|
|
53313
|
+
}
|
|
53314
|
+
async processString(prompt, context) {
|
|
53315
|
+
const userArgsRaw = context.invocation?.args || "";
|
|
53316
|
+
if (!prompt.includes(SHELL_INJECTION_TRIGGER)) {
|
|
53317
|
+
return [
|
|
53318
|
+
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
53319
|
+
];
|
|
53320
|
+
}
|
|
53321
|
+
const config = context.services.agentContext?.config;
|
|
53322
|
+
if (!config) {
|
|
53323
|
+
throw new Error(
|
|
53324
|
+
`Security configuration not loaded. Cannot verify shell command permissions for '${this.commandName}'. Aborting.`
|
|
53325
|
+
);
|
|
53326
|
+
}
|
|
53327
|
+
const injections = extractInjections(
|
|
53328
|
+
prompt,
|
|
53329
|
+
SHELL_INJECTION_TRIGGER,
|
|
53330
|
+
this.commandName
|
|
53331
|
+
);
|
|
53332
|
+
if (injections.length === 0) {
|
|
53333
|
+
return [
|
|
53334
|
+
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
53335
|
+
];
|
|
53336
|
+
}
|
|
53337
|
+
const { shell: shell2 } = getShellConfiguration();
|
|
53338
|
+
const userArgsEscaped = escapeShellArg(userArgsRaw, shell2);
|
|
53339
|
+
const resolvedInjections = injections.map(
|
|
53340
|
+
(injection) => {
|
|
53341
|
+
const command = injection.content;
|
|
53342
|
+
if (command === "") {
|
|
53343
|
+
return { ...injection, resolvedCommand: void 0 };
|
|
53344
|
+
}
|
|
53345
|
+
const resolvedCommand = command.replaceAll(
|
|
53346
|
+
SHORTHAND_ARGS_PLACEHOLDER,
|
|
53347
|
+
userArgsEscaped
|
|
53348
|
+
);
|
|
53349
|
+
return { ...injection, resolvedCommand };
|
|
53350
|
+
}
|
|
53351
|
+
);
|
|
53352
|
+
const commandsToConfirm = /* @__PURE__ */ new Set();
|
|
53353
|
+
for (const injection of resolvedInjections) {
|
|
53354
|
+
const command = injection.resolvedCommand;
|
|
53355
|
+
if (!command) continue;
|
|
53356
|
+
if (context.session.sessionShellAllowlist?.has(command)) {
|
|
53357
|
+
continue;
|
|
53358
|
+
}
|
|
53359
|
+
const { decision } = await config.getPolicyEngine().check(
|
|
53360
|
+
{
|
|
53361
|
+
name: "run_shell_command",
|
|
53362
|
+
args: { command }
|
|
53363
|
+
},
|
|
53364
|
+
void 0
|
|
53365
|
+
);
|
|
53366
|
+
if (decision === PolicyDecision.DENY) {
|
|
53367
|
+
throw new Error(
|
|
53368
|
+
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
53369
|
+
);
|
|
53370
|
+
} else if (decision === PolicyDecision.ASK_USER) {
|
|
53371
|
+
commandsToConfirm.add(command);
|
|
53372
|
+
}
|
|
53373
|
+
}
|
|
53374
|
+
if (commandsToConfirm.size > 0) {
|
|
53375
|
+
throw new ConfirmationRequiredError(
|
|
53376
|
+
"Shell command confirmation required",
|
|
53377
|
+
Array.from(commandsToConfirm)
|
|
53378
|
+
);
|
|
53379
|
+
}
|
|
53380
|
+
let processedPrompt = "";
|
|
53381
|
+
let lastIndex = 0;
|
|
53382
|
+
for (const injection of resolvedInjections) {
|
|
53383
|
+
const segment = prompt.substring(lastIndex, injection.startIndex);
|
|
53384
|
+
processedPrompt += segment.replaceAll(
|
|
53385
|
+
SHORTHAND_ARGS_PLACEHOLDER,
|
|
53386
|
+
userArgsRaw
|
|
53387
|
+
);
|
|
53388
|
+
if (injection.resolvedCommand) {
|
|
53389
|
+
const activeTheme = themeManager.getActiveTheme();
|
|
53390
|
+
const shellExecutionConfig = {
|
|
53391
|
+
...config.getShellExecutionConfig(),
|
|
53392
|
+
defaultFg: activeTheme.colors.Foreground,
|
|
53393
|
+
defaultBg: activeTheme.colors.Background
|
|
53394
|
+
};
|
|
53395
|
+
const { result } = await ShellExecutionService.execute(
|
|
53396
|
+
injection.resolvedCommand,
|
|
53397
|
+
config.getTargetDir(),
|
|
53398
|
+
() => {
|
|
53399
|
+
},
|
|
53400
|
+
new AbortController().signal,
|
|
53401
|
+
config.getEnableInteractiveShell(),
|
|
53402
|
+
shellExecutionConfig
|
|
53403
|
+
);
|
|
53404
|
+
const executionResult = await result;
|
|
53405
|
+
if (executionResult.error && !executionResult.aborted) {
|
|
53406
|
+
throw new Error(
|
|
53407
|
+
`Failed to start shell command in '${this.commandName}': ${executionResult.error.message}. Command: ${injection.resolvedCommand}`
|
|
53408
|
+
);
|
|
53409
|
+
}
|
|
53410
|
+
processedPrompt += executionResult.output;
|
|
53411
|
+
if (executionResult.aborted) {
|
|
53412
|
+
processedPrompt += `
|
|
53413
|
+
[Shell command '${injection.resolvedCommand}' aborted]`;
|
|
53414
|
+
} else if (executionResult.exitCode !== 0 && executionResult.exitCode !== null) {
|
|
53415
|
+
processedPrompt += `
|
|
53416
|
+
[Shell command '${injection.resolvedCommand}' exited with code ${executionResult.exitCode}]`;
|
|
53417
|
+
} else if (executionResult.signal !== null) {
|
|
53418
|
+
processedPrompt += `
|
|
53419
|
+
[Shell command '${injection.resolvedCommand}' terminated by signal ${executionResult.signal}]`;
|
|
53420
|
+
}
|
|
53421
|
+
}
|
|
53422
|
+
lastIndex = injection.endIndex;
|
|
53423
|
+
}
|
|
53424
|
+
const finalSegment = prompt.substring(lastIndex);
|
|
53425
|
+
processedPrompt += finalSegment.replaceAll(
|
|
53426
|
+
SHORTHAND_ARGS_PLACEHOLDER,
|
|
53427
|
+
userArgsRaw
|
|
53428
|
+
);
|
|
53429
|
+
return [{ text: processedPrompt }];
|
|
53430
|
+
}
|
|
53431
|
+
};
|
|
53432
|
+
|
|
53433
|
+
// packages/cli/src/services/prompt-processors/atFileProcessor.ts
|
|
53434
|
+
var AtFileProcessor = class {
|
|
53435
|
+
constructor(commandName) {
|
|
53436
|
+
this.commandName = commandName;
|
|
53437
|
+
}
|
|
53438
|
+
async process(input, context) {
|
|
53439
|
+
const config = context.services.agentContext?.config;
|
|
53440
|
+
if (!config) {
|
|
53441
|
+
return input;
|
|
53442
|
+
}
|
|
53443
|
+
return flatMapTextParts(input, async (text) => {
|
|
53444
|
+
if (!text.includes(AT_FILE_INJECTION_TRIGGER)) {
|
|
53445
|
+
return [{ text }];
|
|
53446
|
+
}
|
|
53447
|
+
const injections = extractInjections(
|
|
53448
|
+
text,
|
|
53449
|
+
AT_FILE_INJECTION_TRIGGER,
|
|
53450
|
+
this.commandName
|
|
53451
|
+
);
|
|
53452
|
+
if (injections.length === 0) {
|
|
53453
|
+
return [{ text }];
|
|
53454
|
+
}
|
|
53455
|
+
const output = [];
|
|
53456
|
+
let lastIndex = 0;
|
|
53457
|
+
for (const injection of injections) {
|
|
53458
|
+
const prefix = text.substring(lastIndex, injection.startIndex);
|
|
53459
|
+
if (prefix) {
|
|
53460
|
+
output.push({ text: prefix });
|
|
53461
|
+
}
|
|
53462
|
+
const pathStr = injection.content;
|
|
53463
|
+
try {
|
|
53464
|
+
const fileContentParts = await readPathFromWorkspace(pathStr, config);
|
|
53465
|
+
if (fileContentParts.length === 0) {
|
|
53466
|
+
const uiMessage = `File '@{${pathStr}}' was ignored by .gitignore or .geminiignore and was not included in the prompt.`;
|
|
53467
|
+
context.ui.addItem(
|
|
53468
|
+
{ type: "info" /* INFO */, text: uiMessage },
|
|
53469
|
+
Date.now()
|
|
53470
|
+
);
|
|
53471
|
+
}
|
|
53472
|
+
output.push(...fileContentParts);
|
|
53473
|
+
} catch (error) {
|
|
53474
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
53475
|
+
const uiMessage = `Failed to inject content for '@{${pathStr}}': ${message}`;
|
|
53476
|
+
debugLogger.error(
|
|
53477
|
+
`Error while loading custom command (${context.invocation.name}) ${uiMessage}. Leaving placeholder in prompt.`
|
|
53478
|
+
);
|
|
53479
|
+
context.ui.addItem(
|
|
53480
|
+
{ type: "error" /* ERROR */, text: uiMessage },
|
|
53481
|
+
Date.now()
|
|
53482
|
+
);
|
|
53483
|
+
const placeholder = text.substring(
|
|
53484
|
+
injection.startIndex,
|
|
53485
|
+
injection.endIndex
|
|
53486
|
+
);
|
|
53487
|
+
output.push({ text: placeholder });
|
|
53488
|
+
}
|
|
53489
|
+
lastIndex = injection.endIndex;
|
|
53490
|
+
}
|
|
53491
|
+
const suffix = text.substring(lastIndex);
|
|
53492
|
+
if (suffix) {
|
|
53493
|
+
output.push({ text: suffix });
|
|
53494
|
+
}
|
|
53495
|
+
return output;
|
|
53496
|
+
});
|
|
53497
|
+
}
|
|
53498
|
+
};
|
|
53499
|
+
|
|
53500
|
+
// packages/cli/src/services/FileCommandLoader.ts
|
|
53501
|
+
var TomlCommandDefSchema = external_exports.object({
|
|
53502
|
+
prompt: external_exports.string({
|
|
53503
|
+
required_error: "The 'prompt' field is required.",
|
|
53504
|
+
invalid_type_error: "The 'prompt' field must be a string."
|
|
53505
|
+
}),
|
|
53506
|
+
description: external_exports.string().optional()
|
|
53507
|
+
});
|
|
53508
|
+
var FileCommandLoader = class {
|
|
53509
|
+
constructor(config) {
|
|
53510
|
+
this.config = config;
|
|
53511
|
+
this.folderTrustEnabled = !!config?.getFolderTrust();
|
|
53512
|
+
this.isTrustedFolder = !!config?.isTrustedFolder();
|
|
53513
|
+
this.projectRoot = config?.getProjectRoot() || process.cwd();
|
|
53514
|
+
}
|
|
53515
|
+
projectRoot;
|
|
53516
|
+
folderTrustEnabled;
|
|
53517
|
+
isTrustedFolder;
|
|
53518
|
+
/**
|
|
53519
|
+
* Loads all commands from user, project, and extension directories.
|
|
53520
|
+
* Returns commands in order: user → project → extensions (alphabetically).
|
|
53521
|
+
*
|
|
53522
|
+
* Order is important for conflict resolution in CommandService:
|
|
53523
|
+
* - User/project commands (without extensionName) use "last wins" strategy
|
|
53524
|
+
* - Extension commands (with extensionName) get renamed if conflicts exist
|
|
53525
|
+
*
|
|
53526
|
+
* @param signal An AbortSignal to cancel the loading process.
|
|
53527
|
+
* @returns A promise that resolves to an array of all loaded SlashCommands.
|
|
53528
|
+
*/
|
|
53529
|
+
async loadCommands(signal) {
|
|
53530
|
+
if (this.folderTrustEnabled && !this.isTrustedFolder) {
|
|
53531
|
+
return [];
|
|
53532
|
+
}
|
|
53533
|
+
const allCommands = [];
|
|
53534
|
+
const globOptions = {
|
|
53535
|
+
nodir: true,
|
|
53536
|
+
dot: true,
|
|
53537
|
+
signal,
|
|
53538
|
+
follow: true
|
|
53539
|
+
};
|
|
53540
|
+
const commandDirs = this.getCommandDirectories();
|
|
53541
|
+
for (const dirInfo of commandDirs) {
|
|
53542
|
+
try {
|
|
53543
|
+
const files = await glob("**/*.toml", {
|
|
53544
|
+
...globOptions,
|
|
53545
|
+
cwd: dirInfo.path
|
|
53546
|
+
});
|
|
53547
|
+
const commandPromises = files.map(
|
|
53548
|
+
(file) => this.parseAndAdaptFile(
|
|
53549
|
+
path20.join(dirInfo.path, file),
|
|
53550
|
+
dirInfo.path,
|
|
53551
|
+
dirInfo.kind,
|
|
53552
|
+
dirInfo.extensionName,
|
|
53553
|
+
dirInfo.extensionId
|
|
53554
|
+
)
|
|
53555
|
+
);
|
|
53556
|
+
const commands = (await Promise.all(commandPromises)).filter(
|
|
53557
|
+
(cmd) => cmd !== null
|
|
53558
|
+
);
|
|
53559
|
+
allCommands.push(...commands);
|
|
53560
|
+
} catch (error) {
|
|
53561
|
+
if (!signal.aborted && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
53562
|
+
error?.code !== "ENOENT") {
|
|
53563
|
+
coreEvents.emitFeedback(
|
|
53564
|
+
"error",
|
|
53565
|
+
`[FileCommandLoader] Error loading commands from ${dirInfo.path}:`,
|
|
53566
|
+
error
|
|
53567
|
+
);
|
|
53568
|
+
}
|
|
53569
|
+
}
|
|
53570
|
+
}
|
|
53571
|
+
return allCommands;
|
|
53572
|
+
}
|
|
53573
|
+
/**
|
|
53574
|
+
* Lists available .toml command files from user, project, and extension directories.
|
|
53575
|
+
*/
|
|
53576
|
+
async listAvailableFiles() {
|
|
53577
|
+
const directories = this.getCommandDirectories();
|
|
53578
|
+
const groups = [];
|
|
53579
|
+
for (const dir of directories) {
|
|
53580
|
+
const displayName = this.getDisplayName(dir);
|
|
53581
|
+
try {
|
|
53582
|
+
const files = await glob("**/*.toml", { cwd: dir.path });
|
|
53583
|
+
if (files.length > 0) {
|
|
53584
|
+
groups.push({
|
|
53585
|
+
displayName,
|
|
53586
|
+
path: dir.path,
|
|
53587
|
+
files: [...files].sort()
|
|
53588
|
+
});
|
|
53589
|
+
}
|
|
53590
|
+
} catch (e) {
|
|
53591
|
+
if (e.code === "ENOENT") {
|
|
53592
|
+
continue;
|
|
53593
|
+
}
|
|
53594
|
+
groups.push({
|
|
53595
|
+
displayName,
|
|
53596
|
+
path: dir.path,
|
|
53597
|
+
files: [],
|
|
53598
|
+
error: e instanceof Error ? e.message : String(e)
|
|
53599
|
+
});
|
|
53600
|
+
}
|
|
53601
|
+
}
|
|
53602
|
+
return groups;
|
|
53603
|
+
}
|
|
53604
|
+
/**
|
|
53605
|
+
* Returns a human-readable display name for the command directory source.
|
|
53606
|
+
*/
|
|
53607
|
+
getDisplayName(dir) {
|
|
53608
|
+
switch (dir.kind) {
|
|
53609
|
+
case "user-file" /* USER_FILE */:
|
|
53610
|
+
return "User";
|
|
53611
|
+
case "workspace-file" /* WORKSPACE_FILE */:
|
|
53612
|
+
return "Project";
|
|
53613
|
+
case "extension-file" /* EXTENSION_FILE */:
|
|
53614
|
+
return `Extension: ${dir.extensionName || "Unknown"}`;
|
|
53615
|
+
default:
|
|
53616
|
+
return "Custom";
|
|
53617
|
+
}
|
|
53618
|
+
}
|
|
53619
|
+
/**
|
|
53620
|
+
* Get all command directories in order for loading.
|
|
53621
|
+
* User commands → Project commands → Extension commands
|
|
53622
|
+
* This order ensures extension commands can detect all conflicts.
|
|
53623
|
+
*/
|
|
53624
|
+
getCommandDirectories() {
|
|
53625
|
+
const dirs = [];
|
|
53626
|
+
const storage = this.config?.storage ?? new Storage(this.projectRoot);
|
|
53627
|
+
dirs.push({
|
|
53628
|
+
path: Storage.getUserCommandsDir(),
|
|
53629
|
+
kind: "user-file" /* USER_FILE */
|
|
53630
|
+
});
|
|
53631
|
+
dirs.push({
|
|
53632
|
+
path: storage.getProjectCommandsDir(),
|
|
53633
|
+
kind: "workspace-file" /* WORKSPACE_FILE */
|
|
53634
|
+
});
|
|
53635
|
+
if (this.config) {
|
|
53636
|
+
const activeExtensions = this.config.getExtensions().filter((ext) => ext.isActive).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
53637
|
+
const extensionCommandDirs = activeExtensions.map((ext) => ({
|
|
53638
|
+
path: path20.join(ext.path, "commands"),
|
|
53639
|
+
kind: "extension-file" /* EXTENSION_FILE */,
|
|
53640
|
+
extensionName: ext.name,
|
|
53641
|
+
extensionId: ext.id
|
|
53642
|
+
}));
|
|
53643
|
+
dirs.push(...extensionCommandDirs);
|
|
53644
|
+
}
|
|
53645
|
+
return dirs;
|
|
53646
|
+
}
|
|
53647
|
+
/**
|
|
53648
|
+
* Parses a single .toml file and transforms it into a SlashCommand object.
|
|
53649
|
+
* @param filePath The absolute path to the .toml file.
|
|
53650
|
+
* @param baseDir The root command directory for name calculation.
|
|
53651
|
+
* @param kind The CommandKind.
|
|
53652
|
+
* @param extensionName Optional extension name to prefix commands with.
|
|
53653
|
+
* @returns A promise resolving to a SlashCommand, or null if the file is invalid.
|
|
53654
|
+
*/
|
|
53655
|
+
async parseAndAdaptFile(filePath, baseDir, kind, extensionName, extensionId) {
|
|
53656
|
+
let fileContent;
|
|
53657
|
+
try {
|
|
53658
|
+
fileContent = await fs28.readFile(filePath, "utf-8");
|
|
53659
|
+
} catch (error) {
|
|
53660
|
+
coreEvents.emitFeedback(
|
|
53661
|
+
"error",
|
|
53662
|
+
`[FileCommandLoader] Failed to read file ${filePath}:`,
|
|
53663
|
+
error instanceof Error ? error.message : String(error)
|
|
53664
|
+
);
|
|
53665
|
+
return null;
|
|
53666
|
+
}
|
|
53667
|
+
let parsed;
|
|
53668
|
+
try {
|
|
53669
|
+
parsed = import_toml.default.parse(fileContent);
|
|
53670
|
+
} catch (error) {
|
|
53671
|
+
coreEvents.emitFeedback(
|
|
53672
|
+
"error",
|
|
53673
|
+
`[FileCommandLoader] Failed to parse TOML file ${filePath}:`,
|
|
53674
|
+
error instanceof Error ? error.message : String(error)
|
|
53675
|
+
);
|
|
53676
|
+
return null;
|
|
53677
|
+
}
|
|
53678
|
+
const validationResult = TomlCommandDefSchema.safeParse(parsed);
|
|
53679
|
+
if (!validationResult.success) {
|
|
53680
|
+
coreEvents.emitFeedback(
|
|
53681
|
+
"error",
|
|
53682
|
+
`[FileCommandLoader] Skipping invalid command file: ${filePath}. Validation errors:`,
|
|
53683
|
+
validationResult.error.flatten()
|
|
53684
|
+
);
|
|
53685
|
+
return null;
|
|
53686
|
+
}
|
|
53687
|
+
const validDef = validationResult.data;
|
|
53688
|
+
const relativePathWithExt = path20.relative(baseDir, filePath);
|
|
53689
|
+
const relativePath = relativePathWithExt.substring(
|
|
53690
|
+
0,
|
|
53691
|
+
relativePathWithExt.length - 5
|
|
53692
|
+
// length of '.toml'
|
|
53693
|
+
);
|
|
53694
|
+
const baseCommandName = relativePath.split(path20.sep).map((segment) => {
|
|
53695
|
+
let sanitized = segment.replace(/[^a-zA-Z0-9_\-.]/g, "_");
|
|
53696
|
+
if (sanitized.length > 50) {
|
|
53697
|
+
sanitized = sanitized.substring(0, 47) + "...";
|
|
53698
|
+
}
|
|
53699
|
+
return sanitized;
|
|
53700
|
+
}).join(":");
|
|
53701
|
+
const defaultDescription = `Custom command from ${path20.basename(filePath)}`;
|
|
53702
|
+
let description = validDef.description || defaultDescription;
|
|
53703
|
+
description = sanitizeForDisplay(description, 100);
|
|
53704
|
+
if (extensionName) {
|
|
53705
|
+
description = `[${extensionName}] ${description}`;
|
|
53706
|
+
}
|
|
53707
|
+
const processors = [];
|
|
53708
|
+
const usesArgs = validDef.prompt.includes(SHORTHAND_ARGS_PLACEHOLDER);
|
|
53709
|
+
const usesShellInjection = validDef.prompt.includes(
|
|
53710
|
+
SHELL_INJECTION_TRIGGER
|
|
53711
|
+
);
|
|
53712
|
+
const usesAtFileInjection = validDef.prompt.includes(
|
|
53713
|
+
AT_FILE_INJECTION_TRIGGER
|
|
53714
|
+
);
|
|
53715
|
+
if (usesAtFileInjection) {
|
|
53716
|
+
processors.push(new AtFileProcessor(baseCommandName));
|
|
53717
|
+
}
|
|
53718
|
+
if (usesShellInjection || usesArgs) {
|
|
53719
|
+
processors.push(new ShellProcessor(baseCommandName));
|
|
53720
|
+
}
|
|
53721
|
+
if (!usesArgs) {
|
|
53722
|
+
processors.push(new DefaultArgumentProcessor());
|
|
53723
|
+
}
|
|
53724
|
+
return {
|
|
53725
|
+
name: baseCommandName,
|
|
53726
|
+
description,
|
|
53727
|
+
kind,
|
|
53728
|
+
extensionName,
|
|
53729
|
+
extensionId,
|
|
53730
|
+
action: async (context, _args) => {
|
|
53731
|
+
if (!context.invocation) {
|
|
53732
|
+
coreEvents.emitFeedback(
|
|
53733
|
+
"error",
|
|
53734
|
+
`[FileCommandLoader] Critical error: Command '${baseCommandName}' was executed without invocation context.`
|
|
53735
|
+
);
|
|
53736
|
+
return {
|
|
53737
|
+
type: "submit_prompt",
|
|
53738
|
+
content: [{ text: validDef.prompt }]
|
|
53739
|
+
// Fallback to unprocessed prompt
|
|
53740
|
+
};
|
|
53741
|
+
}
|
|
53742
|
+
try {
|
|
53743
|
+
let processedContent = [
|
|
53744
|
+
{ text: validDef.prompt }
|
|
53745
|
+
];
|
|
53746
|
+
for (const processor of processors) {
|
|
53747
|
+
processedContent = await processor.process(
|
|
53748
|
+
processedContent,
|
|
53749
|
+
context
|
|
53750
|
+
);
|
|
53751
|
+
}
|
|
53752
|
+
return {
|
|
53753
|
+
type: "submit_prompt",
|
|
53754
|
+
content: processedContent
|
|
53755
|
+
};
|
|
53756
|
+
} catch (e) {
|
|
53757
|
+
if (e instanceof ConfirmationRequiredError) {
|
|
53758
|
+
return {
|
|
53759
|
+
type: "confirm_shell_commands",
|
|
53760
|
+
commandsToConfirm: e.commandsToConfirm,
|
|
53761
|
+
originalInvocation: {
|
|
53762
|
+
raw: context.invocation.raw
|
|
53763
|
+
}
|
|
53764
|
+
};
|
|
53765
|
+
}
|
|
53766
|
+
throw e;
|
|
53767
|
+
}
|
|
53768
|
+
}
|
|
53769
|
+
};
|
|
53770
|
+
}
|
|
53771
|
+
};
|
|
53772
|
+
|
|
53515
53773
|
// packages/cli/src/ui/hooks/useMouseClick.ts
|
|
53516
53774
|
var import_react46 = __toESM(require_react(), 1);
|
|
53517
53775
|
var useMouseClick = (containerRef, handler2, options = {}) => {
|
|
@@ -54390,7 +54648,7 @@ var _ExpandableText = ({
|
|
|
54390
54648
|
var ExpandableText = import_react52.default.memo(_ExpandableText);
|
|
54391
54649
|
|
|
54392
54650
|
// packages/cli/src/ui/key/keybindingUtils.ts
|
|
54393
|
-
import
|
|
54651
|
+
import process26 from "node:process";
|
|
54394
54652
|
var KEY_NAME_MAP = {
|
|
54395
54653
|
enter: "Enter",
|
|
54396
54654
|
escape: "Esc",
|
|
@@ -54434,7 +54692,7 @@ var MODIFIER_MAPS = {
|
|
|
54434
54692
|
}
|
|
54435
54693
|
};
|
|
54436
54694
|
function formatKeyBinding(binding, platform5) {
|
|
54437
|
-
const activePlatform = platform5 ?? (
|
|
54695
|
+
const activePlatform = platform5 ?? (process26.env["FORCE_GENERIC_KEYBINDING_HINTS"] ? "default" : process26.platform);
|
|
54438
54696
|
const modMap = MODIFIER_MAPS[activePlatform] || MODIFIER_MAPS["default"];
|
|
54439
54697
|
const parts = [];
|
|
54440
54698
|
if (binding.ctrl) parts.push(modMap.ctrl);
|
|
@@ -54454,7 +54712,7 @@ function formatCommand(command, config = defaultKeyBindingConfig, platform5) {
|
|
|
54454
54712
|
}
|
|
54455
54713
|
|
|
54456
54714
|
// packages/cli/src/ui/commands/aboutCommand.ts
|
|
54457
|
-
import
|
|
54715
|
+
import process27 from "node:process";
|
|
54458
54716
|
var aboutCommand = {
|
|
54459
54717
|
name: "about",
|
|
54460
54718
|
description: "Show version info",
|
|
@@ -54462,17 +54720,17 @@ var aboutCommand = {
|
|
|
54462
54720
|
autoExecute: true,
|
|
54463
54721
|
isSafeConcurrent: true,
|
|
54464
54722
|
action: async (context) => {
|
|
54465
|
-
const osVersion =
|
|
54723
|
+
const osVersion = process27.platform;
|
|
54466
54724
|
let sandboxEnv = "no sandbox";
|
|
54467
|
-
if (
|
|
54468
|
-
sandboxEnv =
|
|
54469
|
-
} else if (
|
|
54470
|
-
sandboxEnv = `sandbox-exec (${
|
|
54725
|
+
if (process27.env["SANDBOX"] && process27.env["SANDBOX"] !== "sandbox-exec") {
|
|
54726
|
+
sandboxEnv = process27.env["SANDBOX"];
|
|
54727
|
+
} else if (process27.env["SANDBOX"] === "sandbox-exec") {
|
|
54728
|
+
sandboxEnv = `sandbox-exec (${process27.env["SEATBELT_PROFILE"] || "unknown"})`;
|
|
54471
54729
|
}
|
|
54472
54730
|
const modelVersion = context.services.agentContext?.config.getModel() || "Unknown";
|
|
54473
54731
|
const cliVersion = await getVersion();
|
|
54474
54732
|
const selectedAuthType = context.services.settings.merged.security.auth.selectedType || "";
|
|
54475
|
-
const gcpProject =
|
|
54733
|
+
const gcpProject = process27.env["GOOGLE_CLOUD_PROJECT"] || "";
|
|
54476
54734
|
const ideClient = await getIdeClientName(context);
|
|
54477
54735
|
const userAccountManager = new UserAccountManager();
|
|
54478
54736
|
const cachedAccount = userAccountManager.getCachedGoogleAccount();
|
|
@@ -54529,10 +54787,10 @@ function enableFeature(settings, featureName, strategy) {
|
|
|
54529
54787
|
};
|
|
54530
54788
|
}
|
|
54531
54789
|
const modifiedScopes = [];
|
|
54532
|
-
for (const { scope, path:
|
|
54790
|
+
for (const { scope, path: path36 } of foundInDisabledScopes) {
|
|
54533
54791
|
if (isLoadableSettingScope(scope)) {
|
|
54534
54792
|
strategy.enable(settings, scope, featureName);
|
|
54535
|
-
modifiedScopes.push({ scope, path:
|
|
54793
|
+
modifiedScopes.push({ scope, path: path36 });
|
|
54536
54794
|
}
|
|
54537
54795
|
}
|
|
54538
54796
|
return {
|
|
@@ -55000,10 +55258,10 @@ var authCommand = {
|
|
|
55000
55258
|
};
|
|
55001
55259
|
|
|
55002
55260
|
// packages/cli/src/ui/commands/bugCommand.ts
|
|
55003
|
-
import
|
|
55261
|
+
import process28 from "node:process";
|
|
55004
55262
|
|
|
55005
55263
|
// packages/cli/src/generated/git-commit.ts
|
|
55006
|
-
var GIT_COMMIT_INFO = "
|
|
55264
|
+
var GIT_COMMIT_INFO = "a9bd7ed75";
|
|
55007
55265
|
|
|
55008
55266
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
55009
55267
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -55061,16 +55319,16 @@ var bugCommand = {
|
|
|
55061
55319
|
const bugDescription = (args || "").trim();
|
|
55062
55320
|
const agentContext = context.services.agentContext;
|
|
55063
55321
|
const config = agentContext?.config;
|
|
55064
|
-
const osVersion = `${
|
|
55322
|
+
const osVersion = `${process28.platform} ${process28.version}`;
|
|
55065
55323
|
let sandboxEnv = "no sandbox";
|
|
55066
|
-
if (
|
|
55067
|
-
sandboxEnv =
|
|
55068
|
-
} else if (
|
|
55069
|
-
sandboxEnv = `sandbox-exec (${
|
|
55324
|
+
if (process28.env["SANDBOX"] && process28.env["SANDBOX"] !== "sandbox-exec") {
|
|
55325
|
+
sandboxEnv = process28.env["SANDBOX"].replace(/^gemini-(?:code-)?/, "");
|
|
55326
|
+
} else if (process28.env["SANDBOX"] === "sandbox-exec") {
|
|
55327
|
+
sandboxEnv = `sandbox-exec (${process28.env["SEATBELT_PROFILE"] || "unknown"})`;
|
|
55070
55328
|
}
|
|
55071
55329
|
const modelVersion = config?.getModel() || "Unknown";
|
|
55072
55330
|
const cliVersion = await getVersion();
|
|
55073
|
-
const memoryUsage = formatBytes(
|
|
55331
|
+
const memoryUsage = formatBytes(process28.memoryUsage().rss);
|
|
55074
55332
|
const ideClient = await getIdeClientName2(context);
|
|
55075
55333
|
const terminalName = terminalCapabilityManager.getTerminalName() || "Unknown";
|
|
55076
55334
|
const terminalBgColor = terminalCapabilityManager.getTerminalBackgroundColor() || "Unknown";
|
|
@@ -55555,13 +55813,54 @@ var clearCommand = {
|
|
|
55555
55813
|
};
|
|
55556
55814
|
|
|
55557
55815
|
// packages/cli/src/ui/commands/commandsCommand.ts
|
|
55558
|
-
async function
|
|
55816
|
+
async function defaultAction(_context, _args) {
|
|
55559
55817
|
return {
|
|
55560
55818
|
type: "message",
|
|
55561
55819
|
messageType: "info",
|
|
55562
|
-
content: 'Use "/commands reload" to reload custom command definitions
|
|
55820
|
+
content: 'Use "/commands list" to view available .toml files, or "/commands reload" to reload custom command definitions.'
|
|
55563
55821
|
};
|
|
55564
55822
|
}
|
|
55823
|
+
async function listSubcommandAction(context) {
|
|
55824
|
+
try {
|
|
55825
|
+
const config = context.services.agentContext?.config ?? null;
|
|
55826
|
+
const loader = new FileCommandLoader(config);
|
|
55827
|
+
const groups = await loader.listAvailableFiles();
|
|
55828
|
+
const results = [];
|
|
55829
|
+
for (const group of groups) {
|
|
55830
|
+
results.push(`### ${group.displayName} Commands (${group.path})`);
|
|
55831
|
+
if (group.error) {
|
|
55832
|
+
results.push(`- (Error reading directory: ${group.error})`);
|
|
55833
|
+
} else {
|
|
55834
|
+
group.files.forEach((file) => results.push(`- ${file}`));
|
|
55835
|
+
}
|
|
55836
|
+
}
|
|
55837
|
+
results.push(
|
|
55838
|
+
"\n_Note: MCP prompts are dynamically loaded from configured MCP servers._"
|
|
55839
|
+
);
|
|
55840
|
+
if (results.length === 1) {
|
|
55841
|
+
return {
|
|
55842
|
+
type: "message",
|
|
55843
|
+
messageType: "info",
|
|
55844
|
+
content: "No custom command files (.toml) found.\n\n_Note: MCP prompts are dynamically loaded from configured MCP servers._"
|
|
55845
|
+
};
|
|
55846
|
+
}
|
|
55847
|
+
context.ui.addItem(
|
|
55848
|
+
{
|
|
55849
|
+
type: "info" /* INFO */,
|
|
55850
|
+
text: results.join("\n")
|
|
55851
|
+
},
|
|
55852
|
+
Date.now()
|
|
55853
|
+
);
|
|
55854
|
+
} catch (error) {
|
|
55855
|
+
context.ui.addItem(
|
|
55856
|
+
{
|
|
55857
|
+
type: "error" /* ERROR */,
|
|
55858
|
+
text: `Failed to list commands: ${error instanceof Error ? error.message : String(error)}`
|
|
55859
|
+
},
|
|
55860
|
+
Date.now()
|
|
55861
|
+
);
|
|
55862
|
+
}
|
|
55863
|
+
}
|
|
55565
55864
|
async function reloadAction(context) {
|
|
55566
55865
|
try {
|
|
55567
55866
|
context.ui.reloadCommands();
|
|
@@ -55584,10 +55883,17 @@ async function reloadAction(context) {
|
|
|
55584
55883
|
}
|
|
55585
55884
|
var commandsCommand = {
|
|
55586
55885
|
name: "commands",
|
|
55587
|
-
description: "Manage custom slash commands. Usage: /commands [reload]",
|
|
55886
|
+
description: "Manage custom slash commands. Usage: /commands [list|reload]",
|
|
55588
55887
|
kind: "built-in" /* BUILT_IN */,
|
|
55589
55888
|
autoExecute: false,
|
|
55590
55889
|
subCommands: [
|
|
55890
|
+
{
|
|
55891
|
+
name: "list",
|
|
55892
|
+
description: "List available custom command .toml files. Usage: /commands list",
|
|
55893
|
+
kind: "built-in" /* BUILT_IN */,
|
|
55894
|
+
autoExecute: true,
|
|
55895
|
+
action: listSubcommandAction
|
|
55896
|
+
},
|
|
55591
55897
|
{
|
|
55592
55898
|
name: "reload",
|
|
55593
55899
|
altNames: ["refresh"],
|
|
@@ -55597,7 +55903,7 @@ var commandsCommand = {
|
|
|
55597
55903
|
action: reloadAction
|
|
55598
55904
|
}
|
|
55599
55905
|
],
|
|
55600
|
-
action:
|
|
55906
|
+
action: defaultAction
|
|
55601
55907
|
};
|
|
55602
55908
|
|
|
55603
55909
|
// packages/cli/src/ui/commands/compressCommand.ts
|
|
@@ -55730,7 +56036,7 @@ var corgiCommand = {
|
|
|
55730
56036
|
};
|
|
55731
56037
|
|
|
55732
56038
|
// packages/cli/src/ui/commands/docsCommand.ts
|
|
55733
|
-
import
|
|
56039
|
+
import process29 from "node:process";
|
|
55734
56040
|
var docsCommand = {
|
|
55735
56041
|
name: "docs",
|
|
55736
56042
|
description: "Open full Gemini CLI documentation in your browser",
|
|
@@ -55738,7 +56044,7 @@ var docsCommand = {
|
|
|
55738
56044
|
autoExecute: true,
|
|
55739
56045
|
action: async (context) => {
|
|
55740
56046
|
const docsUrl = "https://goo.gle/gemini-cli-docs";
|
|
55741
|
-
if (
|
|
56047
|
+
if (process29.env["SANDBOX"] && process29.env["SANDBOX"] !== "sandbox-exec") {
|
|
55742
56048
|
context.ui.addItem(
|
|
55743
56049
|
{
|
|
55744
56050
|
type: "info" /* INFO */,
|
|
@@ -56005,7 +56311,7 @@ var editorCommand = {
|
|
|
56005
56311
|
};
|
|
56006
56312
|
|
|
56007
56313
|
// packages/cli/src/ui/commands/extensionsCommand.ts
|
|
56008
|
-
import
|
|
56314
|
+
import process30 from "node:process";
|
|
56009
56315
|
import { stat as stat5 } from "node:fs/promises";
|
|
56010
56316
|
|
|
56011
56317
|
// packages/cli/src/ui/components/ConfigExtensionDialog.tsx
|
|
@@ -57137,7 +57443,7 @@ function showMessageIfNoExtensions(context, extensions) {
|
|
|
57137
57443
|
}
|
|
57138
57444
|
return false;
|
|
57139
57445
|
}
|
|
57140
|
-
async function
|
|
57446
|
+
async function listAction(context) {
|
|
57141
57447
|
const extensions = context.services.agentContext?.config ? listExtensions(context.services.agentContext.config) : [];
|
|
57142
57448
|
if (showMessageIfNoExtensions(context, extensions)) {
|
|
57143
57449
|
return;
|
|
@@ -57341,12 +57647,12 @@ async function exploreAction(context) {
|
|
|
57341
57647
|
}
|
|
57342
57648
|
}
|
|
57343
57649
|
const extensionsUrl = "https://geminicli.com/extensions/";
|
|
57344
|
-
if (
|
|
57650
|
+
if (process30.env["NODE_ENV"] === "test") {
|
|
57345
57651
|
context.ui.addItem({
|
|
57346
57652
|
type: "info" /* INFO */,
|
|
57347
57653
|
text: `Would open extensions page in your browser: ${extensionsUrl} (skipped in test environment)`
|
|
57348
57654
|
});
|
|
57349
|
-
} else if (
|
|
57655
|
+
} else if (process30.env["SANDBOX"] && process30.env["SANDBOX"] !== "sandbox-exec") {
|
|
57350
57656
|
context.ui.addItem({
|
|
57351
57657
|
type: "info" /* INFO */,
|
|
57352
57658
|
text: `View available extensions at ${extensionsUrl}`
|
|
@@ -57735,7 +58041,7 @@ var listExtensionsCommand = {
|
|
|
57735
58041
|
kind: "built-in" /* BUILT_IN */,
|
|
57736
58042
|
autoExecute: true,
|
|
57737
58043
|
takesArgs: false,
|
|
57738
|
-
action:
|
|
58044
|
+
action: listAction
|
|
57739
58045
|
};
|
|
57740
58046
|
var updateExtensionsCommand = {
|
|
57741
58047
|
name: "update",
|
|
@@ -57777,6 +58083,7 @@ var linkCommand = {
|
|
|
57777
58083
|
};
|
|
57778
58084
|
var uninstallCommand = {
|
|
57779
58085
|
name: "uninstall",
|
|
58086
|
+
altNames: ["delete"],
|
|
57780
58087
|
description: "Uninstall an extension",
|
|
57781
58088
|
kind: "built-in" /* BUILT_IN */,
|
|
57782
58089
|
autoExecute: false,
|
|
@@ -57868,11 +58175,11 @@ var ConsoleSummaryDisplay = ({
|
|
|
57868
58175
|
};
|
|
57869
58176
|
|
|
57870
58177
|
// packages/cli/src/ui/components/Footer.tsx
|
|
57871
|
-
import
|
|
58178
|
+
import process32 from "node:process";
|
|
57872
58179
|
|
|
57873
58180
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
57874
58181
|
var import_react62 = __toESM(require_react(), 1);
|
|
57875
|
-
import
|
|
58182
|
+
import process31 from "node:process";
|
|
57876
58183
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
57877
58184
|
var MemoryUsageDisplay = ({ color = theme.text.primary, isActive = true }) => {
|
|
57878
58185
|
const [memoryUsage, setMemoryUsage] = (0, import_react62.useState)("");
|
|
@@ -57882,7 +58189,7 @@ var MemoryUsageDisplay = ({ color = theme.text.primary, isActive = true }) => {
|
|
|
57882
58189
|
return;
|
|
57883
58190
|
}
|
|
57884
58191
|
const updateMemory = () => {
|
|
57885
|
-
const usage =
|
|
58192
|
+
const usage = process31.memoryUsage().rss;
|
|
57886
58193
|
setMemoryUsage(formatBytes(usage));
|
|
57887
58194
|
setMemoryUsageColor(
|
|
57888
58195
|
usage >= 2 * 1024 * 1024 * 1024 ? theme.status.error : color
|
|
@@ -58135,7 +58442,7 @@ var SandboxIndicator = ({
|
|
|
58135
58442
|
if (isTrustedFolder === false) {
|
|
58136
58443
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: theme.status.warning, children: "untrusted" });
|
|
58137
58444
|
}
|
|
58138
|
-
const sandbox =
|
|
58445
|
+
const sandbox = process32.env["SANDBOX"];
|
|
58139
58446
|
if (sandbox) {
|
|
58140
58447
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: theme.status.warning, children: "current process" });
|
|
58141
58448
|
}
|
|
@@ -58310,7 +58617,7 @@ var Footer = () => {
|
|
|
58310
58617
|
}
|
|
58311
58618
|
case "sandbox": {
|
|
58312
58619
|
let str = "no sandbox";
|
|
58313
|
-
const sandbox =
|
|
58620
|
+
const sandbox = process32.env["SANDBOX"];
|
|
58314
58621
|
if (isTrustedFolder === false) str = "untrusted";
|
|
58315
58622
|
else if (sandbox) str = "current process";
|
|
58316
58623
|
else if (config.getSandboxEnabled()) str = "all tools";
|
|
@@ -59590,14 +59897,14 @@ function enableHook(settings, hookName) {
|
|
|
59590
59897
|
}
|
|
59591
59898
|
const modifiedScopes = [];
|
|
59592
59899
|
try {
|
|
59593
|
-
for (const { scope, path:
|
|
59900
|
+
for (const { scope, path: path36 } of foundInDisabledScopes) {
|
|
59594
59901
|
if (isLoadableSettingScope(scope)) {
|
|
59595
59902
|
const currentScopeDisabled = settings.forScope(scope).settings.hooksConfig?.disabled ?? [];
|
|
59596
59903
|
const newDisabled = currentScopeDisabled.filter(
|
|
59597
59904
|
(name) => name !== hookName
|
|
59598
59905
|
);
|
|
59599
59906
|
settings.setValue(scope, "hooksConfig.disabled", newDisabled);
|
|
59600
|
-
modifiedScopes.push({ scope, path:
|
|
59907
|
+
modifiedScopes.push({ scope, path: path36 });
|
|
59601
59908
|
}
|
|
59602
59909
|
}
|
|
59603
59910
|
} catch (error) {
|
|
@@ -59892,7 +60199,7 @@ async function enableAction3(context, args) {
|
|
|
59892
60199
|
}
|
|
59893
60200
|
const feedback = renderHookActionFeedback(
|
|
59894
60201
|
result,
|
|
59895
|
-
(label,
|
|
60202
|
+
(label, path36) => `${label} (${path36})`
|
|
59896
60203
|
);
|
|
59897
60204
|
return {
|
|
59898
60205
|
type: "message",
|
|
@@ -59934,7 +60241,7 @@ async function disableAction3(context, args) {
|
|
|
59934
60241
|
}
|
|
59935
60242
|
const feedback = renderHookActionFeedback(
|
|
59936
60243
|
result,
|
|
59937
|
-
(label,
|
|
60244
|
+
(label, path36) => `${label} (${path36})`
|
|
59938
60245
|
);
|
|
59939
60246
|
return {
|
|
59940
60247
|
type: "message",
|
|
@@ -60488,7 +60795,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
60488
60795
|
type: "info",
|
|
60489
60796
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
60490
60797
|
});
|
|
60491
|
-
const { MCPOAuthProvider } = await import("./dist-
|
|
60798
|
+
const { MCPOAuthProvider } = await import("./dist-ATBEVH4R.js");
|
|
60492
60799
|
let oauthConfig = server.oauth;
|
|
60493
60800
|
if (!oauthConfig) {
|
|
60494
60801
|
oauthConfig = { enabled: false };
|
|
@@ -60538,7 +60845,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
60538
60845
|
);
|
|
60539
60846
|
}
|
|
60540
60847
|
};
|
|
60541
|
-
var
|
|
60848
|
+
var listAction2 = async (context, showDescriptions = false, showSchema = false, serverNameFilter) => {
|
|
60542
60849
|
const agentContext = context.services.agentContext;
|
|
60543
60850
|
const config = agentContext?.config;
|
|
60544
60851
|
if (!config) {
|
|
@@ -60655,7 +60962,7 @@ var listCommand2 = {
|
|
|
60655
60962
|
description: "List configured MCP servers and tools",
|
|
60656
60963
|
kind: "built-in" /* BUILT_IN */,
|
|
60657
60964
|
autoExecute: true,
|
|
60658
|
-
action: (context, args) =>
|
|
60965
|
+
action: (context, args) => listAction2(context, false, false, args)
|
|
60659
60966
|
};
|
|
60660
60967
|
var descCommand = {
|
|
60661
60968
|
name: "desc",
|
|
@@ -60663,14 +60970,14 @@ var descCommand = {
|
|
|
60663
60970
|
description: "List configured MCP servers and tools with descriptions",
|
|
60664
60971
|
kind: "built-in" /* BUILT_IN */,
|
|
60665
60972
|
autoExecute: true,
|
|
60666
|
-
action: (context, args) =>
|
|
60973
|
+
action: (context, args) => listAction2(context, true, false, args)
|
|
60667
60974
|
};
|
|
60668
60975
|
var schemaCommand = {
|
|
60669
60976
|
name: "schema",
|
|
60670
60977
|
description: "List configured MCP servers and tools with descriptions and schemas",
|
|
60671
60978
|
kind: "built-in" /* BUILT_IN */,
|
|
60672
60979
|
autoExecute: true,
|
|
60673
|
-
action: (context, args) =>
|
|
60980
|
+
action: (context, args) => listAction2(context, true, true, args)
|
|
60674
60981
|
};
|
|
60675
60982
|
var reloadCommand2 = {
|
|
60676
60983
|
name: "reload",
|
|
@@ -60845,9 +61152,9 @@ var mcpCommand = {
|
|
|
60845
61152
|
if (parsed.commandToExecute?.action) {
|
|
60846
61153
|
return parsed.commandToExecute.action(context, parsed.args);
|
|
60847
61154
|
}
|
|
60848
|
-
return
|
|
61155
|
+
return listAction2(context, false, false, args);
|
|
60849
61156
|
}
|
|
60850
|
-
return
|
|
61157
|
+
return listAction2(context);
|
|
60851
61158
|
}
|
|
60852
61159
|
};
|
|
60853
61160
|
|
|
@@ -77284,7 +77591,7 @@ var oncallCommand = {
|
|
|
77284
77591
|
};
|
|
77285
77592
|
|
|
77286
77593
|
// packages/cli/src/ui/commands/permissionsCommand.ts
|
|
77287
|
-
import * as
|
|
77594
|
+
import * as process33 from "node:process";
|
|
77288
77595
|
import * as path31 from "node:path";
|
|
77289
77596
|
import * as fs34 from "node:fs";
|
|
77290
77597
|
var permissionsCommand = {
|
|
@@ -77302,7 +77609,7 @@ var permissionsCommand = {
|
|
|
77302
77609
|
const dirPath = input.trim();
|
|
77303
77610
|
let targetDirectory;
|
|
77304
77611
|
if (!dirPath) {
|
|
77305
|
-
targetDirectory =
|
|
77612
|
+
targetDirectory = process33.cwd();
|
|
77306
77613
|
} else {
|
|
77307
77614
|
targetDirectory = path31.resolve(expandHomeDir(dirPath));
|
|
77308
77615
|
}
|
|
@@ -77565,12 +77872,14 @@ var quitCommand = {
|
|
|
77565
77872
|
description: "Exit the cli",
|
|
77566
77873
|
kind: "built-in" /* BUILT_IN */,
|
|
77567
77874
|
autoExecute: true,
|
|
77568
|
-
action: (context) => {
|
|
77875
|
+
action: (context, args) => {
|
|
77569
77876
|
const now = Date.now();
|
|
77570
77877
|
const { sessionStartTime } = context.session.stats;
|
|
77571
77878
|
const wallDuration = now - sessionStartTime.getTime();
|
|
77879
|
+
const deleteSession = args.trim() === "--delete";
|
|
77572
77880
|
return {
|
|
77573
77881
|
type: "quit",
|
|
77882
|
+
deleteSession,
|
|
77574
77883
|
messages: [
|
|
77575
77884
|
{
|
|
77576
77885
|
type: "user",
|
|
@@ -78113,7 +78422,7 @@ async function uninstallSkill(name, scope) {
|
|
|
78113
78422
|
}
|
|
78114
78423
|
|
|
78115
78424
|
// packages/cli/src/ui/commands/skillsCommand.ts
|
|
78116
|
-
async function
|
|
78425
|
+
async function listAction3(context, args) {
|
|
78117
78426
|
const subArgs = args.trim().split(/\s+/);
|
|
78118
78427
|
let useShowDescriptions = true;
|
|
78119
78428
|
let showAll = false;
|
|
@@ -78237,7 +78546,7 @@ async function disableAction4(context, args) {
|
|
|
78237
78546
|
const result = disableSkill(context.services.settings, skillName, scope);
|
|
78238
78547
|
let feedback = renderSkillActionFeedback(
|
|
78239
78548
|
result,
|
|
78240
|
-
(label,
|
|
78549
|
+
(label, path36) => `${label} (${path36})`
|
|
78241
78550
|
);
|
|
78242
78551
|
if (result.status === "success" || result.status === "no-op") {
|
|
78243
78552
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -78273,7 +78582,7 @@ async function enableAction4(context, args) {
|
|
|
78273
78582
|
const result = enableSkill(context.services.settings, skillName);
|
|
78274
78583
|
let feedback = renderSkillActionFeedback(
|
|
78275
78584
|
result,
|
|
78276
|
-
(label,
|
|
78585
|
+
(label, path36) => `${label} (${path36})`
|
|
78277
78586
|
);
|
|
78278
78587
|
if (result.status === "success" || result.status === "no-op") {
|
|
78279
78588
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -78379,7 +78688,7 @@ var skillsCommand = {
|
|
|
78379
78688
|
name: "list",
|
|
78380
78689
|
description: "List available agent skills. Usage: /skills list [nodesc] [all]",
|
|
78381
78690
|
kind: "built-in" /* BUILT_IN */,
|
|
78382
|
-
action:
|
|
78691
|
+
action: listAction3
|
|
78383
78692
|
},
|
|
78384
78693
|
{
|
|
78385
78694
|
name: "link",
|
|
@@ -78416,7 +78725,7 @@ var skillsCommand = {
|
|
|
78416
78725
|
return parsed.commandToExecute.action(context, parsed.args);
|
|
78417
78726
|
}
|
|
78418
78727
|
}
|
|
78419
|
-
return
|
|
78728
|
+
return listAction3(context, args);
|
|
78420
78729
|
}
|
|
78421
78730
|
};
|
|
78422
78731
|
|
|
@@ -78470,10 +78779,10 @@ import { Writable } from "node:stream";
|
|
|
78470
78779
|
|
|
78471
78780
|
// packages/cli/src/utils/gitUtils.ts
|
|
78472
78781
|
var import_undici = __toESM(require_undici(), 1);
|
|
78473
|
-
import { execSync as
|
|
78782
|
+
import { execSync as execSync2 } from "node:child_process";
|
|
78474
78783
|
var isGitHubRepository = () => {
|
|
78475
78784
|
try {
|
|
78476
|
-
const remotes = (
|
|
78785
|
+
const remotes = (execSync2("git remote -v", {
|
|
78477
78786
|
encoding: "utf-8"
|
|
78478
78787
|
}) || "").trim();
|
|
78479
78788
|
const pattern = /github\.com/;
|
|
@@ -78484,7 +78793,7 @@ var isGitHubRepository = () => {
|
|
|
78484
78793
|
}
|
|
78485
78794
|
};
|
|
78486
78795
|
var getGitRepoRoot = () => {
|
|
78487
|
-
const gitRepoRoot = (
|
|
78796
|
+
const gitRepoRoot = (execSync2("git rev-parse --show-toplevel", {
|
|
78488
78797
|
encoding: "utf-8"
|
|
78489
78798
|
}) || "").trim();
|
|
78490
78799
|
if (!gitRepoRoot) {
|
|
@@ -78527,7 +78836,7 @@ var getLatestGitHubRelease = async (proxy) => {
|
|
|
78527
78836
|
}
|
|
78528
78837
|
};
|
|
78529
78838
|
function getGitHubRepoInfo() {
|
|
78530
|
-
const remoteUrl =
|
|
78839
|
+
const remoteUrl = execSync2("git remote get-url origin", {
|
|
78531
78840
|
encoding: "utf-8"
|
|
78532
78841
|
}).trim();
|
|
78533
78842
|
let urlToParse = remoteUrl;
|
|
@@ -79032,503 +79341,6 @@ var BuiltinCommandLoader = class {
|
|
|
79032
79341
|
}
|
|
79033
79342
|
};
|
|
79034
79343
|
|
|
79035
|
-
// packages/cli/src/services/FileCommandLoader.ts
|
|
79036
|
-
var import_toml = __toESM(require_toml(), 1);
|
|
79037
|
-
import { promises as fs38 } from "node:fs";
|
|
79038
|
-
import path36 from "node:path";
|
|
79039
|
-
|
|
79040
|
-
// packages/cli/src/services/prompt-processors/argumentProcessor.ts
|
|
79041
|
-
var DefaultArgumentProcessor = class {
|
|
79042
|
-
async process(prompt, context) {
|
|
79043
|
-
if (context.invocation?.args) {
|
|
79044
|
-
return appendToLastTextPart(prompt, context.invocation.raw);
|
|
79045
|
-
}
|
|
79046
|
-
return prompt;
|
|
79047
|
-
}
|
|
79048
|
-
};
|
|
79049
|
-
|
|
79050
|
-
// packages/cli/src/services/prompt-processors/types.ts
|
|
79051
|
-
var SHORTHAND_ARGS_PLACEHOLDER = "{{args}}";
|
|
79052
|
-
var SHELL_INJECTION_TRIGGER = "!{";
|
|
79053
|
-
var AT_FILE_INJECTION_TRIGGER = "@{";
|
|
79054
|
-
|
|
79055
|
-
// packages/cli/src/services/prompt-processors/injectionParser.ts
|
|
79056
|
-
function extractInjections(prompt, trigger, contextName) {
|
|
79057
|
-
const injections = [];
|
|
79058
|
-
let index = 0;
|
|
79059
|
-
while (index < prompt.length) {
|
|
79060
|
-
const startIndex = prompt.indexOf(trigger, index);
|
|
79061
|
-
if (startIndex === -1) {
|
|
79062
|
-
break;
|
|
79063
|
-
}
|
|
79064
|
-
let currentIndex = startIndex + trigger.length;
|
|
79065
|
-
let braceCount = 1;
|
|
79066
|
-
let foundEnd = false;
|
|
79067
|
-
while (currentIndex < prompt.length) {
|
|
79068
|
-
const char = prompt[currentIndex];
|
|
79069
|
-
if (char === "{") {
|
|
79070
|
-
braceCount++;
|
|
79071
|
-
} else if (char === "}") {
|
|
79072
|
-
braceCount--;
|
|
79073
|
-
if (braceCount === 0) {
|
|
79074
|
-
const injectionContent = prompt.substring(
|
|
79075
|
-
startIndex + trigger.length,
|
|
79076
|
-
currentIndex
|
|
79077
|
-
);
|
|
79078
|
-
const endIndex = currentIndex + 1;
|
|
79079
|
-
injections.push({
|
|
79080
|
-
content: injectionContent.trim(),
|
|
79081
|
-
startIndex,
|
|
79082
|
-
endIndex
|
|
79083
|
-
});
|
|
79084
|
-
index = endIndex;
|
|
79085
|
-
foundEnd = true;
|
|
79086
|
-
break;
|
|
79087
|
-
}
|
|
79088
|
-
}
|
|
79089
|
-
currentIndex++;
|
|
79090
|
-
}
|
|
79091
|
-
if (!foundEnd) {
|
|
79092
|
-
const contextInfo = contextName ? ` in command '${contextName}'` : "";
|
|
79093
|
-
throw new Error(
|
|
79094
|
-
`Invalid syntax${contextInfo}: Unclosed injection starting at index ${startIndex} ('${trigger}'). Ensure braces are balanced. Paths or commands with unbalanced braces are not supported directly.`
|
|
79095
|
-
);
|
|
79096
|
-
}
|
|
79097
|
-
}
|
|
79098
|
-
return injections;
|
|
79099
|
-
}
|
|
79100
|
-
|
|
79101
|
-
// packages/cli/src/services/prompt-processors/shellProcessor.ts
|
|
79102
|
-
var ConfirmationRequiredError = class extends Error {
|
|
79103
|
-
constructor(message, commandsToConfirm) {
|
|
79104
|
-
super(message);
|
|
79105
|
-
this.commandsToConfirm = commandsToConfirm;
|
|
79106
|
-
this.name = "ConfirmationRequiredError";
|
|
79107
|
-
}
|
|
79108
|
-
};
|
|
79109
|
-
var ShellProcessor = class {
|
|
79110
|
-
constructor(commandName) {
|
|
79111
|
-
this.commandName = commandName;
|
|
79112
|
-
}
|
|
79113
|
-
async process(prompt, context) {
|
|
79114
|
-
return flatMapTextParts(
|
|
79115
|
-
prompt,
|
|
79116
|
-
(text) => this.processString(text, context)
|
|
79117
|
-
);
|
|
79118
|
-
}
|
|
79119
|
-
async processString(prompt, context) {
|
|
79120
|
-
const userArgsRaw = context.invocation?.args || "";
|
|
79121
|
-
if (!prompt.includes(SHELL_INJECTION_TRIGGER)) {
|
|
79122
|
-
return [
|
|
79123
|
-
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
79124
|
-
];
|
|
79125
|
-
}
|
|
79126
|
-
const config = context.services.agentContext?.config;
|
|
79127
|
-
if (!config) {
|
|
79128
|
-
throw new Error(
|
|
79129
|
-
`Security configuration not loaded. Cannot verify shell command permissions for '${this.commandName}'. Aborting.`
|
|
79130
|
-
);
|
|
79131
|
-
}
|
|
79132
|
-
const injections = extractInjections(
|
|
79133
|
-
prompt,
|
|
79134
|
-
SHELL_INJECTION_TRIGGER,
|
|
79135
|
-
this.commandName
|
|
79136
|
-
);
|
|
79137
|
-
if (injections.length === 0) {
|
|
79138
|
-
return [
|
|
79139
|
-
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
79140
|
-
];
|
|
79141
|
-
}
|
|
79142
|
-
const { shell: shell2 } = getShellConfiguration();
|
|
79143
|
-
const userArgsEscaped = escapeShellArg(userArgsRaw, shell2);
|
|
79144
|
-
const resolvedInjections = injections.map(
|
|
79145
|
-
(injection) => {
|
|
79146
|
-
const command = injection.content;
|
|
79147
|
-
if (command === "") {
|
|
79148
|
-
return { ...injection, resolvedCommand: void 0 };
|
|
79149
|
-
}
|
|
79150
|
-
const resolvedCommand = command.replaceAll(
|
|
79151
|
-
SHORTHAND_ARGS_PLACEHOLDER,
|
|
79152
|
-
userArgsEscaped
|
|
79153
|
-
);
|
|
79154
|
-
return { ...injection, resolvedCommand };
|
|
79155
|
-
}
|
|
79156
|
-
);
|
|
79157
|
-
const commandsToConfirm = /* @__PURE__ */ new Set();
|
|
79158
|
-
for (const injection of resolvedInjections) {
|
|
79159
|
-
const command = injection.resolvedCommand;
|
|
79160
|
-
if (!command) continue;
|
|
79161
|
-
if (context.session.sessionShellAllowlist?.has(command)) {
|
|
79162
|
-
continue;
|
|
79163
|
-
}
|
|
79164
|
-
const { decision } = await config.getPolicyEngine().check(
|
|
79165
|
-
{
|
|
79166
|
-
name: "run_shell_command",
|
|
79167
|
-
args: { command }
|
|
79168
|
-
},
|
|
79169
|
-
void 0
|
|
79170
|
-
);
|
|
79171
|
-
if (decision === PolicyDecision.DENY) {
|
|
79172
|
-
throw new Error(
|
|
79173
|
-
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
79174
|
-
);
|
|
79175
|
-
} else if (decision === PolicyDecision.ASK_USER) {
|
|
79176
|
-
commandsToConfirm.add(command);
|
|
79177
|
-
}
|
|
79178
|
-
}
|
|
79179
|
-
if (commandsToConfirm.size > 0) {
|
|
79180
|
-
throw new ConfirmationRequiredError(
|
|
79181
|
-
"Shell command confirmation required",
|
|
79182
|
-
Array.from(commandsToConfirm)
|
|
79183
|
-
);
|
|
79184
|
-
}
|
|
79185
|
-
let processedPrompt = "";
|
|
79186
|
-
let lastIndex = 0;
|
|
79187
|
-
for (const injection of resolvedInjections) {
|
|
79188
|
-
const segment = prompt.substring(lastIndex, injection.startIndex);
|
|
79189
|
-
processedPrompt += segment.replaceAll(
|
|
79190
|
-
SHORTHAND_ARGS_PLACEHOLDER,
|
|
79191
|
-
userArgsRaw
|
|
79192
|
-
);
|
|
79193
|
-
if (injection.resolvedCommand) {
|
|
79194
|
-
const activeTheme = themeManager.getActiveTheme();
|
|
79195
|
-
const shellExecutionConfig = {
|
|
79196
|
-
...config.getShellExecutionConfig(),
|
|
79197
|
-
defaultFg: activeTheme.colors.Foreground,
|
|
79198
|
-
defaultBg: activeTheme.colors.Background
|
|
79199
|
-
};
|
|
79200
|
-
const { result } = await ShellExecutionService.execute(
|
|
79201
|
-
injection.resolvedCommand,
|
|
79202
|
-
config.getTargetDir(),
|
|
79203
|
-
() => {
|
|
79204
|
-
},
|
|
79205
|
-
new AbortController().signal,
|
|
79206
|
-
config.getEnableInteractiveShell(),
|
|
79207
|
-
shellExecutionConfig
|
|
79208
|
-
);
|
|
79209
|
-
const executionResult = await result;
|
|
79210
|
-
if (executionResult.error && !executionResult.aborted) {
|
|
79211
|
-
throw new Error(
|
|
79212
|
-
`Failed to start shell command in '${this.commandName}': ${executionResult.error.message}. Command: ${injection.resolvedCommand}`
|
|
79213
|
-
);
|
|
79214
|
-
}
|
|
79215
|
-
processedPrompt += executionResult.output;
|
|
79216
|
-
if (executionResult.aborted) {
|
|
79217
|
-
processedPrompt += `
|
|
79218
|
-
[Shell command '${injection.resolvedCommand}' aborted]`;
|
|
79219
|
-
} else if (executionResult.exitCode !== 0 && executionResult.exitCode !== null) {
|
|
79220
|
-
processedPrompt += `
|
|
79221
|
-
[Shell command '${injection.resolvedCommand}' exited with code ${executionResult.exitCode}]`;
|
|
79222
|
-
} else if (executionResult.signal !== null) {
|
|
79223
|
-
processedPrompt += `
|
|
79224
|
-
[Shell command '${injection.resolvedCommand}' terminated by signal ${executionResult.signal}]`;
|
|
79225
|
-
}
|
|
79226
|
-
}
|
|
79227
|
-
lastIndex = injection.endIndex;
|
|
79228
|
-
}
|
|
79229
|
-
const finalSegment = prompt.substring(lastIndex);
|
|
79230
|
-
processedPrompt += finalSegment.replaceAll(
|
|
79231
|
-
SHORTHAND_ARGS_PLACEHOLDER,
|
|
79232
|
-
userArgsRaw
|
|
79233
|
-
);
|
|
79234
|
-
return [{ text: processedPrompt }];
|
|
79235
|
-
}
|
|
79236
|
-
};
|
|
79237
|
-
|
|
79238
|
-
// packages/cli/src/services/prompt-processors/atFileProcessor.ts
|
|
79239
|
-
var AtFileProcessor = class {
|
|
79240
|
-
constructor(commandName) {
|
|
79241
|
-
this.commandName = commandName;
|
|
79242
|
-
}
|
|
79243
|
-
async process(input, context) {
|
|
79244
|
-
const config = context.services.agentContext?.config;
|
|
79245
|
-
if (!config) {
|
|
79246
|
-
return input;
|
|
79247
|
-
}
|
|
79248
|
-
return flatMapTextParts(input, async (text) => {
|
|
79249
|
-
if (!text.includes(AT_FILE_INJECTION_TRIGGER)) {
|
|
79250
|
-
return [{ text }];
|
|
79251
|
-
}
|
|
79252
|
-
const injections = extractInjections(
|
|
79253
|
-
text,
|
|
79254
|
-
AT_FILE_INJECTION_TRIGGER,
|
|
79255
|
-
this.commandName
|
|
79256
|
-
);
|
|
79257
|
-
if (injections.length === 0) {
|
|
79258
|
-
return [{ text }];
|
|
79259
|
-
}
|
|
79260
|
-
const output = [];
|
|
79261
|
-
let lastIndex = 0;
|
|
79262
|
-
for (const injection of injections) {
|
|
79263
|
-
const prefix = text.substring(lastIndex, injection.startIndex);
|
|
79264
|
-
if (prefix) {
|
|
79265
|
-
output.push({ text: prefix });
|
|
79266
|
-
}
|
|
79267
|
-
const pathStr = injection.content;
|
|
79268
|
-
try {
|
|
79269
|
-
const fileContentParts = await readPathFromWorkspace(pathStr, config);
|
|
79270
|
-
if (fileContentParts.length === 0) {
|
|
79271
|
-
const uiMessage = `File '@{${pathStr}}' was ignored by .gitignore or .geminiignore and was not included in the prompt.`;
|
|
79272
|
-
context.ui.addItem(
|
|
79273
|
-
{ type: "info" /* INFO */, text: uiMessage },
|
|
79274
|
-
Date.now()
|
|
79275
|
-
);
|
|
79276
|
-
}
|
|
79277
|
-
output.push(...fileContentParts);
|
|
79278
|
-
} catch (error) {
|
|
79279
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
79280
|
-
const uiMessage = `Failed to inject content for '@{${pathStr}}': ${message}`;
|
|
79281
|
-
debugLogger.error(
|
|
79282
|
-
`Error while loading custom command (${context.invocation.name}) ${uiMessage}. Leaving placeholder in prompt.`
|
|
79283
|
-
);
|
|
79284
|
-
context.ui.addItem(
|
|
79285
|
-
{ type: "error" /* ERROR */, text: uiMessage },
|
|
79286
|
-
Date.now()
|
|
79287
|
-
);
|
|
79288
|
-
const placeholder = text.substring(
|
|
79289
|
-
injection.startIndex,
|
|
79290
|
-
injection.endIndex
|
|
79291
|
-
);
|
|
79292
|
-
output.push({ text: placeholder });
|
|
79293
|
-
}
|
|
79294
|
-
lastIndex = injection.endIndex;
|
|
79295
|
-
}
|
|
79296
|
-
const suffix = text.substring(lastIndex);
|
|
79297
|
-
if (suffix) {
|
|
79298
|
-
output.push({ text: suffix });
|
|
79299
|
-
}
|
|
79300
|
-
return output;
|
|
79301
|
-
});
|
|
79302
|
-
}
|
|
79303
|
-
};
|
|
79304
|
-
|
|
79305
|
-
// packages/cli/src/services/FileCommandLoader.ts
|
|
79306
|
-
var TomlCommandDefSchema = external_exports.object({
|
|
79307
|
-
prompt: external_exports.string({
|
|
79308
|
-
required_error: "The 'prompt' field is required.",
|
|
79309
|
-
invalid_type_error: "The 'prompt' field must be a string."
|
|
79310
|
-
}),
|
|
79311
|
-
description: external_exports.string().optional()
|
|
79312
|
-
});
|
|
79313
|
-
var FileCommandLoader = class {
|
|
79314
|
-
constructor(config) {
|
|
79315
|
-
this.config = config;
|
|
79316
|
-
this.folderTrustEnabled = !!config?.getFolderTrust();
|
|
79317
|
-
this.isTrustedFolder = !!config?.isTrustedFolder();
|
|
79318
|
-
this.projectRoot = config?.getProjectRoot() || process.cwd();
|
|
79319
|
-
}
|
|
79320
|
-
projectRoot;
|
|
79321
|
-
folderTrustEnabled;
|
|
79322
|
-
isTrustedFolder;
|
|
79323
|
-
/**
|
|
79324
|
-
* Loads all commands from user, project, and extension directories.
|
|
79325
|
-
* Returns commands in order: user → project → extensions (alphabetically).
|
|
79326
|
-
*
|
|
79327
|
-
* Order is important for conflict resolution in CommandService:
|
|
79328
|
-
* - User/project commands (without extensionName) use "last wins" strategy
|
|
79329
|
-
* - Extension commands (with extensionName) get renamed if conflicts exist
|
|
79330
|
-
*
|
|
79331
|
-
* @param signal An AbortSignal to cancel the loading process.
|
|
79332
|
-
* @returns A promise that resolves to an array of all loaded SlashCommands.
|
|
79333
|
-
*/
|
|
79334
|
-
async loadCommands(signal) {
|
|
79335
|
-
if (this.folderTrustEnabled && !this.isTrustedFolder) {
|
|
79336
|
-
return [];
|
|
79337
|
-
}
|
|
79338
|
-
const allCommands = [];
|
|
79339
|
-
const globOptions = {
|
|
79340
|
-
nodir: true,
|
|
79341
|
-
dot: true,
|
|
79342
|
-
signal,
|
|
79343
|
-
follow: true
|
|
79344
|
-
};
|
|
79345
|
-
const commandDirs = this.getCommandDirectories();
|
|
79346
|
-
for (const dirInfo of commandDirs) {
|
|
79347
|
-
try {
|
|
79348
|
-
const files = await glob("**/*.toml", {
|
|
79349
|
-
...globOptions,
|
|
79350
|
-
cwd: dirInfo.path
|
|
79351
|
-
});
|
|
79352
|
-
const commandPromises = files.map(
|
|
79353
|
-
(file) => this.parseAndAdaptFile(
|
|
79354
|
-
path36.join(dirInfo.path, file),
|
|
79355
|
-
dirInfo.path,
|
|
79356
|
-
dirInfo.kind,
|
|
79357
|
-
dirInfo.extensionName,
|
|
79358
|
-
dirInfo.extensionId
|
|
79359
|
-
)
|
|
79360
|
-
);
|
|
79361
|
-
const commands = (await Promise.all(commandPromises)).filter(
|
|
79362
|
-
(cmd) => cmd !== null
|
|
79363
|
-
);
|
|
79364
|
-
allCommands.push(...commands);
|
|
79365
|
-
} catch (error) {
|
|
79366
|
-
if (!signal.aborted && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
79367
|
-
error?.code !== "ENOENT") {
|
|
79368
|
-
coreEvents.emitFeedback(
|
|
79369
|
-
"error",
|
|
79370
|
-
`[FileCommandLoader] Error loading commands from ${dirInfo.path}:`,
|
|
79371
|
-
error
|
|
79372
|
-
);
|
|
79373
|
-
}
|
|
79374
|
-
}
|
|
79375
|
-
}
|
|
79376
|
-
return allCommands;
|
|
79377
|
-
}
|
|
79378
|
-
/**
|
|
79379
|
-
* Get all command directories in order for loading.
|
|
79380
|
-
* User commands → Project commands → Extension commands
|
|
79381
|
-
* This order ensures extension commands can detect all conflicts.
|
|
79382
|
-
*/
|
|
79383
|
-
getCommandDirectories() {
|
|
79384
|
-
const dirs = [];
|
|
79385
|
-
const storage = this.config?.storage ?? new Storage(this.projectRoot);
|
|
79386
|
-
dirs.push({
|
|
79387
|
-
path: Storage.getUserCommandsDir(),
|
|
79388
|
-
kind: "user-file" /* USER_FILE */
|
|
79389
|
-
});
|
|
79390
|
-
dirs.push({
|
|
79391
|
-
path: storage.getProjectCommandsDir(),
|
|
79392
|
-
kind: "workspace-file" /* WORKSPACE_FILE */
|
|
79393
|
-
});
|
|
79394
|
-
if (this.config) {
|
|
79395
|
-
const activeExtensions = this.config.getExtensions().filter((ext) => ext.isActive).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
79396
|
-
const extensionCommandDirs = activeExtensions.map((ext) => ({
|
|
79397
|
-
path: path36.join(ext.path, "commands"),
|
|
79398
|
-
kind: "extension-file" /* EXTENSION_FILE */,
|
|
79399
|
-
extensionName: ext.name,
|
|
79400
|
-
extensionId: ext.id
|
|
79401
|
-
}));
|
|
79402
|
-
dirs.push(...extensionCommandDirs);
|
|
79403
|
-
}
|
|
79404
|
-
return dirs;
|
|
79405
|
-
}
|
|
79406
|
-
/**
|
|
79407
|
-
* Parses a single .toml file and transforms it into a SlashCommand object.
|
|
79408
|
-
* @param filePath The absolute path to the .toml file.
|
|
79409
|
-
* @param baseDir The root command directory for name calculation.
|
|
79410
|
-
* @param kind The CommandKind.
|
|
79411
|
-
* @param extensionName Optional extension name to prefix commands with.
|
|
79412
|
-
* @returns A promise resolving to a SlashCommand, or null if the file is invalid.
|
|
79413
|
-
*/
|
|
79414
|
-
async parseAndAdaptFile(filePath, baseDir, kind, extensionName, extensionId) {
|
|
79415
|
-
let fileContent;
|
|
79416
|
-
try {
|
|
79417
|
-
fileContent = await fs38.readFile(filePath, "utf-8");
|
|
79418
|
-
} catch (error) {
|
|
79419
|
-
coreEvents.emitFeedback(
|
|
79420
|
-
"error",
|
|
79421
|
-
`[FileCommandLoader] Failed to read file ${filePath}:`,
|
|
79422
|
-
error instanceof Error ? error.message : String(error)
|
|
79423
|
-
);
|
|
79424
|
-
return null;
|
|
79425
|
-
}
|
|
79426
|
-
let parsed;
|
|
79427
|
-
try {
|
|
79428
|
-
parsed = import_toml.default.parse(fileContent);
|
|
79429
|
-
} catch (error) {
|
|
79430
|
-
coreEvents.emitFeedback(
|
|
79431
|
-
"error",
|
|
79432
|
-
`[FileCommandLoader] Failed to parse TOML file ${filePath}:`,
|
|
79433
|
-
error instanceof Error ? error.message : String(error)
|
|
79434
|
-
);
|
|
79435
|
-
return null;
|
|
79436
|
-
}
|
|
79437
|
-
const validationResult = TomlCommandDefSchema.safeParse(parsed);
|
|
79438
|
-
if (!validationResult.success) {
|
|
79439
|
-
coreEvents.emitFeedback(
|
|
79440
|
-
"error",
|
|
79441
|
-
`[FileCommandLoader] Skipping invalid command file: ${filePath}. Validation errors:`,
|
|
79442
|
-
validationResult.error.flatten()
|
|
79443
|
-
);
|
|
79444
|
-
return null;
|
|
79445
|
-
}
|
|
79446
|
-
const validDef = validationResult.data;
|
|
79447
|
-
const relativePathWithExt = path36.relative(baseDir, filePath);
|
|
79448
|
-
const relativePath = relativePathWithExt.substring(
|
|
79449
|
-
0,
|
|
79450
|
-
relativePathWithExt.length - 5
|
|
79451
|
-
// length of '.toml'
|
|
79452
|
-
);
|
|
79453
|
-
const baseCommandName = relativePath.split(path36.sep).map((segment) => {
|
|
79454
|
-
let sanitized = segment.replace(/[^a-zA-Z0-9_\-.]/g, "_");
|
|
79455
|
-
if (sanitized.length > 50) {
|
|
79456
|
-
sanitized = sanitized.substring(0, 47) + "...";
|
|
79457
|
-
}
|
|
79458
|
-
return sanitized;
|
|
79459
|
-
}).join(":");
|
|
79460
|
-
const defaultDescription = `Custom command from ${path36.basename(filePath)}`;
|
|
79461
|
-
let description = validDef.description || defaultDescription;
|
|
79462
|
-
description = sanitizeForDisplay(description, 100);
|
|
79463
|
-
if (extensionName) {
|
|
79464
|
-
description = `[${extensionName}] ${description}`;
|
|
79465
|
-
}
|
|
79466
|
-
const processors = [];
|
|
79467
|
-
const usesArgs = validDef.prompt.includes(SHORTHAND_ARGS_PLACEHOLDER);
|
|
79468
|
-
const usesShellInjection = validDef.prompt.includes(
|
|
79469
|
-
SHELL_INJECTION_TRIGGER
|
|
79470
|
-
);
|
|
79471
|
-
const usesAtFileInjection = validDef.prompt.includes(
|
|
79472
|
-
AT_FILE_INJECTION_TRIGGER
|
|
79473
|
-
);
|
|
79474
|
-
if (usesAtFileInjection) {
|
|
79475
|
-
processors.push(new AtFileProcessor(baseCommandName));
|
|
79476
|
-
}
|
|
79477
|
-
if (usesShellInjection || usesArgs) {
|
|
79478
|
-
processors.push(new ShellProcessor(baseCommandName));
|
|
79479
|
-
}
|
|
79480
|
-
if (!usesArgs) {
|
|
79481
|
-
processors.push(new DefaultArgumentProcessor());
|
|
79482
|
-
}
|
|
79483
|
-
return {
|
|
79484
|
-
name: baseCommandName,
|
|
79485
|
-
description,
|
|
79486
|
-
kind,
|
|
79487
|
-
extensionName,
|
|
79488
|
-
extensionId,
|
|
79489
|
-
action: async (context, _args) => {
|
|
79490
|
-
if (!context.invocation) {
|
|
79491
|
-
coreEvents.emitFeedback(
|
|
79492
|
-
"error",
|
|
79493
|
-
`[FileCommandLoader] Critical error: Command '${baseCommandName}' was executed without invocation context.`
|
|
79494
|
-
);
|
|
79495
|
-
return {
|
|
79496
|
-
type: "submit_prompt",
|
|
79497
|
-
content: [{ text: validDef.prompt }]
|
|
79498
|
-
// Fallback to unprocessed prompt
|
|
79499
|
-
};
|
|
79500
|
-
}
|
|
79501
|
-
try {
|
|
79502
|
-
let processedContent = [
|
|
79503
|
-
{ text: validDef.prompt }
|
|
79504
|
-
];
|
|
79505
|
-
for (const processor of processors) {
|
|
79506
|
-
processedContent = await processor.process(
|
|
79507
|
-
processedContent,
|
|
79508
|
-
context
|
|
79509
|
-
);
|
|
79510
|
-
}
|
|
79511
|
-
return {
|
|
79512
|
-
type: "submit_prompt",
|
|
79513
|
-
content: processedContent
|
|
79514
|
-
};
|
|
79515
|
-
} catch (e) {
|
|
79516
|
-
if (e instanceof ConfirmationRequiredError) {
|
|
79517
|
-
return {
|
|
79518
|
-
type: "confirm_shell_commands",
|
|
79519
|
-
commandsToConfirm: e.commandsToConfirm,
|
|
79520
|
-
originalInvocation: {
|
|
79521
|
-
raw: context.invocation.raw
|
|
79522
|
-
}
|
|
79523
|
-
};
|
|
79524
|
-
}
|
|
79525
|
-
throw e;
|
|
79526
|
-
}
|
|
79527
|
-
}
|
|
79528
|
-
};
|
|
79529
|
-
}
|
|
79530
|
-
};
|
|
79531
|
-
|
|
79532
79344
|
// packages/cli/src/services/McpPromptLoader.ts
|
|
79533
79345
|
var McpPromptLoader = class {
|
|
79534
79346
|
constructor(config) {
|
|
@@ -79818,7 +79630,6 @@ export {
|
|
|
79818
79630
|
isAutoExecutableCommand,
|
|
79819
79631
|
parseSlashCommand,
|
|
79820
79632
|
CommandService,
|
|
79821
|
-
isDevelopment,
|
|
79822
79633
|
GIT_COMMIT_INFO,
|
|
79823
79634
|
formatBytes,
|
|
79824
79635
|
formatDuration,
|
|
@@ -79850,6 +79661,7 @@ export {
|
|
|
79850
79661
|
use_stdout_default,
|
|
79851
79662
|
use_is_screen_reader_enabled_default,
|
|
79852
79663
|
theme,
|
|
79664
|
+
FileCommandLoader,
|
|
79853
79665
|
useFocus,
|
|
79854
79666
|
SettingsContext,
|
|
79855
79667
|
useSettings,
|
|
@@ -79935,15 +79747,10 @@ export {
|
|
|
79935
79747
|
useTerminalSetupPrompt,
|
|
79936
79748
|
isUltraTier,
|
|
79937
79749
|
BuiltinCommandLoader,
|
|
79938
|
-
FileCommandLoader,
|
|
79939
79750
|
McpPromptLoader,
|
|
79940
79751
|
initializeApp,
|
|
79941
79752
|
validateAuthMethod,
|
|
79942
|
-
startAutoMemoryIfEnabled
|
|
79943
|
-
handleAutoUpdate,
|
|
79944
|
-
setUpdateHandler,
|
|
79945
|
-
RELAUNCH_EXIT_CODE,
|
|
79946
|
-
relaunchApp
|
|
79753
|
+
startAutoMemoryIfEnabled
|
|
79947
79754
|
};
|
|
79948
79755
|
/**
|
|
79949
79756
|
* @license
|